@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/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
|
@@ -544,12 +544,29 @@ var channelList = [
|
|
|
544
544
|
value: "http://ipinfo.io"
|
|
545
545
|
}
|
|
546
546
|
];
|
|
547
|
+
function formatProxySource(dataType) {
|
|
548
|
+
return dataType === "proxyModule" ? "user-added" : dataType === "buyProxy" ? "proxy store" : dataType || "unknown";
|
|
549
|
+
}
|
|
550
|
+
function formatCheckStatus(checkStatus) {
|
|
551
|
+
return checkStatus === 1 ? "\u2705 available" : "\u274C unavailable";
|
|
552
|
+
}
|
|
553
|
+
function formatValue(value) {
|
|
554
|
+
if (value === null || value === void 0 || value === "")
|
|
555
|
+
return "N/A";
|
|
556
|
+
if (Array.isArray(value))
|
|
557
|
+
return value.length > 0 ? value.join(", ") : "N/A";
|
|
558
|
+
return String(value);
|
|
559
|
+
}
|
|
560
|
+
function formatBool(value, truthy = "yes", falsy = "no") {
|
|
561
|
+
return value ? truthy : falsy;
|
|
562
|
+
}
|
|
563
|
+
function formatLocation(proxy) {
|
|
564
|
+
const locationParts = [proxy.lastCity, proxy.lastState, proxy.lastCountry].filter(Boolean);
|
|
565
|
+
return locationParts.length > 0 ? locationParts.join(", ") : "N/A";
|
|
566
|
+
}
|
|
547
567
|
var ProxyList = class {
|
|
548
568
|
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`.";
|
|
569
|
+
description = "Get list of proxy IP List.";
|
|
553
570
|
inputSchema = {
|
|
554
571
|
type: "object",
|
|
555
572
|
properties: {
|
|
@@ -557,9 +574,31 @@ var ProxyList = class {
|
|
|
557
574
|
type: "number",
|
|
558
575
|
description: "Workspace ID"
|
|
559
576
|
},
|
|
560
|
-
|
|
577
|
+
country: {
|
|
578
|
+
type: "string",
|
|
579
|
+
description: "Filter by country (us,cn,jp)"
|
|
580
|
+
},
|
|
581
|
+
checkStatus: {
|
|
561
582
|
type: "number",
|
|
562
|
-
description: "Filter by
|
|
583
|
+
description: "Filter by check status (0: unavailable, 1: available)"
|
|
584
|
+
},
|
|
585
|
+
startDate: {
|
|
586
|
+
type: "string",
|
|
587
|
+
description: "Filter by detection start date (YYYY-MM-DD)"
|
|
588
|
+
},
|
|
589
|
+
endDate: {
|
|
590
|
+
type: "string",
|
|
591
|
+
description: "Filter by detection end date (YYYY-MM-DD)"
|
|
592
|
+
},
|
|
593
|
+
checker: {
|
|
594
|
+
type: "string",
|
|
595
|
+
enum: channelList.map((item) => item.label),
|
|
596
|
+
description: "Filter by detection channel"
|
|
597
|
+
},
|
|
598
|
+
proxyType: {
|
|
599
|
+
type: "string",
|
|
600
|
+
enum: ["user-added", "proxy store"],
|
|
601
|
+
description: "Filter by proxy source type"
|
|
563
602
|
},
|
|
564
603
|
pageIndex: {
|
|
565
604
|
type: "number",
|
|
@@ -584,16 +623,26 @@ var ProxyList = class {
|
|
|
584
623
|
async handle(params) {
|
|
585
624
|
const searchParams = new URLSearchParams();
|
|
586
625
|
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
587
|
-
if (params.id)
|
|
588
|
-
searchParams.append("id", params.id.toString());
|
|
589
626
|
if (params.pageIndex)
|
|
590
627
|
searchParams.append("page_index", params.pageIndex.toString());
|
|
591
628
|
if (params.pageSize)
|
|
592
629
|
searchParams.append("page_size", params.pageSize.toString());
|
|
630
|
+
if (params.country)
|
|
631
|
+
searchParams.append("country", params.country);
|
|
632
|
+
if (params.checkStatus !== void 0)
|
|
633
|
+
searchParams.append("check_status", params.checkStatus.toString());
|
|
634
|
+
if (params.startDate)
|
|
635
|
+
searchParams.append("start_date", params.startDate);
|
|
636
|
+
if (params.endDate)
|
|
637
|
+
searchParams.append("end_date", params.endDate);
|
|
638
|
+
if (params.checker)
|
|
639
|
+
searchParams.append("checker", params.checker);
|
|
640
|
+
if (params.proxyType)
|
|
641
|
+
searchParams.append("proxyType", params.proxyType === "user-added" ? "0" : "1");
|
|
593
642
|
if (!params.workspaceId) {
|
|
594
643
|
throw new Error("workspaceId is required");
|
|
595
644
|
}
|
|
596
|
-
const result = await request(`/proxy/
|
|
645
|
+
const result = await request(`/proxy/list_merged?${searchParams}`);
|
|
597
646
|
let text = "";
|
|
598
647
|
if (result.code === 0) {
|
|
599
648
|
const data = result.data;
|
|
@@ -602,10 +651,14 @@ var ProxyList = class {
|
|
|
602
651
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
603
652
|
const hasNextPage = currentPage < totalPages;
|
|
604
653
|
const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
|
|
605
|
-
const statusText = proxy.checkStatus
|
|
654
|
+
const statusText = formatCheckStatus(proxy.checkStatus);
|
|
655
|
+
const sourceType = proxy.dataType === "proxyModule" ? "user-added" : "proxy store";
|
|
656
|
+
const canDelete = proxy.dataType === "proxyModule" ? "yes" : "no";
|
|
606
657
|
const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
|
|
607
658
|
const location = proxy.lastCountry ? `${proxy.lastCity || ""}${proxy.lastCity && proxy.lastCountry ? ", " : ""}${proxy.lastCountry}` : null;
|
|
608
659
|
let baseInfo = `${index + 1}. ${statusText} **${name}**
|
|
660
|
+
source: ${sourceType}
|
|
661
|
+
deletable: ${canDelete}
|
|
609
662
|
protocol: ${proxy.protocol || "N/A"}
|
|
610
663
|
ipType: ${proxy.ipType || "N/A"}
|
|
611
664
|
bind profile count: ${proxy.bindCount || "N/A"}
|
|
@@ -625,7 +678,9 @@ ${ipInfo.length > 0 ? `${ipInfo.join("")}
|
|
|
625
678
|
}
|
|
626
679
|
return baseInfo;
|
|
627
680
|
}).join("\n\n") : "";
|
|
628
|
-
text = `\u{
|
|
681
|
+
text = `\u{1F4F5} **proxy list** (total: ${data.total})
|
|
682
|
+
|
|
683
|
+
Only proxies with \`source: user-added\` can be deleted.
|
|
629
684
|
|
|
630
685
|
${proxyListText}
|
|
631
686
|
|
|
@@ -643,9 +698,9 @@ ${result.msg}`;
|
|
|
643
698
|
return { content: [{ type: "text", text }] };
|
|
644
699
|
}
|
|
645
700
|
};
|
|
646
|
-
var
|
|
647
|
-
name = "
|
|
648
|
-
description = "Get
|
|
701
|
+
var GetProxyDetail = class {
|
|
702
|
+
name = "roxy_proxy_detail";
|
|
703
|
+
description = "Get detailed information for a specific proxy configuration";
|
|
649
704
|
inputSchema = {
|
|
650
705
|
type: "object",
|
|
651
706
|
properties: {
|
|
@@ -653,138 +708,12 @@ var ProxyStore = class {
|
|
|
653
708
|
type: "number",
|
|
654
709
|
description: "Workspace ID"
|
|
655
710
|
},
|
|
656
|
-
|
|
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: {
|
|
711
|
+
id: {
|
|
744
712
|
type: "number",
|
|
745
|
-
description: "
|
|
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"
|
|
713
|
+
description: "Proxy ID to get detail for"
|
|
785
714
|
}
|
|
786
715
|
},
|
|
787
|
-
required: ["workspaceId", "
|
|
716
|
+
required: ["workspaceId", "id"]
|
|
788
717
|
};
|
|
789
718
|
get schema() {
|
|
790
719
|
return {
|
|
@@ -794,51 +723,93 @@ var CreateProxy = class {
|
|
|
794
723
|
};
|
|
795
724
|
}
|
|
796
725
|
async handle(params) {
|
|
797
|
-
if (!params.workspaceId || !params.
|
|
726
|
+
if (!params.workspaceId || !params.id) {
|
|
798
727
|
return {
|
|
799
728
|
content: [
|
|
800
729
|
{
|
|
801
730
|
type: "text",
|
|
802
|
-
text: "\u274C **Failed to
|
|
731
|
+
text: "\u274C **Failed to get proxy detail:**\n\n workspaceId and id are required"
|
|
803
732
|
}
|
|
804
733
|
]
|
|
805
734
|
};
|
|
806
735
|
}
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
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
|
-
});
|
|
736
|
+
const searchParams = new URLSearchParams();
|
|
737
|
+
searchParams.append("workspaceId", params.workspaceId.toString());
|
|
738
|
+
searchParams.append("id", params.id.toString());
|
|
739
|
+
const result = await request(`/proxy/detail?${searchParams}`);
|
|
819
740
|
let text = "";
|
|
820
741
|
if (result.code !== 0) {
|
|
821
|
-
|
|
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:**
|
|
742
|
+
text = `\u274C **Failed to get proxy detail:**
|
|
829
743
|
|
|
830
744
|
error message: ${result.msg}`;
|
|
831
|
-
}
|
|
832
745
|
} else {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
**
|
|
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}` : ""}
|
|
746
|
+
const detail = result.data?.rows?.[0] || result.data || null;
|
|
747
|
+
if (!detail) {
|
|
748
|
+
text = `\u274C **Proxy Not Found**
|
|
840
749
|
|
|
841
|
-
|
|
750
|
+
No proxy detail found for ID ${params.id} in workspace ${params.workspaceId}.`;
|
|
751
|
+
} else {
|
|
752
|
+
const sourceType = formatProxySource(detail.dataType);
|
|
753
|
+
const sourceSpecificTitle = detail.dataType === "buyProxy" ? "Store Purchase Fields" : "User-added Fields";
|
|
754
|
+
const authText = detail.proxyUserName && detail.proxyPassword ? `${detail.proxyUserName}:${detail.proxyPassword}` : detail.proxyUserName || detail.proxyPassword || "N/A";
|
|
755
|
+
const commonLines = [
|
|
756
|
+
`**ID:** ${formatValue(detail.id)}`,
|
|
757
|
+
`**Source Type:** ${sourceType}`,
|
|
758
|
+
`**Workspace ID:** ${formatValue(detail.workspaceId)}`,
|
|
759
|
+
`**User ID:** ${formatValue(detail.userId)}`,
|
|
760
|
+
`**Remark:** ${formatValue(detail.remark)}`,
|
|
761
|
+
`**Protocol:** ${formatValue(detail.protocol)}`,
|
|
762
|
+
`**Host:** ${formatValue(detail.host)}`,
|
|
763
|
+
`**Port:** ${formatValue(detail.port)}`,
|
|
764
|
+
`**IP Type:** ${formatValue(detail.ipType)}`,
|
|
765
|
+
`**Proxy Account:** ${authText}`,
|
|
766
|
+
`**Bind Status:** ${formatBool(detail.isBind, "bound", "not bound")}`,
|
|
767
|
+
`**Bind Count:** ${formatValue(detail.bindCount)}`,
|
|
768
|
+
`**Bound Browser IDs:** ${formatValue(detail.bindList)}`,
|
|
769
|
+
`**Direct Connection:** ${formatBool(detail.isDirect)}`,
|
|
770
|
+
`**Check Status:** ${formatCheckStatus(detail.checkStatus)}`,
|
|
771
|
+
`**Check Channel:** ${formatValue(detail.checkChannel)}`,
|
|
772
|
+
`**Check Channel Value:** ${formatValue(detail.checkChannelValue)}`,
|
|
773
|
+
`**Last Check Time:** ${formatValue(detail.checkTime)}`,
|
|
774
|
+
`**Last IP:** ${formatValue(detail.lastIp)}`,
|
|
775
|
+
`**Last Location:** ${formatLocation(detail)}`,
|
|
776
|
+
`**Created At:** ${formatValue(detail.createTime)}`,
|
|
777
|
+
`**Updated At:** ${formatValue(detail.updateTime)}`
|
|
778
|
+
];
|
|
779
|
+
const userAddedLines = [
|
|
780
|
+
`**Refresh URL:** ${formatValue(detail.refreshUrl)}`,
|
|
781
|
+
`**Model Param:** ${formatValue(detail.modelParam)}`
|
|
782
|
+
];
|
|
783
|
+
const storePurchaseLines = [
|
|
784
|
+
`**Order No:** ${formatValue(detail.orderNo)}`,
|
|
785
|
+
`**Order Status:** ${formatValue(detail.orderStatus)}`,
|
|
786
|
+
`**Country:** ${formatValue(detail.country)}`,
|
|
787
|
+
`**Provider Type:** ${formatValue(detail.providerType)}`,
|
|
788
|
+
`**Provider Name:** ${formatValue(detail.proxyProviderName)}`,
|
|
789
|
+
`**Provider ID:** ${formatValue(detail.proxyProviderId)}`,
|
|
790
|
+
`**Provider Price:** ${formatValue(detail.proxyProviderPrice)}`,
|
|
791
|
+
`**Discount Price:** ${formatValue(detail.proxyProviderDiscountPrice)}`,
|
|
792
|
+
`**Proxy Check Channel:** ${formatValue(detail.proxyCheckChannel)}`,
|
|
793
|
+
`**Expire Date:** ${formatValue(detail.expireDate)}`,
|
|
794
|
+
`**Expire Status:** ${formatValue(detail.proxyExpireStatus)}`,
|
|
795
|
+
`**Auto Renew:** ${formatBool(detail.autoRenew, "enabled", "disabled")}`,
|
|
796
|
+
`**Can Renew:** ${formatBool(detail.canRenew)}`,
|
|
797
|
+
`**Can Refund:** ${formatBool(detail.canRefund)}`,
|
|
798
|
+
`**Renewal Time:** ${formatValue(detail.renewalTime)}`,
|
|
799
|
+
`**Proxy Months:** ${formatValue(detail.proxyMonths)}`,
|
|
800
|
+
`**Gift Days:** ${formatValue(detail.giftDays)}`,
|
|
801
|
+
`**Replace Status:** ${formatValue(detail.replaceStatus)}`,
|
|
802
|
+
`**Badge Type:** ${formatValue(detail.badgeTypeDesc)}`,
|
|
803
|
+
`**Operator Name:** ${formatValue(detail.opName)}`
|
|
804
|
+
];
|
|
805
|
+
const sourceSpecificLines = detail.dataType === "buyProxy" ? storePurchaseLines : userAddedLines;
|
|
806
|
+
text = `\u{1F50E} **Proxy Detail**
|
|
807
|
+
|
|
808
|
+
${commonLines.join("\n")}
|
|
809
|
+
|
|
810
|
+
**${sourceSpecificTitle}:**
|
|
811
|
+
${sourceSpecificLines.join("\n")}`;
|
|
812
|
+
}
|
|
842
813
|
}
|
|
843
814
|
return {
|
|
844
815
|
content: [
|
|
@@ -850,8 +821,8 @@ ${result.data.map((item) => ` - index: ${item.index}, error message: ${item.msg
|
|
|
850
821
|
};
|
|
851
822
|
}
|
|
852
823
|
};
|
|
853
|
-
var
|
|
854
|
-
name = "
|
|
824
|
+
var CreateProxies = class {
|
|
825
|
+
name = "roxy_create_proxies";
|
|
855
826
|
description = "Batch create multiple proxy configurations";
|
|
856
827
|
inputSchema = {
|
|
857
828
|
type: "object",
|
|
@@ -860,11 +831,6 @@ var BatchCreateProxies = class {
|
|
|
860
831
|
type: "number",
|
|
861
832
|
description: "Workspace ID"
|
|
862
833
|
},
|
|
863
|
-
// checkChannel: {
|
|
864
|
-
// type: 'string',
|
|
865
|
-
// enum: channelList.map(item => item.label),
|
|
866
|
-
// description: 'Default IP detection channel for all proxies',
|
|
867
|
-
// },
|
|
868
834
|
proxyList: {
|
|
869
835
|
type: "array",
|
|
870
836
|
description: "Array of proxy configurations",
|
|
@@ -1199,9 +1165,8 @@ ${params.ids.map((id, index) => ` ${index + 1}. ${id}`).join("\n")}
|
|
|
1199
1165
|
}
|
|
1200
1166
|
};
|
|
1201
1167
|
var proxyList = new ProxyList();
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1204
|
-
var batchCreateProxies = new BatchCreateProxies();
|
|
1168
|
+
var proxyDetail = new GetProxyDetail();
|
|
1169
|
+
var createProxies = new CreateProxies();
|
|
1205
1170
|
var detectProxy = new DetectProxy();
|
|
1206
1171
|
var modifyProxy = new ModifyProxy();
|
|
1207
1172
|
var deleteProxies = new DeleteProxies();
|
|
@@ -1713,7 +1678,7 @@ var CreateBrowser = class {
|
|
|
1713
1678
|
description: "Complete proxy configuration object",
|
|
1714
1679
|
properties: {
|
|
1715
1680
|
// 如果有 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}
|
|
1681
|
+
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
1682
|
proxyMethod: { type: "string", enum: ["custom", "choose", "api"] },
|
|
1718
1683
|
proxyCategory: { type: "string", enum: ["noproxy", "HTTP", "HTTPS", "SOCKS5", "SSH"] },
|
|
1719
1684
|
ipType: { type: "string", enum: ["IPV4", "IPV6"] },
|
|
@@ -2168,11 +2133,12 @@ var ListBrowsers = class {
|
|
|
2168
2133
|
const pageSize = params.pageSize ?? 15;
|
|
2169
2134
|
const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
|
|
2170
2135
|
const hasNextPage = currentPage < totalPages;
|
|
2136
|
+
const serialNo = `${data.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${data.windowSortNum}`;
|
|
2171
2137
|
text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
|
|
2172
2138
|
|
|
2173
2139
|
${data.rows.map(
|
|
2174
|
-
(browser) => `**${browser.windowName || "Unnamed"}** (
|
|
2175
|
-
-
|
|
2140
|
+
(browser) => `**${browser.windowName || "Unnamed"}** (Serial No: ${serialNo})
|
|
2141
|
+
- CoreVersion: ${browser.coreVersion} - DirId: ${browser.dirId}
|
|
2176
2142
|
- OSVersion: ${browser.osVersion}
|
|
2177
2143
|
- OS: ${browser.os}
|
|
2178
2144
|
- Remark: ${browser.windowRemark}`
|
|
@@ -2387,11 +2353,13 @@ var GetBrowserDetail = class {
|
|
|
2387
2353
|
} else {
|
|
2388
2354
|
const cookieCount = detail.cookie?.length || 0;
|
|
2389
2355
|
const { cookie: _cookie, ...detailWithoutCookies } = detail;
|
|
2356
|
+
const serialNo = `${detail.workspaceName?.slice(0, 3).toLocaleUpperCase()}-${detail.windowSortNum}`;
|
|
2390
2357
|
text = `**Browser Details Summary**
|
|
2391
2358
|
|
|
2392
2359
|
**ID:** \`${detail.dirId}\`
|
|
2360
|
+
**dirId**: \`${detail.dirId}\`
|
|
2361
|
+
**Serial No:** ${serialNo}
|
|
2393
2362
|
**Name:** ${detail.windowName}
|
|
2394
|
-
**Sort Number:** ${detail.windowSortNum}
|
|
2395
2363
|
**Project:** ${detail.projectName} (ID: ${detail.projectId})
|
|
2396
2364
|
**OS:** ${detail.os} ${detail.osVersion}
|
|
2397
2365
|
**Core Version:** ${detail.coreVersion}
|
|
@@ -2980,9 +2948,8 @@ var TOOLS = [
|
|
|
2980
2948
|
listLabels.schema,
|
|
2981
2949
|
getConnectionInfo.schema,
|
|
2982
2950
|
proxyList.schema,
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
batchCreateProxies.schema,
|
|
2951
|
+
proxyDetail.schema,
|
|
2952
|
+
createProxies.schema,
|
|
2986
2953
|
detectProxy.schema,
|
|
2987
2954
|
modifyProxy.schema,
|
|
2988
2955
|
deleteProxies.schema,
|
|
@@ -3060,12 +3027,10 @@ var RoxyBrowserMCPServer = class {
|
|
|
3060
3027
|
// 代理相关
|
|
3061
3028
|
case proxyList.name:
|
|
3062
3029
|
return await proxyList.handle(args);
|
|
3063
|
-
case
|
|
3064
|
-
return await
|
|
3065
|
-
case
|
|
3066
|
-
return await
|
|
3067
|
-
case batchCreateProxies.name:
|
|
3068
|
-
return await batchCreateProxies.handle(args);
|
|
3030
|
+
case proxyDetail.name:
|
|
3031
|
+
return await proxyDetail.handle(args);
|
|
3032
|
+
case createProxies.name:
|
|
3033
|
+
return await createProxies.handle(args);
|
|
3069
3034
|
case detectProxy.name:
|
|
3070
3035
|
return await detectProxy.handle(args);
|
|
3071
3036
|
case modifyProxy.name:
|