@roxybrowser/openapi 1.0.12-beta.0 → 1.0.13-beta.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/lib/index.cjs CHANGED
@@ -545,10 +545,7 @@ var channelList = [
545
545
  ];
546
546
  var ProxyList = class {
547
547
  name = "roxy_list_proxies";
548
- /**
549
- * 仅当用户没有指定商店时调用
550
- */
551
- description = "Get list of proxy configurations. If you want to get the list of proxies configurations you've bought, please use `roxy_store_proxies`.";
548
+ description = "Get list of proxy IP List.";
552
549
  inputSchema = {
553
550
  type: "object",
554
551
  properties: {
@@ -556,7 +553,7 @@ var ProxyList = class {
556
553
  type: "number",
557
554
  description: "Workspace ID"
558
555
  },
559
- id: {
556
+ proxyType: {
560
557
  type: "number",
561
558
  description: "Filter by proxy ID"
562
559
  },
@@ -592,7 +589,7 @@ var ProxyList = class {
592
589
  if (!params.workspaceId) {
593
590
  throw new Error("workspaceId is required");
594
591
  }
595
- const result = await request(`/proxy/list?${searchParams}`);
592
+ const result = await request(`/proxy/list_merged?${searchParams}`);
596
593
  let text = "";
597
594
  if (result.code === 0) {
598
595
  const data = result.data;
@@ -602,9 +599,13 @@ var ProxyList = class {
602
599
  const hasNextPage = currentPage < totalPages;
603
600
  const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
604
601
  const statusText = proxy.checkStatus === 1 ? "\u2705 available" : proxy.checkStatus === 2 ? "\u274C unavailable" : "\u23F3 not checked";
602
+ const sourceType = proxy.dataType === "proxyModule" ? "user-added" : proxy.dataType === "buyProxy" ? "proxy store" : proxy.dataType || "unknown";
603
+ const canDelete = proxy.dataType === "proxyModule" ? "yes" : "no";
605
604
  const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
606
605
  const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
607
606
  let baseInfo = `${index + 1}. ${statusText} **${name}**
607
+ source: ${sourceType}
608
+ deletable: ${canDelete}
608
609
  protocol: ${proxy.protocol || "N/A"}
609
610
  ipType: ${proxy.ipType || "N/A"}
610
611
  bind profile count: ${proxy.bindCount || "N/A"}
@@ -624,7 +625,9 @@ ${ipInfo.length > 0 ? `${ipInfo.join("")}
624
625
  }
625
626
  return baseInfo;
626
627
  }).join("\n\n") : "";
627
- text = `\u{1F4CB} **proxy list** (total: ${data.total})
628
+ text = `\u{1F4F5} **proxy list** (total: ${data.total})
629
+
630
+ Only proxies with \`source: user-added\` can be deleted.
628
631
 
629
632
  ${proxyListText}
630
633
 
@@ -642,215 +645,8 @@ ${result.msg}`;
642
645
  return { content: [{ type: "text", text }] };
643
646
  }
644
647
  };
645
- var ProxyStore = class {
646
- name = "roxy_store_proxies";
647
- description = "Get list of proxy configurations in the Proxy Store";
648
- inputSchema = {
649
- type: "object",
650
- properties: {
651
- workspaceId: {
652
- type: "number",
653
- description: "Workspace ID"
654
- },
655
- pageIndex: {
656
- type: "number",
657
- description: "Page index for pagination (default: 1)",
658
- default: 1
659
- },
660
- pageSize: {
661
- type: "number",
662
- description: "Number of items per page (default: 15)",
663
- default: 15
664
- },
665
- type: {
666
- type: "number",
667
- description: "Type of proxies to get (0: list_use, 1: available_list)",
668
- default: 0
669
- }
670
- },
671
- required: ["workspaceId"]
672
- };
673
- get schema() {
674
- return {
675
- name: this.name,
676
- description: this.description,
677
- inputSchema: this.inputSchema
678
- };
679
- }
680
- async handle(params) {
681
- const searchParams = new URLSearchParams();
682
- searchParams.append("workspaceId", params.workspaceId.toString());
683
- if (params.pageIndex)
684
- searchParams.append("page_index", params.pageIndex.toString());
685
- if (params.pageSize)
686
- searchParams.append("page_size", params.pageSize.toString());
687
- if (params.type)
688
- searchParams.append("type", params.type.toString());
689
- const result = await request(`/proxy/bought_list?${searchParams}`);
690
- let text = "";
691
- if (result.code === 0) {
692
- const data = result.data;
693
- const currentPage = params.pageIndex ?? 1;
694
- const pageSize = params.pageSize ?? 15;
695
- const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
696
- const hasNextPage = currentPage < totalPages;
697
- const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
698
- const statusText = proxy.checkStatus === 1 ? "\u2705 available" : proxy.checkStatus === 2 ? "\u274C unavailable" : "\u23F3 not checked";
699
- const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
700
- const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
701
- let baseInfo = `${index + 1}. ${statusText} **${name}**
702
- protocol: ${proxy.protocol || "N/A"}
703
- ipType: ${proxy.ipType || "N/A"}
704
- bind profile count: ${proxy.bindCount || "N/A"}
705
- Detection channel: ${proxy.checkChannel || "N/A"}
706
- expire date: ${proxy.expireDate}`;
707
- const ipInfo = [proxy.host, ":", proxy.port];
708
- if (proxy.proxyUserName) {
709
- ipInfo.push(...[proxy.proxyUserName, "@", proxy.proxyPassword]);
710
- }
711
- if (location) {
712
- baseInfo += `
713
- ${ipInfo.join("")}
714
- \u{1F4CD} ${location}`;
715
- }
716
- return baseInfo;
717
- }).join("\n\n") : "";
718
- text = `\u{1F4CB} **proxy store** (total: ${data.total})
719
-
720
- ${proxyListText}
721
-
722
- Pagination:
723
- - currentPage: ${currentPage}
724
- - pageSize: ${pageSize}
725
- - totalPages: ${totalPages}
726
- - hasNextPage: ${hasNextPage}
727
- ${hasNextPage ? `- nextPageHint: Call roxy_store_proxies again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
728
- } else {
729
- text = `\u274C **get proxy store failed**
730
-
731
- ${result.msg}`;
732
- }
733
- return { content: [{ type: "text", text }] };
734
- }
735
- };
736
- var CreateProxy = class {
737
- name = "roxy_create_proxy";
738
- description = "Create a new proxy configuration with automatic IP detection";
739
- inputSchema = {
740
- type: "object",
741
- properties: {
742
- workspaceId: {
743
- type: "number",
744
- description: "Workspace ID"
745
- },
746
- protocol: {
747
- type: "string",
748
- enum: ["HTTP", "HTTPS", "SOCKS5", "SSH"],
749
- description: "Proxy protocol type"
750
- },
751
- host: {
752
- type: "string",
753
- description: "Proxy host/IP address"
754
- },
755
- port: {
756
- type: "string",
757
- description: "Proxy port"
758
- },
759
- proxyUserName: {
760
- type: "string",
761
- description: "Proxy username"
762
- },
763
- proxyPassword: {
764
- type: "string",
765
- description: "Proxy password"
766
- },
767
- ipType: {
768
- type: "string",
769
- enum: ["IPV4", "IPV6"],
770
- description: "IP type (default: IPV4)"
771
- },
772
- checkChannel: {
773
- type: "string",
774
- enum: channelList.map((item) => item.label),
775
- description: "IP detection channel (default: IP123.in)"
776
- },
777
- refreshUrl: {
778
- type: "string",
779
- description: "Refresh URL for dynamic proxies"
780
- },
781
- remark: {
782
- type: "string",
783
- description: "Proxy remark/notes"
784
- }
785
- },
786
- required: ["workspaceId", "protocol", "host", "port"]
787
- };
788
- get schema() {
789
- return {
790
- name: this.name,
791
- description: this.description,
792
- inputSchema: this.inputSchema
793
- };
794
- }
795
- async handle(params) {
796
- if (!params.workspaceId || !params.protocol || !params.host || !params.port) {
797
- return {
798
- content: [
799
- {
800
- type: "text",
801
- text: "\u274C **Failed to create proxy:**\n\n workspaceId, protocol, host, and port are required"
802
- }
803
- ]
804
- };
805
- }
806
- const { workspaceId, ipType = "IPV4", checkChannel = "IP123.in", ...proxyData } = params;
807
- const proxyParams = {
808
- workspaceId,
809
- ...proxyData,
810
- ipType,
811
- checkChannel: checkChannel ? channelList.find((item) => item.label === checkChannel)?.value : null,
812
- proxyCategory: params.protocol
813
- };
814
- const result = await request("/proxy/create", {
815
- method: "POST",
816
- body: JSON.stringify(proxyParams)
817
- });
818
- let text = "";
819
- if (result.code !== 0) {
820
- if (result.data) {
821
- text = `\u274C **Failed to create proxy:**
822
-
823
- error message: ${result.msg}
824
-
825
- ${result.data.map((item) => ` - index: ${item.index}, error message: ${item.msg.join(", ")}`).join("\n")}`;
826
- } else {
827
- text = `\u274C **Failed to create proxy:**
828
-
829
- error message: ${result.msg}`;
830
- }
831
- } else {
832
- text = `\u2705 **Proxy Created Successfully**
833
-
834
- **Protocol:** ${params.protocol}
835
- **Host:** ${params.host}:${params.port}${params.proxyUserName ? `
836
- **Username:** ${params.proxyUserName}` : ""}${params.remark ? `
837
- **Remark:** ${params.remark}` : ""}${params.checkChannel ? `
838
- **Check Channel:** ${params.checkChannel}` : ""}
839
-
840
- *Proxy configuration created. IP detection will be performed automatically.*`;
841
- }
842
- return {
843
- content: [
844
- {
845
- type: "text",
846
- text
847
- }
848
- ]
849
- };
850
- }
851
- };
852
- var BatchCreateProxies = class {
853
- name = "roxy_batch_create_proxies";
648
+ var CreateProxies = class {
649
+ name = "roxy_create_proxies";
854
650
  description = "Batch create multiple proxy configurations";
855
651
  inputSchema = {
856
652
  type: "object",
@@ -859,11 +655,6 @@ var BatchCreateProxies = class {
859
655
  type: "number",
860
656
  description: "Workspace ID"
861
657
  },
862
- // checkChannel: {
863
- // type: 'string',
864
- // enum: channelList.map(item => item.label),
865
- // description: 'Default IP detection channel for all proxies',
866
- // },
867
658
  proxyList: {
868
659
  type: "array",
869
660
  description: "Array of proxy configurations",
@@ -1198,9 +989,7 @@ ${params.ids.map((id, index) => ` ${index + 1}. ${id}`).join("\n")}
1198
989
  }
1199
990
  };
1200
991
  var proxyList = new ProxyList();
1201
- var proxyStore = new ProxyStore();
1202
- var createProxy = new CreateProxy();
1203
- var batchCreateProxies = new BatchCreateProxies();
992
+ var createProxies = new CreateProxies();
1204
993
  var detectProxy = new DetectProxy();
1205
994
  var modifyProxy = new ModifyProxy();
1206
995
  var deleteProxies = new DeleteProxies();
@@ -1712,7 +1501,7 @@ var CreateBrowser = class {
1712
1501
  description: "Complete proxy configuration object",
1713
1502
  properties: {
1714
1503
  // 如果有 moduleId ,则其他参数不可传递 (moduleId 可通过 roxy_list_proxies 或 roxy_store_proxies 获取) 优先使用该参数来绑定代理IP
1715
- moduleId: { type: "number", description: `If moduleId is provided, no other parameters may be passed. (moduleId can be obtained via ${proxyList.name} or ${proxyStore.name}. field: id) Priority to use this parameter to bind proxy IP` },
1504
+ moduleId: { type: "number", description: `If moduleId is provided, no other parameters may be passed. (moduleId can be obtained via ${proxyList.name} field: id) Priority to use this parameter to bind proxy IP` },
1716
1505
  proxyMethod: { type: "string", enum: ["custom", "choose", "api"] },
1717
1506
  proxyCategory: { type: "string", enum: ["noproxy", "HTTP", "HTTPS", "SOCKS5", "SSH"] },
1718
1507
  ipType: { type: "string", enum: ["IPV4", "IPV6"] },
@@ -1737,7 +1526,7 @@ var CreateBrowser = class {
1737
1526
  isTimeZone: { type: "boolean", description: "Follow IP for timezone" },
1738
1527
  timeZone: { type: "string", description: "Custom timezone" },
1739
1528
  // Geolocation
1740
- position: { type: "number", enum: [0, 1, 2], description: "Geolocation prompt: 0=ask, 1=allow, 2=deny" },
1529
+ position: { type: "number", description: "Geolocation prompt: 0=ask, 1=allow, 2=deny" },
1741
1530
  isPositionBaseIp: { type: "boolean", description: "Follow IP for geolocation" },
1742
1531
  longitude: { type: "string", description: "Custom longitude" },
1743
1532
  latitude: { type: "string", description: "Custom latitude" },
@@ -1773,14 +1562,14 @@ var CreateBrowser = class {
1773
1562
  stopOpenNet: { type: "boolean", description: "Stop opening if network fails" },
1774
1563
  stopOpenIP: { type: "boolean", description: "Stop opening if IP changes" },
1775
1564
  stopOpenPosition: { type: "boolean", description: "Stop opening if IP location changes" },
1776
- openWorkbench: { type: "number", enum: [0, 1, 2], description: "Open workbench: 0=close, 1=open, 2=follow app" },
1565
+ openWorkbench: { type: "number", description: "Open workbench: 0=close, 1=open, 2=follow app" },
1777
1566
  // Display settings
1778
1567
  resolutionType: { type: "boolean", description: "Custom resolution vs follow system" },
1779
1568
  resolutionX: { type: "string", description: "Custom resolution width" },
1780
1569
  resolutionY: { type: "string", description: "Custom resolution height" },
1781
1570
  fontType: { type: "boolean", description: "Random fonts vs system fonts" },
1782
1571
  // Browser fingerprint settings
1783
- webRTC: { type: "number", enum: [0, 1, 2], description: "WebRTC: 0=replace, 1=real, 2=disable" },
1572
+ webRTC: { type: "number", description: "WebRTC: 0=replace, 1=real, 2=disable" },
1784
1573
  webGL: { type: "boolean", description: "WebGL: random vs real" },
1785
1574
  webGLInfo: { type: "boolean", description: "WebGL info: custom vs real" },
1786
1575
  webGLManufacturer: { type: "string", description: "Custom WebGL manufacturer" },
@@ -2167,11 +1956,12 @@ var ListBrowsers = class {
2167
1956
  const pageSize = params.pageSize ?? 15;
2168
1957
  const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
2169
1958
  const hasNextPage = currentPage < totalPages;
1959
+ const serialNo = `${data.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${data.windowSortNum}`;
2170
1960
  text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
2171
1961
 
2172
1962
  ${data.rows.map(
2173
- (browser) => `**${browser.windowName || "Unnamed"}** (ID: ${browser.dirId})
2174
- - coreVersion: ${browser.coreVersion} - Sort: ${browser.windowSortNum}
1963
+ (browser) => `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
1964
+ - CoreVersion: ${browser.coreVersion} - DirId: ${browser.dirId}
2175
1965
  - OSVersion: ${browser.osVersion}
2176
1966
  - OS: ${browser.os}
2177
1967
  - Remark: ${browser.windowRemark}`
@@ -2386,11 +2176,13 @@ var GetBrowserDetail = class {
2386
2176
  } else {
2387
2177
  const cookieCount = detail.cookie?.length || 0;
2388
2178
  const { cookie: _cookie, ...detailWithoutCookies } = detail;
2179
+ const serialNo = `${detail.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${detail.windowSortNum}`;
2389
2180
  text = `**Browser Details Summary**
2390
2181
 
2391
2182
  **ID:** \`${detail.dirId}\`
2183
+ **dirId**: \`${detail.dirId}\`
2184
+ **Serial No:** ${serialNo}
2392
2185
  **Name:** ${detail.windowName}
2393
- **Sort Number:** ${detail.windowSortNum}
2394
2186
  **Project:** ${detail.projectName} (ID: ${detail.projectId})
2395
2187
  **OS:** ${detail.os} ${detail.osVersion}
2396
2188
  **Core Version:** ${detail.coreVersion}
@@ -2979,9 +2771,7 @@ var TOOLS = [
2979
2771
  listLabels.schema,
2980
2772
  getConnectionInfo.schema,
2981
2773
  proxyList.schema,
2982
- proxyStore.schema,
2983
- createProxy.schema,
2984
- batchCreateProxies.schema,
2774
+ createProxies.schema,
2985
2775
  detectProxy.schema,
2986
2776
  modifyProxy.schema,
2987
2777
  deleteProxies.schema,
@@ -3059,12 +2849,8 @@ var RoxyBrowserMCPServer = class {
3059
2849
  // 代理相关
3060
2850
  case proxyList.name:
3061
2851
  return await proxyList.handle(args);
3062
- case proxyStore.name:
3063
- return await proxyStore.handle(args);
3064
- case createProxy.name:
3065
- return await createProxy.handle(args);
3066
- case batchCreateProxies.name:
3067
- return await batchCreateProxies.handle(args);
2852
+ case createProxies.name:
2853
+ return await createProxies.handle(args);
3068
2854
  case detectProxy.name:
3069
2855
  return await detectProxy.handle(args);
3070
2856
  case modifyProxy.name:
@@ -3117,13 +2903,12 @@ exports.RoxyBrowserMCPServer = RoxyBrowserMCPServer;
3117
2903
  exports.TOOLS = TOOLS;
3118
2904
  exports.batchCreateAccounts = batchCreateAccounts;
3119
2905
  exports.batchCreateBrowsers = batchCreateBrowsers;
3120
- exports.batchCreateProxies = batchCreateProxies;
3121
2906
  exports.clearLocalCache = clearLocalCache;
3122
2907
  exports.clearServerCache = clearServerCache;
3123
2908
  exports.closeBrowsers = closeBrowsers;
3124
2909
  exports.createAccount = createAccount;
3125
2910
  exports.createBrowser = createBrowser;
3126
- exports.createProxy = createProxy;
2911
+ exports.createProxies = createProxies;
3127
2912
  exports.deleteAccounts = deleteAccounts;
3128
2913
  exports.deleteBrowsers = deleteBrowsers;
3129
2914
  exports.deleteProxies = deleteProxies;
@@ -3139,7 +2924,6 @@ exports.modifyAccount = modifyAccount;
3139
2924
  exports.modifyProxy = modifyProxy;
3140
2925
  exports.openBrowser = openBrowser;
3141
2926
  exports.proxyList = proxyList;
3142
- exports.proxyStore = proxyStore;
3143
2927
  exports.randomFingerprint = randomFingerprint;
3144
2928
  exports.request = request;
3145
2929
  exports.resolveConfig = resolveConfig;