@microsoft/agents-copilotstudio-client 0.1.25-gcaee57b821 → 0.1.49
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/src/{botType.d.ts → agentType.d.ts} +4 -4
- package/dist/src/agentType.js +22 -0
- package/dist/src/agentType.js.map +1 -0
- package/dist/src/connectionSettings.d.ts +4 -4
- package/dist/src/connectionSettings.js +2 -2
- package/dist/src/connectionSettings.js.map +1 -1
- package/dist/src/copilotStudioClient.d.ts +1 -1
- package/dist/src/copilotStudioClient.js +5 -5
- package/dist/src/copilotStudioClient.js.map +1 -1
- package/dist/src/directToEngineConnectionSettings.d.ts +5 -5
- package/dist/src/executeTurnRequest.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/powerPlatformEnvironment.js +14 -14
- package/dist/src/powerPlatformEnvironment.js.map +1 -1
- package/package.json +5 -5
- package/src/{botType.ts → agentType.ts} +4 -4
- package/src/connectionSettings.ts +6 -6
- package/src/copilotStudioClient.ts +2 -2
- package/src/directToEngineConnectionSettings.ts +5 -5
- package/src/executeTurnRequest.ts +1 -1
- package/src/index.ts +1 -1
- package/src/powerPlatformEnvironment.ts +15 -15
- package/dist/src/botType.js +0 -22
- package/dist/src/botType.js.map +0 -1
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* Enum representing the type of
|
|
6
|
+
* Enum representing the type of agent.
|
|
7
7
|
*/
|
|
8
|
-
export declare enum
|
|
8
|
+
export declare enum AgentType {
|
|
9
9
|
/**
|
|
10
|
-
* Represents a published
|
|
10
|
+
* Represents a published agent.
|
|
11
11
|
*/
|
|
12
12
|
Published = 0,
|
|
13
13
|
/**
|
|
14
|
-
* Represents a prebuilt
|
|
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
|
|
20
|
-
|
|
21
|
-
/** The type of the Copilot
|
|
22
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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,
|
|
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-
|
|
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;
|
|
@@ -10,7 +10,7 @@ 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
|
|
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
16
|
class CopilotStudioClient {
|
|
@@ -41,7 +41,7 @@ class CopilotStudioClient {
|
|
|
41
41
|
results.push(result);
|
|
42
42
|
return results;
|
|
43
43
|
}
|
|
44
|
-
this.logger('
|
|
44
|
+
this.logger('Agent is typing...');
|
|
45
45
|
result += value;
|
|
46
46
|
return await processEvents(await reader.read());
|
|
47
47
|
};
|
|
@@ -51,8 +51,8 @@ class CopilotStudioClient {
|
|
|
51
51
|
const validEvents = values.filter(e => e.substring(0, 4) === 'data' && e !== 'data: end\r');
|
|
52
52
|
validEvents.forEach(ve => {
|
|
53
53
|
try {
|
|
54
|
-
const act =
|
|
55
|
-
if (act.type ===
|
|
54
|
+
const act = agents_activity_1.Activity.fromJson(ve.substring(5, ve.length));
|
|
55
|
+
if (act.type === agents_activity_1.ActivityTypes.Message) {
|
|
56
56
|
activities.push(act);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
@@ -97,7 +97,7 @@ class CopilotStudioClient {
|
|
|
97
97
|
text: question,
|
|
98
98
|
conversation: conversationAccount
|
|
99
99
|
};
|
|
100
|
-
const activity =
|
|
100
|
+
const activity = agents_activity_1.Activity.fromObject(activityObj);
|
|
101
101
|
const localConversationId = (_b = (_a = activity.conversation) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : conversationId;
|
|
102
102
|
const uriExecute = (0, powerPlatformEnvironment_1.getCopilotStudioConnectionUrl)(this.settings, localConversationId);
|
|
103
103
|
const qbody = new executeTurnRequest_1.ExecuteTurnRequest(activity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilotStudioClient.js","sourceRoot":"","sources":["../../src/copilotStudioClient.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uB,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;AApHD,kDAoHC"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
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
|
|
12
|
-
|
|
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
|
|
20
|
-
|
|
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-
|
|
5
|
+
import { Activity } from '@microsoft/agents-activity';
|
|
6
6
|
export declare class ExecuteTurnRequest {
|
|
7
7
|
/** The activity to be executed. */
|
|
8
8
|
activity?: Activity;
|
package/dist/src/index.d.ts
CHANGED
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("./
|
|
17
|
+
__exportStar(require("./agentType"), exports);
|
|
18
18
|
__exportStar(require("./connectionSettings"), exports);
|
|
19
19
|
__exportStar(require("./copilotStudioClient"), exports);
|
|
20
20
|
__exportStar(require("./directToEngineConnectionSettings"), exports);
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
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
|
|
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.
|
|
33
|
-
throw new Error('
|
|
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
|
|
47
|
-
if (settings.
|
|
48
|
-
if (!Object.values(
|
|
49
|
-
throw new Error('Invalid
|
|
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
|
-
|
|
52
|
+
agentType = agentType_1.AgentType[settings.copilotAgentType];
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
|
|
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.
|
|
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(
|
|
72
|
-
const
|
|
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/${
|
|
76
|
+
url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations`;
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
url.pathname = `/copilotstudio/${
|
|
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,
|
|
1
|
+
{"version":3,"file":"powerPlatformEnvironment.js","sourceRoot":"","sources":["../../src/powerPlatformEnvironment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAeH,sEAyDC;AAtED,2CAAuC;AAEvC,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,EAA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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/agents-copilotstudio-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
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-
|
|
24
|
-
"axios": "^1.8.
|
|
23
|
+
"@microsoft/agents-activity": "0.1.49",
|
|
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
|
|
7
|
+
* Enum representing the type of agent.
|
|
8
8
|
*/
|
|
9
|
-
export enum
|
|
9
|
+
export enum AgentType {
|
|
10
10
|
/**
|
|
11
|
-
* Represents a published
|
|
11
|
+
* Represents a published agent.
|
|
12
12
|
*/
|
|
13
13
|
Published = 0,
|
|
14
14
|
/**
|
|
15
|
-
* Represents a prebuilt
|
|
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
|
|
21
|
-
public
|
|
22
|
-
/** The type of the Copilot
|
|
23
|
-
public
|
|
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
|
-
|
|
38
|
-
|
|
37
|
+
agentIdentifier: process.env.agentIdentifier,
|
|
38
|
+
copilotAgentType: process.env.copilotAgentType
|
|
39
39
|
} as ConnectionSettings
|
|
40
40
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
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-
|
|
9
|
+
import { Activity, ActivityTypes, ConversationAccount } from '@microsoft/agents-activity'
|
|
10
10
|
import { ExecuteTurnRequest } from './executeTurnRequest'
|
|
11
11
|
import createDebug, { Debugger } from 'debug'
|
|
12
12
|
|
|
@@ -52,7 +52,7 @@ export class CopilotStudioClient {
|
|
|
52
52
|
results.push(result)
|
|
53
53
|
return results
|
|
54
54
|
}
|
|
55
|
-
this.logger('
|
|
55
|
+
this.logger('Agent is typing...')
|
|
56
56
|
result += value
|
|
57
57
|
|
|
58
58
|
return await processEvents(await reader.read())
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
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
|
|
14
|
-
|
|
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
|
|
22
|
-
|
|
21
|
+
/** The type of the Copilot agent. */
|
|
22
|
+
copilotAgentType: AgentType
|
|
23
23
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
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.
|
|
43
|
-
throw new Error('
|
|
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
|
|
60
|
+
let agentType: AgentType
|
|
61
61
|
|
|
62
|
-
if (settings.
|
|
63
|
-
if (!Object.values(
|
|
64
|
-
throw new Error('Invalid
|
|
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
|
-
|
|
66
|
+
agentType = AgentType[settings.copilotAgentType as keyof typeof AgentType]
|
|
67
67
|
}
|
|
68
68
|
} else {
|
|
69
|
-
|
|
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.
|
|
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
|
-
|
|
88
|
+
agentIdentifier: string,
|
|
89
89
|
host: string,
|
|
90
|
-
|
|
90
|
+
agentType: AgentType,
|
|
91
91
|
conversationId?: string
|
|
92
92
|
): string {
|
|
93
|
-
const
|
|
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/${
|
|
99
|
+
url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations`
|
|
100
100
|
} else {
|
|
101
|
-
url.pathname = `/copilotstudio/${
|
|
101
|
+
url.pathname = `/copilotstudio/${agentPathName}/authenticated/bots/${agentIdentifier}/conversations/${conversationId}`
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
return url.toString()
|
package/dist/src/botType.js
DELETED
|
@@ -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
|
package/dist/src/botType.js.map
DELETED
|
@@ -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"}
|