@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.js
CHANGED
|
@@ -541,12 +541,29 @@ var channelList = [
|
|
|
541
541
|
value: "http://ipinfo.io"
|
|
542
542
|
}
|
|
543
543
|
];
|
|
544
|
+
function formatProxySource(dataType) {
|
|
545
|
+
return dataType === "proxyModule" ? "user-added" : dataType === "buyProxy" ? "proxy store" : dataType || "unknown";
|
|
546
|
+
}
|
|
547
|
+
function formatCheckStatus(checkStatus) {
|
|
548
|
+
return checkStatus === 1 ? "\u2705 available" : "\u274C unavailable";
|
|
549
|
+
}
|
|
550
|
+
function formatValue(value) {
|
|
551
|
+
if (value === null || value === void 0 || value === "")
|
|
552
|
+
return "N/A";
|
|
553
|
+
if (Array.isArray(value))
|
|
554
|
+
return value.length > 0 ? value.join(", ") : "N/A";
|
|
555
|
+
return String(value);
|
|
556
|
+
}
|
|
557
|
+
function formatBool(value, truthy = "yes", falsy = "no") {
|
|
558
|
+
return value ? truthy : falsy;
|
|
559
|
+
}
|
|
560
|
+
function formatLocation(proxy) {
|
|
561
|
+
const locationParts = [proxy.lastCity, proxy.lastState, proxy.lastCountry].filter(Boolean);
|
|
562
|
+
return locationParts.length > 0 ? locationParts.join(", ") : "N/A";
|
|
563
|
+
}
|
|
544
564
|
var ProxyList = class {
|
|
545
565
|
name = "roxy_list_proxies";
|
|
546
|
-
|
|
547
|
-
* 仅当用户没有指定商店时调用
|
|
548
|
-
*/
|
|
549
|
-
description = "Get list of proxy configurations. If you want to get the list of proxies configurations you've bought, please use `roxy_store_proxies`.";
|
|
566
|
+
description = "Get list of proxy IP List.";
|
|
550
567
|
inputSchema = {
|
|
551
568
|
type: "object",
|
|
552
569
|
properties: {
|
|
@@ -554,9 +571,31 @@ var ProxyList = class {
|
|
|
554
571
|
type: "number",
|
|
555
572
|
description: "Workspace ID"
|
|
556
573
|
},
|
|
557
|
-
|
|
574
|
+
country: {
|
|
575
|
+
type: "string",
|
|
576
|
+
description: "Filter by country (us,cn,jp)"
|
|
577
|
+
},
|
|
578
|
+
checkStatus: {
|
|
558
579
|
type: "number",
|
|
559
|
-
description: "Filter by
|
|
580
|
+
description: "Filter by check status (0: unavailable, 1: available)"
|
|
581
|
+
},
|
|
582
|
+
startDate: {
|
|
583
|
+
type: "string",
|
|
584
|
+
description: "Filter by detection start date (YYYY-MM-DD)"
|
|
585
|
+
},
|
|
586
|
+
endDate: {
|
|
587
|
+
type: "string",
|
|
588
|
+
description: "Filter by detection end date (YYYY-MM-DD)"
|
|
589
|
+
},
|
|
590
|
+
checker: {
|
|
591
|
+
type: "string",
|
|
592
|
+
enum: channelList.map((item) => item.label),
|
|
593
|
+
description: "Filter by detection channel"
|
|
594
|
+
},
|
|
595
|
+
proxyType: {
|
|
596
|
+
type: "string",
|
|
597
|
+
enum: ["user-added", "proxy store"],
|
|
598
|
+
description: "Filter by proxy source type"
|
|
560
599
|
},
|
|
561
600
|
pageIndex: {
|
|
562
601
|
type: "number",
|
|
@@ -581,16 +620,26 @@ var ProxyList = class {
|
|
|
581
620
|
async handle(params) {
|
|
582
621
|
const searchParams = new URLSearchParams();
|
|
583
622
|
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
584
|
-
if (params.id)
|
|
585
|
-
searchParams.append("id", params.id.toString());
|
|
586
623
|
if (params.pageIndex)
|
|
587
624
|
searchParams.append("page_index", params.pageIndex.toString());
|
|
588
625
|
if (params.pageSize)
|
|
589
626
|
searchParams.append("page_size", params.pageSize.toString());
|
|
627
|
+
if (params.country)
|
|
628
|
+
searchParams.append("country", params.country);
|
|
629
|
+
if (params.checkStatus !== void 0)
|
|
630
|
+
searchParams.append("check_status", params.checkStatus.toString());
|
|
631
|
+
if (params.startDate)
|
|
632
|
+
searchParams.append("start_date", params.startDate);
|
|
633
|
+
if (params.endDate)
|
|
634
|
+
searchParams.append("end_date", params.endDate);
|
|
635
|
+
if (params.checker)
|
|
636
|
+
searchParams.append("checker", params.checker);
|
|
637
|
+
if (params.proxyType)
|
|
638
|
+
searchParams.append("proxyType", params.proxyType === "user-added" ? "0" : "1");
|
|
590
639
|
if (!params.workspaceId) {
|
|
591
640
|
throw new Error("workspaceId is required");
|
|
592
641
|
}
|
|
593
|
-
const result = await request(`/proxy/
|
|
642
|
+
const result = await request(`/proxy/list_merged?${searchParams}`);
|
|
594
643
|
let text = "";
|
|
595
644
|
if (result.code === 0) {
|
|
596
645
|
const data = result.data;
|
|
@@ -599,10 +648,14 @@ var ProxyList = class {
|
|
|
599
648
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
600
649
|
const hasNextPage = currentPage < totalPages;
|
|
601
650
|
const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
|
|
602
|
-
const statusText = proxy.checkStatus
|
|
651
|
+
const statusText = formatCheckStatus(proxy.checkStatus);
|
|
652
|
+
const sourceType = proxy.dataType === "proxyModule" ? "user-added" : "proxy store";
|
|
653
|
+
const canDelete = proxy.dataType === "proxyModule" ? "yes" : "no";
|
|
603
654
|
const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
|
|
604
655
|
const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
|
|
605
656
|
let baseInfo = `${index + 1}. ${statusText} **${name}**
|
|
657
|
+
source: ${sourceType}
|
|
658
|
+
deletable: ${canDelete}
|
|
606
659
|
protocol: ${proxy.protocol || "N/A"}
|
|
607
660
|
ipType: ${proxy.ipType || "N/A"}
|
|
608
661
|
bind profile count: ${proxy.bindCount || "N/A"}
|
|
@@ -622,7 +675,9 @@ ${ipInfo.length > 0 ? `${ipInfo.join("")}
|
|
|
622
675
|
}
|
|
623
676
|
return baseInfo;
|
|
624
677
|
}).join("\n\n") : "";
|
|
625
|
-
text = `\u{
|
|
678
|
+
text = `\u{1F4F5} **proxy list** (total: ${data.total})
|
|
679
|
+
|
|
680
|
+
Only proxies with \`source: user-added\` can be deleted.
|
|
626
681
|
|
|
627
682
|
${proxyListText}
|
|
628
683
|
|
|
@@ -640,9 +695,9 @@ ${result.msg}`;
|
|
|
640
695
|
return { content: [{ type: "text", text }] };
|
|
641
696
|
}
|
|
642
697
|
};
|
|
643
|
-
var
|
|
644
|
-
name = "
|
|
645
|
-
description = "Get
|
|
698
|
+
var GetProxyDetail = class {
|
|
699
|
+
name = "roxy_proxy_detail";
|
|
700
|
+
description = "Get detailed information for a specific proxy configuration";
|
|
646
701
|
inputSchema = {
|
|
647
702
|
type: "object",
|
|
648
703
|
properties: {
|
|
@@ -650,138 +705,12 @@ var ProxyStore = class {
|
|
|
650
705
|
type: "number",
|
|
651
706
|
description: "Workspace ID"
|
|
652
707
|
},
|
|
653
|
-
|
|
654
|
-
type: "number",
|
|
655
|
-
description: "Page index for pagination (default: 1)",
|
|
656
|
-
default: 1
|
|
657
|
-
},
|
|
658
|
-
pageSize: {
|
|
659
|
-
type: "number",
|
|
660
|
-
description: "Number of items per page (default: 15)",
|
|
661
|
-
default: 15
|
|
662
|
-
},
|
|
663
|
-
type: {
|
|
664
|
-
type: "number",
|
|
665
|
-
description: "Type of proxies to get (0: list_use, 1: available_list)",
|
|
666
|
-
default: 0
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
required: ["workspaceId"]
|
|
670
|
-
};
|
|
671
|
-
get schema() {
|
|
672
|
-
return {
|
|
673
|
-
name: this.name,
|
|
674
|
-
description: this.description,
|
|
675
|
-
inputSchema: this.inputSchema
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
async handle(params) {
|
|
679
|
-
const searchParams = new URLSearchParams();
|
|
680
|
-
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
681
|
-
if (params.pageIndex)
|
|
682
|
-
searchParams.append("page_index", params.pageIndex.toString());
|
|
683
|
-
if (params.pageSize)
|
|
684
|
-
searchParams.append("page_size", params.pageSize.toString());
|
|
685
|
-
if (params.type)
|
|
686
|
-
searchParams.append("type", params.type.toString());
|
|
687
|
-
const result = await request(`/proxy/bought_list?${searchParams}`);
|
|
688
|
-
let text = "";
|
|
689
|
-
if (result.code === 0) {
|
|
690
|
-
const data = result.data;
|
|
691
|
-
const currentPage = params.pageIndex ?? 1;
|
|
692
|
-
const pageSize = params.pageSize ?? 15;
|
|
693
|
-
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
694
|
-
const hasNextPage = currentPage < totalPages;
|
|
695
|
-
const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
|
|
696
|
-
const statusText = proxy.checkStatus === 1 ? "\u2705 available" : proxy.checkStatus === 2 ? "\u274C unavailable" : "\u23F3 not checked";
|
|
697
|
-
const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
|
|
698
|
-
const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
|
|
699
|
-
let baseInfo = `${index + 1}. ${statusText} **${name}**
|
|
700
|
-
protocol: ${proxy.protocol || "N/A"}
|
|
701
|
-
ipType: ${proxy.ipType || "N/A"}
|
|
702
|
-
bind profile count: ${proxy.bindCount || "N/A"}
|
|
703
|
-
Detection channel: ${proxy.checkChannel || "N/A"}
|
|
704
|
-
expire date: ${proxy.expireDate}`;
|
|
705
|
-
const ipInfo = [proxy.host, ":", proxy.port];
|
|
706
|
-
if (proxy.proxyUserName) {
|
|
707
|
-
ipInfo.push(...[proxy.proxyUserName, "@", proxy.proxyPassword]);
|
|
708
|
-
}
|
|
709
|
-
if (location) {
|
|
710
|
-
baseInfo += `
|
|
711
|
-
${ipInfo.join("")}
|
|
712
|
-
\u{1F4CD} ${location}`;
|
|
713
|
-
}
|
|
714
|
-
return baseInfo;
|
|
715
|
-
}).join("\n\n") : "";
|
|
716
|
-
text = `\u{1F4CB} **proxy store** (total: ${data.total})
|
|
717
|
-
|
|
718
|
-
${proxyListText}
|
|
719
|
-
|
|
720
|
-
Pagination:
|
|
721
|
-
- currentPage: ${currentPage}
|
|
722
|
-
- pageSize: ${pageSize}
|
|
723
|
-
- totalPages: ${totalPages}
|
|
724
|
-
- hasNextPage: ${hasNextPage}
|
|
725
|
-
${hasNextPage ? `- nextPageHint: Call roxy_store_proxies again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
|
|
726
|
-
} else {
|
|
727
|
-
text = `\u274C **get proxy store failed**
|
|
728
|
-
|
|
729
|
-
${result.msg}`;
|
|
730
|
-
}
|
|
731
|
-
return { content: [{ type: "text", text }] };
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
var CreateProxy = class {
|
|
735
|
-
name = "roxy_create_proxy";
|
|
736
|
-
description = "Create a new proxy configuration with automatic IP detection";
|
|
737
|
-
inputSchema = {
|
|
738
|
-
type: "object",
|
|
739
|
-
properties: {
|
|
740
|
-
workspaceId: {
|
|
708
|
+
id: {
|
|
741
709
|
type: "number",
|
|
742
|
-
description: "
|
|
743
|
-
},
|
|
744
|
-
protocol: {
|
|
745
|
-
type: "string",
|
|
746
|
-
enum: ["HTTP", "HTTPS", "SOCKS5", "SSH"],
|
|
747
|
-
description: "Proxy protocol type"
|
|
748
|
-
},
|
|
749
|
-
host: {
|
|
750
|
-
type: "string",
|
|
751
|
-
description: "Proxy host/IP address"
|
|
752
|
-
},
|
|
753
|
-
port: {
|
|
754
|
-
type: "string",
|
|
755
|
-
description: "Proxy port"
|
|
756
|
-
},
|
|
757
|
-
proxyUserName: {
|
|
758
|
-
type: "string",
|
|
759
|
-
description: "Proxy username"
|
|
760
|
-
},
|
|
761
|
-
proxyPassword: {
|
|
762
|
-
type: "string",
|
|
763
|
-
description: "Proxy password"
|
|
764
|
-
},
|
|
765
|
-
ipType: {
|
|
766
|
-
type: "string",
|
|
767
|
-
enum: ["IPV4", "IPV6"],
|
|
768
|
-
description: "IP type (default: IPV4)"
|
|
769
|
-
},
|
|
770
|
-
checkChannel: {
|
|
771
|
-
type: "string",
|
|
772
|
-
enum: channelList.map((item) => item.label),
|
|
773
|
-
description: "IP detection channel (default: IP123.in)"
|
|
774
|
-
},
|
|
775
|
-
refreshUrl: {
|
|
776
|
-
type: "string",
|
|
777
|
-
description: "Refresh URL for dynamic proxies"
|
|
778
|
-
},
|
|
779
|
-
remark: {
|
|
780
|
-
type: "string",
|
|
781
|
-
description: "Proxy remark/notes"
|
|
710
|
+
description: "Proxy ID to get detail for"
|
|
782
711
|
}
|
|
783
712
|
},
|
|
784
|
-
required: ["workspaceId", "
|
|
713
|
+
required: ["workspaceId", "id"]
|
|
785
714
|
};
|
|
786
715
|
get schema() {
|
|
787
716
|
return {
|
|
@@ -791,51 +720,93 @@ var CreateProxy = class {
|
|
|
791
720
|
};
|
|
792
721
|
}
|
|
793
722
|
async handle(params) {
|
|
794
|
-
if (!params.workspaceId || !params.
|
|
723
|
+
if (!params.workspaceId || !params.id) {
|
|
795
724
|
return {
|
|
796
725
|
content: [
|
|
797
726
|
{
|
|
798
727
|
type: "text",
|
|
799
|
-
text: "\u274C **Failed to
|
|
728
|
+
text: "\u274C **Failed to get proxy detail:**\n\n workspaceId and id are required"
|
|
800
729
|
}
|
|
801
730
|
]
|
|
802
731
|
};
|
|
803
732
|
}
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
ipType,
|
|
809
|
-
checkChannel: checkChannel ? channelList.find((item) => item.label === checkChannel)?.value : null,
|
|
810
|
-
proxyCategory: params.protocol
|
|
811
|
-
};
|
|
812
|
-
const result = await request("/proxy/create", {
|
|
813
|
-
method: "POST",
|
|
814
|
-
body: JSON.stringify(proxyParams)
|
|
815
|
-
});
|
|
733
|
+
const searchParams = new URLSearchParams();
|
|
734
|
+
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
735
|
+
searchParams.append("id", params.id.toString());
|
|
736
|
+
const result = await request(`/proxy/detail?${searchParams}`);
|
|
816
737
|
let text = "";
|
|
817
738
|
if (result.code !== 0) {
|
|
818
|
-
|
|
819
|
-
text = `\u274C **Failed to create proxy:**
|
|
820
|
-
|
|
821
|
-
error message: ${result.msg}
|
|
822
|
-
|
|
823
|
-
${result.data.map((item) => ` - index: ${item.index}, error message: ${item.msg.join(", ")}`).join("\n")}`;
|
|
824
|
-
} else {
|
|
825
|
-
text = `\u274C **Failed to create proxy:**
|
|
739
|
+
text = `\u274C **Failed to get proxy detail:**
|
|
826
740
|
|
|
827
741
|
error message: ${result.msg}`;
|
|
828
|
-
}
|
|
829
742
|
} else {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
**
|
|
833
|
-
**Host:** ${params.host}:${params.port}${params.proxyUserName ? `
|
|
834
|
-
**Username:** ${params.proxyUserName}` : ""}${params.remark ? `
|
|
835
|
-
**Remark:** ${params.remark}` : ""}${params.checkChannel ? `
|
|
836
|
-
**Check Channel:** ${params.checkChannel}` : ""}
|
|
743
|
+
const detail = result.data?.rows?.[0] || result.data || null;
|
|
744
|
+
if (!detail) {
|
|
745
|
+
text = `\u274C **Proxy Not Found**
|
|
837
746
|
|
|
838
|
-
|
|
747
|
+
No proxy detail found for ID ${params.id} in workspace ${params.workspaceId}.`;
|
|
748
|
+
} else {
|
|
749
|
+
const sourceType = formatProxySource(detail.dataType);
|
|
750
|
+
const sourceSpecificTitle = detail.dataType === "buyProxy" ? "Store Purchase Fields" : "User-added Fields";
|
|
751
|
+
const authText = detail.proxyUserName && detail.proxyPassword ? `${detail.proxyUserName}:${detail.proxyPassword}` : detail.proxyUserName || detail.proxyPassword || "N/A";
|
|
752
|
+
const commonLines = [
|
|
753
|
+
`**ID:** ${formatValue(detail.id)}`,
|
|
754
|
+
`**Source Type:** ${sourceType}`,
|
|
755
|
+
`**Workspace ID:** ${formatValue(detail.workspaceId)}`,
|
|
756
|
+
`**User ID:** ${formatValue(detail.userId)}`,
|
|
757
|
+
`**Remark:** ${formatValue(detail.remark)}`,
|
|
758
|
+
`**Protocol:** ${formatValue(detail.protocol)}`,
|
|
759
|
+
`**Host:** ${formatValue(detail.host)}`,
|
|
760
|
+
`**Port:** ${formatValue(detail.port)}`,
|
|
761
|
+
`**IP Type:** ${formatValue(detail.ipType)}`,
|
|
762
|
+
`**Proxy Account:** ${authText}`,
|
|
763
|
+
`**Bind Status:** ${formatBool(detail.isBind, "bound", "not bound")}`,
|
|
764
|
+
`**Bind Count:** ${formatValue(detail.bindCount)}`,
|
|
765
|
+
`**Bound Browser IDs:** ${formatValue(detail.bindList)}`,
|
|
766
|
+
`**Direct Connection:** ${formatBool(detail.isDirect)}`,
|
|
767
|
+
`**Check Status:** ${formatCheckStatus(detail.checkStatus)}`,
|
|
768
|
+
`**Check Channel:** ${formatValue(detail.checkChannel)}`,
|
|
769
|
+
`**Check Channel Value:** ${formatValue(detail.checkChannelValue)}`,
|
|
770
|
+
`**Last Check Time:** ${formatValue(detail.checkTime)}`,
|
|
771
|
+
`**Last IP:** ${formatValue(detail.lastIp)}`,
|
|
772
|
+
`**Last Location:** ${formatLocation(detail)}`,
|
|
773
|
+
`**Created At:** ${formatValue(detail.createTime)}`,
|
|
774
|
+
`**Updated At:** ${formatValue(detail.updateTime)}`
|
|
775
|
+
];
|
|
776
|
+
const userAddedLines = [
|
|
777
|
+
`**Refresh URL:** ${formatValue(detail.refreshUrl)}`,
|
|
778
|
+
`**Model Param:** ${formatValue(detail.modelParam)}`
|
|
779
|
+
];
|
|
780
|
+
const storePurchaseLines = [
|
|
781
|
+
`**Order No:** ${formatValue(detail.orderNo)}`,
|
|
782
|
+
`**Order Status:** ${formatValue(detail.orderStatus)}`,
|
|
783
|
+
`**Country:** ${formatValue(detail.country)}`,
|
|
784
|
+
`**Provider Type:** ${formatValue(detail.providerType)}`,
|
|
785
|
+
`**Provider Name:** ${formatValue(detail.proxyProviderName)}`,
|
|
786
|
+
`**Provider ID:** ${formatValue(detail.proxyProviderId)}`,
|
|
787
|
+
`**Provider Price:** ${formatValue(detail.proxyProviderPrice)}`,
|
|
788
|
+
`**Discount Price:** ${formatValue(detail.proxyProviderDiscountPrice)}`,
|
|
789
|
+
`**Proxy Check Channel:** ${formatValue(detail.proxyCheckChannel)}`,
|
|
790
|
+
`**Expire Date:** ${formatValue(detail.expireDate)}`,
|
|
791
|
+
`**Expire Status:** ${formatValue(detail.proxyExpireStatus)}`,
|
|
792
|
+
`**Auto Renew:** ${formatBool(detail.autoRenew, "enabled", "disabled")}`,
|
|
793
|
+
`**Can Renew:** ${formatBool(detail.canRenew)}`,
|
|
794
|
+
`**Can Refund:** ${formatBool(detail.canRefund)}`,
|
|
795
|
+
`**Renewal Time:** ${formatValue(detail.renewalTime)}`,
|
|
796
|
+
`**Proxy Months:** ${formatValue(detail.proxyMonths)}`,
|
|
797
|
+
`**Gift Days:** ${formatValue(detail.giftDays)}`,
|
|
798
|
+
`**Replace Status:** ${formatValue(detail.replaceStatus)}`,
|
|
799
|
+
`**Badge Type:** ${formatValue(detail.badgeTypeDesc)}`,
|
|
800
|
+
`**Operator Name:** ${formatValue(detail.opName)}`
|
|
801
|
+
];
|
|
802
|
+
const sourceSpecificLines = detail.dataType === "buyProxy" ? storePurchaseLines : userAddedLines;
|
|
803
|
+
text = `\u{1F50E} **Proxy Detail**
|
|
804
|
+
|
|
805
|
+
${commonLines.join("\n")}
|
|
806
|
+
|
|
807
|
+
**${sourceSpecificTitle}:**
|
|
808
|
+
${sourceSpecificLines.join("\n")}`;
|
|
809
|
+
}
|
|
839
810
|
}
|
|
840
811
|
return {
|
|
841
812
|
content: [
|
|
@@ -847,8 +818,8 @@ ${result.data.map((item) => ` - index: ${item.index}, error message: ${item.msg
|
|
|
847
818
|
};
|
|
848
819
|
}
|
|
849
820
|
};
|
|
850
|
-
var
|
|
851
|
-
name = "
|
|
821
|
+
var CreateProxies = class {
|
|
822
|
+
name = "roxy_create_proxies";
|
|
852
823
|
description = "Batch create multiple proxy configurations";
|
|
853
824
|
inputSchema = {
|
|
854
825
|
type: "object",
|
|
@@ -857,11 +828,6 @@ var BatchCreateProxies = class {
|
|
|
857
828
|
type: "number",
|
|
858
829
|
description: "Workspace ID"
|
|
859
830
|
},
|
|
860
|
-
// checkChannel: {
|
|
861
|
-
// type: 'string',
|
|
862
|
-
// enum: channelList.map(item => item.label),
|
|
863
|
-
// description: 'Default IP detection channel for all proxies',
|
|
864
|
-
// },
|
|
865
831
|
proxyList: {
|
|
866
832
|
type: "array",
|
|
867
833
|
description: "Array of proxy configurations",
|
|
@@ -1196,9 +1162,8 @@ ${params.ids.map((id, index) => ` ${index + 1}. ${id}`).join("\n")}
|
|
|
1196
1162
|
}
|
|
1197
1163
|
};
|
|
1198
1164
|
var proxyList = new ProxyList();
|
|
1199
|
-
var
|
|
1200
|
-
var
|
|
1201
|
-
var batchCreateProxies = new BatchCreateProxies();
|
|
1165
|
+
var proxyDetail = new GetProxyDetail();
|
|
1166
|
+
var createProxies = new CreateProxies();
|
|
1202
1167
|
var detectProxy = new DetectProxy();
|
|
1203
1168
|
var modifyProxy = new ModifyProxy();
|
|
1204
1169
|
var deleteProxies = new DeleteProxies();
|
|
@@ -1710,7 +1675,7 @@ var CreateBrowser = class {
|
|
|
1710
1675
|
description: "Complete proxy configuration object",
|
|
1711
1676
|
properties: {
|
|
1712
1677
|
// 如果有 moduleId ,则其他参数不可传递 (moduleId 可通过 roxy_list_proxies 或 roxy_store_proxies 获取) 优先使用该参数来绑定代理IP
|
|
1713
|
-
moduleId: { type: "number", description: `If moduleId is provided, no other parameters may be passed. (moduleId can be obtained via ${proxyList.name}
|
|
1678
|
+
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` },
|
|
1714
1679
|
proxyMethod: { type: "string", enum: ["custom", "choose", "api"] },
|
|
1715
1680
|
proxyCategory: { type: "string", enum: ["noproxy", "HTTP", "HTTPS", "SOCKS5", "SSH"] },
|
|
1716
1681
|
ipType: { type: "string", enum: ["IPV4", "IPV6"] },
|
|
@@ -2165,11 +2130,12 @@ var ListBrowsers = class {
|
|
|
2165
2130
|
const pageSize = params.pageSize ?? 15;
|
|
2166
2131
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
2167
2132
|
const hasNextPage = currentPage < totalPages;
|
|
2133
|
+
const serialNo = `${data.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${data.windowSortNum}`;
|
|
2168
2134
|
text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
|
|
2169
2135
|
|
|
2170
2136
|
${data.rows.map(
|
|
2171
|
-
(browser) => `**${browser.windowName || "Unnamed"}** (
|
|
2172
|
-
-
|
|
2137
|
+
(browser) => `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
|
|
2138
|
+
- CoreVersion: ${browser.coreVersion} - DirId: ${browser.dirId}
|
|
2173
2139
|
- OSVersion: ${browser.osVersion}
|
|
2174
2140
|
- OS: ${browser.os}
|
|
2175
2141
|
- Remark: ${browser.windowRemark}`
|
|
@@ -2384,11 +2350,13 @@ var GetBrowserDetail = class {
|
|
|
2384
2350
|
} else {
|
|
2385
2351
|
const cookieCount = detail.cookie?.length || 0;
|
|
2386
2352
|
const { cookie: _cookie, ...detailWithoutCookies } = detail;
|
|
2353
|
+
const serialNo = `${detail.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${detail.windowSortNum}`;
|
|
2387
2354
|
text = `**Browser Details Summary**
|
|
2388
2355
|
|
|
2389
2356
|
**ID:** \`${detail.dirId}\`
|
|
2357
|
+
**dirId**: \`${detail.dirId}\`
|
|
2358
|
+
**Serial No:** ${serialNo}
|
|
2390
2359
|
**Name:** ${detail.windowName}
|
|
2391
|
-
**Sort Number:** ${detail.windowSortNum}
|
|
2392
2360
|
**Project:** ${detail.projectName} (ID: ${detail.projectId})
|
|
2393
2361
|
**OS:** ${detail.os} ${detail.osVersion}
|
|
2394
2362
|
**Core Version:** ${detail.coreVersion}
|
|
@@ -2977,9 +2945,8 @@ var TOOLS = [
|
|
|
2977
2945
|
listLabels.schema,
|
|
2978
2946
|
getConnectionInfo.schema,
|
|
2979
2947
|
proxyList.schema,
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
batchCreateProxies.schema,
|
|
2948
|
+
proxyDetail.schema,
|
|
2949
|
+
createProxies.schema,
|
|
2983
2950
|
detectProxy.schema,
|
|
2984
2951
|
modifyProxy.schema,
|
|
2985
2952
|
deleteProxies.schema,
|
|
@@ -3057,12 +3024,10 @@ var RoxyBrowserMCPServer = class {
|
|
|
3057
3024
|
// 代理相关
|
|
3058
3025
|
case proxyList.name:
|
|
3059
3026
|
return await proxyList.handle(args);
|
|
3060
|
-
case
|
|
3061
|
-
return await
|
|
3062
|
-
case
|
|
3063
|
-
return await
|
|
3064
|
-
case batchCreateProxies.name:
|
|
3065
|
-
return await batchCreateProxies.handle(args);
|
|
3027
|
+
case proxyDetail.name:
|
|
3028
|
+
return await proxyDetail.handle(args);
|
|
3029
|
+
case createProxies.name:
|
|
3030
|
+
return await createProxies.handle(args);
|
|
3066
3031
|
case detectProxy.name:
|
|
3067
3032
|
return await detectProxy.handle(args);
|
|
3068
3033
|
case modifyProxy.name:
|
|
@@ -3110,6 +3075,6 @@ async function runServer() {
|
|
|
3110
3075
|
await server.run();
|
|
3111
3076
|
}
|
|
3112
3077
|
|
|
3113
|
-
export { DEFAULT_CONFIG, RoxyBrowserMCPServer, TOOLS, batchCreateAccounts, batchCreateBrowsers,
|
|
3078
|
+
export { DEFAULT_CONFIG, RoxyBrowserMCPServer, TOOLS, batchCreateAccounts, batchCreateBrowsers, clearLocalCache, clearServerCache, closeBrowsers, createAccount, createBrowser, createProxies, deleteAccounts, deleteBrowsers, deleteProxies, detectProxy, getBrowserDetail, getConnectionInfo, healthCheck, listAccounts, listBrowsers, listLabels, listWorkspaces, modifyAccount, modifyProxy, openBrowser, proxyDetail, proxyList, randomFingerprint, request, resolveConfig, runServer, updateBrowser };
|
|
3114
3079
|
//# sourceMappingURL=index.js.map
|
|
3115
3080
|
//# sourceMappingURL=index.js.map
|