@roxybrowser/openapi 1.0.12 → 1.0.13-beta.3
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 +2 -2
- package/lib/cli.cjs +162 -197
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +162 -197
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +164 -200
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +43 -138
- package/lib/index.d.ts +43 -138
- package/lib/index.js +163 -198
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -543,12 +543,29 @@ 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
|
-
|
|
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`.";
|
|
568
|
+
description = "Get list of proxy IP List.";
|
|
552
569
|
inputSchema = {
|
|
553
570
|
type: "object",
|
|
554
571
|
properties: {
|
|
@@ -556,9 +573,31 @@ var ProxyList = class {
|
|
|
556
573
|
type: "number",
|
|
557
574
|
description: "Workspace ID"
|
|
558
575
|
},
|
|
559
|
-
|
|
576
|
+
country: {
|
|
577
|
+
type: "string",
|
|
578
|
+
description: "Filter by country (us,cn,jp)"
|
|
579
|
+
},
|
|
580
|
+
checkStatus: {
|
|
560
581
|
type: "number",
|
|
561
|
-
description: "Filter by
|
|
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"
|
|
562
601
|
},
|
|
563
602
|
pageIndex: {
|
|
564
603
|
type: "number",
|
|
@@ -583,16 +622,26 @@ var ProxyList = class {
|
|
|
583
622
|
async handle(params) {
|
|
584
623
|
const searchParams = new URLSearchParams();
|
|
585
624
|
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
586
|
-
if (params.id)
|
|
587
|
-
searchParams.append("id", params.id.toString());
|
|
588
625
|
if (params.pageIndex)
|
|
589
626
|
searchParams.append("page_index", params.pageIndex.toString());
|
|
590
627
|
if (params.pageSize)
|
|
591
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");
|
|
592
641
|
if (!params.workspaceId) {
|
|
593
642
|
throw new Error("workspaceId is required");
|
|
594
643
|
}
|
|
595
|
-
const result = await request(`/proxy/
|
|
644
|
+
const result = await request(`/proxy/list_merged?${searchParams}`);
|
|
596
645
|
let text = "";
|
|
597
646
|
if (result.code === 0) {
|
|
598
647
|
const data = result.data;
|
|
@@ -601,10 +650,14 @@ var ProxyList = class {
|
|
|
601
650
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
602
651
|
const hasNextPage = currentPage < totalPages;
|
|
603
652
|
const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
|
|
604
|
-
const statusText = proxy.checkStatus
|
|
653
|
+
const statusText = formatCheckStatus(proxy.checkStatus);
|
|
654
|
+
const sourceType = proxy.dataType === "proxyModule" ? "user-added" : "proxy store";
|
|
655
|
+
const canDelete = proxy.dataType === "proxyModule" ? "yes" : "no";
|
|
605
656
|
const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
|
|
606
657
|
const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
|
|
607
658
|
let baseInfo = `${index + 1}. ${statusText} **${name}**
|
|
659
|
+
source: ${sourceType}
|
|
660
|
+
deletable: ${canDelete}
|
|
608
661
|
protocol: ${proxy.protocol || "N/A"}
|
|
609
662
|
ipType: ${proxy.ipType || "N/A"}
|
|
610
663
|
bind profile count: ${proxy.bindCount || "N/A"}
|
|
@@ -624,7 +677,9 @@ ${ipInfo.length > 0 ? `${ipInfo.join("")}
|
|
|
624
677
|
}
|
|
625
678
|
return baseInfo;
|
|
626
679
|
}).join("\n\n") : "";
|
|
627
|
-
text = `\u{
|
|
680
|
+
text = `\u{1F4F5} **proxy list** (total: ${data.total})
|
|
681
|
+
|
|
682
|
+
Only proxies with \`source: user-added\` can be deleted.
|
|
628
683
|
|
|
629
684
|
${proxyListText}
|
|
630
685
|
|
|
@@ -642,9 +697,9 @@ ${result.msg}`;
|
|
|
642
697
|
return { content: [{ type: "text", text }] };
|
|
643
698
|
}
|
|
644
699
|
};
|
|
645
|
-
var
|
|
646
|
-
name = "
|
|
647
|
-
description = "Get
|
|
700
|
+
var GetProxyDetail = class {
|
|
701
|
+
name = "roxy_proxy_detail";
|
|
702
|
+
description = "Get detailed information for a specific proxy configuration";
|
|
648
703
|
inputSchema = {
|
|
649
704
|
type: "object",
|
|
650
705
|
properties: {
|
|
@@ -652,138 +707,12 @@ var ProxyStore = class {
|
|
|
652
707
|
type: "number",
|
|
653
708
|
description: "Workspace ID"
|
|
654
709
|
},
|
|
655
|
-
|
|
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: {
|
|
710
|
+
id: {
|
|
743
711
|
type: "number",
|
|
744
|
-
description: "
|
|
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"
|
|
712
|
+
description: "Proxy ID to get detail for"
|
|
784
713
|
}
|
|
785
714
|
},
|
|
786
|
-
required: ["workspaceId", "
|
|
715
|
+
required: ["workspaceId", "id"]
|
|
787
716
|
};
|
|
788
717
|
get schema() {
|
|
789
718
|
return {
|
|
@@ -793,51 +722,93 @@ var CreateProxy = class {
|
|
|
793
722
|
};
|
|
794
723
|
}
|
|
795
724
|
async handle(params) {
|
|
796
|
-
if (!params.workspaceId || !params.
|
|
725
|
+
if (!params.workspaceId || !params.id) {
|
|
797
726
|
return {
|
|
798
727
|
content: [
|
|
799
728
|
{
|
|
800
729
|
type: "text",
|
|
801
|
-
text: "\u274C **Failed to
|
|
730
|
+
text: "\u274C **Failed to get proxy detail:**\n\n workspaceId and id are required"
|
|
802
731
|
}
|
|
803
732
|
]
|
|
804
733
|
};
|
|
805
734
|
}
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
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
|
-
});
|
|
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}`);
|
|
818
739
|
let text = "";
|
|
819
740
|
if (result.code !== 0) {
|
|
820
|
-
|
|
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:**
|
|
741
|
+
text = `\u274C **Failed to get proxy detail:**
|
|
828
742
|
|
|
829
743
|
error message: ${result.msg}`;
|
|
830
|
-
}
|
|
831
744
|
} else {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
**
|
|
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}` : ""}
|
|
745
|
+
const detail = result.data?.rows?.[0] || result.data || null;
|
|
746
|
+
if (!detail) {
|
|
747
|
+
text = `\u274C **Proxy Not Found**
|
|
839
748
|
|
|
840
|
-
|
|
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
|
+
}
|
|
841
812
|
}
|
|
842
813
|
return {
|
|
843
814
|
content: [
|
|
@@ -849,8 +820,8 @@ ${result.data.map((item) => ` - index: ${item.index}, error message: ${item.msg
|
|
|
849
820
|
};
|
|
850
821
|
}
|
|
851
822
|
};
|
|
852
|
-
var
|
|
853
|
-
name = "
|
|
823
|
+
var CreateProxies = class {
|
|
824
|
+
name = "roxy_create_proxies";
|
|
854
825
|
description = "Batch create multiple proxy configurations";
|
|
855
826
|
inputSchema = {
|
|
856
827
|
type: "object",
|
|
@@ -859,11 +830,6 @@ var BatchCreateProxies = class {
|
|
|
859
830
|
type: "number",
|
|
860
831
|
description: "Workspace ID"
|
|
861
832
|
},
|
|
862
|
-
// checkChannel: {
|
|
863
|
-
// type: 'string',
|
|
864
|
-
// enum: channelList.map(item => item.label),
|
|
865
|
-
// description: 'Default IP detection channel for all proxies',
|
|
866
|
-
// },
|
|
867
833
|
proxyList: {
|
|
868
834
|
type: "array",
|
|
869
835
|
description: "Array of proxy configurations",
|
|
@@ -1198,9 +1164,8 @@ ${params.ids.map((id, index) => ` ${index + 1}. ${id}`).join("\n")}
|
|
|
1198
1164
|
}
|
|
1199
1165
|
};
|
|
1200
1166
|
var proxyList = new ProxyList();
|
|
1201
|
-
var
|
|
1202
|
-
var
|
|
1203
|
-
var batchCreateProxies = new BatchCreateProxies();
|
|
1167
|
+
var proxyDetail = new GetProxyDetail();
|
|
1168
|
+
var createProxies = new CreateProxies();
|
|
1204
1169
|
var detectProxy = new DetectProxy();
|
|
1205
1170
|
var modifyProxy = new ModifyProxy();
|
|
1206
1171
|
var deleteProxies = new DeleteProxies();
|
|
@@ -1712,7 +1677,7 @@ var CreateBrowser = class {
|
|
|
1712
1677
|
description: "Complete proxy configuration object",
|
|
1713
1678
|
properties: {
|
|
1714
1679
|
// 如果有 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}
|
|
1680
|
+
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
1681
|
proxyMethod: { type: "string", enum: ["custom", "choose", "api"] },
|
|
1717
1682
|
proxyCategory: { type: "string", enum: ["noproxy", "HTTP", "HTTPS", "SOCKS5", "SSH"] },
|
|
1718
1683
|
ipType: { type: "string", enum: ["IPV4", "IPV6"] },
|
|
@@ -2167,11 +2132,12 @@ var ListBrowsers = class {
|
|
|
2167
2132
|
const pageSize = params.pageSize ?? 15;
|
|
2168
2133
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
2169
2134
|
const hasNextPage = currentPage < totalPages;
|
|
2135
|
+
const serialNo = `${data.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${data.windowSortNum}`;
|
|
2170
2136
|
text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
|
|
2171
2137
|
|
|
2172
2138
|
${data.rows.map(
|
|
2173
|
-
(browser) => `**${browser.windowName || "Unnamed"}** (
|
|
2174
|
-
-
|
|
2139
|
+
(browser) => `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
|
|
2140
|
+
- CoreVersion: ${browser.coreVersion} - DirId: ${browser.dirId}
|
|
2175
2141
|
- OSVersion: ${browser.osVersion}
|
|
2176
2142
|
- OS: ${browser.os}
|
|
2177
2143
|
- Remark: ${browser.windowRemark}`
|
|
@@ -2386,11 +2352,13 @@ var GetBrowserDetail = class {
|
|
|
2386
2352
|
} else {
|
|
2387
2353
|
const cookieCount = detail.cookie?.length || 0;
|
|
2388
2354
|
const { cookie: _cookie, ...detailWithoutCookies } = detail;
|
|
2355
|
+
const serialNo = `${detail.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${detail.windowSortNum}`;
|
|
2389
2356
|
text = `**Browser Details Summary**
|
|
2390
2357
|
|
|
2391
2358
|
**ID:** \`${detail.dirId}\`
|
|
2359
|
+
**dirId**: \`${detail.dirId}\`
|
|
2360
|
+
**Serial No:** ${serialNo}
|
|
2392
2361
|
**Name:** ${detail.windowName}
|
|
2393
|
-
**Sort Number:** ${detail.windowSortNum}
|
|
2394
2362
|
**Project:** ${detail.projectName} (ID: ${detail.projectId})
|
|
2395
2363
|
**OS:** ${detail.os} ${detail.osVersion}
|
|
2396
2364
|
**Core Version:** ${detail.coreVersion}
|
|
@@ -2979,9 +2947,8 @@ var TOOLS = [
|
|
|
2979
2947
|
listLabels.schema,
|
|
2980
2948
|
getConnectionInfo.schema,
|
|
2981
2949
|
proxyList.schema,
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
batchCreateProxies.schema,
|
|
2950
|
+
proxyDetail.schema,
|
|
2951
|
+
createProxies.schema,
|
|
2985
2952
|
detectProxy.schema,
|
|
2986
2953
|
modifyProxy.schema,
|
|
2987
2954
|
deleteProxies.schema,
|
|
@@ -3059,12 +3026,10 @@ var RoxyBrowserMCPServer = class {
|
|
|
3059
3026
|
// 代理相关
|
|
3060
3027
|
case proxyList.name:
|
|
3061
3028
|
return await proxyList.handle(args);
|
|
3062
|
-
case
|
|
3063
|
-
return await
|
|
3064
|
-
case
|
|
3065
|
-
return await
|
|
3066
|
-
case batchCreateProxies.name:
|
|
3067
|
-
return await batchCreateProxies.handle(args);
|
|
3029
|
+
case proxyDetail.name:
|
|
3030
|
+
return await proxyDetail.handle(args);
|
|
3031
|
+
case createProxies.name:
|
|
3032
|
+
return await createProxies.handle(args);
|
|
3068
3033
|
case detectProxy.name:
|
|
3069
3034
|
return await detectProxy.handle(args);
|
|
3070
3035
|
case modifyProxy.name:
|
|
@@ -3117,13 +3082,12 @@ exports.RoxyBrowserMCPServer = RoxyBrowserMCPServer;
|
|
|
3117
3082
|
exports.TOOLS = TOOLS;
|
|
3118
3083
|
exports.batchCreateAccounts = batchCreateAccounts;
|
|
3119
3084
|
exports.batchCreateBrowsers = batchCreateBrowsers;
|
|
3120
|
-
exports.batchCreateProxies = batchCreateProxies;
|
|
3121
3085
|
exports.clearLocalCache = clearLocalCache;
|
|
3122
3086
|
exports.clearServerCache = clearServerCache;
|
|
3123
3087
|
exports.closeBrowsers = closeBrowsers;
|
|
3124
3088
|
exports.createAccount = createAccount;
|
|
3125
3089
|
exports.createBrowser = createBrowser;
|
|
3126
|
-
exports.
|
|
3090
|
+
exports.createProxies = createProxies;
|
|
3127
3091
|
exports.deleteAccounts = deleteAccounts;
|
|
3128
3092
|
exports.deleteBrowsers = deleteBrowsers;
|
|
3129
3093
|
exports.deleteProxies = deleteProxies;
|
|
@@ -3138,8 +3102,8 @@ exports.listWorkspaces = listWorkspaces;
|
|
|
3138
3102
|
exports.modifyAccount = modifyAccount;
|
|
3139
3103
|
exports.modifyProxy = modifyProxy;
|
|
3140
3104
|
exports.openBrowser = openBrowser;
|
|
3105
|
+
exports.proxyDetail = proxyDetail;
|
|
3141
3106
|
exports.proxyList = proxyList;
|
|
3142
|
-
exports.proxyStore = proxyStore;
|
|
3143
3107
|
exports.randomFingerprint = randomFingerprint;
|
|
3144
3108
|
exports.request = request;
|
|
3145
3109
|
exports.resolveConfig = resolveConfig;
|