botbrowser-mcp 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/account.d.ts +5 -0
- package/dist/tools/account.js +84 -54
- package/dist/tools/account.js.map +1 -1
- package/dist/tools/instance.d.ts +6 -1
- package/dist/tools/instance.js +80 -50
- package/dist/tools/instance.js.map +1 -1
- package/dist/tools/profile.d.ts +12 -0
- package/dist/tools/profile.js +76 -52
- package/dist/tools/profile.js.map +1 -1
- package/package.json +1 -1
package/dist/tools/account.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare const accountTools: {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
required: string[];
|
|
21
|
+
additionalProperties: boolean;
|
|
21
22
|
};
|
|
22
23
|
handler: (args: any) => Promise<{
|
|
23
24
|
content: {
|
|
@@ -36,6 +37,7 @@ export declare const accountTools: {
|
|
|
36
37
|
description: string;
|
|
37
38
|
};
|
|
38
39
|
};
|
|
40
|
+
additionalProperties: boolean;
|
|
39
41
|
};
|
|
40
42
|
handler: (args: any) => Promise<{
|
|
41
43
|
content: {
|
|
@@ -59,6 +61,7 @@ export declare const accountTools: {
|
|
|
59
61
|
};
|
|
60
62
|
};
|
|
61
63
|
required: string[];
|
|
64
|
+
additionalProperties: boolean;
|
|
62
65
|
};
|
|
63
66
|
handler: (args: any) => Promise<{
|
|
64
67
|
content: {
|
|
@@ -86,6 +89,7 @@ export declare const accountTools: {
|
|
|
86
89
|
};
|
|
87
90
|
};
|
|
88
91
|
required: string[];
|
|
92
|
+
additionalProperties: boolean;
|
|
89
93
|
};
|
|
90
94
|
handler: (args: any) => Promise<{
|
|
91
95
|
content: {
|
|
@@ -105,6 +109,7 @@ export declare const accountTools: {
|
|
|
105
109
|
};
|
|
106
110
|
};
|
|
107
111
|
required: string[];
|
|
112
|
+
additionalProperties: boolean;
|
|
108
113
|
};
|
|
109
114
|
handler: (args: any) => Promise<{
|
|
110
115
|
content: {
|
package/dist/tools/account.js
CHANGED
|
@@ -1,109 +1,139 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Account management tools
|
|
3
3
|
*/
|
|
4
4
|
import { AccountRepository } from '../db/repositories/account.js';
|
|
5
5
|
const accountRepo = new AccountRepository();
|
|
6
6
|
export const accountTools = {
|
|
7
7
|
add_account: {
|
|
8
|
-
description: '
|
|
8
|
+
description: 'Add an account to a browser profile with flexible metadata storage',
|
|
9
9
|
inputSchema: {
|
|
10
10
|
type: 'object',
|
|
11
11
|
properties: {
|
|
12
|
-
profile_alias: { type: 'string', description: '
|
|
13
|
-
username: { type: 'string', description: '
|
|
14
|
-
metadata: { type: 'string', description: '
|
|
12
|
+
profile_alias: { type: 'string', description: 'Browser profile alias' },
|
|
13
|
+
username: { type: 'string', description: 'Account username or identifier' },
|
|
14
|
+
metadata: { type: 'string', description: 'Account metadata (password, email, 2FA, etc.) in any format - key-value, JSON, or natural language' },
|
|
15
15
|
},
|
|
16
16
|
required: ['profile_alias', 'username'],
|
|
17
|
+
additionalProperties: false,
|
|
17
18
|
},
|
|
18
19
|
handler: async (args) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
try {
|
|
21
|
+
const id = accountRepo.create(args);
|
|
22
|
+
return {
|
|
23
|
+
content: [{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: `Account "${args.username}" added successfully with ID: ${id}`,
|
|
26
|
+
}],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw new Error(`Failed to add account: ${error instanceof Error ? error.message : String(error)}`);
|
|
31
|
+
}
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
34
|
list_accounts: {
|
|
29
|
-
description: '
|
|
35
|
+
description: 'List all accounts or accounts for a specific profile',
|
|
30
36
|
inputSchema: {
|
|
31
37
|
type: 'object',
|
|
32
38
|
properties: {
|
|
33
|
-
profile_alias: { type: 'string', description: '
|
|
39
|
+
profile_alias: { type: 'string', description: 'Filter by browser profile alias (optional)' },
|
|
34
40
|
},
|
|
41
|
+
additionalProperties: false,
|
|
35
42
|
},
|
|
36
43
|
handler: async (args) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
try {
|
|
45
|
+
const accounts = args.profile_alias
|
|
46
|
+
? accountRepo.getByProfile(args.profile_alias)
|
|
47
|
+
: accountRepo.getAll();
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: JSON.stringify(accounts, null, 2),
|
|
52
|
+
}],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error(`Failed to list accounts: ${error instanceof Error ? error.message : String(error)}`);
|
|
57
|
+
}
|
|
46
58
|
},
|
|
47
59
|
},
|
|
48
60
|
find_account: {
|
|
49
|
-
description: '
|
|
61
|
+
description: 'Find a specific account by username within a profile',
|
|
50
62
|
inputSchema: {
|
|
51
63
|
type: 'object',
|
|
52
64
|
properties: {
|
|
53
|
-
profile_alias: { type: 'string', description: '
|
|
54
|
-
username: { type: 'string', description: '
|
|
65
|
+
profile_alias: { type: 'string', description: 'Browser profile alias' },
|
|
66
|
+
username: { type: 'string', description: 'Account username to search for' },
|
|
55
67
|
},
|
|
56
68
|
required: ['profile_alias', 'username'],
|
|
69
|
+
additionalProperties: false,
|
|
57
70
|
},
|
|
58
71
|
handler: async (args) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
try {
|
|
73
|
+
const account = accountRepo.findByUsername(args.profile_alias, args.username);
|
|
74
|
+
return {
|
|
75
|
+
content: [{
|
|
76
|
+
type: 'text',
|
|
77
|
+
text: account ? JSON.stringify(account, null, 2) : 'Account not found',
|
|
78
|
+
}],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new Error(`Failed to find account: ${error instanceof Error ? error.message : String(error)}`);
|
|
83
|
+
}
|
|
66
84
|
},
|
|
67
85
|
},
|
|
68
86
|
update_account: {
|
|
69
|
-
description: '
|
|
87
|
+
description: 'Update account information',
|
|
70
88
|
inputSchema: {
|
|
71
89
|
type: 'object',
|
|
72
90
|
properties: {
|
|
73
|
-
id: { type: 'number', description: '
|
|
74
|
-
username: { type: 'string', description: '
|
|
75
|
-
metadata: { type: 'string', description: '
|
|
91
|
+
id: { type: 'number', description: 'Account ID' },
|
|
92
|
+
username: { type: 'string', description: 'New username' },
|
|
93
|
+
metadata: { type: 'string', description: 'New metadata' },
|
|
76
94
|
},
|
|
77
95
|
required: ['id'],
|
|
96
|
+
additionalProperties: false,
|
|
78
97
|
},
|
|
79
98
|
handler: async (args) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
try {
|
|
100
|
+
const { id, ...updates } = args;
|
|
101
|
+
accountRepo.update(id, updates);
|
|
102
|
+
return {
|
|
103
|
+
content: [{
|
|
104
|
+
type: 'text',
|
|
105
|
+
text: `Account ${id} updated successfully`,
|
|
106
|
+
}],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
throw new Error(`Failed to update account: ${error instanceof Error ? error.message : String(error)}`);
|
|
111
|
+
}
|
|
88
112
|
},
|
|
89
113
|
},
|
|
90
114
|
delete_account: {
|
|
91
|
-
description: '
|
|
115
|
+
description: 'Delete an account',
|
|
92
116
|
inputSchema: {
|
|
93
117
|
type: 'object',
|
|
94
118
|
properties: {
|
|
95
|
-
id: { type: 'number', description: '
|
|
119
|
+
id: { type: 'number', description: 'Account ID to delete' },
|
|
96
120
|
},
|
|
97
121
|
required: ['id'],
|
|
122
|
+
additionalProperties: false,
|
|
98
123
|
},
|
|
99
124
|
handler: async (args) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
try {
|
|
126
|
+
accountRepo.delete(args.id);
|
|
127
|
+
return {
|
|
128
|
+
content: [{
|
|
129
|
+
type: 'text',
|
|
130
|
+
text: `Account ${args.id} deleted successfully`,
|
|
131
|
+
}],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
throw new Error(`Failed to delete account: ${error instanceof Error ? error.message : String(error)}`);
|
|
136
|
+
}
|
|
107
137
|
},
|
|
108
138
|
},
|
|
109
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,WAAW,EAAE;QACX,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,WAAW,EAAE;QACX,WAAW,EAAE,oEAAoE;QACjF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBACvE,QAAQ,EAAE,EAAE,IAAI,EAAE,Q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;SAC5B;QACD,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;YAC3B,IAAI,CAAC;gBACH,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC5B,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,WAAW,IAAI,CAAC,EAAE,uBAAuB;yBAChD,CAAC;iBACH,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzG,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
package/dist/tools/instance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Browser instance management tools
|
|
3
3
|
*/
|
|
4
4
|
import { PlaywrightManager } from '../playwright/manager.js';
|
|
5
5
|
export declare function setManager(m: PlaywrightManager): void;
|
|
@@ -24,6 +24,7 @@ export declare const instanceTools: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
required: string[];
|
|
27
|
+
additionalProperties: boolean;
|
|
27
28
|
};
|
|
28
29
|
handler: (args: any) => Promise<{
|
|
29
30
|
content: {
|
|
@@ -37,6 +38,7 @@ export declare const instanceTools: {
|
|
|
37
38
|
inputSchema: {
|
|
38
39
|
type: string;
|
|
39
40
|
properties: {};
|
|
41
|
+
additionalProperties: boolean;
|
|
40
42
|
};
|
|
41
43
|
handler: () => Promise<{
|
|
42
44
|
content: {
|
|
@@ -56,6 +58,7 @@ export declare const instanceTools: {
|
|
|
56
58
|
};
|
|
57
59
|
};
|
|
58
60
|
required: string[];
|
|
61
|
+
additionalProperties: boolean;
|
|
59
62
|
};
|
|
60
63
|
handler: (args: any) => Promise<{
|
|
61
64
|
content: {
|
|
@@ -75,6 +78,7 @@ export declare const instanceTools: {
|
|
|
75
78
|
};
|
|
76
79
|
};
|
|
77
80
|
required: string[];
|
|
81
|
+
additionalProperties: boolean;
|
|
78
82
|
};
|
|
79
83
|
handler: (args: any) => Promise<{
|
|
80
84
|
content: {
|
|
@@ -88,6 +92,7 @@ export declare const instanceTools: {
|
|
|
88
92
|
inputSchema: {
|
|
89
93
|
type: string;
|
|
90
94
|
properties: {};
|
|
95
|
+
additionalProperties: boolean;
|
|
91
96
|
};
|
|
92
97
|
handler: () => Promise<{
|
|
93
98
|
content: {
|
package/dist/tools/instance.js
CHANGED
|
@@ -4,104 +4,134 @@ export function setManager(m) {
|
|
|
4
4
|
}
|
|
5
5
|
export const instanceTools = {
|
|
6
6
|
launch_browser: {
|
|
7
|
-
description: '
|
|
7
|
+
description: 'Launch a new browser instance based on a profile configuration',
|
|
8
8
|
inputSchema: {
|
|
9
9
|
type: 'object',
|
|
10
10
|
properties: {
|
|
11
|
-
profile_alias: { type: 'string', description: '
|
|
12
|
-
account_id: { type: 'number', description: '
|
|
11
|
+
profile_alias: { type: 'string', description: 'Browser profile alias to use' },
|
|
12
|
+
account_id: { type: 'number', description: 'Optional account ID to associate with this instance' },
|
|
13
13
|
launch_options: {
|
|
14
14
|
type: 'object',
|
|
15
|
-
description: 'Playwright
|
|
15
|
+
description: 'Optional Playwright launch options (e.g., {"headless": false, "channel": "chrome"})',
|
|
16
16
|
additionalProperties: true,
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
required: ['profile_alias'],
|
|
20
|
+
additionalProperties: false,
|
|
20
21
|
},
|
|
21
22
|
handler: async (args) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
try {
|
|
24
|
+
const id = await manager.launchInstance(args.profile_alias, args.account_id, args.launch_options);
|
|
25
|
+
return {
|
|
26
|
+
content: [{
|
|
27
|
+
type: 'text',
|
|
28
|
+
text: `Browser instance ${id} launched successfully`,
|
|
29
|
+
}],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw new Error(`Failed to launch browser: ${error instanceof Error ? error.message : String(error)}`);
|
|
34
|
+
}
|
|
29
35
|
},
|
|
30
36
|
},
|
|
31
37
|
list_browser_instances: {
|
|
32
|
-
description: '
|
|
38
|
+
description: 'List all running browser instances with their status',
|
|
33
39
|
inputSchema: {
|
|
34
40
|
type: 'object',
|
|
35
41
|
properties: {},
|
|
42
|
+
additionalProperties: false,
|
|
36
43
|
},
|
|
37
44
|
handler: async () => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
try {
|
|
46
|
+
const instances = manager.listInstances();
|
|
47
|
+
return {
|
|
48
|
+
content: [{
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: JSON.stringify(instances, null, 2),
|
|
51
|
+
}],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new Error(`Failed to list instances: ${error instanceof Error ? error.message : String(error)}`);
|
|
56
|
+
}
|
|
45
57
|
},
|
|
46
58
|
},
|
|
47
59
|
switch_browser_instance: {
|
|
48
|
-
description: '
|
|
60
|
+
description: 'Switch the active browser instance. All subsequent browser operations will run on the switched instance',
|
|
49
61
|
inputSchema: {
|
|
50
62
|
type: 'object',
|
|
51
63
|
properties: {
|
|
52
|
-
instance_id: { type: 'number', description: '
|
|
64
|
+
instance_id: { type: 'number', description: 'Instance ID to switch to' },
|
|
53
65
|
},
|
|
54
66
|
required: ['instance_id'],
|
|
67
|
+
additionalProperties: false,
|
|
55
68
|
},
|
|
56
69
|
handler: async (args) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
try {
|
|
71
|
+
await manager.switchActive(args.instance_id);
|
|
72
|
+
// CRITICAL: Reset Playwright MCP's context cache
|
|
73
|
+
// This forces it to fetch the new active context on the next tool call
|
|
74
|
+
const { playwrightMCPProxy } = await import('../index.js');
|
|
75
|
+
if (playwrightMCPProxy) {
|
|
76
|
+
await playwrightMCPProxy.resetContext();
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
content: [{
|
|
80
|
+
type: 'text',
|
|
81
|
+
text: `Switched to instance ${args.instance_id}`,
|
|
82
|
+
}],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
throw new Error(`Failed to switch instance: ${error instanceof Error ? error.message : String(error)}`);
|
|
63
87
|
}
|
|
64
|
-
return {
|
|
65
|
-
content: [{
|
|
66
|
-
type: 'text',
|
|
67
|
-
text: `已切换到实例 ${args.instance_id}`,
|
|
68
|
-
}],
|
|
69
|
-
};
|
|
70
88
|
},
|
|
71
89
|
},
|
|
72
90
|
stop_browser_instance: {
|
|
73
|
-
description: '
|
|
91
|
+
description: 'Stop a running browser instance and save its state',
|
|
74
92
|
inputSchema: {
|
|
75
93
|
type: 'object',
|
|
76
94
|
properties: {
|
|
77
|
-
instance_id: { type: 'number', description: '
|
|
95
|
+
instance_id: { type: 'number', description: 'Instance ID to stop' },
|
|
78
96
|
},
|
|
79
97
|
required: ['instance_id'],
|
|
98
|
+
additionalProperties: false,
|
|
80
99
|
},
|
|
81
100
|
handler: async (args) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
try {
|
|
102
|
+
await manager.stopInstance(args.instance_id);
|
|
103
|
+
return {
|
|
104
|
+
content: [{
|
|
105
|
+
type: 'text',
|
|
106
|
+
text: `Instance ${args.instance_id} stopped successfully`,
|
|
107
|
+
}],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw new Error(`Failed to stop instance: ${error instanceof Error ? error.message : String(error)}`);
|
|
112
|
+
}
|
|
89
113
|
},
|
|
90
114
|
},
|
|
91
115
|
cleanup_orphaned_instances: {
|
|
92
|
-
description: '
|
|
116
|
+
description: 'Clean up orphaned instance records (database entries for instances that are no longer running)',
|
|
93
117
|
inputSchema: {
|
|
94
118
|
type: 'object',
|
|
95
119
|
properties: {},
|
|
120
|
+
additionalProperties: false,
|
|
96
121
|
},
|
|
97
122
|
handler: async () => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
try {
|
|
124
|
+
const count = await manager.cleanupOrphaned();
|
|
125
|
+
return {
|
|
126
|
+
content: [{
|
|
127
|
+
type: 'text',
|
|
128
|
+
text: `Cleaned up ${count} orphaned instance record(s)`,
|
|
129
|
+
}],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
throw new Error(`Failed to cleanup orphaned instances: ${error instanceof Error ? error.message : String(error)}`);
|
|
134
|
+
}
|
|
105
135
|
},
|
|
106
136
|
},
|
|
107
137
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/tools/instance.ts"],"names":[],"mappings":"AAKA,IAAI,OAA0B,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,CAAoB;IAC7C,OAAO,GAAG,CAAC,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE;QACd,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/tools/instance.ts"],"names":[],"mappings":"AAKA,IAAI,OAA0B,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,CAAoB;IAC7C,OAAO,GAAG,CAAC,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE;QACd,WAAW,EAA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AAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACrH,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
package/dist/tools/profile.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const profileTools: {
|
|
|
4
4
|
inputSchema: {
|
|
5
5
|
type: string;
|
|
6
6
|
properties: {};
|
|
7
|
+
additionalProperties: boolean;
|
|
7
8
|
};
|
|
8
9
|
handler: () => Promise<{
|
|
9
10
|
content: {
|
|
@@ -55,6 +56,7 @@ export declare const profileTools: {
|
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
58
|
required: string[];
|
|
59
|
+
additionalProperties: boolean;
|
|
58
60
|
};
|
|
59
61
|
handler: (args: any) => Promise<{
|
|
60
62
|
content: {
|
|
@@ -74,30 +76,39 @@ export declare const profileTools: {
|
|
|
74
76
|
};
|
|
75
77
|
executable_path: {
|
|
76
78
|
type: string;
|
|
79
|
+
description: string;
|
|
77
80
|
};
|
|
78
81
|
fingerprint_path: {
|
|
79
82
|
type: string;
|
|
83
|
+
description: string;
|
|
80
84
|
};
|
|
81
85
|
storage_state_path: {
|
|
82
86
|
type: string;
|
|
87
|
+
description: string;
|
|
83
88
|
};
|
|
84
89
|
description: {
|
|
85
90
|
type: string;
|
|
91
|
+
description: string;
|
|
86
92
|
};
|
|
87
93
|
proxy_server: {
|
|
88
94
|
type: string;
|
|
95
|
+
description: string;
|
|
89
96
|
};
|
|
90
97
|
proxy_username: {
|
|
91
98
|
type: string;
|
|
99
|
+
description: string;
|
|
92
100
|
};
|
|
93
101
|
proxy_password: {
|
|
94
102
|
type: string;
|
|
103
|
+
description: string;
|
|
95
104
|
};
|
|
96
105
|
proxy_bypass: {
|
|
97
106
|
type: string;
|
|
107
|
+
description: string;
|
|
98
108
|
};
|
|
99
109
|
};
|
|
100
110
|
required: string[];
|
|
111
|
+
additionalProperties: boolean;
|
|
101
112
|
};
|
|
102
113
|
handler: (args: any) => Promise<{
|
|
103
114
|
content: {
|
|
@@ -117,6 +128,7 @@ export declare const profileTools: {
|
|
|
117
128
|
};
|
|
118
129
|
};
|
|
119
130
|
required: string[];
|
|
131
|
+
additionalProperties: boolean;
|
|
120
132
|
};
|
|
121
133
|
handler: (args: any) => Promise<{
|
|
122
134
|
content: {
|
package/dist/tools/profile.js
CHANGED
|
@@ -5,93 +5,117 @@ import { ProfileRepository } from '../db/repositories/profile.js';
|
|
|
5
5
|
const profileRepo = new ProfileRepository();
|
|
6
6
|
export const profileTools = {
|
|
7
7
|
list_browser_profiles: {
|
|
8
|
-
description: '
|
|
8
|
+
description: 'List all browser profiles with their configurations',
|
|
9
9
|
inputSchema: {
|
|
10
10
|
type: 'object',
|
|
11
11
|
properties: {},
|
|
12
|
+
additionalProperties: false,
|
|
12
13
|
},
|
|
13
14
|
handler: async () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
try {
|
|
16
|
+
const profiles = profileRepo.getAll();
|
|
17
|
+
return {
|
|
18
|
+
content: [{
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: JSON.stringify(profiles, null, 2),
|
|
21
|
+
}],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
throw new Error(`Failed to list profiles: ${error instanceof Error ? error.message : String(error)}`);
|
|
26
|
+
}
|
|
21
27
|
},
|
|
22
28
|
},
|
|
23
29
|
create_browser_profile: {
|
|
24
|
-
description: '
|
|
30
|
+
description: 'Create a new browser profile with executable path and optional proxy settings',
|
|
25
31
|
inputSchema: {
|
|
26
32
|
type: 'object',
|
|
27
33
|
properties: {
|
|
28
|
-
alias: { type: 'string', description: '
|
|
29
|
-
executable_path: { type: 'string', description: 'Chrome
|
|
30
|
-
fingerprint_path: { type: 'string', description: '
|
|
31
|
-
storage_state_path: { type: 'string', description: '
|
|
32
|
-
description: { type: 'string', description: '
|
|
33
|
-
proxy_server: { type: 'string', description: '
|
|
34
|
-
proxy_username: { type: 'string', description: '
|
|
35
|
-
proxy_password: { type: 'string', description: '
|
|
36
|
-
proxy_bypass: { type: 'string', description: '
|
|
34
|
+
alias: { type: 'string', description: 'Unique profile identifier' },
|
|
35
|
+
executable_path: { type: 'string', description: 'Path to Chrome/Chromium executable' },
|
|
36
|
+
fingerprint_path: { type: 'string', description: 'Path to fingerprint configuration file (optional)' },
|
|
37
|
+
storage_state_path: { type: 'string', description: 'Path to save cookies/localStorage (optional)' },
|
|
38
|
+
description: { type: 'string', description: 'Profile description' },
|
|
39
|
+
proxy_server: { type: 'string', description: 'Proxy server URL (e.g., http://127.0.0.1:7890)' },
|
|
40
|
+
proxy_username: { type: 'string', description: 'Proxy authentication username' },
|
|
41
|
+
proxy_password: { type: 'string', description: 'Proxy authentication password' },
|
|
42
|
+
proxy_bypass: { type: 'string', description: 'Comma-separated domains to bypass proxy' },
|
|
37
43
|
},
|
|
38
44
|
required: ['alias', 'executable_path'],
|
|
45
|
+
additionalProperties: false,
|
|
39
46
|
},
|
|
40
47
|
handler: async (args) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
try {
|
|
49
|
+
profileRepo.create(args);
|
|
50
|
+
return {
|
|
51
|
+
content: [{
|
|
52
|
+
type: 'text',
|
|
53
|
+
text: `Profile "${args.alias}" created successfully`,
|
|
54
|
+
}],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new Error(`Failed to create profile: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
|
+
}
|
|
48
60
|
},
|
|
49
61
|
},
|
|
50
62
|
update_browser_profile: {
|
|
51
|
-
description: '
|
|
63
|
+
description: 'Update an existing browser profile configuration',
|
|
52
64
|
inputSchema: {
|
|
53
65
|
type: 'object',
|
|
54
66
|
properties: {
|
|
55
|
-
alias: { type: 'string', description: '
|
|
56
|
-
executable_path: { type: 'string' },
|
|
57
|
-
fingerprint_path: { type: 'string' },
|
|
58
|
-
storage_state_path: { type: 'string' },
|
|
59
|
-
description: { type: 'string' },
|
|
60
|
-
proxy_server: { type: 'string' },
|
|
61
|
-
proxy_username: { type: 'string' },
|
|
62
|
-
proxy_password: { type: 'string' },
|
|
63
|
-
proxy_bypass: { type: 'string' },
|
|
67
|
+
alias: { type: 'string', description: 'Profile alias to update' },
|
|
68
|
+
executable_path: { type: 'string', description: 'New executable path' },
|
|
69
|
+
fingerprint_path: { type: 'string', description: 'New fingerprint path' },
|
|
70
|
+
storage_state_path: { type: 'string', description: 'New storage state path' },
|
|
71
|
+
description: { type: 'string', description: 'New description' },
|
|
72
|
+
proxy_server: { type: 'string', description: 'New proxy server URL' },
|
|
73
|
+
proxy_username: { type: 'string', description: 'New proxy username' },
|
|
74
|
+
proxy_password: { type: 'string', description: 'New proxy password' },
|
|
75
|
+
proxy_bypass: { type: 'string', description: 'New proxy bypass list' },
|
|
64
76
|
},
|
|
65
77
|
required: ['alias'],
|
|
78
|
+
additionalProperties: false,
|
|
66
79
|
},
|
|
67
80
|
handler: async (args) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
try {
|
|
82
|
+
const { alias, ...updates } = args;
|
|
83
|
+
profileRepo.update(alias, updates);
|
|
84
|
+
return {
|
|
85
|
+
content: [{
|
|
86
|
+
type: 'text',
|
|
87
|
+
text: `Profile "${alias}" updated successfully`,
|
|
88
|
+
}],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
throw new Error(`Failed to update profile: ${error instanceof Error ? error.message : String(error)}`);
|
|
93
|
+
}
|
|
76
94
|
},
|
|
77
95
|
},
|
|
78
96
|
delete_browser_profile: {
|
|
79
|
-
description: '
|
|
97
|
+
description: 'Delete a browser profile and all associated accounts',
|
|
80
98
|
inputSchema: {
|
|
81
99
|
type: 'object',
|
|
82
100
|
properties: {
|
|
83
|
-
alias: { type: 'string', description: '
|
|
101
|
+
alias: { type: 'string', description: 'Profile alias to delete' },
|
|
84
102
|
},
|
|
85
103
|
required: ['alias'],
|
|
104
|
+
additionalProperties: false,
|
|
86
105
|
},
|
|
87
106
|
handler: async (args) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
try {
|
|
108
|
+
profileRepo.delete(args.alias);
|
|
109
|
+
return {
|
|
110
|
+
content: [{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: `Profile "${args.alias}" deleted successfully`,
|
|
113
|
+
}],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
throw new Error(`Failed to delete profile: ${error instanceof Error ? error.message : String(error)}`);
|
|
118
|
+
}
|
|
95
119
|
},
|
|
96
120
|
},
|
|
97
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/tools/profile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AAElF,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,qBAAqB,EAAE;QACrB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/tools/profile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AAElF,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CA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