wuying-agentbay-sdk 0.10.1 → 0.10.2
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/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +13 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -301,6 +301,7 @@ declare class ApplyMqttTokenResponse extends $dara.Model {
|
|
|
301
301
|
declare class CallMcpToolRequest extends $dara.Model {
|
|
302
302
|
args?: string;
|
|
303
303
|
authorization?: string;
|
|
304
|
+
autoGenSession?: boolean;
|
|
304
305
|
externalUserId?: string;
|
|
305
306
|
imageId?: string;
|
|
306
307
|
name?: string;
|
|
@@ -3734,9 +3735,9 @@ declare class Mobile {
|
|
|
3734
3735
|
*/
|
|
3735
3736
|
startApp(startCmd: string, workDirectory?: string, activity?: string): Promise<ProcessResult>;
|
|
3736
3737
|
/**
|
|
3737
|
-
* Stop app by
|
|
3738
|
+
* Stop app by command.
|
|
3738
3739
|
*/
|
|
3739
|
-
|
|
3740
|
+
stopAppByCmd(stopCmd: string): Promise<BoolResult>;
|
|
3740
3741
|
/**
|
|
3741
3742
|
* Take a screenshot.
|
|
3742
3743
|
*/
|
|
@@ -4337,9 +4338,10 @@ declare class Session {
|
|
|
4337
4338
|
*
|
|
4338
4339
|
* @param toolName - Name of the MCP tool to call
|
|
4339
4340
|
* @param args - Arguments to pass to the tool
|
|
4341
|
+
* @param autoGenSession - Whether to automatically generate session if not exists (default: false)
|
|
4340
4342
|
* @returns McpToolResult containing the response data
|
|
4341
4343
|
*/
|
|
4342
|
-
callMcpTool(toolName: string, args: any): Promise<McpToolResult>;
|
|
4344
|
+
callMcpTool(toolName: string, args: any, autoGenSession?: boolean): Promise<McpToolResult>;
|
|
4343
4345
|
}
|
|
4344
4346
|
|
|
4345
4347
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -301,6 +301,7 @@ declare class ApplyMqttTokenResponse extends $dara.Model {
|
|
|
301
301
|
declare class CallMcpToolRequest extends $dara.Model {
|
|
302
302
|
args?: string;
|
|
303
303
|
authorization?: string;
|
|
304
|
+
autoGenSession?: boolean;
|
|
304
305
|
externalUserId?: string;
|
|
305
306
|
imageId?: string;
|
|
306
307
|
name?: string;
|
|
@@ -3734,9 +3735,9 @@ declare class Mobile {
|
|
|
3734
3735
|
*/
|
|
3735
3736
|
startApp(startCmd: string, workDirectory?: string, activity?: string): Promise<ProcessResult>;
|
|
3736
3737
|
/**
|
|
3737
|
-
* Stop app by
|
|
3738
|
+
* Stop app by command.
|
|
3738
3739
|
*/
|
|
3739
|
-
|
|
3740
|
+
stopAppByCmd(stopCmd: string): Promise<BoolResult>;
|
|
3740
3741
|
/**
|
|
3741
3742
|
* Take a screenshot.
|
|
3742
3743
|
*/
|
|
@@ -4337,9 +4338,10 @@ declare class Session {
|
|
|
4337
4338
|
*
|
|
4338
4339
|
* @param toolName - Name of the MCP tool to call
|
|
4339
4340
|
* @param args - Arguments to pass to the tool
|
|
4341
|
+
* @param autoGenSession - Whether to automatically generate session if not exists (default: false)
|
|
4340
4342
|
* @returns McpToolResult containing the response data
|
|
4341
4343
|
*/
|
|
4342
|
-
callMcpTool(toolName: string, args: any): Promise<McpToolResult>;
|
|
4344
|
+
callMcpTool(toolName: string, args: any, autoGenSession?: boolean): Promise<McpToolResult>;
|
|
4343
4345
|
}
|
|
4344
4346
|
|
|
4345
4347
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1085,6 +1085,7 @@ var _CallMcpToolRequest = class _CallMcpToolRequest extends $dara16.Model {
|
|
|
1085
1085
|
return {
|
|
1086
1086
|
args: "Args",
|
|
1087
1087
|
authorization: "Authorization",
|
|
1088
|
+
autoGenSession: "AutoGenSession",
|
|
1088
1089
|
externalUserId: "ExternalUserId",
|
|
1089
1090
|
imageId: "ImageId",
|
|
1090
1091
|
name: "Name",
|
|
@@ -1097,6 +1098,7 @@ var _CallMcpToolRequest = class _CallMcpToolRequest extends $dara16.Model {
|
|
|
1097
1098
|
return {
|
|
1098
1099
|
args: "string",
|
|
1099
1100
|
authorization: "string",
|
|
1101
|
+
autoGenSession: "boolean",
|
|
1100
1102
|
externalUserId: "string",
|
|
1101
1103
|
imageId: "string",
|
|
1102
1104
|
name: "string",
|
|
@@ -3447,6 +3449,9 @@ var _Client = class _Client extends (OpenApi.default || OpenApi) {
|
|
|
3447
3449
|
if (!$dara84.isNull(request.authorization)) {
|
|
3448
3450
|
body["Authorization"] = request.authorization;
|
|
3449
3451
|
}
|
|
3452
|
+
if (!$dara84.isNull(request.autoGenSession)) {
|
|
3453
|
+
body["AutoGenSession"] = request.autoGenSession;
|
|
3454
|
+
}
|
|
3450
3455
|
if (!$dara84.isNull(request.externalUserId)) {
|
|
3451
3456
|
body["ExternalUserId"] = request.externalUserId;
|
|
3452
3457
|
}
|
|
@@ -9409,12 +9414,12 @@ var _Mobile = class _Mobile {
|
|
|
9409
9414
|
}
|
|
9410
9415
|
}
|
|
9411
9416
|
/**
|
|
9412
|
-
* Stop app by
|
|
9417
|
+
* Stop app by command.
|
|
9413
9418
|
*/
|
|
9414
|
-
async
|
|
9415
|
-
const args = {
|
|
9419
|
+
async stopAppByCmd(stopCmd) {
|
|
9420
|
+
const args = { stop_cmd: stopCmd };
|
|
9416
9421
|
try {
|
|
9417
|
-
const result = await this.session.callMcpTool("
|
|
9422
|
+
const result = await this.session.callMcpTool("stop_app_by_cmd", args);
|
|
9418
9423
|
return {
|
|
9419
9424
|
success: result.success || false,
|
|
9420
9425
|
requestId: result.requestId || "",
|
|
@@ -10858,9 +10863,10 @@ var _Session = class _Session {
|
|
|
10858
10863
|
*
|
|
10859
10864
|
* @param toolName - Name of the MCP tool to call
|
|
10860
10865
|
* @param args - Arguments to pass to the tool
|
|
10866
|
+
* @param autoGenSession - Whether to automatically generate session if not exists (default: false)
|
|
10861
10867
|
* @returns McpToolResult containing the response data
|
|
10862
10868
|
*/
|
|
10863
|
-
async callMcpTool(toolName, args) {
|
|
10869
|
+
async callMcpTool(toolName, args, autoGenSession = false) {
|
|
10864
10870
|
try {
|
|
10865
10871
|
const argsJSON = JSON.stringify(args);
|
|
10866
10872
|
if (this.isVpcEnabled()) {
|
|
@@ -10938,7 +10944,8 @@ var _Session = class _Session {
|
|
|
10938
10944
|
authorization: `Bearer ${this.getAPIKey()}`,
|
|
10939
10945
|
sessionId: this.getSessionId(),
|
|
10940
10946
|
name: toolName,
|
|
10941
|
-
args: argsJSON
|
|
10947
|
+
args: argsJSON,
|
|
10948
|
+
autoGenSession
|
|
10942
10949
|
});
|
|
10943
10950
|
const response = await this.getClient().callMcpTool(callToolRequest);
|
|
10944
10951
|
if (!response.body?.data) {
|