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 CHANGED
@@ -1071,6 +1071,7 @@ var _CallMcpToolRequest = class _CallMcpToolRequest extends $dara16.Model {
1071
1071
  return {
1072
1072
  args: "Args",
1073
1073
  authorization: "Authorization",
1074
+ autoGenSession: "AutoGenSession",
1074
1075
  externalUserId: "ExternalUserId",
1075
1076
  imageId: "ImageId",
1076
1077
  name: "Name",
@@ -1083,6 +1084,7 @@ var _CallMcpToolRequest = class _CallMcpToolRequest extends $dara16.Model {
1083
1084
  return {
1084
1085
  args: "string",
1085
1086
  authorization: "string",
1087
+ autoGenSession: "boolean",
1086
1088
  externalUserId: "string",
1087
1089
  imageId: "string",
1088
1090
  name: "string",
@@ -3433,6 +3435,9 @@ var _Client = class _Client extends _openapicore2.default {
3433
3435
  if (!$dara84.isNull(request.authorization)) {
3434
3436
  body["Authorization"] = request.authorization;
3435
3437
  }
3438
+ if (!$dara84.isNull(request.autoGenSession)) {
3439
+ body["AutoGenSession"] = request.autoGenSession;
3440
+ }
3436
3441
  if (!$dara84.isNull(request.externalUserId)) {
3437
3442
  body["ExternalUserId"] = request.externalUserId;
3438
3443
  }
@@ -9395,12 +9400,12 @@ var _Mobile = class _Mobile {
9395
9400
  }
9396
9401
  }
9397
9402
  /**
9398
- * Stop app by package name.
9403
+ * Stop app by command.
9399
9404
  */
9400
- async stopAppByPName(pname) {
9401
- const args = { pname };
9405
+ async stopAppByCmd(stopCmd) {
9406
+ const args = { stop_cmd: stopCmd };
9402
9407
  try {
9403
- const result = await this.session.callMcpTool("stop_app_by_pname", args);
9408
+ const result = await this.session.callMcpTool("stop_app_by_cmd", args);
9404
9409
  return {
9405
9410
  success: result.success || false,
9406
9411
  requestId: result.requestId || "",
@@ -10844,9 +10849,10 @@ var _Session = class _Session {
10844
10849
  *
10845
10850
  * @param toolName - Name of the MCP tool to call
10846
10851
  * @param args - Arguments to pass to the tool
10852
+ * @param autoGenSession - Whether to automatically generate session if not exists (default: false)
10847
10853
  * @returns McpToolResult containing the response data
10848
10854
  */
10849
- async callMcpTool(toolName, args) {
10855
+ async callMcpTool(toolName, args, autoGenSession = false) {
10850
10856
  try {
10851
10857
  const argsJSON = JSON.stringify(args);
10852
10858
  if (this.isVpcEnabled()) {
@@ -10924,7 +10930,8 @@ var _Session = class _Session {
10924
10930
  authorization: `Bearer ${this.getAPIKey()}`,
10925
10931
  sessionId: this.getSessionId(),
10926
10932
  name: toolName,
10927
- args: argsJSON
10933
+ args: argsJSON,
10934
+ autoGenSession
10928
10935
  });
10929
10936
  const response = await this.getClient().callMcpTool(callToolRequest);
10930
10937
  if (!_optionalChain([response, 'access', _121 => _121.body, 'optionalAccess', _122 => _122.data])) {