@tgebrowser/mcp 1.1.0 → 1.1.1
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/build/server.js +290 -20
- package/package.json +1 -1
package/build/server.js
CHANGED
|
@@ -57,13 +57,26 @@ var ENDPOINTS = {
|
|
|
57
57
|
CREATE_BROWSER: "/api/browser/create",
|
|
58
58
|
UPDATE_BROWSER: "/api/browser/update",
|
|
59
59
|
DELETE_BROWSER: "/api/browser/delete",
|
|
60
|
+
BATCH_DELETE_BROWSER: "/api/browser/delete/batch",
|
|
60
61
|
GET_BROWSER_LIST: "/api/browser/list",
|
|
61
62
|
GET_BROWSER_DETAIL: "/api/browser/detail",
|
|
62
63
|
CLOSE_ALL_PROFILES: "/api/browser/stop-all",
|
|
63
64
|
DELETE_CACHE_V2: "/api/browser/cache/delete",
|
|
65
|
+
BATCH_DELETE_CACHE: "/api/browser/batch/delete-cache",
|
|
64
66
|
GET_OPENED_BROWSER: "/api/browser/open/list",
|
|
67
|
+
GET_MOBILE_DEVICES: "/api/browser/mobile-devices",
|
|
68
|
+
WINDOW_SORT: "/api/windowbounds/sort",
|
|
69
|
+
WINDOW_SORT_CUSTOM: "/api/windowbounds/sort/custom",
|
|
65
70
|
GET_GROUP_LIST: "/api/groups/list",
|
|
66
|
-
|
|
71
|
+
CREATE_GROUP: "/api/groups",
|
|
72
|
+
UPDATE_GROUP: (groupId) => `/api/groups/${groupId}`,
|
|
73
|
+
DELETE_GROUP: (groupId) => `/api/groups/${groupId}`,
|
|
74
|
+
GET_PROXY_LIST: "/api/proxies/list",
|
|
75
|
+
CREATE_PROXY: "/api/proxies",
|
|
76
|
+
UPDATE_PROXY: (proxyId) => `/api/proxies/${proxyId}`,
|
|
77
|
+
DELETE_PROXY: (proxyId) => `/api/proxies/${proxyId}`,
|
|
78
|
+
WINDOW_HIDE: "/api/window/hide",
|
|
79
|
+
WINDOW_SHOW: "/api/window/show"
|
|
67
80
|
};
|
|
68
81
|
var apiClient = import_axios.default.create({
|
|
69
82
|
baseURL: BASE_URL,
|
|
@@ -210,6 +223,40 @@ To automate this browser, use connect-browser-with-ws with wsUrl="${wsUrl}"`;
|
|
|
210
223
|
const response = await apiClient.get(ENDPOINTS.GET_OPENED_BROWSER);
|
|
211
224
|
assertSuccess(response.data, "get active browsers");
|
|
212
225
|
return `Active browsers: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
226
|
+
},
|
|
227
|
+
async batchDelete({ envIds, userIndexes, permanent }) {
|
|
228
|
+
const body = {};
|
|
229
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
230
|
+
if (userIndexes && userIndexes.length > 0) body.userIndexes = userIndexes;
|
|
231
|
+
if (permanent !== void 0) body.permanent = permanent;
|
|
232
|
+
const response = await apiClient.post(ENDPOINTS.BATCH_DELETE_BROWSER, body);
|
|
233
|
+
assertSuccess(response.data, "batch delete browsers");
|
|
234
|
+
const info = response.data.data || {};
|
|
235
|
+
return `Batch delete result: total=${info.total}, deleted=${JSON.stringify(info.deleted)}, failed=${JSON.stringify(info.failed)}`;
|
|
236
|
+
},
|
|
237
|
+
async batchDeleteCache({ envIds, userIndexes }) {
|
|
238
|
+
const body = {};
|
|
239
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
240
|
+
if (userIndexes && userIndexes.length > 0) body.userIndexes = userIndexes;
|
|
241
|
+
const response = await apiClient.post(ENDPOINTS.BATCH_DELETE_CACHE, body);
|
|
242
|
+
assertSuccess(response.data, "batch delete cache");
|
|
243
|
+
const info = response.data.data || {};
|
|
244
|
+
return `Batch delete cache result: total=${info.total}, success=${info.success}, failed=${info.failed}`;
|
|
245
|
+
},
|
|
246
|
+
async getMobileDevices({ os: os2 }) {
|
|
247
|
+
const params = {};
|
|
248
|
+
if (os2) params.os = os2;
|
|
249
|
+
const response = await apiClient.get(ENDPOINTS.GET_MOBILE_DEVICES, { params });
|
|
250
|
+
assertSuccess(response.data, "get mobile devices");
|
|
251
|
+
return `Mobile devices: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
252
|
+
},
|
|
253
|
+
async getDetail({ envId, userIndex }) {
|
|
254
|
+
const body = {};
|
|
255
|
+
if (envId !== void 0) body.envId = envId;
|
|
256
|
+
if (userIndex !== void 0) body.userIndex = userIndex;
|
|
257
|
+
const response = await apiClient.post(ENDPOINTS.GET_BROWSER_DETAIL, body);
|
|
258
|
+
assertSuccess(response.data, "get browser detail");
|
|
259
|
+
return `Browser detail: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
213
260
|
}
|
|
214
261
|
};
|
|
215
262
|
|
|
@@ -404,8 +451,8 @@ var profileSchemas = {
|
|
|
404
451
|
Cookie: import_zod.z.any().optional()
|
|
405
452
|
}),
|
|
406
453
|
update: import_zod.z.object({
|
|
407
|
-
envId: import_zod.z.number().
|
|
408
|
-
browserName: import_zod.z.string().
|
|
454
|
+
envId: import_zod.z.number().describe("Environment id to update"),
|
|
455
|
+
browserName: import_zod.z.string().describe("Environment name"),
|
|
409
456
|
groupId: import_zod.z.number().optional().describe("Group id"),
|
|
410
457
|
remark: import_zod.z.string().optional().describe("Remark"),
|
|
411
458
|
proxy: import_zod.z.object({
|
|
@@ -477,7 +524,29 @@ var profileSchemas = {
|
|
|
477
524
|
}).refine((data) => data.profileId || data.profileNo, {
|
|
478
525
|
message: "Either profileId or profileNo must be provided"
|
|
479
526
|
}),
|
|
480
|
-
openedList: import_zod.z.object({}).strict()
|
|
527
|
+
openedList: import_zod.z.object({}).strict(),
|
|
528
|
+
batchDelete: import_zod.z.object({
|
|
529
|
+
envIds: import_zod.z.array(import_zod.z.number().int().positive()).optional().describe("Array of environment ids to delete"),
|
|
530
|
+
userIndexes: import_zod.z.array(import_zod.z.number().int().min(1)).optional().describe("Array of environment indexes to delete"),
|
|
531
|
+
permanent: import_zod.z.boolean().optional().describe("true=hard delete, false=soft delete (default)")
|
|
532
|
+
}).refine((data) => data.envIds && data.envIds.length > 0 || data.userIndexes && data.userIndexes.length > 0, {
|
|
533
|
+
message: "Either envIds or userIndexes must be provided"
|
|
534
|
+
}),
|
|
535
|
+
batchDeleteCache: import_zod.z.object({
|
|
536
|
+
envIds: import_zod.z.array(import_zod.z.number().int().positive()).optional().describe("Array of environment ids"),
|
|
537
|
+
userIndexes: import_zod.z.array(import_zod.z.number().int().min(1)).optional().describe("Array of environment indexes")
|
|
538
|
+
}).refine((data) => data.envIds && data.envIds.length > 0 || data.userIndexes && data.userIndexes.length > 0, {
|
|
539
|
+
message: "Either envIds or userIndexes must be provided"
|
|
540
|
+
}),
|
|
541
|
+
mobileDevices: import_zod.z.object({
|
|
542
|
+
os: import_zod.z.enum(["Android", "iOS"]).optional().describe("Filter by OS: Android or iOS")
|
|
543
|
+
}).strict(),
|
|
544
|
+
detail: import_zod.z.object({
|
|
545
|
+
envId: import_zod.z.number().int().positive().optional().describe("Environment id"),
|
|
546
|
+
userIndex: import_zod.z.number().int().min(1).optional().describe("Environment index")
|
|
547
|
+
}).refine((data) => data.envId !== void 0 || data.userIndex !== void 0, {
|
|
548
|
+
message: "Either envId or userIndex must be provided"
|
|
549
|
+
})
|
|
481
550
|
};
|
|
482
551
|
|
|
483
552
|
// ../core/src/automation/actions.ts
|
|
@@ -723,6 +792,21 @@ var groupActions = {
|
|
|
723
792
|
const response = await apiClient.get(ENDPOINTS.GET_GROUP_LIST, { params });
|
|
724
793
|
assertSuccess2(response.data, "get group list");
|
|
725
794
|
return `Group list: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
795
|
+
},
|
|
796
|
+
async create({ name }) {
|
|
797
|
+
const response = await apiClient.post(ENDPOINTS.CREATE_GROUP, { name });
|
|
798
|
+
assertSuccess2(response.data, "create group");
|
|
799
|
+
return `Group created: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
800
|
+
},
|
|
801
|
+
async update({ groupId, name }) {
|
|
802
|
+
const response = await apiClient.put(ENDPOINTS.UPDATE_GROUP(groupId), { name });
|
|
803
|
+
assertSuccess2(response.data, "update group");
|
|
804
|
+
return `Group updated: groupId=${groupId}`;
|
|
805
|
+
},
|
|
806
|
+
async delete({ groupId }) {
|
|
807
|
+
const response = await apiClient.delete(ENDPOINTS.DELETE_GROUP(groupId));
|
|
808
|
+
assertSuccess2(response.data, "delete group");
|
|
809
|
+
return `Group deleted: groupId=${groupId}`;
|
|
726
810
|
}
|
|
727
811
|
};
|
|
728
812
|
|
|
@@ -732,6 +816,16 @@ var groupSchemas = {
|
|
|
732
816
|
list: import_zod3.z.object({
|
|
733
817
|
current: import_zod3.z.number().optional().describe("Current page"),
|
|
734
818
|
pageSize: import_zod3.z.number().optional().describe("Page size")
|
|
819
|
+
}).strict(),
|
|
820
|
+
create: import_zod3.z.object({
|
|
821
|
+
name: import_zod3.z.string().describe("Group name")
|
|
822
|
+
}).strict(),
|
|
823
|
+
update: import_zod3.z.object({
|
|
824
|
+
groupId: import_zod3.z.number().int().positive().describe("Group id to update"),
|
|
825
|
+
name: import_zod3.z.string().describe("New group name")
|
|
826
|
+
}).strict(),
|
|
827
|
+
delete: import_zod3.z.object({
|
|
828
|
+
groupId: import_zod3.z.number().int().positive().describe("Group id to delete")
|
|
735
829
|
}).strict()
|
|
736
830
|
};
|
|
737
831
|
|
|
@@ -749,6 +843,21 @@ var proxyActions = {
|
|
|
749
843
|
const response = await apiClient.get(ENDPOINTS.GET_PROXY_LIST, { params });
|
|
750
844
|
assertSuccess3(response.data, "get proxy list");
|
|
751
845
|
return `Proxy list: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
846
|
+
},
|
|
847
|
+
async create(params) {
|
|
848
|
+
const response = await apiClient.post(ENDPOINTS.CREATE_PROXY, params);
|
|
849
|
+
assertSuccess3(response.data, "create proxy");
|
|
850
|
+
return `Proxy created: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
851
|
+
},
|
|
852
|
+
async update({ proxyId, ...rest }) {
|
|
853
|
+
const response = await apiClient.put(ENDPOINTS.UPDATE_PROXY(proxyId), rest);
|
|
854
|
+
assertSuccess3(response.data, "update proxy");
|
|
855
|
+
return `Proxy updated: proxyId=${proxyId}`;
|
|
856
|
+
},
|
|
857
|
+
async delete({ proxyId }) {
|
|
858
|
+
const response = await apiClient.delete(ENDPOINTS.DELETE_PROXY(proxyId));
|
|
859
|
+
assertSuccess3(response.data, "delete proxy");
|
|
860
|
+
return `Proxy deleted: proxyId=${proxyId}`;
|
|
752
861
|
}
|
|
753
862
|
};
|
|
754
863
|
|
|
@@ -758,21 +867,98 @@ var proxySchemas = {
|
|
|
758
867
|
list: import_zod4.z.object({
|
|
759
868
|
current: import_zod4.z.number().optional().describe("Current page"),
|
|
760
869
|
pageSize: import_zod4.z.number().optional().describe("Page size")
|
|
870
|
+
}).strict(),
|
|
871
|
+
create: import_zod4.z.object({
|
|
872
|
+
protocol: import_zod4.z.enum(["http", "socks5"]).describe("Proxy protocol: http or socks5"),
|
|
873
|
+
host: import_zod4.z.string().optional().describe("Proxy host (required for http/socks5)"),
|
|
874
|
+
port: import_zod4.z.number().optional().describe("Proxy port (required for http/socks5)"),
|
|
875
|
+
username: import_zod4.z.string().optional().describe("Proxy username"),
|
|
876
|
+
password: import_zod4.z.string().optional().describe("Proxy password"),
|
|
877
|
+
ipChecker: import_zod4.z.enum(["iptrush", "ip234", "ipinfo", "ipapi"]).optional().describe("IP checker service")
|
|
878
|
+
}).strict(),
|
|
879
|
+
update: import_zod4.z.object({
|
|
880
|
+
proxyId: import_zod4.z.number().int().positive().describe("Proxy id to update"),
|
|
881
|
+
protocol: import_zod4.z.enum(["http", "socks5"]).optional().describe("Proxy protocol"),
|
|
882
|
+
host: import_zod4.z.string().optional().describe("Proxy host"),
|
|
883
|
+
port: import_zod4.z.number().optional().describe("Proxy port"),
|
|
884
|
+
username: import_zod4.z.string().optional().describe("Proxy username"),
|
|
885
|
+
password: import_zod4.z.string().optional().describe("Proxy password"),
|
|
886
|
+
ipChecker: import_zod4.z.enum(["iptrush", "ip234", "ipinfo", "ipapi"]).optional().describe("IP checker service")
|
|
887
|
+
}).strict(),
|
|
888
|
+
delete: import_zod4.z.object({
|
|
889
|
+
proxyId: import_zod4.z.number().int().positive().describe("Proxy id to delete")
|
|
761
890
|
}).strict()
|
|
762
891
|
};
|
|
763
892
|
|
|
764
893
|
// ../core/src/system/actions.ts
|
|
894
|
+
function assertSuccess4(data, action) {
|
|
895
|
+
if (data && data.success) return;
|
|
896
|
+
const message = data && typeof data.message === "string" ? data.message : "Unknown error";
|
|
897
|
+
throw new Error(`Failed to ${action}: ${message}`);
|
|
898
|
+
}
|
|
765
899
|
var systemActions = {
|
|
766
900
|
async checkStatus() {
|
|
767
901
|
const response = await apiClient.get(ENDPOINTS.STATUS);
|
|
768
902
|
return `Connection status: ${JSON.stringify(response.data, null, 2)}`;
|
|
903
|
+
},
|
|
904
|
+
async windowSort({ envIds }) {
|
|
905
|
+
const body = {};
|
|
906
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
907
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SORT, body);
|
|
908
|
+
assertSuccess4(response.data, "sort windows");
|
|
909
|
+
return `Window sort result: ${response.data.message || JSON.stringify(response.data.data)}`;
|
|
910
|
+
},
|
|
911
|
+
async windowSortCustom(params) {
|
|
912
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SORT_CUSTOM, params);
|
|
913
|
+
assertSuccess4(response.data, "custom sort windows");
|
|
914
|
+
return `Custom window sort result: ${response.data.message || JSON.stringify(response.data.data)}`;
|
|
915
|
+
},
|
|
916
|
+
async windowHide() {
|
|
917
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_HIDE, {});
|
|
918
|
+
assertSuccess4(response.data, "hide window");
|
|
919
|
+
return `Window hidden: ${JSON.stringify(response.data.data)}`;
|
|
920
|
+
},
|
|
921
|
+
async windowShow() {
|
|
922
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SHOW, {});
|
|
923
|
+
assertSuccess4(response.data, "show window");
|
|
924
|
+
return `Window shown: ${JSON.stringify(response.data.data)}`;
|
|
769
925
|
}
|
|
770
926
|
};
|
|
771
927
|
|
|
928
|
+
// ../core/src/system/schema.ts
|
|
929
|
+
var import_zod5 = require("zod");
|
|
930
|
+
var systemSchemas = {
|
|
931
|
+
windowSort: import_zod5.z.object({
|
|
932
|
+
envIds: import_zod5.z.array(import_zod5.z.number().int().positive()).optional().describe("Target environment ids to sort. If omitted, sorts all open windows.")
|
|
933
|
+
}).strict(),
|
|
934
|
+
windowSortCustom: import_zod5.z.object({
|
|
935
|
+
type: import_zod5.z.enum(["box", "diagonal"]).describe("Layout type: box (grid) or diagonal"),
|
|
936
|
+
width: import_zod5.z.number().positive().describe("Window width"),
|
|
937
|
+
height: import_zod5.z.number().positive().describe("Window height"),
|
|
938
|
+
col: import_zod5.z.number().int().positive().describe("Column count"),
|
|
939
|
+
startX: import_zod5.z.number().describe("Starting X coordinate"),
|
|
940
|
+
startY: import_zod5.z.number().describe("Starting Y coordinate"),
|
|
941
|
+
spaceX: import_zod5.z.number().describe("Horizontal spacing between windows"),
|
|
942
|
+
spaceY: import_zod5.z.number().describe("Vertical spacing between windows"),
|
|
943
|
+
offsetX: import_zod5.z.number().describe("X offset"),
|
|
944
|
+
offsetY: import_zod5.z.number().describe("Y offset"),
|
|
945
|
+
envIds: import_zod5.z.array(import_zod5.z.number().int().positive()).optional().describe("Target environment ids"),
|
|
946
|
+
minWindowCount: import_zod5.z.number().int().positive().optional().describe("Minimum number of windows to trigger sort")
|
|
947
|
+
}).strict()
|
|
948
|
+
};
|
|
949
|
+
|
|
772
950
|
// src/wrap.ts
|
|
773
|
-
function wrapHandler(handler) {
|
|
951
|
+
function wrapHandler(handler, schema) {
|
|
774
952
|
return async (params) => {
|
|
775
953
|
try {
|
|
954
|
+
if (schema) {
|
|
955
|
+
const result = schema.safeParse(params);
|
|
956
|
+
if (!result.success) {
|
|
957
|
+
const messages = result.error.errors.map((e) => e.message).join("; ");
|
|
958
|
+
return { content: [{ type: "text", text: `Invalid parameters: ${messages}` }] };
|
|
959
|
+
}
|
|
960
|
+
params = result.data;
|
|
961
|
+
}
|
|
776
962
|
const content = await handler(params);
|
|
777
963
|
if (typeof content === "string") {
|
|
778
964
|
return { content: [{ type: "text", text: content }] };
|
|
@@ -805,37 +991,37 @@ function registerTools(server2) {
|
|
|
805
991
|
"open-browser",
|
|
806
992
|
"Open the browser (environment/profile). Requires envId OR userIndex. Use get-browser-list first to find envId/userIndex. After opening, call connect-browser-with-ws with the returned ws URL to enable automation tools (navigate, screenshot, click, etc.)",
|
|
807
993
|
schemaShape(profileSchemas.open),
|
|
808
|
-
wrapHandler(profileActions.open)
|
|
994
|
+
wrapHandler(profileActions.open, profileSchemas.open)
|
|
809
995
|
);
|
|
810
996
|
server2.tool(
|
|
811
997
|
"close-browser",
|
|
812
998
|
"Close the browser",
|
|
813
999
|
schemaShape(profileSchemas.close),
|
|
814
|
-
wrapHandler(profileActions.close)
|
|
1000
|
+
wrapHandler(profileActions.close, profileSchemas.close)
|
|
815
1001
|
);
|
|
816
1002
|
server2.tool(
|
|
817
1003
|
"create-browser",
|
|
818
1004
|
"Create a browser",
|
|
819
1005
|
profileSchemas.create.shape,
|
|
820
|
-
wrapHandler(profileActions.create)
|
|
1006
|
+
wrapHandler(profileActions.create, profileSchemas.create)
|
|
821
1007
|
);
|
|
822
1008
|
server2.tool(
|
|
823
1009
|
"update-browser",
|
|
824
|
-
"Update the browser",
|
|
1010
|
+
"Update the browser. envId and browserName are required.",
|
|
825
1011
|
profileSchemas.update.shape,
|
|
826
|
-
wrapHandler(profileActions.update)
|
|
1012
|
+
wrapHandler(profileActions.update, profileSchemas.update)
|
|
827
1013
|
);
|
|
828
1014
|
server2.tool(
|
|
829
1015
|
"delete-browser",
|
|
830
1016
|
"Delete the browser",
|
|
831
1017
|
schemaShape(profileSchemas.delete),
|
|
832
|
-
wrapHandler(profileActions.delete)
|
|
1018
|
+
wrapHandler(profileActions.delete, profileSchemas.delete)
|
|
833
1019
|
);
|
|
834
1020
|
server2.tool(
|
|
835
1021
|
"get-browser-list",
|
|
836
1022
|
"Get a summary list of browsers (envId, userIndex, browserName, groupId, remark, lastOpenedTime). Use pageSize to limit results. Use envId or userIndex from results to open a browser.",
|
|
837
1023
|
profileSchemas.list.shape,
|
|
838
|
-
wrapHandler(profileActions.list)
|
|
1024
|
+
wrapHandler(profileActions.list, profileSchemas.list)
|
|
839
1025
|
);
|
|
840
1026
|
server2.tool(
|
|
841
1027
|
"get-opened-browser",
|
|
@@ -847,13 +1033,13 @@ function registerTools(server2) {
|
|
|
847
1033
|
"get-profile-cookies",
|
|
848
1034
|
"Query and return cookies of the specified profile. Only one profile can be queried per request.",
|
|
849
1035
|
schemaShape(profileSchemas.cookies),
|
|
850
|
-
wrapHandler(profileActions.getCookies)
|
|
1036
|
+
wrapHandler(profileActions.getCookies, profileSchemas.cookies)
|
|
851
1037
|
);
|
|
852
1038
|
server2.tool(
|
|
853
1039
|
"get-profile-ua",
|
|
854
1040
|
"Query and return the User-Agent of specified profiles. Up to 10 profiles can be queried per request.",
|
|
855
1041
|
schemaShape(profileSchemas.ua),
|
|
856
|
-
wrapHandler(profileActions.getUa)
|
|
1042
|
+
wrapHandler(profileActions.getUa, profileSchemas.ua)
|
|
857
1043
|
);
|
|
858
1044
|
server2.tool(
|
|
859
1045
|
"close-all-profiles",
|
|
@@ -865,31 +1051,91 @@ function registerTools(server2) {
|
|
|
865
1051
|
"new-fingerprint",
|
|
866
1052
|
"Generate a new fingerprint for specified profiles. Up to 10 profiles are supported per request.",
|
|
867
1053
|
schemaShape(profileSchemas.newFingerprint),
|
|
868
|
-
wrapHandler(profileActions.newFingerprint)
|
|
1054
|
+
wrapHandler(profileActions.newFingerprint, profileSchemas.newFingerprint)
|
|
869
1055
|
);
|
|
870
1056
|
server2.tool(
|
|
871
|
-
"delete-cache
|
|
1057
|
+
"delete-cache",
|
|
872
1058
|
"Clear local cache of specific profiles. For account security, please ensure that there are no open browsers on the device when using this interface.",
|
|
873
1059
|
schemaShape(profileSchemas.deleteCache),
|
|
874
|
-
wrapHandler(profileActions.deleteCache)
|
|
1060
|
+
wrapHandler(profileActions.deleteCache, profileSchemas.deleteCache)
|
|
875
1061
|
);
|
|
876
1062
|
server2.tool(
|
|
877
1063
|
"get-browser-active",
|
|
878
1064
|
"Get active browser profile information",
|
|
879
1065
|
schemaShape(profileSchemas.active),
|
|
880
|
-
wrapHandler(profileActions.getActive)
|
|
1066
|
+
wrapHandler(profileActions.getActive, profileSchemas.active)
|
|
1067
|
+
);
|
|
1068
|
+
server2.tool(
|
|
1069
|
+
"delete-browser-batch",
|
|
1070
|
+
"Batch delete multiple browser environments at once",
|
|
1071
|
+
schemaShape(profileSchemas.batchDelete),
|
|
1072
|
+
wrapHandler(profileActions.batchDelete, profileSchemas.batchDelete)
|
|
1073
|
+
);
|
|
1074
|
+
server2.tool(
|
|
1075
|
+
"delete-cache-batch",
|
|
1076
|
+
"Clear local cache for multiple browser profiles at once",
|
|
1077
|
+
schemaShape(profileSchemas.batchDeleteCache),
|
|
1078
|
+
wrapHandler(profileActions.batchDeleteCache, profileSchemas.batchDeleteCache)
|
|
1079
|
+
);
|
|
1080
|
+
server2.tool(
|
|
1081
|
+
"get-mobile-devices",
|
|
1082
|
+
"Get available mobile device models for Android/iOS fingerprinting",
|
|
1083
|
+
profileSchemas.mobileDevices.shape,
|
|
1084
|
+
wrapHandler(profileActions.getMobileDevices, profileSchemas.mobileDevices)
|
|
1085
|
+
);
|
|
1086
|
+
server2.tool(
|
|
1087
|
+
"get-browser-detail",
|
|
1088
|
+
"Get detailed information for a single browser environment",
|
|
1089
|
+
profileSchemas.detail.shape,
|
|
1090
|
+
wrapHandler(profileActions.getDetail, profileSchemas.detail)
|
|
881
1091
|
);
|
|
882
1092
|
server2.tool(
|
|
883
1093
|
"get-group-list",
|
|
884
1094
|
"Get the list of groups",
|
|
885
1095
|
groupSchemas.list.shape,
|
|
886
|
-
wrapHandler(groupActions.list)
|
|
1096
|
+
wrapHandler(groupActions.list, groupSchemas.list)
|
|
1097
|
+
);
|
|
1098
|
+
server2.tool(
|
|
1099
|
+
"create-group",
|
|
1100
|
+
"Create a new browser environment group",
|
|
1101
|
+
groupSchemas.create.shape,
|
|
1102
|
+
wrapHandler(groupActions.create, groupSchemas.create)
|
|
1103
|
+
);
|
|
1104
|
+
server2.tool(
|
|
1105
|
+
"update-group",
|
|
1106
|
+
"Update an existing group name",
|
|
1107
|
+
groupSchemas.update.shape,
|
|
1108
|
+
wrapHandler(groupActions.update, groupSchemas.update)
|
|
1109
|
+
);
|
|
1110
|
+
server2.tool(
|
|
1111
|
+
"delete-group",
|
|
1112
|
+
"Delete a group by groupId",
|
|
1113
|
+
groupSchemas.delete.shape,
|
|
1114
|
+
wrapHandler(groupActions.delete, groupSchemas.delete)
|
|
887
1115
|
);
|
|
888
1116
|
server2.tool(
|
|
889
1117
|
"get-proxy-list",
|
|
890
1118
|
"Get the list of proxies",
|
|
891
1119
|
proxySchemas.list.shape,
|
|
892
|
-
wrapHandler(proxyActions.list)
|
|
1120
|
+
wrapHandler(proxyActions.list, proxySchemas.list)
|
|
1121
|
+
);
|
|
1122
|
+
server2.tool(
|
|
1123
|
+
"create-proxy",
|
|
1124
|
+
"Create a new proxy configuration",
|
|
1125
|
+
proxySchemas.create.shape,
|
|
1126
|
+
wrapHandler(proxyActions.create, proxySchemas.create)
|
|
1127
|
+
);
|
|
1128
|
+
server2.tool(
|
|
1129
|
+
"update-proxy",
|
|
1130
|
+
"Update an existing proxy configuration",
|
|
1131
|
+
proxySchemas.update.shape,
|
|
1132
|
+
wrapHandler(proxyActions.update, proxySchemas.update)
|
|
1133
|
+
);
|
|
1134
|
+
server2.tool(
|
|
1135
|
+
"delete-proxy",
|
|
1136
|
+
"Delete a proxy configuration by proxyId",
|
|
1137
|
+
proxySchemas.delete.shape,
|
|
1138
|
+
wrapHandler(proxyActions.delete, proxySchemas.delete)
|
|
893
1139
|
);
|
|
894
1140
|
server2.tool(
|
|
895
1141
|
"check-status",
|
|
@@ -897,6 +1143,30 @@ function registerTools(server2) {
|
|
|
897
1143
|
automationSchemas.empty.shape,
|
|
898
1144
|
wrapHandler(systemActions.checkStatus)
|
|
899
1145
|
);
|
|
1146
|
+
server2.tool(
|
|
1147
|
+
"window-sort",
|
|
1148
|
+
"Auto-arrange open browser windows to fit the screen",
|
|
1149
|
+
systemSchemas.windowSort.shape,
|
|
1150
|
+
wrapHandler(systemActions.windowSort, systemSchemas.windowSort)
|
|
1151
|
+
);
|
|
1152
|
+
server2.tool(
|
|
1153
|
+
"window-sort-custom",
|
|
1154
|
+
"Arrange browser windows using a custom layout (grid or diagonal)",
|
|
1155
|
+
systemSchemas.windowSortCustom.shape,
|
|
1156
|
+
wrapHandler(systemActions.windowSortCustom, systemSchemas.windowSortCustom)
|
|
1157
|
+
);
|
|
1158
|
+
server2.tool(
|
|
1159
|
+
"window-hide",
|
|
1160
|
+
"Hide the TgeBrowser client window",
|
|
1161
|
+
automationSchemas.empty.shape,
|
|
1162
|
+
wrapHandler(systemActions.windowHide)
|
|
1163
|
+
);
|
|
1164
|
+
server2.tool(
|
|
1165
|
+
"window-show",
|
|
1166
|
+
"Show the TgeBrowser client window",
|
|
1167
|
+
automationSchemas.empty.shape,
|
|
1168
|
+
wrapHandler(systemActions.windowShow)
|
|
1169
|
+
);
|
|
900
1170
|
server2.tool(
|
|
901
1171
|
"connect-browser-with-ws",
|
|
902
1172
|
"Connect to an opened browser via WebSocket CDP URL (obtained from open-browser result). Must be called before using any automation tools (navigate, screenshot, click, fill-input, etc.)",
|