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