@microsoft/agents-copilotstudio-client 0.1.27 → 0.2.7-gd7a3e9ef95

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.
@@ -3,15 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * Enum representing the type of bot.
6
+ * Enum representing the type of agent.
7
7
  */
8
- export declare enum BotType {
8
+ export declare enum AgentType {
9
9
  /**
10
- * Represents a published bot.
10
+ * Represents a published agent.
11
11
  */
12
12
  Published = 0,
13
13
  /**
14
- * Represents a prebuilt bot.
14
+ * Represents a prebuilt agent.
15
15
  */
16
16
  Prebuilt = 1
17
17
  }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AgentType = void 0;
8
+ /**
9
+ * Enum representing the type of agent.
10
+ */
11
+ var AgentType;
12
+ (function (AgentType) {
13
+ /**
14
+ * Represents a published agent.
15
+ */
16
+ AgentType[AgentType["Published"] = 0] = "Published";
17
+ /**
18
+ * Represents a prebuilt agent.
19
+ */
20
+ AgentType[AgentType["Prebuilt"] = 1] = "Prebuilt";
21
+ })(AgentType || (exports.AgentType = AgentType = {}));
22
+ //# sourceMappingURL=agentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentType.js","sourceRoot":"","sources":["../../src/agentType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB;;OAEG;IACH,mDAAa,CAAA;IACb;;OAEG;IACH,iDAAY,CAAA;AACd,CAAC,EATW,SAAS,yBAAT,SAAS,QASpB"}
@@ -16,10 +16,10 @@ export declare class ConnectionSettings {
16
16
  cloud: string;
17
17
  /** The custom Power Platform cloud URL, if any. */
18
18
  customPowerPlatformCloud?: string;
19
- /** The identifier of the bot. */
20
- botIdentifier?: string;
21
- /** The type of the Copilot bot. */
22
- copilotBotType?: string;
19
+ /** The identifier of the agent. */
20
+ agentIdentifier?: string;
21
+ /** The type of the Copilot agent. */
22
+ copilotAgentType?: string;
23
23
  }
24
24
  /**
25
25
  * Loads the connection settings for Copilot Studio from environment variables.
@@ -33,8 +33,8 @@ const loadCopilotStudioConnectionSettingsFromEnv = () => {
33
33
  environmentId: (_c = process.env.environmentId) !== null && _c !== void 0 ? _c : '',
34
34
  cloud: process.env.cloud,
35
35
  customPowerPlatformCloud: process.env.customPowerPlatformCloud,
36
- botIdentifier: process.env.botIdentifier,
37
- copilotBotType: process.env.copilotBotType
36
+ agentIdentifier: process.env.agentIdentifier,
37
+ copilotAgentType: process.env.copilotAgentType
38
38
  };
39
39
  };
40
40
  exports.loadCopilotStudioConnectionSettingsFromEnv = loadCopilotStudioConnectionSettingsFromEnv;
@@ -1 +1 @@
1
- {"version":3,"file":"connectionSettings.js","sourceRoot":"","sources":["../../src/connectionSettings.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAa,kBAAkB;IAA/B;QACE,wCAAwC;QACjC,gBAAW,GAAW,EAAE,CAAA;QAC/B,wCAAwC;QACjC,aAAQ,GAAW,EAAE,CAAA;QAC5B,6CAA6C;QACtC,kBAAa,GAAW,EAAE,CAAA;QACjC,gDAAgD;QACzC,UAAK,GAAW,EAAE,CAAA;IAO3B,CAAC;CAAA;AAfD,gDAeC;AAED;;;GAGG;AACI,MAAM,0CAA0C,GAA6B,GAAG,EAAE;;IACvF,OAAO;QACL,WAAW,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,WAAW,mCAAI,EAAE;QAC1C,QAAQ,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,EAAE;QACpC,aAAa,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,mCAAI,EAAE;QAC9C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK;QACxB,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAC9D,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;QACxC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;KACrB,CAAA;AACzB,CAAC,CAAA;AAVY,QAAA,0CAA0C,8CAUtD"}
1
+ {"version":3,"file":"connectionSettings.js","sourceRoot":"","sources":["../../src/connectionSettings.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAa,kBAAkB;IAA/B;QACE,wCAAwC;QACjC,gBAAW,GAAW,EAAE,CAAA;QAC/B,wCAAwC;QACjC,aAAQ,GAAW,EAAE,CAAA;QAC5B,6CAA6C;QACtC,kBAAa,GAAW,EAAE,CAAA;QACjC,gDAAgD;QACzC,UAAK,GAAW,EAAE,CAAA;IAO3B,CAAC;CAAA;AAfD,gDAeC;AAED;;;GAGG;AACI,MAAM,0CAA0C,GAA6B,GAAG,EAAE;;IACvF,OAAO;QACL,WAAW,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,WAAW,mCAAI,EAAE;QAC1C,QAAQ,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,EAAE;QACpC,aAAa,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,mCAAI,EAAE;QAC9C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK;QACxB,wBAAwB,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAC9D,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;QAC5C,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;KACzB,CAAA;AACzB,CAAC,CAAA;AAVY,QAAA,0CAA0C,8CAUtD"}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ConnectionSettings } from './connectionSettings';
6
- import { Activity } from '@microsoft/agents-bot-activity';
6
+ import { Activity } from '@microsoft/agents-activity';
7
7
  export declare class CopilotStudioClient {
8
8
  /** The ID of the current conversation. */
9
9
  private conversationId;
@@ -20,6 +20,7 @@ export declare class CopilotStudioClient {
20
20
  */
21
21
  constructor(settings: ConnectionSettings, token: string);
22
22
  private postRequestAsync;
23
+ private static getProductInfo;
23
24
  startConversationAsync(emitStartConversationEvent?: boolean): Promise<Activity>;
24
25
  askQuestionAsync(question: string, conversationId?: string): Promise<Activity[]>;
25
26
  }
@@ -10,9 +10,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CopilotStudioClient = void 0;
11
11
  const axios_1 = __importDefault(require("axios"));
12
12
  const powerPlatformEnvironment_1 = require("./powerPlatformEnvironment");
13
- const agents_bot_activity_1 = require("@microsoft/agents-bot-activity");
13
+ const agents_activity_1 = require("@microsoft/agents-activity");
14
14
  const executeTurnRequest_1 = require("./executeTurnRequest");
15
15
  const debug_1 = __importDefault(require("debug"));
16
+ const package_json_1 = __importDefault(require("@microsoft/agents-copilotstudio-client/package.json"));
17
+ const os_1 = __importDefault(require("os"));
16
18
  class CopilotStudioClient {
17
19
  /**
18
20
  * Creates an instance of CopilotStudioClient.
@@ -41,7 +43,7 @@ class CopilotStudioClient {
41
43
  results.push(result);
42
44
  return results;
43
45
  }
44
- this.logger('Bot is typing...');
46
+ this.logger('Agent is typing...');
45
47
  result += value;
46
48
  return await processEvents(await reader.read());
47
49
  };
@@ -51,8 +53,8 @@ class CopilotStudioClient {
51
53
  const validEvents = values.filter(e => e.substring(0, 4) === 'data' && e !== 'data: end\r');
52
54
  validEvents.forEach(ve => {
53
55
  try {
54
- const act = agents_bot_activity_1.Activity.fromJson(ve.substring(5, ve.length));
55
- if (act.type === agents_bot_activity_1.ActivityTypes.Message) {
56
+ const act = agents_activity_1.Activity.fromJson(ve.substring(5, ve.length));
57
+ if (act.type === agents_activity_1.ActivityTypes.Message) {
56
58
  activities.push(act);
57
59
  }
58
60
  else {
@@ -67,6 +69,9 @@ class CopilotStudioClient {
67
69
  });
68
70
  return activities;
69
71
  }
72
+ static getProductInfo() {
73
+ return `CopilotStudioClient.agents-sdk-js/${package_json_1.default.version} nodejs/${process.version} ${os_1.default.platform()}-${os_1.default.arch()}/${os_1.default.release()}`;
74
+ }
70
75
  async startConversationAsync(emitStartConversationEvent = true) {
71
76
  var _a;
72
77
  const uriStart = (0, powerPlatformEnvironment_1.getCopilotStudioConnectionUrl)(this.settings);
@@ -76,7 +81,8 @@ class CopilotStudioClient {
76
81
  url: uriStart,
77
82
  headers: {
78
83
  Accept: 'text/event-stream',
79
- 'Content-Type': 'application/json'
84
+ 'Content-Type': 'application/json',
85
+ 'User-Agent': CopilotStudioClient.getProductInfo(),
80
86
  },
81
87
  data: body,
82
88
  responseType: 'stream',
@@ -97,7 +103,7 @@ class CopilotStudioClient {
97
103
  text: question,
98
104
  conversation: conversationAccount
99
105
  };
100
- const activity = agents_bot_activity_1.Activity.fromObject(activityObj);
106
+ const activity = agents_activity_1.Activity.fromObject(activityObj);
101
107
  const localConversationId = (_b = (_a = activity.conversation) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : conversationId;
102
108
  const uriExecute = (0, powerPlatformEnvironment_1.getCopilotStudioConnectionUrl)(this.settings, localConversationId);
103
109
  const qbody = new executeTurnRequest_1.ExecuteTurnRequest(activity);
@@ -1 +1 @@
1
- {"version":3,"file":"copilotStudioClient.js","sourceRoot":"","sources":["../../src/copilotStudioClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,kDAAgE;AAChE,yEAA0E;AAC1E,wEAA6F;AAC7F,6DAAyD;AACzD,kDAA6C;AAO7C,MAAa,mBAAmB;IAU9B;;;;OAIG;IACH,YAAa,QAA4B,EAAE,KAAa;QAdxD,0CAA0C;QAClC,mBAAc,GAAW,EAAE,CAAA;QAcjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,EAAE,CAAA;QAC5B,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AAc,CAAA;QACvE,MAAM,UAAU,GAAG,IAAA,wDAA6B,EAAC,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;QACpF,MAAM,KAAK,GAAuB,IAAI,uCAAkB,CAAC,QAAQ,CAAC,CAAA;QAElE,MAAM,MAAM,GAAuB;YACjC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,UAAU;YACf,OAAO,EAAE;gBACP,MAAM,EAAE,mBAAmB;gBAC3B,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,KAAK;YACX,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE,OAAO;SACjB,CAAA;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QAClD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAzHD,kDAyHC"}
@@ -2,20 +2,20 @@
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { BotType } from './botType';
5
+ import { AgentType } from './agentType';
6
6
  import { PowerPlatformCloud } from './powerPlatformCloud';
7
7
  /**
8
8
  * Represents the settings required to establish a direct connection to the engine.
9
9
  */
10
10
  export interface DirectToEngineConnectionSettings {
11
- /** The identifier of the bot. */
12
- botIdentifier: string;
11
+ /** The identifier of the agent. */
12
+ agentIdentifier: string;
13
13
  /** The custom Power Platform cloud URL. */
14
14
  customPowerPlatformCloud: string;
15
15
  /** The environment ID of the application. */
16
16
  environmentId: string;
17
17
  /** The cloud environment of the application. */
18
18
  cloud: PowerPlatformCloud;
19
- /** The type of the Copilot bot. */
20
- copilotBotType: BotType;
19
+ /** The type of the Copilot agent. */
20
+ copilotAgentType: AgentType;
21
21
  }
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Activity } from '@microsoft/agents-bot-activity';
5
+ import { Activity } from '@microsoft/agents-activity';
6
6
  export declare class ExecuteTurnRequest {
7
7
  /** The activity to be executed. */
8
8
  activity?: Activity;
@@ -1,4 +1,4 @@
1
- export * from './botType';
1
+ export * from './agentType';
2
2
  export * from './connectionSettings';
3
3
  export * from './copilotStudioClient';
4
4
  export * from './directToEngineConnectionSettings';
package/dist/src/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./botType"), exports);
17
+ __exportStar(require("./agentType"), exports);
18
18
  __exportStar(require("./connectionSettings"), exports);
19
19
  __exportStar(require("./copilotStudioClient"), exports);
20
20
  __exportStar(require("./directToEngineConnectionSettings"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,uDAAoC;AACpC,wDAAqC;AACrC,qEAAkD;AAClD,uDAAoC;AACpC,uDAAoC;AACpC,6DAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,uDAAoC;AACpC,wDAAqC;AACrC,qEAAkD;AAClD,uDAAoC;AACpC,uDAAoC;AACpC,6DAA0C"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.getCopilotStudioConnectionUrl = getCopilotStudioConnectionUrl;
8
- const botType_1 = require("./botType");
8
+ const agentType_1 = require("./agentType");
9
9
  const powerPlatformCloud_1 = require("./powerPlatformCloud");
10
10
  const ApiVersion = '2022-03-01-preview';
11
11
  /**
@@ -29,8 +29,8 @@ function getCopilotStudioConnectionUrl(settings, conversationId) {
29
29
  if (settings.environmentId.trim() === '') {
30
30
  throw new Error('EnvironmentId must be provided');
31
31
  }
32
- if (settings.botIdentifier === undefined || settings.botIdentifier.trim() === '') {
33
- throw new Error('BotIdentifier must be provided');
32
+ if (settings.agentIdentifier === undefined || settings.agentIdentifier.trim() === '') {
33
+ throw new Error('AgentIdentifier must be provided');
34
34
  }
35
35
  if (cloudSetting !== powerPlatformCloud_1.PowerPlatformCloud.Unknown) {
36
36
  cloudValue = cloudSetting;
@@ -43,21 +43,21 @@ function getCopilotStudioConnectionUrl(settings, conversationId) {
43
43
  throw new Error('customPowerPlatformCloud must be provided when PowerPlatformCloud is Other');
44
44
  }
45
45
  }
46
- let botType;
47
- if (settings.copilotBotType && settings.copilotBotType.trim() !== '') {
48
- if (!Object.values(botType_1.BotType).includes(settings.copilotBotType)) {
49
- throw new Error('Invalid BotType enum key');
46
+ let agentType;
47
+ if (settings.copilotAgentType && settings.copilotAgentType.trim() !== '') {
48
+ if (!Object.values(agentType_1.AgentType).includes(settings.copilotAgentType)) {
49
+ throw new Error('Invalid AgentType enum key');
50
50
  }
51
51
  else {
52
- botType = botType_1.BotType[settings.copilotBotType];
52
+ agentType = agentType_1.AgentType[settings.copilotAgentType];
53
53
  }
54
54
  }
55
55
  else {
56
- botType = botType_1.BotType.Published;
56
+ agentType = agentType_1.AgentType.Published;
57
57
  }
58
58
  settings.customPowerPlatformCloud = isNotEmptyCustomPowerPlatformCloud ? settings.customPowerPlatformCloud : 'api.unknown.powerplatform.com';
59
59
  const host = getEnvironmentEndpoint(cloudValue, settings.environmentId, settings.customPowerPlatformCloud);
60
- return createUri(settings.botIdentifier, host, botType, conversationId);
60
+ return createUri(settings.agentIdentifier, host, agentType, conversationId);
61
61
  }
62
62
  function isValidUri(uri) {
63
63
  try {
@@ -68,15 +68,15 @@ function isValidUri(uri) {
68
68
  return false;
69
69
  }
70
70
  }
71
- function createUri(botIdentifier, host, botType, conversationId) {
72
- const botPathName = botType === botType_1.BotType.Published ? 'dataverse-backed' : 'prebuilt';
71
+ function createUri(agentIdentifier, host, agentType, conversationId) {
72
+ const agentPathName = agentType === agentType_1.AgentType.Published ? 'dataverse-backed' : 'prebuilt';
73
73
  const url = new URL(`https://${host}`);
74
74
  url.searchParams.set('api-version', ApiVersion);
75
75
  if (!conversationId) {
76
- url.pathname = `/copilotstudio/${botPathName}/authenticated/bots/${botIdentifier}/conversations`;
76
+ url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations`;
77
77
  }
78
78
  else {
79
- url.pathname = `/copilotstudio/${botPathName}/authenticated/bots/${botIdentifier}/conversations/${conversationId}`;
79
+ url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations/${conversationId}`;
80
80
  }
81
81
  return url.toString();
82
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"powerPlatformEnvironment.js","sourceRoot":"","sources":["../../src/powerPlatformEnvironment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAeH,sEAyDC;AAtED,uCAAmC;AAEnC,6DAAyD;AAEzD,MAAM,UAAU,GAAW,oBAAoB,CAAA;AAE/C;;;;;;GAMG;AACH,SAAgB,6BAA6B,CAC3C,QAA4B,EAC5B,cAAuB;IAEvB,IAAI,UAAU,GAAuB,uCAAkB,CAAC,IAAI,CAAA;IAE5D,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;IACtE,MAAM,kCAAkC,GAAG,QAAQ,CAAC,wBAAwB,KAAK,SAAS,IAAI,QAAQ,CAAC,wBAAwB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;IAE7I,IAAI,eAAe,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,uCAAkB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,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AAE,CAAC,CAAA;IAClE,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAE,KAAyB;IACnD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,uCAAkB,CAAC,YAAY,CAAC;QACrC,KAAK,uCAAkB,CAAC,IAAI;YAC1B,OAAO,CAAC,CAAA;QACV;YACE,OAAO,CAAC,CAAA;IACZ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@microsoft/agents-copilotstudio-client",
3
- "version": "0.1.27",
3
+ "version": "0.2.7-gd7a3e9ef95",
4
4
  "homepage": "https://github.com/microsoft/Agents-for-js",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "https://github.com/microsoft/Agents-for-js"
7
+ "url": "git+https://github.com/microsoft/Agents-for-js.git"
8
8
  },
9
9
  "author": {
10
10
  "name": "Microsoft",
11
11
  "email": "agentssdk@microsoft.com",
12
12
  "url": "https://aka.ms/Agents"
13
13
  },
14
- "description": "Microsoft Copilot Studio Client for JavaScript",
14
+ "description": "Microsoft Copilot Studio Client for JavaScript. Copilot Studio Client.",
15
15
  "keywords": [
16
16
  "Agents",
17
17
  "copilotstudio",
@@ -20,8 +20,8 @@
20
20
  "main": "dist/src/index.js",
21
21
  "types": "dist/src/index.d.ts",
22
22
  "dependencies": {
23
- "@microsoft/agents-bot-activity": "0.1.27",
24
- "axios": "^1.8.1",
23
+ "@microsoft/agents-activity": "0.2.7-gd7a3e9ef95",
24
+ "axios": "^1.8.2",
25
25
  "debug": "^4.3.7"
26
26
  },
27
27
  "license": "MIT",
@@ -4,15 +4,15 @@
4
4
  */
5
5
 
6
6
  /**
7
- * Enum representing the type of bot.
7
+ * Enum representing the type of agent.
8
8
  */
9
- export enum BotType {
9
+ export enum AgentType {
10
10
  /**
11
- * Represents a published bot.
11
+ * Represents a published agent.
12
12
  */
13
13
  Published = 0,
14
14
  /**
15
- * Represents a prebuilt bot.
15
+ * Represents a prebuilt agent.
16
16
  */
17
17
  Prebuilt = 1
18
18
  }
@@ -17,10 +17,10 @@ export class ConnectionSettings {
17
17
  public cloud: string = ''
18
18
  /** The custom Power Platform cloud URL, if any. */
19
19
  public customPowerPlatformCloud?: string
20
- /** The identifier of the bot. */
21
- public botIdentifier?: string
22
- /** The type of the Copilot bot. */
23
- public copilotBotType?: string
20
+ /** The identifier of the agent. */
21
+ public agentIdentifier?: string
22
+ /** The type of the Copilot agent. */
23
+ public copilotAgentType?: string
24
24
  }
25
25
 
26
26
  /**
@@ -34,7 +34,7 @@ export const loadCopilotStudioConnectionSettingsFromEnv: () => ConnectionSetting
34
34
  environmentId: process.env.environmentId ?? '',
35
35
  cloud: process.env.cloud,
36
36
  customPowerPlatformCloud: process.env.customPowerPlatformCloud,
37
- botIdentifier: process.env.botIdentifier,
38
- copilotBotType: process.env.copilotBotType
37
+ agentIdentifier: process.env.agentIdentifier,
38
+ copilotAgentType: process.env.copilotAgentType
39
39
  } as ConnectionSettings
40
40
  }
@@ -6,9 +6,11 @@
6
6
  import { ConnectionSettings } from './connectionSettings'
7
7
  import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'
8
8
  import { getCopilotStudioConnectionUrl } from './powerPlatformEnvironment'
9
- import { Activity, ActivityTypes, ConversationAccount } from '@microsoft/agents-bot-activity'
9
+ import { Activity, ActivityTypes, ConversationAccount } from '@microsoft/agents-activity'
10
10
  import { ExecuteTurnRequest } from './executeTurnRequest'
11
11
  import createDebug, { Debugger } from 'debug'
12
+ import pjson from '@microsoft/agents-copilotstudio-client/package.json'
13
+ import os from 'os'
12
14
 
13
15
  interface streamRead {
14
16
  done: boolean,
@@ -52,7 +54,7 @@ export class CopilotStudioClient {
52
54
  results.push(result)
53
55
  return results
54
56
  }
55
- this.logger('Bot is typing...')
57
+ this.logger('Agent is typing...')
56
58
  result += value
57
59
 
58
60
  return await processEvents(await reader.read())
@@ -80,6 +82,10 @@ export class CopilotStudioClient {
80
82
  return activities
81
83
  }
82
84
 
85
+ private static getProductInfo (): string {
86
+ return `CopilotStudioClient.agents-sdk-js/${pjson.version} nodejs/${process.version} ${os.platform()}-${os.arch()}/${os.release()}`
87
+ }
88
+
83
89
  public async startConversationAsync (emitStartConversationEvent: boolean = true): Promise<Activity> {
84
90
  const uriStart: string = getCopilotStudioConnectionUrl(this.settings)
85
91
  const body = { emitStartConversationEvent }
@@ -89,7 +95,8 @@ export class CopilotStudioClient {
89
95
  url: uriStart,
90
96
  headers: {
91
97
  Accept: 'text/event-stream',
92
- 'Content-Type': 'application/json'
98
+ 'Content-Type': 'application/json',
99
+ 'User-Agent': CopilotStudioClient.getProductInfo(),
93
100
  },
94
101
  data: body,
95
102
  responseType: 'stream',
@@ -3,21 +3,21 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { BotType } from './botType'
6
+ import { AgentType } from './agentType'
7
7
  import { PowerPlatformCloud } from './powerPlatformCloud'
8
8
 
9
9
  /**
10
10
  * Represents the settings required to establish a direct connection to the engine.
11
11
  */
12
12
  export interface DirectToEngineConnectionSettings {
13
- /** The identifier of the bot. */
14
- botIdentifier: string
13
+ /** The identifier of the agent. */
14
+ agentIdentifier: string
15
15
  /** The custom Power Platform cloud URL. */
16
16
  customPowerPlatformCloud: string
17
17
  /** The environment ID of the application. */
18
18
  environmentId: string
19
19
  /** The cloud environment of the application. */
20
20
  cloud: PowerPlatformCloud
21
- /** The type of the Copilot bot. */
22
- copilotBotType: BotType
21
+ /** The type of the Copilot agent. */
22
+ copilotAgentType: AgentType
23
23
  }
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { Activity } from '@microsoft/agents-bot-activity'
6
+ import { Activity } from '@microsoft/agents-activity'
7
7
 
8
8
  export class ExecuteTurnRequest {
9
9
  /** The activity to be executed. */
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './botType'
1
+ export * from './agentType'
2
2
  export * from './connectionSettings'
3
3
  export * from './copilotStudioClient'
4
4
  export * from './directToEngineConnectionSettings'
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { BotType } from './botType'
6
+ import { AgentType } from './agentType'
7
7
  import { ConnectionSettings } from './connectionSettings'
8
8
  import { PowerPlatformCloud } from './powerPlatformCloud'
9
9
 
@@ -39,8 +39,8 @@ export function getCopilotStudioConnectionUrl (
39
39
  throw new Error('EnvironmentId must be provided')
40
40
  }
41
41
 
42
- if (settings.botIdentifier === undefined || settings.botIdentifier.trim() === '') {
43
- throw new Error('BotIdentifier must be provided')
42
+ if (settings.agentIdentifier === undefined || settings.agentIdentifier.trim() === '') {
43
+ throw new Error('AgentIdentifier must be provided')
44
44
  }
45
45
 
46
46
  if (cloudSetting !== PowerPlatformCloud.Unknown) {
@@ -57,22 +57,22 @@ export function getCopilotStudioConnectionUrl (
57
57
  }
58
58
  }
59
59
 
60
- let botType: BotType
60
+ let agentType: AgentType
61
61
 
62
- if (settings.copilotBotType && settings.copilotBotType.trim() !== '') {
63
- if (!Object.values(BotType).includes(settings.copilotBotType as unknown as BotType)) {
64
- throw new Error('Invalid BotType enum key')
62
+ if (settings.copilotAgentType && settings.copilotAgentType.trim() !== '') {
63
+ if (!Object.values(AgentType).includes(settings.copilotAgentType as unknown as AgentType)) {
64
+ throw new Error('Invalid AgentType enum key')
65
65
  } else {
66
- botType = BotType[settings.copilotBotType as keyof typeof BotType]
66
+ agentType = AgentType[settings.copilotAgentType as keyof typeof AgentType]
67
67
  }
68
68
  } else {
69
- botType = BotType.Published
69
+ agentType = AgentType.Published
70
70
  }
71
71
 
72
72
  settings.customPowerPlatformCloud = isNotEmptyCustomPowerPlatformCloud ? settings.customPowerPlatformCloud : 'api.unknown.powerplatform.com'
73
73
 
74
74
  const host = getEnvironmentEndpoint(cloudValue, settings.environmentId, settings.customPowerPlatformCloud)
75
- return createUri(settings.botIdentifier, host, botType, conversationId)
75
+ return createUri(settings.agentIdentifier, host, agentType, conversationId)
76
76
  }
77
77
 
78
78
  function isValidUri (uri: string): boolean {
@@ -85,20 +85,20 @@ function isValidUri (uri: string): boolean {
85
85
  }
86
86
 
87
87
  function createUri (
88
- botIdentifier: string,
88
+ agentIdentifier: string,
89
89
  host: string,
90
- botType: BotType,
90
+ agentType: AgentType,
91
91
  conversationId?: string
92
92
  ): string {
93
- const botPathName = botType === BotType.Published ? 'dataverse-backed' : 'prebuilt'
93
+ const agentPathName = agentType === AgentType.Published ? 'dataverse-backed' : 'prebuilt'
94
94
 
95
95
  const url = new URL(`https://${host}`)
96
96
  url.searchParams.set('api-version', ApiVersion)
97
97
 
98
98
  if (!conversationId) {
99
- url.pathname = `/copilotstudio/${botPathName}/authenticated/bots/${botIdentifier}/conversations`
99
+ url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations`
100
100
  } else {
101
- url.pathname = `/copilotstudio/${botPathName}/authenticated/bots/${botIdentifier}/conversations/${conversationId}`
101
+ url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations/${conversationId}`
102
102
  }
103
103
 
104
104
  return url.toString()
@@ -1,22 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.BotType = void 0;
8
- /**
9
- * Enum representing the type of bot.
10
- */
11
- var BotType;
12
- (function (BotType) {
13
- /**
14
- * Represents a published bot.
15
- */
16
- BotType[BotType["Published"] = 0] = "Published";
17
- /**
18
- * Represents a prebuilt bot.
19
- */
20
- BotType[BotType["Prebuilt"] = 1] = "Prebuilt";
21
- })(BotType || (exports.BotType = BotType = {}));
22
- //# sourceMappingURL=botType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"botType.js","sourceRoot":"","sources":["../../src/botType.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,OASX;AATD,WAAY,OAAO;IACjB;;OAEG;IACH,+CAAa,CAAA;IACb;;OAEG;IACH,6CAAY,CAAA;AACd,CAAC,EATW,OAAO,uBAAP,OAAO,QASlB"}