@roxybrowser/openapi 1.0.13-beta.1 → 1.0.13-beta.5

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
@@ -543,6 +543,26 @@ var channelList = [
543
543
  value: "http://ipinfo.io"
544
544
  }
545
545
  ];
546
+ function formatProxySource(dataType) {
547
+ return dataType === "proxyModule" ? "user-added" : dataType === "buyProxy" ? "proxy store" : dataType || "unknown";
548
+ }
549
+ function formatCheckStatus(checkStatus) {
550
+ return checkStatus === 1 ? "\u2705 available" : "\u274C unavailable";
551
+ }
552
+ function formatValue(value) {
553
+ if (value === null || value === void 0 || value === "")
554
+ return "N/A";
555
+ if (Array.isArray(value))
556
+ return value.length > 0 ? value.join(", ") : "N/A";
557
+ return String(value);
558
+ }
559
+ function formatBool(value, truthy = "yes", falsy = "no") {
560
+ return value ? truthy : falsy;
561
+ }
562
+ function formatLocation(proxy) {
563
+ const locationParts = [proxy.lastCity, proxy.lastState, proxy.lastCountry].filter(Boolean);
564
+ return locationParts.length > 0 ? locationParts.join(", ") : "N/A";
565
+ }
546
566
  var ProxyList = class {
547
567
  name = "roxy_list_proxies";
548
568
  description = "Get list of proxy IP List.";
@@ -553,9 +573,31 @@ var ProxyList = class {
553
573
  type: "number",
554
574
  description: "Workspace ID"
555
575
  },
556
- proxyType: {
576
+ country: {
577
+ type: "string",
578
+ description: "Filter by country (us,cn,jp)"
579
+ },
580
+ checkStatus: {
557
581
  type: "number",
558
- description: "Filter by proxy ID"
582
+ description: "Filter by check status (0: unavailable, 1: available)"
583
+ },
584
+ startDate: {
585
+ type: "string",
586
+ description: "Filter by detection start date (YYYY-MM-DD)"
587
+ },
588
+ endDate: {
589
+ type: "string",
590
+ description: "Filter by detection end date (YYYY-MM-DD)"
591
+ },
592
+ checker: {
593
+ type: "string",
594
+ enum: channelList.map((item) => item.label),
595
+ description: "Filter by detection channel"
596
+ },
597
+ proxyType: {
598
+ type: "string",
599
+ enum: ["user-added", "proxy store"],
600
+ description: "Filter by proxy source type"
559
601
  },
560
602
  pageIndex: {
561
603
  type: "number",
@@ -580,12 +622,22 @@ var ProxyList = class {
580
622
  async handle(params) {
581
623
  const searchParams = new URLSearchParams();
582
624
  searchParams.append("workspaceId", params.workspaceId.toString());
583
- if (params.id)
584
- searchParams.append("id", params.id.toString());
585
625
  if (params.pageIndex)
586
626
  searchParams.append("page_index", params.pageIndex.toString());
587
627
  if (params.pageSize)
588
628
  searchParams.append("page_size", params.pageSize.toString());
629
+ if (params.country)
630
+ searchParams.append("country", params.country);
631
+ if (params.checkStatus !== void 0)
632
+ searchParams.append("check_status", params.checkStatus.toString());
633
+ if (params.startDate)
634
+ searchParams.append("start_date", params.startDate);
635
+ if (params.endDate)
636
+ searchParams.append("end_date", params.endDate);
637
+ if (params.checker)
638
+ searchParams.append("checker", params.checker);
639
+ if (params.proxyType)
640
+ searchParams.append("proxyType", params.proxyType === "user-added" ? "0" : "1");
589
641
  if (!params.workspaceId) {
590
642
  throw new Error("workspaceId is required");
591
643
  }
@@ -598,8 +650,8 @@ var ProxyList = class {
598
650
  const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
599
651
  const hasNextPage = currentPage < totalPages;
600
652
  const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
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";
653
+ const statusText = formatCheckStatus(proxy.checkStatus);
654
+ const sourceType = proxy.dataType === "proxyModule" ? "user-added" : "proxy store";
603
655
  const canDelete = proxy.dataType === "proxyModule" ? "yes" : "no";
604
656
  const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
605
657
  const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
@@ -645,6 +697,129 @@ ${result.msg}`;
645
697
  return { content: [{ type: "text", text }] };
646
698
  }
647
699
  };
700
+ var GetProxyDetail = class {
701
+ name = "roxy_proxy_detail";
702
+ description = "Get detailed information for a specific proxy configuration";
703
+ inputSchema = {
704
+ type: "object",
705
+ properties: {
706
+ workspaceId: {
707
+ type: "number",
708
+ description: "Workspace ID"
709
+ },
710
+ id: {
711
+ type: "number",
712
+ description: "Proxy ID to get detail for"
713
+ }
714
+ },
715
+ required: ["workspaceId", "id"]
716
+ };
717
+ get schema() {
718
+ return {
719
+ name: this.name,
720
+ description: this.description,
721
+ inputSchema: this.inputSchema
722
+ };
723
+ }
724
+ async handle(params) {
725
+ if (!params.workspaceId || !params.id) {
726
+ return {
727
+ content: [
728
+ {
729
+ type: "text",
730
+ text: "\u274C **Failed to get proxy detail:**\n\n workspaceId and id are required"
731
+ }
732
+ ]
733
+ };
734
+ }
735
+ const searchParams = new URLSearchParams();
736
+ searchParams.append("workspaceId", params.workspaceId.toString());
737
+ searchParams.append("id", params.id.toString());
738
+ const result = await request(`/proxy/detail?${searchParams}`);
739
+ let text = "";
740
+ if (result.code !== 0) {
741
+ text = `\u274C **Failed to get proxy detail:**
742
+
743
+ error message: ${result.msg}`;
744
+ } else {
745
+ const detail = result.data?.rows?.[0] || result.data || null;
746
+ if (!detail) {
747
+ text = `\u274C **Proxy Not Found**
748
+
749
+ No proxy detail found for ID ${params.id} in workspace ${params.workspaceId}.`;
750
+ } else {
751
+ const sourceType = formatProxySource(detail.dataType);
752
+ const sourceSpecificTitle = detail.dataType === "buyProxy" ? "Store Purchase Fields" : "User-added Fields";
753
+ const authText = detail.proxyUserName && detail.proxyPassword ? `${detail.proxyUserName}:${detail.proxyPassword}` : detail.proxyUserName || detail.proxyPassword || "N/A";
754
+ const commonLines = [
755
+ `**ID:** ${formatValue(detail.id)}`,
756
+ `**Source Type:** ${sourceType}`,
757
+ `**Workspace ID:** ${formatValue(detail.workspaceId)}`,
758
+ `**User ID:** ${formatValue(detail.userId)}`,
759
+ `**Remark:** ${formatValue(detail.remark)}`,
760
+ `**Protocol:** ${formatValue(detail.protocol)}`,
761
+ `**Host:** ${formatValue(detail.host)}`,
762
+ `**Port:** ${formatValue(detail.port)}`,
763
+ `**IP Type:** ${formatValue(detail.ipType)}`,
764
+ `**Proxy Account:** ${authText}`,
765
+ `**Bind Status:** ${formatBool(detail.isBind, "bound", "not bound")}`,
766
+ `**Bind Count:** ${formatValue(detail.bindCount)}`,
767
+ `**Bound Browser IDs:** ${formatValue(detail.bindList)}`,
768
+ `**Direct Connection:** ${formatBool(detail.isDirect)}`,
769
+ `**Check Status:** ${formatCheckStatus(detail.checkStatus)}`,
770
+ `**Check Channel:** ${formatValue(detail.checkChannel)}`,
771
+ `**Check Channel Value:** ${formatValue(detail.checkChannelValue)}`,
772
+ `**Last Check Time:** ${formatValue(detail.checkTime)}`,
773
+ `**Last IP:** ${formatValue(detail.lastIp)}`,
774
+ `**Last Location:** ${formatLocation(detail)}`,
775
+ `**Created At:** ${formatValue(detail.createTime)}`,
776
+ `**Updated At:** ${formatValue(detail.updateTime)}`
777
+ ];
778
+ const userAddedLines = [
779
+ `**Refresh URL:** ${formatValue(detail.refreshUrl)}`,
780
+ `**Model Param:** ${formatValue(detail.modelParam)}`
781
+ ];
782
+ const storePurchaseLines = [
783
+ `**Order No:** ${formatValue(detail.orderNo)}`,
784
+ `**Order Status:** ${formatValue(detail.orderStatus)}`,
785
+ `**Country:** ${formatValue(detail.country)}`,
786
+ `**Provider Type:** ${formatValue(detail.providerType)}`,
787
+ `**Provider Name:** ${formatValue(detail.proxyProviderName)}`,
788
+ `**Provider ID:** ${formatValue(detail.proxyProviderId)}`,
789
+ `**Provider Price:** ${formatValue(detail.proxyProviderPrice)}`,
790
+ `**Discount Price:** ${formatValue(detail.proxyProviderDiscountPrice)}`,
791
+ `**Proxy Check Channel:** ${formatValue(detail.proxyCheckChannel)}`,
792
+ `**Expire Date:** ${formatValue(detail.expireDate)}`,
793
+ `**Expire Status:** ${formatValue(detail.proxyExpireStatus)}`,
794
+ `**Auto Renew:** ${formatBool(detail.autoRenew, "enabled", "disabled")}`,
795
+ `**Can Renew:** ${formatBool(detail.canRenew)}`,
796
+ `**Can Refund:** ${formatBool(detail.canRefund)}`,
797
+ `**Renewal Time:** ${formatValue(detail.renewalTime)}`,
798
+ `**Proxy Months:** ${formatValue(detail.proxyMonths)}`,
799
+ `**Gift Days:** ${formatValue(detail.giftDays)}`,
800
+ `**Replace Status:** ${formatValue(detail.replaceStatus)}`,
801
+ `**Badge Type:** ${formatValue(detail.badgeTypeDesc)}`,
802
+ `**Operator Name:** ${formatValue(detail.opName)}`
803
+ ];
804
+ const sourceSpecificLines = detail.dataType === "buyProxy" ? storePurchaseLines : userAddedLines;
805
+ text = `\u{1F50E} **Proxy Detail**
806
+
807
+ ${commonLines.join("\n")}
808
+
809
+ **${sourceSpecificTitle}:**
810
+ ${sourceSpecificLines.join("\n")}`;
811
+ }
812
+ }
813
+ return {
814
+ content: [
815
+ {
816
+ type: "text",
817
+ text
818
+ }
819
+ ]
820
+ };
821
+ }
822
+ };
648
823
  var CreateProxies = class {
649
824
  name = "roxy_create_proxies";
650
825
  description = "Batch create multiple proxy configurations";
@@ -989,6 +1164,7 @@ ${params.ids.map((id, index) => ` ${index + 1}. ${id}`).join("\n")}
989
1164
  }
990
1165
  };
991
1166
  var proxyList = new ProxyList();
1167
+ var proxyDetail = new GetProxyDetail();
992
1168
  var createProxies = new CreateProxies();
993
1169
  var detectProxy = new DetectProxy();
994
1170
  var modifyProxy = new ModifyProxy();
@@ -1956,16 +2132,16 @@ var ListBrowsers = class {
1956
2132
  const pageSize = params.pageSize ?? 15;
1957
2133
  const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
1958
2134
  const hasNextPage = currentPage < totalPages;
1959
- const serialNo = `${data.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${data.windowSortNum}`;
1960
2135
  text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
1961
2136
 
1962
- ${data.rows.map(
1963
- (browser) => `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
2137
+ ${data.rows.map((browser) => {
2138
+ const serialNo = `${browser.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${browser.windowSortNum}`;
2139
+ return `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
1964
2140
  - CoreVersion: ${browser.coreVersion} - DirId: ${browser.dirId}
1965
2141
  - OSVersion: ${browser.osVersion}
1966
2142
  - OS: ${browser.os}
1967
- - Remark: ${browser.windowRemark}`
1968
- ).join("\n\n")}
2143
+ - Remark: ${browser.windowRemark}`;
2144
+ }).join("\n\n")}
1969
2145
 
1970
2146
  Pagination:
1971
2147
  - currentPage: ${currentPage}
@@ -2771,6 +2947,7 @@ var TOOLS = [
2771
2947
  listLabels.schema,
2772
2948
  getConnectionInfo.schema,
2773
2949
  proxyList.schema,
2950
+ proxyDetail.schema,
2774
2951
  createProxies.schema,
2775
2952
  detectProxy.schema,
2776
2953
  modifyProxy.schema,
@@ -2849,6 +3026,8 @@ var RoxyBrowserMCPServer = class {
2849
3026
  // 代理相关
2850
3027
  case proxyList.name:
2851
3028
  return await proxyList.handle(args);
3029
+ case proxyDetail.name:
3030
+ return await proxyDetail.handle(args);
2852
3031
  case createProxies.name:
2853
3032
  return await createProxies.handle(args);
2854
3033
  case detectProxy.name:
@@ -2923,6 +3102,7 @@ exports.listWorkspaces = listWorkspaces;
2923
3102
  exports.modifyAccount = modifyAccount;
2924
3103
  exports.modifyProxy = modifyProxy;
2925
3104
  exports.openBrowser = openBrowser;
3105
+ exports.proxyDetail = proxyDetail;
2926
3106
  exports.proxyList = proxyList;
2927
3107
  exports.randomFingerprint = randomFingerprint;
2928
3108
  exports.request = request;