wuying-agentbay-sdk 0.5.1 → 0.6.1
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 +84 -153
- package/dist/index.cjs +1153 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +455 -33
- package/dist/index.d.ts +455 -33
- package/dist/index.mjs +1140 -154
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -504,7 +504,7 @@ init_esm_shims();
|
|
|
504
504
|
|
|
505
505
|
// src/api/client.ts
|
|
506
506
|
init_esm_shims();
|
|
507
|
-
import * as $
|
|
507
|
+
import * as $dara77 from "@darabonba/typescript";
|
|
508
508
|
import OpenApi from "@alicloud/openapi-core";
|
|
509
509
|
import { OpenApiUtil, $OpenApiUtil } from "@alicloud/openapi-core";
|
|
510
510
|
|
|
@@ -1056,6 +1056,7 @@ var _CreateMcpSessionRequest = class _CreateMcpSessionRequest extends $dara18.Mo
|
|
|
1056
1056
|
externalUserId: "ExternalUserId",
|
|
1057
1057
|
imageId: "ImageId",
|
|
1058
1058
|
labels: "Labels",
|
|
1059
|
+
mcpPolicyId: "McpPolicyId",
|
|
1059
1060
|
persistenceDataList: "PersistenceDataList",
|
|
1060
1061
|
sessionId: "SessionId",
|
|
1061
1062
|
vpcResource: "VpcResource"
|
|
@@ -1068,6 +1069,7 @@ var _CreateMcpSessionRequest = class _CreateMcpSessionRequest extends $dara18.Mo
|
|
|
1068
1069
|
externalUserId: "string",
|
|
1069
1070
|
imageId: "string",
|
|
1070
1071
|
labels: "string",
|
|
1072
|
+
mcpPolicyId: "string",
|
|
1071
1073
|
persistenceDataList: { "type": "array", "itemType": CreateMcpSessionRequestPersistenceDataList },
|
|
1072
1074
|
sessionId: "string",
|
|
1073
1075
|
vpcResource: "boolean"
|
|
@@ -1097,6 +1099,7 @@ var _CreateMcpSessionShrinkRequest = class _CreateMcpSessionShrinkRequest extend
|
|
|
1097
1099
|
externalUserId: "ExternalUserId",
|
|
1098
1100
|
imageId: "ImageId",
|
|
1099
1101
|
labels: "Labels",
|
|
1102
|
+
mcpPolicyId: "McpPolicyId",
|
|
1100
1103
|
persistenceDataListShrink: "PersistenceDataList",
|
|
1101
1104
|
sessionId: "SessionId",
|
|
1102
1105
|
vpcResource: "VpcResource"
|
|
@@ -1109,6 +1112,7 @@ var _CreateMcpSessionShrinkRequest = class _CreateMcpSessionShrinkRequest extend
|
|
|
1109
1112
|
externalUserId: "string",
|
|
1110
1113
|
imageId: "string",
|
|
1111
1114
|
labels: "string",
|
|
1115
|
+
mcpPolicyId: "string",
|
|
1112
1116
|
persistenceDataListShrink: "string",
|
|
1113
1117
|
sessionId: "string",
|
|
1114
1118
|
vpcResource: "boolean"
|
|
@@ -1802,14 +1806,16 @@ var _InitBrowserRequest = class _InitBrowserRequest extends $dara40.Model {
|
|
|
1802
1806
|
return {
|
|
1803
1807
|
authorization: "Authorization",
|
|
1804
1808
|
persistentPath: "PersistentPath",
|
|
1805
|
-
sessionId: "SessionId"
|
|
1809
|
+
sessionId: "SessionId",
|
|
1810
|
+
browserOption: "BrowserOption"
|
|
1806
1811
|
};
|
|
1807
1812
|
}
|
|
1808
1813
|
static types() {
|
|
1809
1814
|
return {
|
|
1810
1815
|
authorization: "string",
|
|
1811
1816
|
persistentPath: "string",
|
|
1812
|
-
sessionId: "string"
|
|
1817
|
+
sessionId: "string",
|
|
1818
|
+
browserOption: { "type": "map", "keyType": "string", "valueType": "any" }
|
|
1813
1819
|
};
|
|
1814
1820
|
}
|
|
1815
1821
|
validate() {
|
|
@@ -2546,16 +2552,463 @@ var _SyncContextRequest = class _SyncContextRequest extends $dara62.Model {
|
|
|
2546
2552
|
super(map);
|
|
2547
2553
|
}
|
|
2548
2554
|
};
|
|
2549
|
-
__name(_SyncContextRequest, "SyncContextRequest");
|
|
2550
|
-
var SyncContextRequest = _SyncContextRequest;
|
|
2551
|
-
|
|
2552
|
-
// src/api/models/SyncContextResponseBody.ts
|
|
2553
|
-
init_esm_shims();
|
|
2554
|
-
import * as $dara63 from "@darabonba/typescript";
|
|
2555
|
-
var _SyncContextResponseBody = class _SyncContextResponseBody extends $dara63.Model {
|
|
2555
|
+
__name(_SyncContextRequest, "SyncContextRequest");
|
|
2556
|
+
var SyncContextRequest = _SyncContextRequest;
|
|
2557
|
+
|
|
2558
|
+
// src/api/models/SyncContextResponseBody.ts
|
|
2559
|
+
init_esm_shims();
|
|
2560
|
+
import * as $dara63 from "@darabonba/typescript";
|
|
2561
|
+
var _SyncContextResponseBody = class _SyncContextResponseBody extends $dara63.Model {
|
|
2562
|
+
static names() {
|
|
2563
|
+
return {
|
|
2564
|
+
code: "Code",
|
|
2565
|
+
httpStatusCode: "HttpStatusCode",
|
|
2566
|
+
message: "Message",
|
|
2567
|
+
requestId: "RequestId",
|
|
2568
|
+
success: "Success"
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
static types() {
|
|
2572
|
+
return {
|
|
2573
|
+
code: "string",
|
|
2574
|
+
httpStatusCode: "number",
|
|
2575
|
+
message: "string",
|
|
2576
|
+
requestId: "string",
|
|
2577
|
+
success: "boolean"
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
validate() {
|
|
2581
|
+
super.validate();
|
|
2582
|
+
}
|
|
2583
|
+
constructor(map) {
|
|
2584
|
+
super(map);
|
|
2585
|
+
}
|
|
2586
|
+
};
|
|
2587
|
+
__name(_SyncContextResponseBody, "SyncContextResponseBody");
|
|
2588
|
+
var SyncContextResponseBody = _SyncContextResponseBody;
|
|
2589
|
+
|
|
2590
|
+
// src/api/models/SyncContextResponse.ts
|
|
2591
|
+
init_esm_shims();
|
|
2592
|
+
import * as $dara64 from "@darabonba/typescript";
|
|
2593
|
+
var _SyncContextResponse = class _SyncContextResponse extends $dara64.Model {
|
|
2594
|
+
static names() {
|
|
2595
|
+
return {
|
|
2596
|
+
headers: "headers",
|
|
2597
|
+
statusCode: "statusCode",
|
|
2598
|
+
body: "body"
|
|
2599
|
+
};
|
|
2600
|
+
}
|
|
2601
|
+
static types() {
|
|
2602
|
+
return {
|
|
2603
|
+
headers: { "type": "map", "keyType": "string", "valueType": "string" },
|
|
2604
|
+
statusCode: "number",
|
|
2605
|
+
body: SyncContextResponseBody
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
validate() {
|
|
2609
|
+
if (this.headers) {
|
|
2610
|
+
$dara64.Model.validateMap(this.headers);
|
|
2611
|
+
}
|
|
2612
|
+
if (this.body && typeof this.body.validate === "function") {
|
|
2613
|
+
this.body.validate();
|
|
2614
|
+
}
|
|
2615
|
+
super.validate();
|
|
2616
|
+
}
|
|
2617
|
+
constructor(map) {
|
|
2618
|
+
super(map);
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
__name(_SyncContextResponse, "SyncContextResponse");
|
|
2622
|
+
var SyncContextResponse = _SyncContextResponse;
|
|
2623
|
+
|
|
2624
|
+
// src/api/models/DeleteContextFileRequest.ts
|
|
2625
|
+
init_esm_shims();
|
|
2626
|
+
import * as $dara65 from "@darabonba/typescript";
|
|
2627
|
+
var _DeleteContextFileRequest = class _DeleteContextFileRequest extends $dara65.Model {
|
|
2628
|
+
static names() {
|
|
2629
|
+
return {
|
|
2630
|
+
authorization: "Authorization",
|
|
2631
|
+
contextId: "ContextId",
|
|
2632
|
+
filePath: "FilePath"
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
static types() {
|
|
2636
|
+
return {
|
|
2637
|
+
authorization: "string",
|
|
2638
|
+
contextId: "string",
|
|
2639
|
+
filePath: "string"
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
validate() {
|
|
2643
|
+
super.validate();
|
|
2644
|
+
}
|
|
2645
|
+
constructor(map) {
|
|
2646
|
+
super(map);
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
__name(_DeleteContextFileRequest, "DeleteContextFileRequest");
|
|
2650
|
+
var DeleteContextFileRequest = _DeleteContextFileRequest;
|
|
2651
|
+
|
|
2652
|
+
// src/api/models/DeleteContextFileResponseBody.ts
|
|
2653
|
+
init_esm_shims();
|
|
2654
|
+
import * as $dara66 from "@darabonba/typescript";
|
|
2655
|
+
var _DeleteContextFileResponseBody = class _DeleteContextFileResponseBody extends $dara66.Model {
|
|
2656
|
+
static names() {
|
|
2657
|
+
return {
|
|
2658
|
+
code: "Code",
|
|
2659
|
+
httpStatusCode: "HttpStatusCode",
|
|
2660
|
+
message: "Message",
|
|
2661
|
+
requestId: "RequestId",
|
|
2662
|
+
success: "Success"
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2665
|
+
static types() {
|
|
2666
|
+
return {
|
|
2667
|
+
code: "string",
|
|
2668
|
+
httpStatusCode: "number",
|
|
2669
|
+
message: "string",
|
|
2670
|
+
requestId: "string",
|
|
2671
|
+
success: "boolean"
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
validate() {
|
|
2675
|
+
super.validate();
|
|
2676
|
+
}
|
|
2677
|
+
constructor(map) {
|
|
2678
|
+
super(map);
|
|
2679
|
+
}
|
|
2680
|
+
};
|
|
2681
|
+
__name(_DeleteContextFileResponseBody, "DeleteContextFileResponseBody");
|
|
2682
|
+
var DeleteContextFileResponseBody = _DeleteContextFileResponseBody;
|
|
2683
|
+
|
|
2684
|
+
// src/api/models/DeleteContextFileResponse.ts
|
|
2685
|
+
init_esm_shims();
|
|
2686
|
+
import * as $dara67 from "@darabonba/typescript";
|
|
2687
|
+
var _DeleteContextFileResponse = class _DeleteContextFileResponse extends $dara67.Model {
|
|
2688
|
+
static names() {
|
|
2689
|
+
return {
|
|
2690
|
+
headers: "headers",
|
|
2691
|
+
statusCode: "statusCode",
|
|
2692
|
+
body: "body"
|
|
2693
|
+
};
|
|
2694
|
+
}
|
|
2695
|
+
static types() {
|
|
2696
|
+
return {
|
|
2697
|
+
headers: { type: "map", keyType: "string", valueType: "string" },
|
|
2698
|
+
statusCode: "number",
|
|
2699
|
+
body: DeleteContextFileResponseBody
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
validate() {
|
|
2703
|
+
super.validate();
|
|
2704
|
+
}
|
|
2705
|
+
constructor(map) {
|
|
2706
|
+
super(map);
|
|
2707
|
+
}
|
|
2708
|
+
};
|
|
2709
|
+
__name(_DeleteContextFileResponse, "DeleteContextFileResponse");
|
|
2710
|
+
var DeleteContextFileResponse = _DeleteContextFileResponse;
|
|
2711
|
+
|
|
2712
|
+
// src/api/models/DescribeContextFilesRequest.ts
|
|
2713
|
+
init_esm_shims();
|
|
2714
|
+
import * as $dara68 from "@darabonba/typescript";
|
|
2715
|
+
var _DescribeContextFilesRequest = class _DescribeContextFilesRequest extends $dara68.Model {
|
|
2716
|
+
static names() {
|
|
2717
|
+
return {
|
|
2718
|
+
authorization: "Authorization",
|
|
2719
|
+
pageNumber: "PageNumber",
|
|
2720
|
+
pageSize: "PageSize",
|
|
2721
|
+
parentFolderPath: "ParentFolderPath",
|
|
2722
|
+
contextId: "ContextId"
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
2725
|
+
static types() {
|
|
2726
|
+
return {
|
|
2727
|
+
authorization: "string",
|
|
2728
|
+
pageNumber: "number",
|
|
2729
|
+
pageSize: "number",
|
|
2730
|
+
parentFolderPath: "string",
|
|
2731
|
+
contextId: "string"
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
validate() {
|
|
2735
|
+
super.validate();
|
|
2736
|
+
}
|
|
2737
|
+
constructor(map) {
|
|
2738
|
+
super(map);
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
__name(_DescribeContextFilesRequest, "DescribeContextFilesRequest");
|
|
2742
|
+
var DescribeContextFilesRequest = _DescribeContextFilesRequest;
|
|
2743
|
+
|
|
2744
|
+
// src/api/models/DescribeContextFilesResponseBody.ts
|
|
2745
|
+
init_esm_shims();
|
|
2746
|
+
import * as $dara69 from "@darabonba/typescript";
|
|
2747
|
+
var _DescribeContextFilesResponseBodyData = class _DescribeContextFilesResponseBodyData extends $dara69.Model {
|
|
2748
|
+
static names() {
|
|
2749
|
+
return {
|
|
2750
|
+
fileId: "FileId",
|
|
2751
|
+
fileName: "FileName",
|
|
2752
|
+
filePath: "FilePath",
|
|
2753
|
+
fileType: "FileType",
|
|
2754
|
+
gmtCreate: "GmtCreate",
|
|
2755
|
+
gmtModified: "GmtModified",
|
|
2756
|
+
size: "Size",
|
|
2757
|
+
status: "Status"
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
static types() {
|
|
2761
|
+
return {
|
|
2762
|
+
fileId: "string",
|
|
2763
|
+
fileName: "string",
|
|
2764
|
+
filePath: "string",
|
|
2765
|
+
fileType: "string",
|
|
2766
|
+
gmtCreate: "string",
|
|
2767
|
+
gmtModified: "string",
|
|
2768
|
+
size: "number",
|
|
2769
|
+
status: "string"
|
|
2770
|
+
};
|
|
2771
|
+
}
|
|
2772
|
+
validate() {
|
|
2773
|
+
super.validate();
|
|
2774
|
+
}
|
|
2775
|
+
constructor(map) {
|
|
2776
|
+
super(map);
|
|
2777
|
+
}
|
|
2778
|
+
};
|
|
2779
|
+
__name(_DescribeContextFilesResponseBodyData, "DescribeContextFilesResponseBodyData");
|
|
2780
|
+
var DescribeContextFilesResponseBodyData = _DescribeContextFilesResponseBodyData;
|
|
2781
|
+
var _DescribeContextFilesResponseBody = class _DescribeContextFilesResponseBody extends $dara69.Model {
|
|
2782
|
+
static names() {
|
|
2783
|
+
return {
|
|
2784
|
+
code: "Code",
|
|
2785
|
+
count: "Count",
|
|
2786
|
+
data: "Data",
|
|
2787
|
+
httpStatusCode: "HttpStatusCode",
|
|
2788
|
+
message: "Message",
|
|
2789
|
+
requestId: "RequestId",
|
|
2790
|
+
success: "Success"
|
|
2791
|
+
};
|
|
2792
|
+
}
|
|
2793
|
+
static types() {
|
|
2794
|
+
return {
|
|
2795
|
+
code: "string",
|
|
2796
|
+
count: "number",
|
|
2797
|
+
data: { type: "array", itemType: DescribeContextFilesResponseBodyData },
|
|
2798
|
+
httpStatusCode: "number",
|
|
2799
|
+
message: "string",
|
|
2800
|
+
requestId: "string",
|
|
2801
|
+
success: "boolean"
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
validate() {
|
|
2805
|
+
super.validate();
|
|
2806
|
+
}
|
|
2807
|
+
constructor(map) {
|
|
2808
|
+
super(map);
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
__name(_DescribeContextFilesResponseBody, "DescribeContextFilesResponseBody");
|
|
2812
|
+
var DescribeContextFilesResponseBody = _DescribeContextFilesResponseBody;
|
|
2813
|
+
|
|
2814
|
+
// src/api/models/DescribeContextFilesResponse.ts
|
|
2815
|
+
init_esm_shims();
|
|
2816
|
+
import * as $dara70 from "@darabonba/typescript";
|
|
2817
|
+
var _DescribeContextFilesResponse = class _DescribeContextFilesResponse extends $dara70.Model {
|
|
2818
|
+
static names() {
|
|
2819
|
+
return {
|
|
2820
|
+
headers: "headers",
|
|
2821
|
+
statusCode: "statusCode",
|
|
2822
|
+
body: "body"
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
static types() {
|
|
2826
|
+
return {
|
|
2827
|
+
headers: { type: "map", keyType: "string", valueType: "string" },
|
|
2828
|
+
statusCode: "number",
|
|
2829
|
+
body: DescribeContextFilesResponseBody
|
|
2830
|
+
};
|
|
2831
|
+
}
|
|
2832
|
+
validate() {
|
|
2833
|
+
super.validate();
|
|
2834
|
+
}
|
|
2835
|
+
constructor(map) {
|
|
2836
|
+
super(map);
|
|
2837
|
+
}
|
|
2838
|
+
};
|
|
2839
|
+
__name(_DescribeContextFilesResponse, "DescribeContextFilesResponse");
|
|
2840
|
+
var DescribeContextFilesResponse = _DescribeContextFilesResponse;
|
|
2841
|
+
|
|
2842
|
+
// src/api/models/GetContextFileDownloadUrlRequest.ts
|
|
2843
|
+
init_esm_shims();
|
|
2844
|
+
import * as $dara71 from "@darabonba/typescript";
|
|
2845
|
+
var _GetContextFileDownloadUrlRequest = class _GetContextFileDownloadUrlRequest extends $dara71.Model {
|
|
2846
|
+
static names() {
|
|
2847
|
+
return {
|
|
2848
|
+
authorization: "Authorization",
|
|
2849
|
+
contextId: "ContextId",
|
|
2850
|
+
filePath: "FilePath"
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
static types() {
|
|
2854
|
+
return {
|
|
2855
|
+
authorization: "string",
|
|
2856
|
+
contextId: "string",
|
|
2857
|
+
filePath: "string"
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2860
|
+
validate() {
|
|
2861
|
+
super.validate();
|
|
2862
|
+
}
|
|
2863
|
+
constructor(map) {
|
|
2864
|
+
super(map);
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
__name(_GetContextFileDownloadUrlRequest, "GetContextFileDownloadUrlRequest");
|
|
2868
|
+
var GetContextFileDownloadUrlRequest = _GetContextFileDownloadUrlRequest;
|
|
2869
|
+
|
|
2870
|
+
// src/api/models/GetContextFileDownloadUrlResponseBody.ts
|
|
2871
|
+
init_esm_shims();
|
|
2872
|
+
import * as $dara72 from "@darabonba/typescript";
|
|
2873
|
+
var _GetContextFileDownloadUrlResponseBodyData = class _GetContextFileDownloadUrlResponseBodyData extends $dara72.Model {
|
|
2874
|
+
static names() {
|
|
2875
|
+
return {
|
|
2876
|
+
expireTime: "ExpireTime",
|
|
2877
|
+
url: "Url"
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
static types() {
|
|
2881
|
+
return {
|
|
2882
|
+
expireTime: "number",
|
|
2883
|
+
url: "string"
|
|
2884
|
+
};
|
|
2885
|
+
}
|
|
2886
|
+
validate() {
|
|
2887
|
+
super.validate();
|
|
2888
|
+
}
|
|
2889
|
+
constructor(map) {
|
|
2890
|
+
super(map);
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
__name(_GetContextFileDownloadUrlResponseBodyData, "GetContextFileDownloadUrlResponseBodyData");
|
|
2894
|
+
var GetContextFileDownloadUrlResponseBodyData = _GetContextFileDownloadUrlResponseBodyData;
|
|
2895
|
+
var _GetContextFileDownloadUrlResponseBody = class _GetContextFileDownloadUrlResponseBody extends $dara72.Model {
|
|
2896
|
+
static names() {
|
|
2897
|
+
return {
|
|
2898
|
+
code: "Code",
|
|
2899
|
+
data: "Data",
|
|
2900
|
+
httpStatusCode: "HttpStatusCode",
|
|
2901
|
+
message: "Message",
|
|
2902
|
+
requestId: "RequestId",
|
|
2903
|
+
success: "Success"
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2906
|
+
static types() {
|
|
2907
|
+
return {
|
|
2908
|
+
code: "string",
|
|
2909
|
+
data: GetContextFileDownloadUrlResponseBodyData,
|
|
2910
|
+
httpStatusCode: "number",
|
|
2911
|
+
message: "string",
|
|
2912
|
+
requestId: "string",
|
|
2913
|
+
success: "boolean"
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
validate() {
|
|
2917
|
+
super.validate();
|
|
2918
|
+
}
|
|
2919
|
+
constructor(map) {
|
|
2920
|
+
super(map);
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
__name(_GetContextFileDownloadUrlResponseBody, "GetContextFileDownloadUrlResponseBody");
|
|
2924
|
+
var GetContextFileDownloadUrlResponseBody = _GetContextFileDownloadUrlResponseBody;
|
|
2925
|
+
|
|
2926
|
+
// src/api/models/GetContextFileDownloadUrlResponse.ts
|
|
2927
|
+
init_esm_shims();
|
|
2928
|
+
import * as $dara73 from "@darabonba/typescript";
|
|
2929
|
+
var _GetContextFileDownloadUrlResponse = class _GetContextFileDownloadUrlResponse extends $dara73.Model {
|
|
2930
|
+
static names() {
|
|
2931
|
+
return {
|
|
2932
|
+
headers: "headers",
|
|
2933
|
+
statusCode: "statusCode",
|
|
2934
|
+
body: "body"
|
|
2935
|
+
};
|
|
2936
|
+
}
|
|
2937
|
+
static types() {
|
|
2938
|
+
return {
|
|
2939
|
+
headers: { type: "map", keyType: "string", valueType: "string" },
|
|
2940
|
+
statusCode: "number",
|
|
2941
|
+
body: GetContextFileDownloadUrlResponseBody
|
|
2942
|
+
};
|
|
2943
|
+
}
|
|
2944
|
+
validate() {
|
|
2945
|
+
super.validate();
|
|
2946
|
+
}
|
|
2947
|
+
constructor(map) {
|
|
2948
|
+
super(map);
|
|
2949
|
+
}
|
|
2950
|
+
};
|
|
2951
|
+
__name(_GetContextFileDownloadUrlResponse, "GetContextFileDownloadUrlResponse");
|
|
2952
|
+
var GetContextFileDownloadUrlResponse = _GetContextFileDownloadUrlResponse;
|
|
2953
|
+
|
|
2954
|
+
// src/api/models/GetContextFileUploadUrlRequest.ts
|
|
2955
|
+
init_esm_shims();
|
|
2956
|
+
import * as $dara74 from "@darabonba/typescript";
|
|
2957
|
+
var _GetContextFileUploadUrlRequest = class _GetContextFileUploadUrlRequest extends $dara74.Model {
|
|
2958
|
+
static names() {
|
|
2959
|
+
return {
|
|
2960
|
+
authorization: "Authorization",
|
|
2961
|
+
contextId: "ContextId",
|
|
2962
|
+
filePath: "FilePath"
|
|
2963
|
+
};
|
|
2964
|
+
}
|
|
2965
|
+
static types() {
|
|
2966
|
+
return {
|
|
2967
|
+
authorization: "string",
|
|
2968
|
+
contextId: "string",
|
|
2969
|
+
filePath: "string"
|
|
2970
|
+
};
|
|
2971
|
+
}
|
|
2972
|
+
validate() {
|
|
2973
|
+
super.validate();
|
|
2974
|
+
}
|
|
2975
|
+
constructor(map) {
|
|
2976
|
+
super(map);
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
__name(_GetContextFileUploadUrlRequest, "GetContextFileUploadUrlRequest");
|
|
2980
|
+
var GetContextFileUploadUrlRequest = _GetContextFileUploadUrlRequest;
|
|
2981
|
+
|
|
2982
|
+
// src/api/models/GetContextFileUploadUrlResponseBody.ts
|
|
2983
|
+
init_esm_shims();
|
|
2984
|
+
import * as $dara75 from "@darabonba/typescript";
|
|
2985
|
+
var _GetContextFileUploadUrlResponseBodyData = class _GetContextFileUploadUrlResponseBodyData extends $dara75.Model {
|
|
2986
|
+
static names() {
|
|
2987
|
+
return {
|
|
2988
|
+
expireTime: "ExpireTime",
|
|
2989
|
+
url: "Url"
|
|
2990
|
+
};
|
|
2991
|
+
}
|
|
2992
|
+
static types() {
|
|
2993
|
+
return {
|
|
2994
|
+
expireTime: "number",
|
|
2995
|
+
url: "string"
|
|
2996
|
+
};
|
|
2997
|
+
}
|
|
2998
|
+
validate() {
|
|
2999
|
+
super.validate();
|
|
3000
|
+
}
|
|
3001
|
+
constructor(map) {
|
|
3002
|
+
super(map);
|
|
3003
|
+
}
|
|
3004
|
+
};
|
|
3005
|
+
__name(_GetContextFileUploadUrlResponseBodyData, "GetContextFileUploadUrlResponseBodyData");
|
|
3006
|
+
var GetContextFileUploadUrlResponseBodyData = _GetContextFileUploadUrlResponseBodyData;
|
|
3007
|
+
var _GetContextFileUploadUrlResponseBody = class _GetContextFileUploadUrlResponseBody extends $dara75.Model {
|
|
2556
3008
|
static names() {
|
|
2557
3009
|
return {
|
|
2558
3010
|
code: "Code",
|
|
3011
|
+
data: "Data",
|
|
2559
3012
|
httpStatusCode: "HttpStatusCode",
|
|
2560
3013
|
message: "Message",
|
|
2561
3014
|
requestId: "RequestId",
|
|
@@ -2565,6 +3018,7 @@ var _SyncContextResponseBody = class _SyncContextResponseBody extends $dara63.Mo
|
|
|
2565
3018
|
static types() {
|
|
2566
3019
|
return {
|
|
2567
3020
|
code: "string",
|
|
3021
|
+
data: GetContextFileUploadUrlResponseBodyData,
|
|
2568
3022
|
httpStatusCode: "number",
|
|
2569
3023
|
message: "string",
|
|
2570
3024
|
requestId: "string",
|
|
@@ -2578,13 +3032,13 @@ var _SyncContextResponseBody = class _SyncContextResponseBody extends $dara63.Mo
|
|
|
2578
3032
|
super(map);
|
|
2579
3033
|
}
|
|
2580
3034
|
};
|
|
2581
|
-
__name(
|
|
2582
|
-
var
|
|
3035
|
+
__name(_GetContextFileUploadUrlResponseBody, "GetContextFileUploadUrlResponseBody");
|
|
3036
|
+
var GetContextFileUploadUrlResponseBody = _GetContextFileUploadUrlResponseBody;
|
|
2583
3037
|
|
|
2584
|
-
// src/api/models/
|
|
3038
|
+
// src/api/models/GetContextFileUploadUrlResponse.ts
|
|
2585
3039
|
init_esm_shims();
|
|
2586
|
-
import * as $
|
|
2587
|
-
var
|
|
3040
|
+
import * as $dara76 from "@darabonba/typescript";
|
|
3041
|
+
var _GetContextFileUploadUrlResponse = class _GetContextFileUploadUrlResponse extends $dara76.Model {
|
|
2588
3042
|
static names() {
|
|
2589
3043
|
return {
|
|
2590
3044
|
headers: "headers",
|
|
@@ -2594,26 +3048,20 @@ var _SyncContextResponse = class _SyncContextResponse extends $dara64.Model {
|
|
|
2594
3048
|
}
|
|
2595
3049
|
static types() {
|
|
2596
3050
|
return {
|
|
2597
|
-
headers: {
|
|
3051
|
+
headers: { type: "map", keyType: "string", valueType: "string" },
|
|
2598
3052
|
statusCode: "number",
|
|
2599
|
-
body:
|
|
3053
|
+
body: GetContextFileUploadUrlResponseBody
|
|
2600
3054
|
};
|
|
2601
3055
|
}
|
|
2602
3056
|
validate() {
|
|
2603
|
-
if (this.headers) {
|
|
2604
|
-
$dara64.Model.validateMap(this.headers);
|
|
2605
|
-
}
|
|
2606
|
-
if (this.body && typeof this.body.validate === "function") {
|
|
2607
|
-
this.body.validate();
|
|
2608
|
-
}
|
|
2609
3057
|
super.validate();
|
|
2610
3058
|
}
|
|
2611
3059
|
constructor(map) {
|
|
2612
3060
|
super(map);
|
|
2613
3061
|
}
|
|
2614
3062
|
};
|
|
2615
|
-
__name(
|
|
2616
|
-
var
|
|
3063
|
+
__name(_GetContextFileUploadUrlResponse, "GetContextFileUploadUrlResponse");
|
|
3064
|
+
var GetContextFileUploadUrlResponse = _GetContextFileUploadUrlResponse;
|
|
2617
3065
|
|
|
2618
3066
|
// src/api/client.ts
|
|
2619
3067
|
var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
@@ -2633,10 +3081,10 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2633
3081
|
);
|
|
2634
3082
|
}
|
|
2635
3083
|
getEndpoint(productId, regionId, endpointRule, network, suffix, endpointMap, endpoint) {
|
|
2636
|
-
if (!$
|
|
3084
|
+
if (!$dara77.isNull(endpoint)) {
|
|
2637
3085
|
return endpoint;
|
|
2638
3086
|
}
|
|
2639
|
-
if (!$
|
|
3087
|
+
if (!$dara77.isNull(endpointMap) && !$dara77.isNull(endpointMap[regionId])) {
|
|
2640
3088
|
return endpointMap[regionId];
|
|
2641
3089
|
}
|
|
2642
3090
|
return OpenApiUtil.getEndpointRules(
|
|
@@ -2657,28 +3105,28 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2657
3105
|
async callMcpToolWithOptions(request, runtime) {
|
|
2658
3106
|
request.validate();
|
|
2659
3107
|
const body = {};
|
|
2660
|
-
if (!$
|
|
3108
|
+
if (!$dara77.isNull(request.args)) {
|
|
2661
3109
|
body["Args"] = request.args;
|
|
2662
3110
|
}
|
|
2663
|
-
if (!$
|
|
3111
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2664
3112
|
body["Authorization"] = request.authorization;
|
|
2665
3113
|
}
|
|
2666
|
-
if (!$
|
|
3114
|
+
if (!$dara77.isNull(request.externalUserId)) {
|
|
2667
3115
|
body["ExternalUserId"] = request.externalUserId;
|
|
2668
3116
|
}
|
|
2669
|
-
if (!$
|
|
3117
|
+
if (!$dara77.isNull(request.imageId)) {
|
|
2670
3118
|
body["ImageId"] = request.imageId;
|
|
2671
3119
|
}
|
|
2672
|
-
if (!$
|
|
3120
|
+
if (!$dara77.isNull(request.name)) {
|
|
2673
3121
|
body["Name"] = request.name;
|
|
2674
3122
|
}
|
|
2675
|
-
if (!$
|
|
3123
|
+
if (!$dara77.isNull(request.server)) {
|
|
2676
3124
|
body["Server"] = request.server;
|
|
2677
3125
|
}
|
|
2678
|
-
if (!$
|
|
3126
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
2679
3127
|
body["SessionId"] = request.sessionId;
|
|
2680
3128
|
}
|
|
2681
|
-
if (!$
|
|
3129
|
+
if (!$dara77.isNull(request.tool)) {
|
|
2682
3130
|
body["Tool"] = request.tool;
|
|
2683
3131
|
}
|
|
2684
3132
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2695,7 +3143,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2695
3143
|
reqBodyType: "formData",
|
|
2696
3144
|
bodyType: "json"
|
|
2697
3145
|
});
|
|
2698
|
-
return $
|
|
3146
|
+
return $dara77.cast(
|
|
2699
3147
|
await this.callApi(params, req, runtime),
|
|
2700
3148
|
new CallMcpToolResponse({})
|
|
2701
3149
|
);
|
|
@@ -2707,7 +3155,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2707
3155
|
* @returns CallMcpToolResponse
|
|
2708
3156
|
*/
|
|
2709
3157
|
async callMcpTool(request) {
|
|
2710
|
-
const runtime = new $
|
|
3158
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2711
3159
|
return await this.callMcpToolWithOptions(request, runtime);
|
|
2712
3160
|
}
|
|
2713
3161
|
/**
|
|
@@ -2721,7 +3169,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2721
3169
|
tmpReq.validate();
|
|
2722
3170
|
const request = new CreateMcpSessionShrinkRequest({});
|
|
2723
3171
|
OpenApiUtil.convert(tmpReq, request);
|
|
2724
|
-
if (!$
|
|
3172
|
+
if (!$dara77.isNull(tmpReq.persistenceDataList)) {
|
|
2725
3173
|
request.persistenceDataListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(
|
|
2726
3174
|
tmpReq.persistenceDataList,
|
|
2727
3175
|
"PersistenceDataList",
|
|
@@ -2729,28 +3177,31 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2729
3177
|
);
|
|
2730
3178
|
}
|
|
2731
3179
|
const body = {};
|
|
2732
|
-
if (!$
|
|
3180
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2733
3181
|
body["Authorization"] = request.authorization;
|
|
2734
3182
|
}
|
|
2735
|
-
if (!$
|
|
3183
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
2736
3184
|
body["ContextId"] = request.contextId;
|
|
2737
3185
|
}
|
|
2738
|
-
if (!$
|
|
3186
|
+
if (!$dara77.isNull(request.externalUserId)) {
|
|
2739
3187
|
body["ExternalUserId"] = request.externalUserId;
|
|
2740
3188
|
}
|
|
2741
|
-
if (!$
|
|
3189
|
+
if (!$dara77.isNull(request.imageId)) {
|
|
2742
3190
|
body["ImageId"] = request.imageId;
|
|
2743
3191
|
}
|
|
2744
|
-
if (!$
|
|
3192
|
+
if (!$dara77.isNull(request.labels)) {
|
|
2745
3193
|
body["Labels"] = request.labels;
|
|
2746
3194
|
}
|
|
2747
|
-
if (!$
|
|
3195
|
+
if (!$dara77.isNull(request.mcpPolicyId)) {
|
|
3196
|
+
body["McpPolicyId"] = request.mcpPolicyId;
|
|
3197
|
+
}
|
|
3198
|
+
if (!$dara77.isNull(request.persistenceDataListShrink)) {
|
|
2748
3199
|
body["PersistenceDataList"] = request.persistenceDataListShrink;
|
|
2749
3200
|
}
|
|
2750
|
-
if (!$
|
|
3201
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
2751
3202
|
body["SessionId"] = request.sessionId;
|
|
2752
3203
|
}
|
|
2753
|
-
if (!$
|
|
3204
|
+
if (!$dara77.isNull(request.vpcResource)) {
|
|
2754
3205
|
body["VpcResource"] = request.vpcResource;
|
|
2755
3206
|
}
|
|
2756
3207
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2767,7 +3218,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2767
3218
|
reqBodyType: "formData",
|
|
2768
3219
|
bodyType: "json"
|
|
2769
3220
|
});
|
|
2770
|
-
return $
|
|
3221
|
+
return $dara77.cast(
|
|
2771
3222
|
await this.callApi(params, req, runtime),
|
|
2772
3223
|
new CreateMcpSessionResponse({})
|
|
2773
3224
|
);
|
|
@@ -2779,7 +3230,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2779
3230
|
* @returns CreateMcpSessionResponse
|
|
2780
3231
|
*/
|
|
2781
3232
|
async createMcpSession(request) {
|
|
2782
|
-
const runtime = new $
|
|
3233
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2783
3234
|
return await this.createMcpSessionWithOptions(request, runtime);
|
|
2784
3235
|
}
|
|
2785
3236
|
/**
|
|
@@ -2792,10 +3243,10 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2792
3243
|
async deleteContextWithOptions(request, runtime) {
|
|
2793
3244
|
request.validate();
|
|
2794
3245
|
const body = {};
|
|
2795
|
-
if (!$
|
|
3246
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2796
3247
|
body["Authorization"] = request.authorization;
|
|
2797
3248
|
}
|
|
2798
|
-
if (!$
|
|
3249
|
+
if (!$dara77.isNull(request.id)) {
|
|
2799
3250
|
body["Id"] = request.id;
|
|
2800
3251
|
}
|
|
2801
3252
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2812,7 +3263,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2812
3263
|
reqBodyType: "formData",
|
|
2813
3264
|
bodyType: "json"
|
|
2814
3265
|
});
|
|
2815
|
-
return $
|
|
3266
|
+
return $dara77.cast(
|
|
2816
3267
|
await this.callApi(params, req, runtime),
|
|
2817
3268
|
new DeleteContextResponse({})
|
|
2818
3269
|
);
|
|
@@ -2824,7 +3275,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2824
3275
|
* @returns DeleteContextResponse
|
|
2825
3276
|
*/
|
|
2826
3277
|
async deleteContext(request) {
|
|
2827
|
-
const runtime = new $
|
|
3278
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2828
3279
|
return await this.deleteContextWithOptions(request, runtime);
|
|
2829
3280
|
}
|
|
2830
3281
|
/**
|
|
@@ -2837,13 +3288,13 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2837
3288
|
async getContextWithOptions(request, runtime) {
|
|
2838
3289
|
request.validate();
|
|
2839
3290
|
const body = {};
|
|
2840
|
-
if (!$
|
|
3291
|
+
if (!$dara77.isNull(request.allowCreate)) {
|
|
2841
3292
|
body["AllowCreate"] = request.allowCreate;
|
|
2842
3293
|
}
|
|
2843
|
-
if (!$
|
|
3294
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2844
3295
|
body["Authorization"] = request.authorization;
|
|
2845
3296
|
}
|
|
2846
|
-
if (!$
|
|
3297
|
+
if (!$dara77.isNull(request.name)) {
|
|
2847
3298
|
body["Name"] = request.name;
|
|
2848
3299
|
}
|
|
2849
3300
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2860,7 +3311,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2860
3311
|
reqBodyType: "formData",
|
|
2861
3312
|
bodyType: "json"
|
|
2862
3313
|
});
|
|
2863
|
-
return $
|
|
3314
|
+
return $dara77.cast(
|
|
2864
3315
|
await this.callApi(params, req, runtime),
|
|
2865
3316
|
new GetContextResponse({})
|
|
2866
3317
|
);
|
|
@@ -2872,7 +3323,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2872
3323
|
* @returns GetContextResponse
|
|
2873
3324
|
*/
|
|
2874
3325
|
async getContext(request) {
|
|
2875
|
-
const runtime = new $
|
|
3326
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2876
3327
|
return await this.getContextWithOptions(request, runtime);
|
|
2877
3328
|
}
|
|
2878
3329
|
/**
|
|
@@ -2885,19 +3336,19 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2885
3336
|
async getContextInfoWithOptions(request, runtime) {
|
|
2886
3337
|
request.validate();
|
|
2887
3338
|
const body = {};
|
|
2888
|
-
if (!$
|
|
3339
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2889
3340
|
body["Authorization"] = request.authorization;
|
|
2890
3341
|
}
|
|
2891
|
-
if (!$
|
|
3342
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
2892
3343
|
body["ContextId"] = request.contextId;
|
|
2893
3344
|
}
|
|
2894
|
-
if (!$
|
|
3345
|
+
if (!$dara77.isNull(request.path)) {
|
|
2895
3346
|
body["Path"] = request.path;
|
|
2896
3347
|
}
|
|
2897
|
-
if (!$
|
|
3348
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
2898
3349
|
body["SessionId"] = request.sessionId;
|
|
2899
3350
|
}
|
|
2900
|
-
if (!$
|
|
3351
|
+
if (!$dara77.isNull(request.taskType)) {
|
|
2901
3352
|
body["TaskType"] = request.taskType;
|
|
2902
3353
|
}
|
|
2903
3354
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2914,7 +3365,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2914
3365
|
reqBodyType: "formData",
|
|
2915
3366
|
bodyType: "json"
|
|
2916
3367
|
});
|
|
2917
|
-
return $
|
|
3368
|
+
return $dara77.cast(
|
|
2918
3369
|
await this.callApi(params, req, runtime),
|
|
2919
3370
|
new GetContextInfoResponse({})
|
|
2920
3371
|
);
|
|
@@ -2926,7 +3377,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2926
3377
|
* @returns GetContextInfoResponse
|
|
2927
3378
|
*/
|
|
2928
3379
|
async getContextInfo(request) {
|
|
2929
|
-
const runtime = new $
|
|
3380
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2930
3381
|
return await this.getContextInfoWithOptions(request, runtime);
|
|
2931
3382
|
}
|
|
2932
3383
|
/**
|
|
@@ -2939,16 +3390,16 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2939
3390
|
async getLabelWithOptions(request, runtime) {
|
|
2940
3391
|
request.validate();
|
|
2941
3392
|
const body = {};
|
|
2942
|
-
if (!$
|
|
3393
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2943
3394
|
body["Authorization"] = request.authorization;
|
|
2944
3395
|
}
|
|
2945
|
-
if (!$
|
|
3396
|
+
if (!$dara77.isNull(request.maxResults)) {
|
|
2946
3397
|
body["MaxResults"] = request.maxResults;
|
|
2947
3398
|
}
|
|
2948
|
-
if (!$
|
|
3399
|
+
if (!$dara77.isNull(request.nextToken)) {
|
|
2949
3400
|
body["NextToken"] = request.nextToken;
|
|
2950
3401
|
}
|
|
2951
|
-
if (!$
|
|
3402
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
2952
3403
|
body["SessionId"] = request.sessionId;
|
|
2953
3404
|
}
|
|
2954
3405
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -2965,7 +3416,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2965
3416
|
reqBodyType: "formData",
|
|
2966
3417
|
bodyType: "json"
|
|
2967
3418
|
});
|
|
2968
|
-
return $
|
|
3419
|
+
return $dara77.cast(
|
|
2969
3420
|
await this.callApi(params, req, runtime),
|
|
2970
3421
|
new GetLabelResponse({})
|
|
2971
3422
|
);
|
|
@@ -2977,7 +3428,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2977
3428
|
* @returns GetLabelResponse
|
|
2978
3429
|
*/
|
|
2979
3430
|
async getLabel(request) {
|
|
2980
|
-
const runtime = new $
|
|
3431
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
2981
3432
|
return await this.getLabelWithOptions(request, runtime);
|
|
2982
3433
|
}
|
|
2983
3434
|
/**
|
|
@@ -2990,16 +3441,16 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
2990
3441
|
async getLinkWithOptions(request, runtime) {
|
|
2991
3442
|
request.validate();
|
|
2992
3443
|
const body = {};
|
|
2993
|
-
if (!$
|
|
3444
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
2994
3445
|
body["Authorization"] = request.authorization;
|
|
2995
3446
|
}
|
|
2996
|
-
if (!$
|
|
3447
|
+
if (!$dara77.isNull(request.port)) {
|
|
2997
3448
|
body["Port"] = request.port;
|
|
2998
3449
|
}
|
|
2999
|
-
if (!$
|
|
3450
|
+
if (!$dara77.isNull(request.protocolType)) {
|
|
3000
3451
|
body["ProtocolType"] = request.protocolType;
|
|
3001
3452
|
}
|
|
3002
|
-
if (!$
|
|
3453
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3003
3454
|
body["SessionId"] = request.sessionId;
|
|
3004
3455
|
}
|
|
3005
3456
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3016,7 +3467,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3016
3467
|
reqBodyType: "formData",
|
|
3017
3468
|
bodyType: "json"
|
|
3018
3469
|
});
|
|
3019
|
-
return $
|
|
3470
|
+
return $dara77.cast(
|
|
3020
3471
|
await this.callApi(params, req, runtime),
|
|
3021
3472
|
new GetLinkResponse({})
|
|
3022
3473
|
);
|
|
@@ -3028,7 +3479,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3028
3479
|
* @returns GetLinkResponse
|
|
3029
3480
|
*/
|
|
3030
3481
|
async getLink(request) {
|
|
3031
|
-
const runtime = new $
|
|
3482
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3032
3483
|
return await this.getLinkWithOptions(request, runtime);
|
|
3033
3484
|
}
|
|
3034
3485
|
/**
|
|
@@ -3041,10 +3492,10 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3041
3492
|
async getMcpResourceWithOptions(request, runtime) {
|
|
3042
3493
|
request.validate();
|
|
3043
3494
|
const body = {};
|
|
3044
|
-
if (!$
|
|
3495
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3045
3496
|
body["Authorization"] = request.authorization;
|
|
3046
3497
|
}
|
|
3047
|
-
if (!$
|
|
3498
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3048
3499
|
body["SessionId"] = request.sessionId;
|
|
3049
3500
|
}
|
|
3050
3501
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3061,7 +3512,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3061
3512
|
reqBodyType: "formData",
|
|
3062
3513
|
bodyType: "json"
|
|
3063
3514
|
});
|
|
3064
|
-
return $
|
|
3515
|
+
return $dara77.cast(
|
|
3065
3516
|
await this.callApi(params, req, runtime),
|
|
3066
3517
|
new GetMcpResourceResponse({})
|
|
3067
3518
|
);
|
|
@@ -3073,7 +3524,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3073
3524
|
* @returns GetMcpResourceResponse
|
|
3074
3525
|
*/
|
|
3075
3526
|
async getMcpResource(request) {
|
|
3076
|
-
const runtime = new $
|
|
3527
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3077
3528
|
return await this.getMcpResourceWithOptions(request, runtime);
|
|
3078
3529
|
}
|
|
3079
3530
|
/**
|
|
@@ -3086,13 +3537,13 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3086
3537
|
async listContextsWithOptions(request, runtime) {
|
|
3087
3538
|
request.validate();
|
|
3088
3539
|
const body = {};
|
|
3089
|
-
if (!$
|
|
3540
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3090
3541
|
body["Authorization"] = request.authorization;
|
|
3091
3542
|
}
|
|
3092
|
-
if (!$
|
|
3543
|
+
if (!$dara77.isNull(request.maxResults)) {
|
|
3093
3544
|
body["MaxResults"] = request.maxResults;
|
|
3094
3545
|
}
|
|
3095
|
-
if (!$
|
|
3546
|
+
if (!$dara77.isNull(request.nextToken)) {
|
|
3096
3547
|
body["NextToken"] = request.nextToken;
|
|
3097
3548
|
}
|
|
3098
3549
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3109,7 +3560,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3109
3560
|
reqBodyType: "formData",
|
|
3110
3561
|
bodyType: "json"
|
|
3111
3562
|
});
|
|
3112
|
-
return $
|
|
3563
|
+
return $dara77.cast(
|
|
3113
3564
|
await this.callApi(params, req, runtime),
|
|
3114
3565
|
new ListContextsResponse({})
|
|
3115
3566
|
);
|
|
@@ -3121,7 +3572,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3121
3572
|
* @returns ListContextsResponse
|
|
3122
3573
|
*/
|
|
3123
3574
|
async listContexts(request) {
|
|
3124
|
-
const runtime = new $
|
|
3575
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3125
3576
|
return await this.listContextsWithOptions(request, runtime);
|
|
3126
3577
|
}
|
|
3127
3578
|
/**
|
|
@@ -3134,10 +3585,10 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3134
3585
|
async listMcpToolsWithOptions(request, runtime) {
|
|
3135
3586
|
request.validate();
|
|
3136
3587
|
const body = {};
|
|
3137
|
-
if (!$
|
|
3588
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3138
3589
|
body["Authorization"] = request.authorization;
|
|
3139
3590
|
}
|
|
3140
|
-
if (!$
|
|
3591
|
+
if (!$dara77.isNull(request.imageId)) {
|
|
3141
3592
|
body["ImageId"] = request.imageId;
|
|
3142
3593
|
}
|
|
3143
3594
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3154,7 +3605,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3154
3605
|
reqBodyType: "formData",
|
|
3155
3606
|
bodyType: "json"
|
|
3156
3607
|
});
|
|
3157
|
-
return $
|
|
3608
|
+
return $dara77.cast(
|
|
3158
3609
|
await this.callApi(params, req, runtime),
|
|
3159
3610
|
new ListMcpToolsResponse({})
|
|
3160
3611
|
);
|
|
@@ -3166,7 +3617,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3166
3617
|
* @returns ListMcpToolsResponse
|
|
3167
3618
|
*/
|
|
3168
3619
|
async listMcpTools(request) {
|
|
3169
|
-
const runtime = new $
|
|
3620
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3170
3621
|
return await this.listMcpToolsWithOptions(request, runtime);
|
|
3171
3622
|
}
|
|
3172
3623
|
/**
|
|
@@ -3179,16 +3630,16 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3179
3630
|
async listSessionWithOptions(request, runtime) {
|
|
3180
3631
|
request.validate();
|
|
3181
3632
|
const body = {};
|
|
3182
|
-
if (!$
|
|
3633
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3183
3634
|
body["Authorization"] = request.authorization;
|
|
3184
3635
|
}
|
|
3185
|
-
if (!$
|
|
3636
|
+
if (!$dara77.isNull(request.labels)) {
|
|
3186
3637
|
body["Labels"] = request.labels;
|
|
3187
3638
|
}
|
|
3188
|
-
if (!$
|
|
3639
|
+
if (!$dara77.isNull(request.maxResults)) {
|
|
3189
3640
|
body["MaxResults"] = request.maxResults;
|
|
3190
3641
|
}
|
|
3191
|
-
if (!$
|
|
3642
|
+
if (!$dara77.isNull(request.nextToken)) {
|
|
3192
3643
|
body["NextToken"] = request.nextToken;
|
|
3193
3644
|
}
|
|
3194
3645
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3205,7 +3656,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3205
3656
|
reqBodyType: "formData",
|
|
3206
3657
|
bodyType: "json"
|
|
3207
3658
|
});
|
|
3208
|
-
return $
|
|
3659
|
+
return $dara77.cast(
|
|
3209
3660
|
await this.callApi(params, req, runtime),
|
|
3210
3661
|
new ListSessionResponse({})
|
|
3211
3662
|
);
|
|
@@ -3217,7 +3668,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3217
3668
|
* @returns ListSessionResponse
|
|
3218
3669
|
*/
|
|
3219
3670
|
async listSession(request) {
|
|
3220
|
-
const runtime = new $
|
|
3671
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3221
3672
|
return await this.listSessionWithOptions(request, runtime);
|
|
3222
3673
|
}
|
|
3223
3674
|
/**
|
|
@@ -3230,13 +3681,13 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3230
3681
|
async modifyContextWithOptions(request, runtime) {
|
|
3231
3682
|
request.validate();
|
|
3232
3683
|
const body = {};
|
|
3233
|
-
if (!$
|
|
3684
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3234
3685
|
body["Authorization"] = request.authorization;
|
|
3235
3686
|
}
|
|
3236
|
-
if (!$
|
|
3687
|
+
if (!$dara77.isNull(request.id)) {
|
|
3237
3688
|
body["Id"] = request.id;
|
|
3238
3689
|
}
|
|
3239
|
-
if (!$
|
|
3690
|
+
if (!$dara77.isNull(request.name)) {
|
|
3240
3691
|
body["Name"] = request.name;
|
|
3241
3692
|
}
|
|
3242
3693
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3253,7 +3704,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3253
3704
|
reqBodyType: "formData",
|
|
3254
3705
|
bodyType: "json"
|
|
3255
3706
|
});
|
|
3256
|
-
return $
|
|
3707
|
+
return $dara77.cast(
|
|
3257
3708
|
await this.callApi(params, req, runtime),
|
|
3258
3709
|
new ModifyContextResponse({})
|
|
3259
3710
|
);
|
|
@@ -3265,7 +3716,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3265
3716
|
* @returns ModifyContextResponse
|
|
3266
3717
|
*/
|
|
3267
3718
|
async modifyContext(request) {
|
|
3268
|
-
const runtime = new $
|
|
3719
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3269
3720
|
return await this.modifyContextWithOptions(request, runtime);
|
|
3270
3721
|
}
|
|
3271
3722
|
/**
|
|
@@ -3278,10 +3729,10 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3278
3729
|
async releaseMcpSessionWithOptions(request, runtime) {
|
|
3279
3730
|
request.validate();
|
|
3280
3731
|
const body = {};
|
|
3281
|
-
if (!$
|
|
3732
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3282
3733
|
body["Authorization"] = request.authorization;
|
|
3283
3734
|
}
|
|
3284
|
-
if (!$
|
|
3735
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3285
3736
|
body["SessionId"] = request.sessionId;
|
|
3286
3737
|
}
|
|
3287
3738
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3298,7 +3749,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3298
3749
|
reqBodyType: "formData",
|
|
3299
3750
|
bodyType: "json"
|
|
3300
3751
|
});
|
|
3301
|
-
return $
|
|
3752
|
+
return $dara77.cast(
|
|
3302
3753
|
await this.callApi(params, req, runtime),
|
|
3303
3754
|
new ReleaseMcpSessionResponse({})
|
|
3304
3755
|
);
|
|
@@ -3310,7 +3761,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3310
3761
|
* @returns ReleaseMcpSessionResponse
|
|
3311
3762
|
*/
|
|
3312
3763
|
async releaseMcpSession(request) {
|
|
3313
|
-
const runtime = new $
|
|
3764
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3314
3765
|
return await this.releaseMcpSessionWithOptions(request, runtime);
|
|
3315
3766
|
}
|
|
3316
3767
|
/**
|
|
@@ -3323,13 +3774,13 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3323
3774
|
async setLabelWithOptions(request, runtime) {
|
|
3324
3775
|
request.validate();
|
|
3325
3776
|
const body = {};
|
|
3326
|
-
if (!$
|
|
3777
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3327
3778
|
body["Authorization"] = request.authorization;
|
|
3328
3779
|
}
|
|
3329
|
-
if (!$
|
|
3780
|
+
if (!$dara77.isNull(request.labels)) {
|
|
3330
3781
|
body["Labels"] = request.labels;
|
|
3331
3782
|
}
|
|
3332
|
-
if (!$
|
|
3783
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3333
3784
|
body["SessionId"] = request.sessionId;
|
|
3334
3785
|
}
|
|
3335
3786
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3346,7 +3797,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3346
3797
|
reqBodyType: "formData",
|
|
3347
3798
|
bodyType: "json"
|
|
3348
3799
|
});
|
|
3349
|
-
return $
|
|
3800
|
+
return $dara77.cast(
|
|
3350
3801
|
await this.callApi(params, req, runtime),
|
|
3351
3802
|
new SetLabelResponse({})
|
|
3352
3803
|
);
|
|
@@ -3358,7 +3809,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3358
3809
|
* @returns SetLabelResponse
|
|
3359
3810
|
*/
|
|
3360
3811
|
async setLabel(request) {
|
|
3361
|
-
const runtime = new $
|
|
3812
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3362
3813
|
return await this.setLabelWithOptions(request, runtime);
|
|
3363
3814
|
}
|
|
3364
3815
|
/**
|
|
@@ -3371,20 +3822,20 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3371
3822
|
async syncContextWithOptions(request, runtime) {
|
|
3372
3823
|
request.validate();
|
|
3373
3824
|
const query = {};
|
|
3374
|
-
if (!$
|
|
3825
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3375
3826
|
query["Authorization"] = request.authorization;
|
|
3376
3827
|
}
|
|
3377
3828
|
const body = {};
|
|
3378
|
-
if (!$
|
|
3829
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
3379
3830
|
body["ContextId"] = request.contextId;
|
|
3380
3831
|
}
|
|
3381
|
-
if (!$
|
|
3832
|
+
if (!$dara77.isNull(request.mode)) {
|
|
3382
3833
|
body["Mode"] = request.mode;
|
|
3383
3834
|
}
|
|
3384
|
-
if (!$
|
|
3835
|
+
if (!$dara77.isNull(request.path)) {
|
|
3385
3836
|
body["Path"] = request.path;
|
|
3386
3837
|
}
|
|
3387
|
-
if (!$
|
|
3838
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3388
3839
|
body["SessionId"] = request.sessionId;
|
|
3389
3840
|
}
|
|
3390
3841
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
@@ -3402,7 +3853,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3402
3853
|
reqBodyType: "formData",
|
|
3403
3854
|
bodyType: "json"
|
|
3404
3855
|
});
|
|
3405
|
-
return $
|
|
3856
|
+
return $dara77.cast(
|
|
3406
3857
|
await this.callApi(params, req, runtime),
|
|
3407
3858
|
new SyncContextResponse({})
|
|
3408
3859
|
);
|
|
@@ -3414,7 +3865,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3414
3865
|
* @returns SyncContextResponse
|
|
3415
3866
|
*/
|
|
3416
3867
|
async syncContext(request) {
|
|
3417
|
-
const runtime = new $
|
|
3868
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3418
3869
|
return await this.syncContextWithOptions(request, runtime);
|
|
3419
3870
|
}
|
|
3420
3871
|
/**
|
|
@@ -3427,15 +3878,18 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3427
3878
|
async initBrowserWithOptions(request, runtime) {
|
|
3428
3879
|
request.validate();
|
|
3429
3880
|
const body = {};
|
|
3430
|
-
if (!$
|
|
3881
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3431
3882
|
body["Authorization"] = request.authorization;
|
|
3432
3883
|
}
|
|
3433
|
-
if (!$
|
|
3884
|
+
if (!$dara77.isNull(request.persistentPath)) {
|
|
3434
3885
|
body["PersistentPath"] = request.persistentPath;
|
|
3435
3886
|
}
|
|
3436
|
-
if (!$
|
|
3887
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3437
3888
|
body["SessionId"] = request.sessionId;
|
|
3438
3889
|
}
|
|
3890
|
+
if (!$dara77.isNull(request.browserOption)) {
|
|
3891
|
+
body["BrowserOption"] = JSON.stringify(request.browserOption);
|
|
3892
|
+
}
|
|
3439
3893
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
3440
3894
|
body: OpenApiUtil.parseToMap(body)
|
|
3441
3895
|
});
|
|
@@ -3450,7 +3904,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3450
3904
|
reqBodyType: "formData",
|
|
3451
3905
|
bodyType: "json"
|
|
3452
3906
|
});
|
|
3453
|
-
return $
|
|
3907
|
+
return $dara77.cast(
|
|
3454
3908
|
await this.callApi(params, req, runtime),
|
|
3455
3909
|
new InitBrowserResponse({})
|
|
3456
3910
|
);
|
|
@@ -3462,7 +3916,7 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3462
3916
|
* @returns InitBrowserResponse
|
|
3463
3917
|
*/
|
|
3464
3918
|
async initBrowser(request) {
|
|
3465
|
-
const runtime = new $
|
|
3919
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3466
3920
|
return await this.initBrowserWithOptions(request, runtime);
|
|
3467
3921
|
}
|
|
3468
3922
|
/**
|
|
@@ -3472,18 +3926,21 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3472
3926
|
* @returns InitBrowserResponse
|
|
3473
3927
|
*/
|
|
3474
3928
|
initBrowserSync(request) {
|
|
3475
|
-
const runtime = new $
|
|
3929
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
3476
3930
|
request.validate();
|
|
3477
3931
|
const body = {};
|
|
3478
|
-
if (!$
|
|
3932
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3479
3933
|
body["Authorization"] = request.authorization;
|
|
3480
3934
|
}
|
|
3481
|
-
if (!$
|
|
3935
|
+
if (!$dara77.isNull(request.persistentPath)) {
|
|
3482
3936
|
body["PersistentPath"] = request.persistentPath;
|
|
3483
3937
|
}
|
|
3484
|
-
if (!$
|
|
3938
|
+
if (!$dara77.isNull(request.sessionId)) {
|
|
3485
3939
|
body["SessionId"] = request.sessionId;
|
|
3486
3940
|
}
|
|
3941
|
+
if (!$dara77.isNull(request.browserOption)) {
|
|
3942
|
+
body["BrowserOption"] = JSON.stringify(request.browserOption);
|
|
3943
|
+
}
|
|
3487
3944
|
const req = new $OpenApiUtil.OpenApiRequest({
|
|
3488
3945
|
body: OpenApiUtil.parseToMap(body)
|
|
3489
3946
|
});
|
|
@@ -3498,11 +3955,209 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3498
3955
|
reqBodyType: "formData",
|
|
3499
3956
|
bodyType: "json"
|
|
3500
3957
|
});
|
|
3501
|
-
return $
|
|
3958
|
+
return $dara77.cast(
|
|
3502
3959
|
this.callApi(params, req, runtime),
|
|
3503
3960
|
new InitBrowserResponse({})
|
|
3504
3961
|
);
|
|
3505
3962
|
}
|
|
3963
|
+
/**
|
|
3964
|
+
* 获取上传context文件url
|
|
3965
|
+
*
|
|
3966
|
+
* @param request - DeleteContextFileRequest
|
|
3967
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
3968
|
+
* @returns DeleteContextFileResponse
|
|
3969
|
+
*/
|
|
3970
|
+
async deleteContextFileWithOptions(request, runtime) {
|
|
3971
|
+
request.validate();
|
|
3972
|
+
const body = {};
|
|
3973
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
3974
|
+
body["Authorization"] = request.authorization;
|
|
3975
|
+
}
|
|
3976
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
3977
|
+
body["ContextId"] = request.contextId;
|
|
3978
|
+
}
|
|
3979
|
+
if (!$dara77.isNull(request.filePath)) {
|
|
3980
|
+
body["FilePath"] = request.filePath;
|
|
3981
|
+
}
|
|
3982
|
+
const req = new $OpenApiUtil.OpenApiRequest({
|
|
3983
|
+
body: OpenApiUtil.parseToMap(body)
|
|
3984
|
+
});
|
|
3985
|
+
const params = new $OpenApiUtil.Params({
|
|
3986
|
+
action: "DeleteContextFile",
|
|
3987
|
+
version: "2025-05-06",
|
|
3988
|
+
protocol: "HTTPS",
|
|
3989
|
+
pathname: "/",
|
|
3990
|
+
method: "POST",
|
|
3991
|
+
authType: "Anonymous",
|
|
3992
|
+
style: "RPC",
|
|
3993
|
+
reqBodyType: "formData",
|
|
3994
|
+
bodyType: "json"
|
|
3995
|
+
});
|
|
3996
|
+
return $dara77.cast(
|
|
3997
|
+
await this.callApi(params, req, runtime),
|
|
3998
|
+
new DeleteContextFileResponse({})
|
|
3999
|
+
);
|
|
4000
|
+
}
|
|
4001
|
+
/**
|
|
4002
|
+
* 获取上传context文件url
|
|
4003
|
+
*
|
|
4004
|
+
* @param request - DeleteContextFileRequest
|
|
4005
|
+
* @returns DeleteContextFileResponse
|
|
4006
|
+
*/
|
|
4007
|
+
async deleteContextFile(request) {
|
|
4008
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
4009
|
+
return await this.deleteContextFileWithOptions(request, runtime);
|
|
4010
|
+
}
|
|
4011
|
+
/**
|
|
4012
|
+
* 查询context特定目录文件
|
|
4013
|
+
*
|
|
4014
|
+
* @param request - DescribeContextFilesRequest
|
|
4015
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
4016
|
+
* @returns DescribeContextFilesResponse
|
|
4017
|
+
*/
|
|
4018
|
+
async describeContextFilesWithOptions(request, runtime) {
|
|
4019
|
+
request.validate();
|
|
4020
|
+
const body = {};
|
|
4021
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
4022
|
+
body["Authorization"] = request.authorization;
|
|
4023
|
+
}
|
|
4024
|
+
if (!$dara77.isNull(request.pageNumber)) {
|
|
4025
|
+
body["PageNumber"] = request.pageNumber;
|
|
4026
|
+
}
|
|
4027
|
+
if (!$dara77.isNull(request.pageSize)) {
|
|
4028
|
+
body["PageSize"] = request.pageSize;
|
|
4029
|
+
}
|
|
4030
|
+
if (!$dara77.isNull(request.parentFolderPath)) {
|
|
4031
|
+
body["ParentFolderPath"] = request.parentFolderPath;
|
|
4032
|
+
}
|
|
4033
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
4034
|
+
body["ContextId"] = request.contextId;
|
|
4035
|
+
}
|
|
4036
|
+
const req = new $OpenApiUtil.OpenApiRequest({
|
|
4037
|
+
body: OpenApiUtil.parseToMap(body)
|
|
4038
|
+
});
|
|
4039
|
+
const params = new $OpenApiUtil.Params({
|
|
4040
|
+
action: "DescribeContextFiles",
|
|
4041
|
+
version: "2025-05-06",
|
|
4042
|
+
protocol: "HTTPS",
|
|
4043
|
+
pathname: "/",
|
|
4044
|
+
method: "POST",
|
|
4045
|
+
authType: "Anonymous",
|
|
4046
|
+
style: "RPC",
|
|
4047
|
+
reqBodyType: "formData",
|
|
4048
|
+
bodyType: "json"
|
|
4049
|
+
});
|
|
4050
|
+
return $dara77.cast(
|
|
4051
|
+
await this.callApi(params, req, runtime),
|
|
4052
|
+
new DescribeContextFilesResponse({})
|
|
4053
|
+
);
|
|
4054
|
+
}
|
|
4055
|
+
/**
|
|
4056
|
+
* 查询context特定目录文件
|
|
4057
|
+
*
|
|
4058
|
+
* @param request - DescribeContextFilesRequest
|
|
4059
|
+
* @returns DescribeContextFilesResponse
|
|
4060
|
+
*/
|
|
4061
|
+
async describeContextFiles(request) {
|
|
4062
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
4063
|
+
return await this.describeContextFilesWithOptions(request, runtime);
|
|
4064
|
+
}
|
|
4065
|
+
/**
|
|
4066
|
+
* 获取上传context文件url
|
|
4067
|
+
*
|
|
4068
|
+
* @param request - GetContextFileDownloadUrlRequest
|
|
4069
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
4070
|
+
* @returns GetContextFileDownloadUrlResponse
|
|
4071
|
+
*/
|
|
4072
|
+
async getContextFileDownloadUrlWithOptions(request, runtime) {
|
|
4073
|
+
request.validate();
|
|
4074
|
+
const body = {};
|
|
4075
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
4076
|
+
body["Authorization"] = request.authorization;
|
|
4077
|
+
}
|
|
4078
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
4079
|
+
body["ContextId"] = request.contextId;
|
|
4080
|
+
}
|
|
4081
|
+
if (!$dara77.isNull(request.filePath)) {
|
|
4082
|
+
body["FilePath"] = request.filePath;
|
|
4083
|
+
}
|
|
4084
|
+
const req = new $OpenApiUtil.OpenApiRequest({
|
|
4085
|
+
body: OpenApiUtil.parseToMap(body)
|
|
4086
|
+
});
|
|
4087
|
+
const params = new $OpenApiUtil.Params({
|
|
4088
|
+
action: "GetContextFileDownloadUrl",
|
|
4089
|
+
version: "2025-05-06",
|
|
4090
|
+
protocol: "HTTPS",
|
|
4091
|
+
pathname: "/",
|
|
4092
|
+
method: "POST",
|
|
4093
|
+
authType: "Anonymous",
|
|
4094
|
+
style: "RPC",
|
|
4095
|
+
reqBodyType: "formData",
|
|
4096
|
+
bodyType: "json"
|
|
4097
|
+
});
|
|
4098
|
+
return $dara77.cast(
|
|
4099
|
+
await this.callApi(params, req, runtime),
|
|
4100
|
+
new GetContextFileDownloadUrlResponse({})
|
|
4101
|
+
);
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* 获取上传context文件url
|
|
4105
|
+
*
|
|
4106
|
+
* @param request - GetContextFileDownloadUrlRequest
|
|
4107
|
+
* @returns GetContextFileDownloadUrlResponse
|
|
4108
|
+
*/
|
|
4109
|
+
async getContextFileDownloadUrl(request) {
|
|
4110
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
4111
|
+
return await this.getContextFileDownloadUrlWithOptions(request, runtime);
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* 获取上传context文件url
|
|
4115
|
+
*
|
|
4116
|
+
* @param request - GetContextFileUploadUrlRequest
|
|
4117
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
4118
|
+
* @returns GetContextFileUploadUrlResponse
|
|
4119
|
+
*/
|
|
4120
|
+
async getContextFileUploadUrlWithOptions(request, runtime) {
|
|
4121
|
+
request.validate();
|
|
4122
|
+
const body = {};
|
|
4123
|
+
if (!$dara77.isNull(request.authorization)) {
|
|
4124
|
+
body["Authorization"] = request.authorization;
|
|
4125
|
+
}
|
|
4126
|
+
if (!$dara77.isNull(request.contextId)) {
|
|
4127
|
+
body["ContextId"] = request.contextId;
|
|
4128
|
+
}
|
|
4129
|
+
if (!$dara77.isNull(request.filePath)) {
|
|
4130
|
+
body["FilePath"] = request.filePath;
|
|
4131
|
+
}
|
|
4132
|
+
const req = new $OpenApiUtil.OpenApiRequest({
|
|
4133
|
+
body: OpenApiUtil.parseToMap(body)
|
|
4134
|
+
});
|
|
4135
|
+
const params = new $OpenApiUtil.Params({
|
|
4136
|
+
action: "GetContextFileUploadUrl",
|
|
4137
|
+
version: "2025-05-06",
|
|
4138
|
+
protocol: "HTTPS",
|
|
4139
|
+
pathname: "/",
|
|
4140
|
+
method: "POST",
|
|
4141
|
+
authType: "Anonymous",
|
|
4142
|
+
style: "RPC",
|
|
4143
|
+
reqBodyType: "formData",
|
|
4144
|
+
bodyType: "json"
|
|
4145
|
+
});
|
|
4146
|
+
return $dara77.cast(
|
|
4147
|
+
await this.callApi(params, req, runtime),
|
|
4148
|
+
new GetContextFileUploadUrlResponse({})
|
|
4149
|
+
);
|
|
4150
|
+
}
|
|
4151
|
+
/**
|
|
4152
|
+
* 获取上传context文件url
|
|
4153
|
+
*
|
|
4154
|
+
* @param request - GetContextFileUploadUrlRequest
|
|
4155
|
+
* @returns GetContextFileUploadUrlResponse
|
|
4156
|
+
*/
|
|
4157
|
+
async getContextFileUploadUrl(request) {
|
|
4158
|
+
const runtime = new $dara77.RuntimeOptions({});
|
|
4159
|
+
return await this.getContextFileUploadUrlWithOptions(request, runtime);
|
|
4160
|
+
}
|
|
3506
4161
|
};
|
|
3507
4162
|
__name(_Client, "Client");
|
|
3508
4163
|
var Client = _Client;
|
|
@@ -3830,6 +4485,112 @@ var _ContextService = class _ContextService {
|
|
|
3830
4485
|
};
|
|
3831
4486
|
}
|
|
3832
4487
|
}
|
|
4488
|
+
/**
|
|
4489
|
+
* Get a presigned upload URL for a file in a context.
|
|
4490
|
+
*/
|
|
4491
|
+
async getFileUploadUrl(contextId, filePath) {
|
|
4492
|
+
log("API Call: GetContextFileUploadUrl");
|
|
4493
|
+
log(`Request: ContextId=${contextId}, FilePath=${filePath}`);
|
|
4494
|
+
const req = new GetContextFileUploadUrlRequest({
|
|
4495
|
+
authorization: `Bearer ${this.agentBay.getAPIKey()}`,
|
|
4496
|
+
contextId,
|
|
4497
|
+
filePath
|
|
4498
|
+
});
|
|
4499
|
+
const resp = await this.agentBay.getClient().getContextFileUploadUrl(req);
|
|
4500
|
+
log("Response from GetContextFileUploadUrl:", resp.body);
|
|
4501
|
+
const requestId = extractRequestId(resp) || "";
|
|
4502
|
+
const body = resp.body;
|
|
4503
|
+
const data = body?.data;
|
|
4504
|
+
return {
|
|
4505
|
+
requestId,
|
|
4506
|
+
success: !!(body && body.success),
|
|
4507
|
+
url: data?.url || "",
|
|
4508
|
+
expireTime: data?.expireTime
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4511
|
+
/**
|
|
4512
|
+
* Get a presigned download URL for a file in a context.
|
|
4513
|
+
*/
|
|
4514
|
+
async getFileDownloadUrl(contextId, filePath) {
|
|
4515
|
+
log("API Call: GetContextFileDownloadUrl");
|
|
4516
|
+
log(`Request: ContextId=${contextId}, FilePath=${filePath}`);
|
|
4517
|
+
const req = new GetContextFileDownloadUrlRequest({
|
|
4518
|
+
authorization: `Bearer ${this.agentBay.getAPIKey()}`,
|
|
4519
|
+
contextId,
|
|
4520
|
+
filePath
|
|
4521
|
+
});
|
|
4522
|
+
const resp = await this.agentBay.getClient().getContextFileDownloadUrl(req);
|
|
4523
|
+
log("Response from GetContextFileDownloadUrl:", resp.body);
|
|
4524
|
+
const requestId = extractRequestId(resp) || "";
|
|
4525
|
+
const body = resp.body;
|
|
4526
|
+
const data = body?.data;
|
|
4527
|
+
return {
|
|
4528
|
+
requestId,
|
|
4529
|
+
success: !!(body && body.success),
|
|
4530
|
+
url: data?.url || "",
|
|
4531
|
+
expireTime: data?.expireTime
|
|
4532
|
+
};
|
|
4533
|
+
}
|
|
4534
|
+
/**
|
|
4535
|
+
* Delete a file in a context.
|
|
4536
|
+
*/
|
|
4537
|
+
async deleteFile(contextId, filePath) {
|
|
4538
|
+
log("API Call: DeleteContextFile");
|
|
4539
|
+
log(`Request: ContextId=${contextId}, FilePath=${filePath}`);
|
|
4540
|
+
const req = new DeleteContextFileRequest({
|
|
4541
|
+
authorization: `Bearer ${this.agentBay.getAPIKey()}`,
|
|
4542
|
+
contextId,
|
|
4543
|
+
filePath
|
|
4544
|
+
});
|
|
4545
|
+
const resp = await this.agentBay.getClient().deleteContextFile(req);
|
|
4546
|
+
log("Response from DeleteContextFile:", resp.body);
|
|
4547
|
+
const requestId = extractRequestId(resp) || "";
|
|
4548
|
+
const body = resp.body;
|
|
4549
|
+
const success = !!(body && body.success);
|
|
4550
|
+
return {
|
|
4551
|
+
requestId,
|
|
4552
|
+
success,
|
|
4553
|
+
data: success,
|
|
4554
|
+
errorMessage: success ? "" : `Delete failed: ${body?.code || ""}`
|
|
4555
|
+
};
|
|
4556
|
+
}
|
|
4557
|
+
/**
|
|
4558
|
+
* List files under a specific folder path in a context.
|
|
4559
|
+
*/
|
|
4560
|
+
async listFiles(contextId, parentFolderPath, pageNumber = 1, pageSize = 50) {
|
|
4561
|
+
log("API Call: DescribeContextFiles");
|
|
4562
|
+
log(
|
|
4563
|
+
`Request: ContextId=${contextId}, ParentFolderPath=${parentFolderPath}, PageNumber=${pageNumber}, PageSize=${pageSize}`
|
|
4564
|
+
);
|
|
4565
|
+
const req = new DescribeContextFilesRequest({
|
|
4566
|
+
authorization: `Bearer ${this.agentBay.getAPIKey()}`,
|
|
4567
|
+
pageNumber,
|
|
4568
|
+
pageSize,
|
|
4569
|
+
parentFolderPath,
|
|
4570
|
+
contextId
|
|
4571
|
+
});
|
|
4572
|
+
const resp = await this.agentBay.getClient().describeContextFiles(req);
|
|
4573
|
+
log("Response from DescribeContextFiles:", resp.body);
|
|
4574
|
+
const requestId = extractRequestId(resp) || "";
|
|
4575
|
+
const body = resp.body;
|
|
4576
|
+
const rawList = body?.data || [];
|
|
4577
|
+
const entries = rawList.map((it) => ({
|
|
4578
|
+
fileId: it.fileId,
|
|
4579
|
+
fileName: it.fileName,
|
|
4580
|
+
filePath: it.filePath || "",
|
|
4581
|
+
fileType: it.fileType,
|
|
4582
|
+
gmtCreate: it.gmtCreate,
|
|
4583
|
+
gmtModified: it.gmtModified,
|
|
4584
|
+
size: it.size,
|
|
4585
|
+
status: it.status
|
|
4586
|
+
}));
|
|
4587
|
+
return {
|
|
4588
|
+
requestId,
|
|
4589
|
+
success: !!(body && body.success),
|
|
4590
|
+
entries,
|
|
4591
|
+
count: body?.count
|
|
4592
|
+
};
|
|
4593
|
+
}
|
|
3833
4594
|
};
|
|
3834
4595
|
__name(_ContextService, "ContextService");
|
|
3835
4596
|
var ContextService = _ContextService;
|
|
@@ -6242,7 +7003,7 @@ var _BrowserAgent = class _BrowserAgent {
|
|
|
6242
7003
|
throw new BrowserError("Browser must be initialized before calling act.");
|
|
6243
7004
|
}
|
|
6244
7005
|
try {
|
|
6245
|
-
const [pageIndex, contextIndex] = this.
|
|
7006
|
+
const [pageIndex, contextIndex] = await this._getPageAndContextIndexAsync(page);
|
|
6246
7007
|
log(`Acting on page: ${page}, pageIndex: ${pageIndex}, contextIndex: ${contextIndex}`);
|
|
6247
7008
|
const args = {
|
|
6248
7009
|
context_id: contextIndex,
|
|
@@ -6293,7 +7054,7 @@ var _BrowserAgent = class _BrowserAgent {
|
|
|
6293
7054
|
throw new BrowserError("Browser must be initialized before calling observe.");
|
|
6294
7055
|
}
|
|
6295
7056
|
try {
|
|
6296
|
-
const [pageIndex, contextIndex] = this.
|
|
7057
|
+
const [pageIndex, contextIndex] = await this._getPageAndContextIndexAsync(page);
|
|
6297
7058
|
log(`Observing page: ${page}, pageIndex: ${pageIndex}, contextIndex: ${contextIndex}`);
|
|
6298
7059
|
const args = {
|
|
6299
7060
|
context_id: contextIndex,
|
|
@@ -6356,7 +7117,7 @@ var _BrowserAgent = class _BrowserAgent {
|
|
|
6356
7117
|
throw new BrowserError("Browser must be initialized before calling extract.");
|
|
6357
7118
|
}
|
|
6358
7119
|
try {
|
|
6359
|
-
const [pageIndex, contextIndex] = this.
|
|
7120
|
+
const [pageIndex, contextIndex] = await this._getPageAndContextIndexAsync(page);
|
|
6360
7121
|
const tempInstance = new options.schema();
|
|
6361
7122
|
const schema = tempInstance.constructor.name;
|
|
6362
7123
|
const args = {
|
|
@@ -6432,12 +7193,35 @@ var _BrowserAgent = class _BrowserAgent {
|
|
|
6432
7193
|
throw new BrowserError("Page is null");
|
|
6433
7194
|
}
|
|
6434
7195
|
try {
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
7196
|
+
if (page.context && typeof page.context === "function") {
|
|
7197
|
+
const context = page.context();
|
|
7198
|
+
if (context && typeof context.newCDPSession === "function") {
|
|
7199
|
+
const cdpSession = await context.newCDPSession(page);
|
|
7200
|
+
const targetInfo = await cdpSession.send("Target.getTargetInfo");
|
|
7201
|
+
const pageIndex2 = targetInfo && targetInfo.targetInfo && targetInfo.targetInfo.targetId ? targetInfo.targetInfo.targetId : "default-page-id";
|
|
7202
|
+
if (typeof cdpSession.detach === "function") {
|
|
7203
|
+
await cdpSession.detach();
|
|
7204
|
+
}
|
|
7205
|
+
let contextIndex2 = 0;
|
|
7206
|
+
if (typeof context.browser === "function") {
|
|
7207
|
+
const browserObj = context.browser();
|
|
7208
|
+
if (browserObj && typeof browserObj.contexts === "function") {
|
|
7209
|
+
const contexts = browserObj.contexts();
|
|
7210
|
+
const idx = contexts.indexOf(context);
|
|
7211
|
+
if (idx >= 0) {
|
|
7212
|
+
contextIndex2 = idx;
|
|
7213
|
+
}
|
|
7214
|
+
}
|
|
7215
|
+
}
|
|
7216
|
+
return [pageIndex2, contextIndex2];
|
|
7217
|
+
}
|
|
7218
|
+
}
|
|
6438
7219
|
} catch (error) {
|
|
6439
|
-
|
|
7220
|
+
log(`CDP targetId retrieval failed, fallback to defaults: ${error}`);
|
|
6440
7221
|
}
|
|
7222
|
+
const pageIndex = "default-page-id";
|
|
7223
|
+
const contextIndex = 0;
|
|
7224
|
+
return [pageIndex, contextIndex];
|
|
6441
7225
|
}
|
|
6442
7226
|
async _callMcpTool(toolName, args) {
|
|
6443
7227
|
return this.session.callMcpTool(toolName, args);
|
|
@@ -6447,6 +7231,164 @@ __name(_BrowserAgent, "BrowserAgent");
|
|
|
6447
7231
|
var BrowserAgent = _BrowserAgent;
|
|
6448
7232
|
|
|
6449
7233
|
// src/browser/browser.ts
|
|
7234
|
+
var _BrowserProxyClass = class _BrowserProxyClass {
|
|
7235
|
+
constructor(proxyType, server, username, password, strategy, pollsize) {
|
|
7236
|
+
this.type = proxyType;
|
|
7237
|
+
this.server = server;
|
|
7238
|
+
this.username = username;
|
|
7239
|
+
this.password = password;
|
|
7240
|
+
this.strategy = strategy;
|
|
7241
|
+
this.pollsize = pollsize;
|
|
7242
|
+
if (proxyType !== "custom" && proxyType !== "wuying") {
|
|
7243
|
+
throw new Error("proxy_type must be custom or wuying");
|
|
7244
|
+
}
|
|
7245
|
+
if (proxyType === "custom" && !server) {
|
|
7246
|
+
throw new Error("server is required for custom proxy type");
|
|
7247
|
+
}
|
|
7248
|
+
if (proxyType === "wuying" && !strategy) {
|
|
7249
|
+
throw new Error("strategy is required for wuying proxy type");
|
|
7250
|
+
}
|
|
7251
|
+
if (proxyType === "wuying" && strategy !== "restricted" && strategy !== "polling") {
|
|
7252
|
+
throw new Error("strategy must be restricted or polling for wuying proxy type");
|
|
7253
|
+
}
|
|
7254
|
+
if (proxyType === "wuying" && strategy === "polling" && pollsize !== void 0 && pollsize <= 0) {
|
|
7255
|
+
throw new Error("pollsize must be greater than 0 for polling strategy");
|
|
7256
|
+
}
|
|
7257
|
+
}
|
|
7258
|
+
toMap() {
|
|
7259
|
+
const proxyMap = {
|
|
7260
|
+
type: this.type
|
|
7261
|
+
};
|
|
7262
|
+
if (this.type === "custom") {
|
|
7263
|
+
proxyMap.server = this.server;
|
|
7264
|
+
if (this.username) {
|
|
7265
|
+
proxyMap.username = this.username;
|
|
7266
|
+
}
|
|
7267
|
+
if (this.password) {
|
|
7268
|
+
proxyMap.password = this.password;
|
|
7269
|
+
}
|
|
7270
|
+
} else if (this.type === "wuying") {
|
|
7271
|
+
proxyMap.strategy = this.strategy;
|
|
7272
|
+
if (this.strategy === "polling") {
|
|
7273
|
+
proxyMap.pollsize = this.pollsize;
|
|
7274
|
+
}
|
|
7275
|
+
}
|
|
7276
|
+
return proxyMap;
|
|
7277
|
+
}
|
|
7278
|
+
static fromMap(m) {
|
|
7279
|
+
if (!m || typeof m !== "object") {
|
|
7280
|
+
return null;
|
|
7281
|
+
}
|
|
7282
|
+
const proxyType = m.type;
|
|
7283
|
+
if (!proxyType) {
|
|
7284
|
+
return null;
|
|
7285
|
+
}
|
|
7286
|
+
if (proxyType === "custom") {
|
|
7287
|
+
return new _BrowserProxyClass(
|
|
7288
|
+
proxyType,
|
|
7289
|
+
m.server,
|
|
7290
|
+
m.username,
|
|
7291
|
+
m.password
|
|
7292
|
+
);
|
|
7293
|
+
} else if (proxyType === "wuying") {
|
|
7294
|
+
return new _BrowserProxyClass(
|
|
7295
|
+
proxyType,
|
|
7296
|
+
void 0,
|
|
7297
|
+
void 0,
|
|
7298
|
+
void 0,
|
|
7299
|
+
m.strategy,
|
|
7300
|
+
m.pollsize || 10
|
|
7301
|
+
);
|
|
7302
|
+
} else {
|
|
7303
|
+
throw new Error(`Unsupported proxy type: ${proxyType}`);
|
|
7304
|
+
}
|
|
7305
|
+
}
|
|
7306
|
+
};
|
|
7307
|
+
__name(_BrowserProxyClass, "BrowserProxyClass");
|
|
7308
|
+
var BrowserProxyClass = _BrowserProxyClass;
|
|
7309
|
+
var _BrowserOptionClass = class _BrowserOptionClass {
|
|
7310
|
+
constructor(useStealth = false, userAgent, viewport, screen, fingerprint, proxies) {
|
|
7311
|
+
this.useStealth = useStealth;
|
|
7312
|
+
this.userAgent = userAgent;
|
|
7313
|
+
this.viewport = viewport;
|
|
7314
|
+
this.screen = screen;
|
|
7315
|
+
this.fingerprint = fingerprint;
|
|
7316
|
+
this.proxies = proxies;
|
|
7317
|
+
if (proxies !== void 0) {
|
|
7318
|
+
if (!Array.isArray(proxies)) {
|
|
7319
|
+
throw new Error("proxies must be a list");
|
|
7320
|
+
}
|
|
7321
|
+
if (proxies.length > 1) {
|
|
7322
|
+
throw new Error("proxies list length must be limited to 1");
|
|
7323
|
+
}
|
|
7324
|
+
}
|
|
7325
|
+
}
|
|
7326
|
+
toMap() {
|
|
7327
|
+
const optionMap = {};
|
|
7328
|
+
if (this.useStealth !== void 0) {
|
|
7329
|
+
optionMap["useStealth"] = this.useStealth;
|
|
7330
|
+
}
|
|
7331
|
+
if (this.userAgent !== void 0) {
|
|
7332
|
+
optionMap["userAgent"] = this.userAgent;
|
|
7333
|
+
}
|
|
7334
|
+
if (this.viewport !== void 0) {
|
|
7335
|
+
optionMap["viewport"] = { width: this.viewport.width, height: this.viewport.height };
|
|
7336
|
+
}
|
|
7337
|
+
if (this.screen !== void 0) {
|
|
7338
|
+
optionMap["screen"] = { width: this.screen.width, height: this.screen.height };
|
|
7339
|
+
}
|
|
7340
|
+
if (this.fingerprint !== void 0) {
|
|
7341
|
+
const fp = {};
|
|
7342
|
+
if (this.fingerprint.devices) fp["devices"] = this.fingerprint.devices;
|
|
7343
|
+
if (this.fingerprint.operatingSystems) fp["operatingSystems"] = this.fingerprint.operatingSystems;
|
|
7344
|
+
if (this.fingerprint.locales) fp["locales"] = this.fingerprint.locales;
|
|
7345
|
+
optionMap["fingerprint"] = fp;
|
|
7346
|
+
}
|
|
7347
|
+
if (this.proxies !== void 0) {
|
|
7348
|
+
optionMap["proxies"] = this.proxies.map((proxy) => proxy.toMap());
|
|
7349
|
+
}
|
|
7350
|
+
return optionMap;
|
|
7351
|
+
}
|
|
7352
|
+
fromMap(m) {
|
|
7353
|
+
const map = m || {};
|
|
7354
|
+
if (map.useStealth !== void 0) {
|
|
7355
|
+
this.useStealth = map.useStealth;
|
|
7356
|
+
} else {
|
|
7357
|
+
this.useStealth = false;
|
|
7358
|
+
}
|
|
7359
|
+
if (map.userAgent !== void 0) {
|
|
7360
|
+
this.userAgent = map.userAgent;
|
|
7361
|
+
}
|
|
7362
|
+
if (map.viewport !== void 0) {
|
|
7363
|
+
this.viewport = { width: map.viewport.width, height: map.viewport.height };
|
|
7364
|
+
}
|
|
7365
|
+
if (map.screen !== void 0) {
|
|
7366
|
+
this.screen = { width: map.screen.width, height: map.screen.height };
|
|
7367
|
+
}
|
|
7368
|
+
if (map.fingerprint !== void 0) {
|
|
7369
|
+
const fp = {};
|
|
7370
|
+
if (map.fingerprint.devices) fp.devices = map.fingerprint.devices;
|
|
7371
|
+
if (map.fingerprint.operatingSystems) fp.operatingSystems = map.fingerprint.operatingSystems;
|
|
7372
|
+
if (map.fingerprint.locales) fp.locales = map.fingerprint.locales;
|
|
7373
|
+
this.fingerprint = fp;
|
|
7374
|
+
}
|
|
7375
|
+
if (map.proxies !== void 0) {
|
|
7376
|
+
const proxyList = map.proxies;
|
|
7377
|
+
if (proxyList.length > 1) {
|
|
7378
|
+
throw new Error("proxies list length must be limited to 1");
|
|
7379
|
+
}
|
|
7380
|
+
this.proxies = proxyList.map((proxyData) => {
|
|
7381
|
+
if (proxyData instanceof BrowserProxyClass) {
|
|
7382
|
+
return proxyData;
|
|
7383
|
+
}
|
|
7384
|
+
return BrowserProxyClass.fromMap(proxyData);
|
|
7385
|
+
}).filter(Boolean);
|
|
7386
|
+
}
|
|
7387
|
+
return this;
|
|
7388
|
+
}
|
|
7389
|
+
};
|
|
7390
|
+
__name(_BrowserOptionClass, "BrowserOptionClass");
|
|
7391
|
+
var BrowserOptionClass = _BrowserOptionClass;
|
|
6450
7392
|
var _Browser = class _Browser {
|
|
6451
7393
|
constructor(session) {
|
|
6452
7394
|
this._endpointUrl = null;
|
|
@@ -6468,12 +7410,23 @@ var _Browser = class _Browser {
|
|
|
6468
7410
|
request.authorization = `Bearer ${this.session.getAPIKey()}`;
|
|
6469
7411
|
request.persistentPath = BROWSER_DATA_PATH;
|
|
6470
7412
|
request.sessionId = this.session.getSessionId();
|
|
7413
|
+
let browserOption;
|
|
7414
|
+
if (option instanceof BrowserOptionClass) {
|
|
7415
|
+
browserOption = option;
|
|
7416
|
+
} else {
|
|
7417
|
+
browserOption = new BrowserOptionClass();
|
|
7418
|
+
browserOption.fromMap(option);
|
|
7419
|
+
}
|
|
7420
|
+
const browserOptionMap = browserOption.toMap();
|
|
7421
|
+
if (Object.keys(browserOptionMap).length > 0) {
|
|
7422
|
+
request.browserOption = browserOptionMap;
|
|
7423
|
+
}
|
|
6471
7424
|
const response = this.session.getClient().initBrowserSync(request);
|
|
6472
7425
|
log(`Response from init_browser data:`, response.body?.data);
|
|
6473
7426
|
const success = response.body?.data?.port !== null && response.body?.data?.port !== void 0;
|
|
6474
7427
|
if (success) {
|
|
6475
7428
|
this._initialized = true;
|
|
6476
|
-
this._option =
|
|
7429
|
+
this._option = browserOption;
|
|
6477
7430
|
log("Browser instance was successfully initialized.");
|
|
6478
7431
|
}
|
|
6479
7432
|
return success;
|
|
@@ -6498,12 +7451,23 @@ var _Browser = class _Browser {
|
|
|
6498
7451
|
request.authorization = `Bearer ${this.session.getAPIKey()}`;
|
|
6499
7452
|
request.persistentPath = BROWSER_DATA_PATH;
|
|
6500
7453
|
request.sessionId = this.session.getSessionId();
|
|
7454
|
+
let browserOption;
|
|
7455
|
+
if (option instanceof BrowserOptionClass) {
|
|
7456
|
+
browserOption = option;
|
|
7457
|
+
} else {
|
|
7458
|
+
browserOption = new BrowserOptionClass();
|
|
7459
|
+
browserOption.fromMap(option);
|
|
7460
|
+
}
|
|
7461
|
+
const browserOptionMap = browserOption.toMap();
|
|
7462
|
+
if (Object.keys(browserOptionMap).length > 0) {
|
|
7463
|
+
request.browserOption = browserOptionMap;
|
|
7464
|
+
}
|
|
6501
7465
|
const response = await this.session.getClient().initBrowser(request);
|
|
6502
7466
|
log(`Response from init_browser data:`, response.body?.data);
|
|
6503
7467
|
const success = response.body?.data?.port !== null && response.body?.data?.port !== void 0;
|
|
6504
7468
|
if (success) {
|
|
6505
7469
|
this._initialized = true;
|
|
6506
|
-
this._option =
|
|
7470
|
+
this._option = browserOption;
|
|
6507
7471
|
log("Browser instance successfully initialized");
|
|
6508
7472
|
}
|
|
6509
7473
|
return success;
|
|
@@ -6543,6 +7507,16 @@ var _Browser = class _Browser {
|
|
|
6543
7507
|
isInitialized() {
|
|
6544
7508
|
return this._initialized;
|
|
6545
7509
|
}
|
|
7510
|
+
/**
|
|
7511
|
+
* Stop the browser instance, internal use only.
|
|
7512
|
+
*/
|
|
7513
|
+
_stopBrowser() {
|
|
7514
|
+
if (this.isInitialized()) {
|
|
7515
|
+
this.session.callMcpTool("stopChrome", {});
|
|
7516
|
+
} else {
|
|
7517
|
+
throw new BrowserError("Browser is not initialized. Cannot stop browser.");
|
|
7518
|
+
}
|
|
7519
|
+
}
|
|
6546
7520
|
};
|
|
6547
7521
|
__name(_Browser, "Browser");
|
|
6548
7522
|
var Browser = _Browser;
|
|
@@ -7217,15 +8191,15 @@ var _AgentBay = class _AgentBay {
|
|
|
7217
8191
|
const request = new CreateMcpSessionRequest({
|
|
7218
8192
|
authorization: "Bearer " + this.apiKey
|
|
7219
8193
|
});
|
|
7220
|
-
if (params.contextId) {
|
|
7221
|
-
request.contextId = params.contextId;
|
|
7222
|
-
}
|
|
7223
8194
|
if (params.labels) {
|
|
7224
8195
|
request.labels = JSON.stringify(params.labels);
|
|
7225
8196
|
}
|
|
7226
8197
|
if (params.imageId) {
|
|
7227
8198
|
request.imageId = params.imageId;
|
|
7228
8199
|
}
|
|
8200
|
+
if (params.mcpPolicyId) {
|
|
8201
|
+
request.mcpPolicyId = params.mcpPolicyId;
|
|
8202
|
+
}
|
|
7229
8203
|
request.vpcResource = params.isVpc || false;
|
|
7230
8204
|
let hasPersistenceData = false;
|
|
7231
8205
|
if (params.contextSync && params.contextSync.length > 0) {
|
|
@@ -7264,9 +8238,6 @@ var _AgentBay = class _AgentBay {
|
|
|
7264
8238
|
}
|
|
7265
8239
|
log("API Call: CreateMcpSession");
|
|
7266
8240
|
let requestLog = "Request: ";
|
|
7267
|
-
if (request.contextId) {
|
|
7268
|
-
requestLog += `ContextId=${request.contextId}, `;
|
|
7269
|
-
}
|
|
7270
8241
|
if (request.imageId) {
|
|
7271
8242
|
requestLog += `ImageId=${request.imageId}, `;
|
|
7272
8243
|
}
|
|
@@ -7285,8 +8256,11 @@ var _AgentBay = class _AgentBay {
|
|
|
7285
8256
|
}
|
|
7286
8257
|
log(requestLog);
|
|
7287
8258
|
const response = await this.client.createMcpSession(request);
|
|
7288
|
-
log("response data =", response.body?.data);
|
|
7289
8259
|
const requestId = extractRequestId(response) || "";
|
|
8260
|
+
log("response data =", response.body?.data);
|
|
8261
|
+
if (requestId) {
|
|
8262
|
+
log(`requestId = ${requestId}`);
|
|
8263
|
+
}
|
|
7290
8264
|
const sessionData = response.body;
|
|
7291
8265
|
if (!sessionData || typeof sessionData !== "object") {
|
|
7292
8266
|
return {
|
|
@@ -7651,13 +8625,6 @@ var _CreateSessionParams = class _CreateSessionParams {
|
|
|
7651
8625
|
this.labels = labels;
|
|
7652
8626
|
return this;
|
|
7653
8627
|
}
|
|
7654
|
-
/**
|
|
7655
|
-
* WithContextID sets the context ID for the session parameters and returns the updated parameters.
|
|
7656
|
-
*/
|
|
7657
|
-
withContextID(contextId) {
|
|
7658
|
-
this.contextId = contextId;
|
|
7659
|
-
return this;
|
|
7660
|
-
}
|
|
7661
8628
|
/**
|
|
7662
8629
|
* WithImageId sets the image ID for the session parameters and returns the updated parameters.
|
|
7663
8630
|
*/
|
|
@@ -7679,6 +8646,13 @@ var _CreateSessionParams = class _CreateSessionParams {
|
|
|
7679
8646
|
this.isVpc = isVpc;
|
|
7680
8647
|
return this;
|
|
7681
8648
|
}
|
|
8649
|
+
/**
|
|
8650
|
+
* WithMcpPolicyId sets the MCP policy id for the session parameters and returns the updated parameters.
|
|
8651
|
+
*/
|
|
8652
|
+
withMcpPolicyId(mcpPolicyId) {
|
|
8653
|
+
this.mcpPolicyId = mcpPolicyId;
|
|
8654
|
+
return this;
|
|
8655
|
+
}
|
|
7682
8656
|
/**
|
|
7683
8657
|
* GetLabelsJSON returns the labels as a JSON string.
|
|
7684
8658
|
* Returns an object with success status and result/error message to match Go version behavior.
|
|
@@ -7725,11 +8699,11 @@ var _CreateSessionParams = class _CreateSessionParams {
|
|
|
7725
8699
|
toJSON() {
|
|
7726
8700
|
return {
|
|
7727
8701
|
labels: this.labels,
|
|
7728
|
-
contextId: this.contextId,
|
|
7729
8702
|
imageId: this.imageId,
|
|
7730
8703
|
contextSync: this.contextSync,
|
|
7731
8704
|
browserContext: this.browserContext,
|
|
7732
|
-
isVpc: this.isVpc
|
|
8705
|
+
isVpc: this.isVpc,
|
|
8706
|
+
mcpPolicyId: this.mcpPolicyId
|
|
7733
8707
|
};
|
|
7734
8708
|
}
|
|
7735
8709
|
/**
|
|
@@ -7738,11 +8712,11 @@ var _CreateSessionParams = class _CreateSessionParams {
|
|
|
7738
8712
|
static fromJSON(config) {
|
|
7739
8713
|
const params = new _CreateSessionParams();
|
|
7740
8714
|
params.labels = config.labels || {};
|
|
7741
|
-
params.contextId = config.contextId;
|
|
7742
8715
|
params.imageId = config.imageId;
|
|
7743
8716
|
params.contextSync = config.contextSync || [];
|
|
7744
8717
|
params.browserContext = config.browserContext;
|
|
7745
8718
|
params.isVpc = config.isVpc || false;
|
|
8719
|
+
params.mcpPolicyId = config.mcpPolicyId;
|
|
7746
8720
|
return params;
|
|
7747
8721
|
}
|
|
7748
8722
|
};
|
|
@@ -7754,7 +8728,6 @@ function newCreateSessionParams() {
|
|
|
7754
8728
|
__name(newCreateSessionParams, "newCreateSessionParams");
|
|
7755
8729
|
export {
|
|
7756
8730
|
APIError,
|
|
7757
|
-
ActResult,
|
|
7758
8731
|
Agent,
|
|
7759
8732
|
AgentBay,
|
|
7760
8733
|
AgentBayError,
|
|
@@ -7768,6 +8741,8 @@ export {
|
|
|
7768
8741
|
Browser,
|
|
7769
8742
|
BrowserAgent,
|
|
7770
8743
|
BrowserError,
|
|
8744
|
+
BrowserOptionClass,
|
|
8745
|
+
BrowserProxyClass,
|
|
7771
8746
|
CallMcpToolRequest,
|
|
7772
8747
|
CallMcpToolResponse,
|
|
7773
8748
|
CallMcpToolResponseBody,
|
|
@@ -7785,12 +8760,24 @@ export {
|
|
|
7785
8760
|
CreateMcpSessionResponseBodyData,
|
|
7786
8761
|
CreateMcpSessionShrinkRequest,
|
|
7787
8762
|
CreateSessionParams,
|
|
8763
|
+
DeleteContextFileRequest,
|
|
8764
|
+
DeleteContextFileResponse,
|
|
8765
|
+
DeleteContextFileResponseBody,
|
|
7788
8766
|
DeleteContextRequest,
|
|
7789
8767
|
DeleteContextResponse,
|
|
7790
8768
|
DeleteContextResponseBody,
|
|
8769
|
+
DescribeContextFilesRequest,
|
|
8770
|
+
DescribeContextFilesResponse,
|
|
8771
|
+
DescribeContextFilesResponseBody,
|
|
7791
8772
|
DownloadStrategy,
|
|
7792
8773
|
FileError,
|
|
7793
8774
|
FileSystem,
|
|
8775
|
+
GetContextFileDownloadUrlRequest,
|
|
8776
|
+
GetContextFileDownloadUrlResponse,
|
|
8777
|
+
GetContextFileDownloadUrlResponseBody,
|
|
8778
|
+
GetContextFileUploadUrlRequest,
|
|
8779
|
+
GetContextFileUploadUrlResponse,
|
|
8780
|
+
GetContextFileUploadUrlResponseBody,
|
|
7794
8781
|
GetContextInfoRequest,
|
|
7795
8782
|
GetContextInfoResponse,
|
|
7796
8783
|
GetContextInfoResponseBody,
|
|
@@ -7831,7 +8818,6 @@ export {
|
|
|
7831
8818
|
ModifyContextRequest,
|
|
7832
8819
|
ModifyContextResponse,
|
|
7833
8820
|
ModifyContextResponseBody,
|
|
7834
|
-
ObserveResult,
|
|
7835
8821
|
Oss,
|
|
7836
8822
|
OssError,
|
|
7837
8823
|
ReleaseMcpSessionRequest,
|