@tgebrowser/mcp 1.1.0 → 1.1.2
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 +330 -20
- package/package.json +1 -1
package/build/server.js
CHANGED
|
@@ -57,13 +57,28 @@ 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",
|
|
80
|
+
UPDATE_COOKIE: "/api/browser/cookie/update",
|
|
81
|
+
BATCH_UPDATE: "/api/browser/batch/update"
|
|
67
82
|
};
|
|
68
83
|
var apiClient = import_axios.default.create({
|
|
69
84
|
baseURL: BASE_URL,
|
|
@@ -210,6 +225,54 @@ To automate this browser, use connect-browser-with-ws with wsUrl="${wsUrl}"`;
|
|
|
210
225
|
const response = await apiClient.get(ENDPOINTS.GET_OPENED_BROWSER);
|
|
211
226
|
assertSuccess(response.data, "get active browsers");
|
|
212
227
|
return `Active browsers: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
228
|
+
},
|
|
229
|
+
async batchDelete({ envIds, userIndexes, permanent }) {
|
|
230
|
+
const body = {};
|
|
231
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
232
|
+
if (userIndexes && userIndexes.length > 0) body.userIndexes = userIndexes;
|
|
233
|
+
if (permanent !== void 0) body.permanent = permanent;
|
|
234
|
+
const response = await apiClient.post(ENDPOINTS.BATCH_DELETE_BROWSER, body);
|
|
235
|
+
assertSuccess(response.data, "batch delete browsers");
|
|
236
|
+
const info = response.data.data || {};
|
|
237
|
+
return `Batch delete result: total=${info.total}, deleted=${JSON.stringify(info.deleted)}, failed=${JSON.stringify(info.failed)}`;
|
|
238
|
+
},
|
|
239
|
+
async batchDeleteCache({ envIds, userIndexes }) {
|
|
240
|
+
const body = {};
|
|
241
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
242
|
+
if (userIndexes && userIndexes.length > 0) body.userIndexes = userIndexes;
|
|
243
|
+
const response = await apiClient.post(ENDPOINTS.BATCH_DELETE_CACHE, body);
|
|
244
|
+
assertSuccess(response.data, "batch delete cache");
|
|
245
|
+
const info = response.data.data || {};
|
|
246
|
+
return `Batch delete cache result: total=${info.total}, success=${info.success}, failed=${info.failed}`;
|
|
247
|
+
},
|
|
248
|
+
async getMobileDevices({ os: os2 }) {
|
|
249
|
+
const params = {};
|
|
250
|
+
if (os2) params.os = os2;
|
|
251
|
+
const response = await apiClient.get(ENDPOINTS.GET_MOBILE_DEVICES, { params });
|
|
252
|
+
assertSuccess(response.data, "get mobile devices");
|
|
253
|
+
return `Mobile devices: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
254
|
+
},
|
|
255
|
+
async getDetail({ envId, userIndex }) {
|
|
256
|
+
const body = {};
|
|
257
|
+
if (envId !== void 0) body.envId = envId;
|
|
258
|
+
if (userIndex !== void 0) body.userIndex = userIndex;
|
|
259
|
+
const response = await apiClient.post(ENDPOINTS.GET_BROWSER_DETAIL, body);
|
|
260
|
+
assertSuccess(response.data, "get browser detail");
|
|
261
|
+
return `Browser detail: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
262
|
+
},
|
|
263
|
+
async updateCookie({ envId, userIndex, cookie }) {
|
|
264
|
+
const body = { cookie };
|
|
265
|
+
if (envId !== void 0) body.envId = envId;
|
|
266
|
+
if (userIndex !== void 0) body.userIndex = userIndex;
|
|
267
|
+
const response = await apiClient.post(ENDPOINTS.UPDATE_COOKIE, body);
|
|
268
|
+
assertSuccess(response.data, "update cookie");
|
|
269
|
+
return `Cookie updated for envId=${body.envId ?? ""} userIndex=${body.userIndex ?? ""}`;
|
|
270
|
+
},
|
|
271
|
+
async batchUpdate({ envIds, field, value }) {
|
|
272
|
+
const response = await apiClient.put(ENDPOINTS.BATCH_UPDATE, { envIds, field, value });
|
|
273
|
+
assertSuccess(response.data, "batch update");
|
|
274
|
+
const info = response.data.data || {};
|
|
275
|
+
return `Batch update result: total=${info.total}, success=${info.success}, failed=${info.failed}`;
|
|
213
276
|
}
|
|
214
277
|
};
|
|
215
278
|
|
|
@@ -404,8 +467,8 @@ var profileSchemas = {
|
|
|
404
467
|
Cookie: import_zod.z.any().optional()
|
|
405
468
|
}),
|
|
406
469
|
update: import_zod.z.object({
|
|
407
|
-
envId: import_zod.z.number().
|
|
408
|
-
browserName: import_zod.z.string().
|
|
470
|
+
envId: import_zod.z.number().describe("Environment id to update"),
|
|
471
|
+
browserName: import_zod.z.string().describe("Environment name"),
|
|
409
472
|
groupId: import_zod.z.number().optional().describe("Group id"),
|
|
410
473
|
remark: import_zod.z.string().optional().describe("Remark"),
|
|
411
474
|
proxy: import_zod.z.object({
|
|
@@ -477,7 +540,41 @@ var profileSchemas = {
|
|
|
477
540
|
}).refine((data) => data.profileId || data.profileNo, {
|
|
478
541
|
message: "Either profileId or profileNo must be provided"
|
|
479
542
|
}),
|
|
480
|
-
openedList: import_zod.z.object({}).strict()
|
|
543
|
+
openedList: import_zod.z.object({}).strict(),
|
|
544
|
+
batchDelete: import_zod.z.object({
|
|
545
|
+
envIds: import_zod.z.array(import_zod.z.number().int().positive()).optional().describe("Array of environment ids to delete"),
|
|
546
|
+
userIndexes: import_zod.z.array(import_zod.z.number().int().min(1)).optional().describe("Array of environment indexes to delete"),
|
|
547
|
+
permanent: import_zod.z.boolean().optional().describe("true=hard delete, false=soft delete (default)")
|
|
548
|
+
}).refine((data) => data.envIds && data.envIds.length > 0 || data.userIndexes && data.userIndexes.length > 0, {
|
|
549
|
+
message: "Either envIds or userIndexes must be provided"
|
|
550
|
+
}),
|
|
551
|
+
batchDeleteCache: import_zod.z.object({
|
|
552
|
+
envIds: import_zod.z.array(import_zod.z.number().int().positive()).optional().describe("Array of environment ids"),
|
|
553
|
+
userIndexes: import_zod.z.array(import_zod.z.number().int().min(1)).optional().describe("Array of environment indexes")
|
|
554
|
+
}).refine((data) => data.envIds && data.envIds.length > 0 || data.userIndexes && data.userIndexes.length > 0, {
|
|
555
|
+
message: "Either envIds or userIndexes must be provided"
|
|
556
|
+
}),
|
|
557
|
+
mobileDevices: import_zod.z.object({
|
|
558
|
+
os: import_zod.z.enum(["Android", "iOS"]).optional().describe("Filter by OS: Android or iOS")
|
|
559
|
+
}).strict(),
|
|
560
|
+
detail: import_zod.z.object({
|
|
561
|
+
envId: import_zod.z.number().int().positive().optional().describe("Environment id"),
|
|
562
|
+
userIndex: import_zod.z.number().int().min(1).optional().describe("Environment index")
|
|
563
|
+
}).refine((data) => data.envId !== void 0 || data.userIndex !== void 0, {
|
|
564
|
+
message: "Either envId or userIndex must be provided"
|
|
565
|
+
}),
|
|
566
|
+
updateCookie: import_zod.z.object({
|
|
567
|
+
envId: import_zod.z.number().int().positive().optional().describe("Environment id"),
|
|
568
|
+
userIndex: import_zod.z.number().int().min(1).optional().describe("Environment index"),
|
|
569
|
+
cookie: import_zod.z.string().describe("Cookie string. Empty string or null clears the cookie.")
|
|
570
|
+
}).refine((data) => data.envId !== void 0 || data.userIndex !== void 0, {
|
|
571
|
+
message: "Either envId or userIndex must be provided"
|
|
572
|
+
}),
|
|
573
|
+
batchUpdate: import_zod.z.object({
|
|
574
|
+
envIds: import_zod.z.array(import_zod.z.number().int().positive()).describe("Array of environment ids"),
|
|
575
|
+
field: import_zod.z.string().describe('Field name to update, e.g. "browserName", "remark", "fingerprint"'),
|
|
576
|
+
value: import_zod.z.any().describe("New value for the field")
|
|
577
|
+
})
|
|
481
578
|
};
|
|
482
579
|
|
|
483
580
|
// ../core/src/automation/actions.ts
|
|
@@ -723,6 +820,21 @@ var groupActions = {
|
|
|
723
820
|
const response = await apiClient.get(ENDPOINTS.GET_GROUP_LIST, { params });
|
|
724
821
|
assertSuccess2(response.data, "get group list");
|
|
725
822
|
return `Group list: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
823
|
+
},
|
|
824
|
+
async create({ name }) {
|
|
825
|
+
const response = await apiClient.post(ENDPOINTS.CREATE_GROUP, { name });
|
|
826
|
+
assertSuccess2(response.data, "create group");
|
|
827
|
+
return `Group created: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
828
|
+
},
|
|
829
|
+
async update({ groupId, name }) {
|
|
830
|
+
const response = await apiClient.put(ENDPOINTS.UPDATE_GROUP(groupId), { name });
|
|
831
|
+
assertSuccess2(response.data, "update group");
|
|
832
|
+
return `Group updated: groupId=${groupId}`;
|
|
833
|
+
},
|
|
834
|
+
async delete({ groupId }) {
|
|
835
|
+
const response = await apiClient.delete(ENDPOINTS.DELETE_GROUP(groupId));
|
|
836
|
+
assertSuccess2(response.data, "delete group");
|
|
837
|
+
return `Group deleted: groupId=${groupId}`;
|
|
726
838
|
}
|
|
727
839
|
};
|
|
728
840
|
|
|
@@ -732,6 +844,16 @@ var groupSchemas = {
|
|
|
732
844
|
list: import_zod3.z.object({
|
|
733
845
|
current: import_zod3.z.number().optional().describe("Current page"),
|
|
734
846
|
pageSize: import_zod3.z.number().optional().describe("Page size")
|
|
847
|
+
}).strict(),
|
|
848
|
+
create: import_zod3.z.object({
|
|
849
|
+
name: import_zod3.z.string().describe("Group name")
|
|
850
|
+
}).strict(),
|
|
851
|
+
update: import_zod3.z.object({
|
|
852
|
+
groupId: import_zod3.z.number().int().positive().describe("Group id to update"),
|
|
853
|
+
name: import_zod3.z.string().describe("New group name")
|
|
854
|
+
}).strict(),
|
|
855
|
+
delete: import_zod3.z.object({
|
|
856
|
+
groupId: import_zod3.z.number().int().positive().describe("Group id to delete")
|
|
735
857
|
}).strict()
|
|
736
858
|
};
|
|
737
859
|
|
|
@@ -749,6 +871,21 @@ var proxyActions = {
|
|
|
749
871
|
const response = await apiClient.get(ENDPOINTS.GET_PROXY_LIST, { params });
|
|
750
872
|
assertSuccess3(response.data, "get proxy list");
|
|
751
873
|
return `Proxy list: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
874
|
+
},
|
|
875
|
+
async create(params) {
|
|
876
|
+
const response = await apiClient.post(ENDPOINTS.CREATE_PROXY, params);
|
|
877
|
+
assertSuccess3(response.data, "create proxy");
|
|
878
|
+
return `Proxy created: ${JSON.stringify(response.data.data, null, 2)}`;
|
|
879
|
+
},
|
|
880
|
+
async update({ proxyId, ...rest }) {
|
|
881
|
+
const response = await apiClient.put(ENDPOINTS.UPDATE_PROXY(proxyId), rest);
|
|
882
|
+
assertSuccess3(response.data, "update proxy");
|
|
883
|
+
return `Proxy updated: proxyId=${proxyId}`;
|
|
884
|
+
},
|
|
885
|
+
async delete({ proxyId }) {
|
|
886
|
+
const response = await apiClient.delete(ENDPOINTS.DELETE_PROXY(proxyId));
|
|
887
|
+
assertSuccess3(response.data, "delete proxy");
|
|
888
|
+
return `Proxy deleted: proxyId=${proxyId}`;
|
|
752
889
|
}
|
|
753
890
|
};
|
|
754
891
|
|
|
@@ -758,21 +895,98 @@ var proxySchemas = {
|
|
|
758
895
|
list: import_zod4.z.object({
|
|
759
896
|
current: import_zod4.z.number().optional().describe("Current page"),
|
|
760
897
|
pageSize: import_zod4.z.number().optional().describe("Page size")
|
|
898
|
+
}).strict(),
|
|
899
|
+
create: import_zod4.z.object({
|
|
900
|
+
protocol: import_zod4.z.enum(["http", "socks5"]).describe("Proxy protocol: http or socks5"),
|
|
901
|
+
host: import_zod4.z.string().optional().describe("Proxy host (required for http/socks5)"),
|
|
902
|
+
port: import_zod4.z.number().optional().describe("Proxy port (required for http/socks5)"),
|
|
903
|
+
username: import_zod4.z.string().optional().describe("Proxy username"),
|
|
904
|
+
password: import_zod4.z.string().optional().describe("Proxy password"),
|
|
905
|
+
ipChecker: import_zod4.z.enum(["iptrush", "ip234", "ipinfo", "ipapi"]).optional().describe("IP checker service")
|
|
906
|
+
}).strict(),
|
|
907
|
+
update: import_zod4.z.object({
|
|
908
|
+
proxyId: import_zod4.z.number().int().positive().describe("Proxy id to update"),
|
|
909
|
+
protocol: import_zod4.z.enum(["http", "socks5"]).optional().describe("Proxy protocol"),
|
|
910
|
+
host: import_zod4.z.string().optional().describe("Proxy host"),
|
|
911
|
+
port: import_zod4.z.number().optional().describe("Proxy port"),
|
|
912
|
+
username: import_zod4.z.string().optional().describe("Proxy username"),
|
|
913
|
+
password: import_zod4.z.string().optional().describe("Proxy password"),
|
|
914
|
+
ipChecker: import_zod4.z.enum(["iptrush", "ip234", "ipinfo", "ipapi"]).optional().describe("IP checker service")
|
|
915
|
+
}).strict(),
|
|
916
|
+
delete: import_zod4.z.object({
|
|
917
|
+
proxyId: import_zod4.z.number().int().positive().describe("Proxy id to delete")
|
|
761
918
|
}).strict()
|
|
762
919
|
};
|
|
763
920
|
|
|
764
921
|
// ../core/src/system/actions.ts
|
|
922
|
+
function assertSuccess4(data, action) {
|
|
923
|
+
if (data && data.success) return;
|
|
924
|
+
const message = data && typeof data.message === "string" ? data.message : "Unknown error";
|
|
925
|
+
throw new Error(`Failed to ${action}: ${message}`);
|
|
926
|
+
}
|
|
765
927
|
var systemActions = {
|
|
766
928
|
async checkStatus() {
|
|
767
929
|
const response = await apiClient.get(ENDPOINTS.STATUS);
|
|
768
930
|
return `Connection status: ${JSON.stringify(response.data, null, 2)}`;
|
|
931
|
+
},
|
|
932
|
+
async windowSort({ envIds }) {
|
|
933
|
+
const body = {};
|
|
934
|
+
if (envIds && envIds.length > 0) body.envIds = envIds;
|
|
935
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SORT, body);
|
|
936
|
+
assertSuccess4(response.data, "sort windows");
|
|
937
|
+
return `Window sort result: ${response.data.message || JSON.stringify(response.data.data)}`;
|
|
938
|
+
},
|
|
939
|
+
async windowSortCustom(params) {
|
|
940
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SORT_CUSTOM, params);
|
|
941
|
+
assertSuccess4(response.data, "custom sort windows");
|
|
942
|
+
return `Custom window sort result: ${response.data.message || JSON.stringify(response.data.data)}`;
|
|
943
|
+
},
|
|
944
|
+
async windowHide() {
|
|
945
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_HIDE, {});
|
|
946
|
+
assertSuccess4(response.data, "hide window");
|
|
947
|
+
return `Window hidden: ${JSON.stringify(response.data.data)}`;
|
|
948
|
+
},
|
|
949
|
+
async windowShow() {
|
|
950
|
+
const response = await apiClient.post(ENDPOINTS.WINDOW_SHOW, {});
|
|
951
|
+
assertSuccess4(response.data, "show window");
|
|
952
|
+
return `Window shown: ${JSON.stringify(response.data.data)}`;
|
|
769
953
|
}
|
|
770
954
|
};
|
|
771
955
|
|
|
956
|
+
// ../core/src/system/schema.ts
|
|
957
|
+
var import_zod5 = require("zod");
|
|
958
|
+
var systemSchemas = {
|
|
959
|
+
windowSort: import_zod5.z.object({
|
|
960
|
+
envIds: import_zod5.z.array(import_zod5.z.number().int().positive()).optional().describe("Target environment ids to sort. If omitted, sorts all open windows.")
|
|
961
|
+
}).strict(),
|
|
962
|
+
windowSortCustom: import_zod5.z.object({
|
|
963
|
+
type: import_zod5.z.enum(["box", "diagonal"]).describe("Layout type: box (grid) or diagonal"),
|
|
964
|
+
width: import_zod5.z.number().positive().describe("Window width"),
|
|
965
|
+
height: import_zod5.z.number().positive().describe("Window height"),
|
|
966
|
+
col: import_zod5.z.number().int().positive().describe("Column count"),
|
|
967
|
+
startX: import_zod5.z.number().describe("Starting X coordinate"),
|
|
968
|
+
startY: import_zod5.z.number().describe("Starting Y coordinate"),
|
|
969
|
+
spaceX: import_zod5.z.number().describe("Horizontal spacing between windows"),
|
|
970
|
+
spaceY: import_zod5.z.number().describe("Vertical spacing between windows"),
|
|
971
|
+
offsetX: import_zod5.z.number().describe("X offset"),
|
|
972
|
+
offsetY: import_zod5.z.number().describe("Y offset"),
|
|
973
|
+
envIds: import_zod5.z.array(import_zod5.z.number().int().positive()).optional().describe("Target environment ids"),
|
|
974
|
+
minWindowCount: import_zod5.z.number().int().positive().optional().describe("Minimum number of windows to trigger sort")
|
|
975
|
+
}).strict()
|
|
976
|
+
};
|
|
977
|
+
|
|
772
978
|
// src/wrap.ts
|
|
773
|
-
function wrapHandler(handler) {
|
|
979
|
+
function wrapHandler(handler, schema) {
|
|
774
980
|
return async (params) => {
|
|
775
981
|
try {
|
|
982
|
+
if (schema) {
|
|
983
|
+
const result = schema.safeParse(params);
|
|
984
|
+
if (!result.success) {
|
|
985
|
+
const messages = result.error.errors.map((e) => e.message).join("; ");
|
|
986
|
+
return { content: [{ type: "text", text: `Invalid parameters: ${messages}` }] };
|
|
987
|
+
}
|
|
988
|
+
params = result.data;
|
|
989
|
+
}
|
|
776
990
|
const content = await handler(params);
|
|
777
991
|
if (typeof content === "string") {
|
|
778
992
|
return { content: [{ type: "text", text: content }] };
|
|
@@ -805,37 +1019,37 @@ function registerTools(server2) {
|
|
|
805
1019
|
"open-browser",
|
|
806
1020
|
"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
1021
|
schemaShape(profileSchemas.open),
|
|
808
|
-
wrapHandler(profileActions.open)
|
|
1022
|
+
wrapHandler(profileActions.open, profileSchemas.open)
|
|
809
1023
|
);
|
|
810
1024
|
server2.tool(
|
|
811
1025
|
"close-browser",
|
|
812
1026
|
"Close the browser",
|
|
813
1027
|
schemaShape(profileSchemas.close),
|
|
814
|
-
wrapHandler(profileActions.close)
|
|
1028
|
+
wrapHandler(profileActions.close, profileSchemas.close)
|
|
815
1029
|
);
|
|
816
1030
|
server2.tool(
|
|
817
1031
|
"create-browser",
|
|
818
1032
|
"Create a browser",
|
|
819
1033
|
profileSchemas.create.shape,
|
|
820
|
-
wrapHandler(profileActions.create)
|
|
1034
|
+
wrapHandler(profileActions.create, profileSchemas.create)
|
|
821
1035
|
);
|
|
822
1036
|
server2.tool(
|
|
823
1037
|
"update-browser",
|
|
824
|
-
"Update the browser",
|
|
1038
|
+
"Update the browser. envId and browserName are required.",
|
|
825
1039
|
profileSchemas.update.shape,
|
|
826
|
-
wrapHandler(profileActions.update)
|
|
1040
|
+
wrapHandler(profileActions.update, profileSchemas.update)
|
|
827
1041
|
);
|
|
828
1042
|
server2.tool(
|
|
829
1043
|
"delete-browser",
|
|
830
1044
|
"Delete the browser",
|
|
831
1045
|
schemaShape(profileSchemas.delete),
|
|
832
|
-
wrapHandler(profileActions.delete)
|
|
1046
|
+
wrapHandler(profileActions.delete, profileSchemas.delete)
|
|
833
1047
|
);
|
|
834
1048
|
server2.tool(
|
|
835
1049
|
"get-browser-list",
|
|
836
1050
|
"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
1051
|
profileSchemas.list.shape,
|
|
838
|
-
wrapHandler(profileActions.list)
|
|
1052
|
+
wrapHandler(profileActions.list, profileSchemas.list)
|
|
839
1053
|
);
|
|
840
1054
|
server2.tool(
|
|
841
1055
|
"get-opened-browser",
|
|
@@ -847,13 +1061,13 @@ function registerTools(server2) {
|
|
|
847
1061
|
"get-profile-cookies",
|
|
848
1062
|
"Query and return cookies of the specified profile. Only one profile can be queried per request.",
|
|
849
1063
|
schemaShape(profileSchemas.cookies),
|
|
850
|
-
wrapHandler(profileActions.getCookies)
|
|
1064
|
+
wrapHandler(profileActions.getCookies, profileSchemas.cookies)
|
|
851
1065
|
);
|
|
852
1066
|
server2.tool(
|
|
853
1067
|
"get-profile-ua",
|
|
854
1068
|
"Query and return the User-Agent of specified profiles. Up to 10 profiles can be queried per request.",
|
|
855
1069
|
schemaShape(profileSchemas.ua),
|
|
856
|
-
wrapHandler(profileActions.getUa)
|
|
1070
|
+
wrapHandler(profileActions.getUa, profileSchemas.ua)
|
|
857
1071
|
);
|
|
858
1072
|
server2.tool(
|
|
859
1073
|
"close-all-profiles",
|
|
@@ -865,31 +1079,103 @@ function registerTools(server2) {
|
|
|
865
1079
|
"new-fingerprint",
|
|
866
1080
|
"Generate a new fingerprint for specified profiles. Up to 10 profiles are supported per request.",
|
|
867
1081
|
schemaShape(profileSchemas.newFingerprint),
|
|
868
|
-
wrapHandler(profileActions.newFingerprint)
|
|
1082
|
+
wrapHandler(profileActions.newFingerprint, profileSchemas.newFingerprint)
|
|
869
1083
|
);
|
|
870
1084
|
server2.tool(
|
|
871
|
-
"delete-cache
|
|
1085
|
+
"delete-cache",
|
|
872
1086
|
"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
1087
|
schemaShape(profileSchemas.deleteCache),
|
|
874
|
-
wrapHandler(profileActions.deleteCache)
|
|
1088
|
+
wrapHandler(profileActions.deleteCache, profileSchemas.deleteCache)
|
|
875
1089
|
);
|
|
876
1090
|
server2.tool(
|
|
877
1091
|
"get-browser-active",
|
|
878
1092
|
"Get active browser profile information",
|
|
879
1093
|
schemaShape(profileSchemas.active),
|
|
880
|
-
wrapHandler(profileActions.getActive)
|
|
1094
|
+
wrapHandler(profileActions.getActive, profileSchemas.active)
|
|
1095
|
+
);
|
|
1096
|
+
server2.tool(
|
|
1097
|
+
"delete-browser-batch",
|
|
1098
|
+
"Batch delete multiple browser environments at once",
|
|
1099
|
+
schemaShape(profileSchemas.batchDelete),
|
|
1100
|
+
wrapHandler(profileActions.batchDelete, profileSchemas.batchDelete)
|
|
1101
|
+
);
|
|
1102
|
+
server2.tool(
|
|
1103
|
+
"delete-cache-batch",
|
|
1104
|
+
"Clear local cache for multiple browser profiles at once",
|
|
1105
|
+
schemaShape(profileSchemas.batchDeleteCache),
|
|
1106
|
+
wrapHandler(profileActions.batchDeleteCache, profileSchemas.batchDeleteCache)
|
|
1107
|
+
);
|
|
1108
|
+
server2.tool(
|
|
1109
|
+
"get-mobile-devices",
|
|
1110
|
+
"Get available mobile device models for Android/iOS fingerprinting",
|
|
1111
|
+
profileSchemas.mobileDevices.shape,
|
|
1112
|
+
wrapHandler(profileActions.getMobileDevices, profileSchemas.mobileDevices)
|
|
1113
|
+
);
|
|
1114
|
+
server2.tool(
|
|
1115
|
+
"get-browser-detail",
|
|
1116
|
+
"Get detailed information for a single browser environment",
|
|
1117
|
+
profileSchemas.detail.shape,
|
|
1118
|
+
wrapHandler(profileActions.getDetail, profileSchemas.detail)
|
|
1119
|
+
);
|
|
1120
|
+
server2.tool(
|
|
1121
|
+
"update-cookie",
|
|
1122
|
+
"Update the cookie for a specific environment. Pass empty string to clear.",
|
|
1123
|
+
schemaShape(profileSchemas.updateCookie),
|
|
1124
|
+
wrapHandler(profileActions.updateCookie, profileSchemas.updateCookie)
|
|
1125
|
+
);
|
|
1126
|
+
server2.tool(
|
|
1127
|
+
"batch-update",
|
|
1128
|
+
"Batch update a specific field across multiple environments",
|
|
1129
|
+
profileSchemas.batchUpdate.shape,
|
|
1130
|
+
wrapHandler(profileActions.batchUpdate, profileSchemas.batchUpdate)
|
|
881
1131
|
);
|
|
882
1132
|
server2.tool(
|
|
883
1133
|
"get-group-list",
|
|
884
1134
|
"Get the list of groups",
|
|
885
1135
|
groupSchemas.list.shape,
|
|
886
|
-
wrapHandler(groupActions.list)
|
|
1136
|
+
wrapHandler(groupActions.list, groupSchemas.list)
|
|
1137
|
+
);
|
|
1138
|
+
server2.tool(
|
|
1139
|
+
"create-group",
|
|
1140
|
+
"Create a new browser environment group",
|
|
1141
|
+
groupSchemas.create.shape,
|
|
1142
|
+
wrapHandler(groupActions.create, groupSchemas.create)
|
|
1143
|
+
);
|
|
1144
|
+
server2.tool(
|
|
1145
|
+
"update-group",
|
|
1146
|
+
"Update an existing group name",
|
|
1147
|
+
groupSchemas.update.shape,
|
|
1148
|
+
wrapHandler(groupActions.update, groupSchemas.update)
|
|
1149
|
+
);
|
|
1150
|
+
server2.tool(
|
|
1151
|
+
"delete-group",
|
|
1152
|
+
"Delete a group by groupId",
|
|
1153
|
+
groupSchemas.delete.shape,
|
|
1154
|
+
wrapHandler(groupActions.delete, groupSchemas.delete)
|
|
887
1155
|
);
|
|
888
1156
|
server2.tool(
|
|
889
1157
|
"get-proxy-list",
|
|
890
1158
|
"Get the list of proxies",
|
|
891
1159
|
proxySchemas.list.shape,
|
|
892
|
-
wrapHandler(proxyActions.list)
|
|
1160
|
+
wrapHandler(proxyActions.list, proxySchemas.list)
|
|
1161
|
+
);
|
|
1162
|
+
server2.tool(
|
|
1163
|
+
"create-proxy",
|
|
1164
|
+
"Create a new proxy configuration",
|
|
1165
|
+
proxySchemas.create.shape,
|
|
1166
|
+
wrapHandler(proxyActions.create, proxySchemas.create)
|
|
1167
|
+
);
|
|
1168
|
+
server2.tool(
|
|
1169
|
+
"update-proxy",
|
|
1170
|
+
"Update an existing proxy configuration",
|
|
1171
|
+
proxySchemas.update.shape,
|
|
1172
|
+
wrapHandler(proxyActions.update, proxySchemas.update)
|
|
1173
|
+
);
|
|
1174
|
+
server2.tool(
|
|
1175
|
+
"delete-proxy",
|
|
1176
|
+
"Delete a proxy configuration by proxyId",
|
|
1177
|
+
proxySchemas.delete.shape,
|
|
1178
|
+
wrapHandler(proxyActions.delete, proxySchemas.delete)
|
|
893
1179
|
);
|
|
894
1180
|
server2.tool(
|
|
895
1181
|
"check-status",
|
|
@@ -897,6 +1183,30 @@ function registerTools(server2) {
|
|
|
897
1183
|
automationSchemas.empty.shape,
|
|
898
1184
|
wrapHandler(systemActions.checkStatus)
|
|
899
1185
|
);
|
|
1186
|
+
server2.tool(
|
|
1187
|
+
"window-sort",
|
|
1188
|
+
"Auto-arrange open browser windows to fit the screen",
|
|
1189
|
+
systemSchemas.windowSort.shape,
|
|
1190
|
+
wrapHandler(systemActions.windowSort, systemSchemas.windowSort)
|
|
1191
|
+
);
|
|
1192
|
+
server2.tool(
|
|
1193
|
+
"window-sort-custom",
|
|
1194
|
+
"Arrange browser windows using a custom layout (grid or diagonal)",
|
|
1195
|
+
systemSchemas.windowSortCustom.shape,
|
|
1196
|
+
wrapHandler(systemActions.windowSortCustom, systemSchemas.windowSortCustom)
|
|
1197
|
+
);
|
|
1198
|
+
server2.tool(
|
|
1199
|
+
"window-hide",
|
|
1200
|
+
"Hide the TgeBrowser client window",
|
|
1201
|
+
automationSchemas.empty.shape,
|
|
1202
|
+
wrapHandler(systemActions.windowHide)
|
|
1203
|
+
);
|
|
1204
|
+
server2.tool(
|
|
1205
|
+
"window-show",
|
|
1206
|
+
"Show the TgeBrowser client window",
|
|
1207
|
+
automationSchemas.empty.shape,
|
|
1208
|
+
wrapHandler(systemActions.windowShow)
|
|
1209
|
+
);
|
|
900
1210
|
server2.tool(
|
|
901
1211
|
"connect-browser-with-ws",
|
|
902
1212
|
"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.)",
|