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