Skip to content

Commit 69ae3f9

Browse files
stevengumStevenic
andauthored
add skillDialog and associated classes (#1771)
* add skillDialog and associated classes * move non-impl Skill code to core for use in dialogs * scaffold dialogRootBot and dialogSkillBot * apply SkillDialog updates from microsoft/botbuilder-dotnet#3474 * rename SkillDialogArgs to BeginSkillDialogOptions Co-authored-by: Steven Ickman <stevenic@microsoft.com>
1 parent cc6d78e commit 69ae3f9

24 files changed

+341
-17
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
*.zip
99
*.vscode
1010

11+
# Functional Tests
12+
libraries/functional-tests/**/lib
13+
libraries/functional-tests/**/*.vscode/launch.json
14+
1115
# User-specific files
1216
*.suo
1317
*.user

lerna.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"libraries/botframework-connector",
1515
"libraries/botframework-schema",
1616
"libraries/functional-tests",
17+
"libraries/functional-tests/dialogToDialog/dialogRootBot",
18+
"libraries/functional-tests/dialogToDialog/dialogSkillBot",
1719
"libraries/testbot",
1820
"libraries/botframework-streaming",
1921
"libraries/testskills/skillparent",

libraries/botbuilder-core/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export * from './botTelemetryClient';
1818
export * from './browserStorage';
1919
export * from './cardFactory';
2020
export * from './conversationState';
21+
export * from './invokeResponse';
2122
export * from './memoryStorage';
2223
export * from './memoryTranscriptStore';
2324
export * from './messageFactory';
@@ -26,6 +27,7 @@ export * from './privateConversationState';
2627
export * from './propertyManager';
2728
export * from './recognizerResult';
2829
export * from './showTypingMiddleware';
30+
export { BotFrameworkSkill, BotFrameworkClient, SkillConversationIdFactoryBase } from './skills';
2931
export * from './skypeMentionNormalizeMiddleware';
3032
export * from './storage';
3133
export * from './telemetryLoggerMiddleware';
File renamed without changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @module botbuilder
3+
*/
4+
/**
5+
* Copyright (c) Microsoft Corporation. All rights reserved.
6+
* Licensed under the MIT License.
7+
*/
8+
9+
import { Activity } from 'botframework-schema';
10+
import { InvokeResponse } from '../invokeResponse';
11+
12+
export abstract class BotFrameworkClient {
13+
/**
14+
* Forwards an activity to a another bot.
15+
* @remarks
16+
*
17+
* @param fromBotId The MicrosoftAppId of the bot sending the activity.
18+
* @param toBotId The MicrosoftAppId of the bot receiving the activity.
19+
* @param toUrl The URL of the bot receiving the activity.
20+
* @param serviceUrl The callback Url for the skill host.
21+
* @param conversationId A conversation ID to use for the conversation with the skill.
22+
* @param activity Activity to forward.
23+
*/
24+
public abstract postActivity(fromBotId: string, toBotId: string, toUrl: string, serviceUrl: string, conversationId: string, activity: Activity): Promise<InvokeResponse>
25+
}

libraries/botbuilder/src/skills/botFrameworkSkill.ts renamed to libraries/botbuilder-core/src/skills/botFrameworkSkill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module botbuilder
2+
* @module botbuilder-core
33
*/
44
/**
55
* Copyright (c) Microsoft Corporation. All rights reserved.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @module botbuilder-core
3+
*/
4+
/**
5+
* Copyright (c) Microsoft Corporation. All rights reserved.
6+
* Licensed under the MIT License.
7+
*/
8+
9+
export { BotFrameworkClient } from './botFrameworkClient';
10+
export { BotFrameworkSkill } from './botFrameworkSkill';
11+
export { SkillConversationIdFactoryBase } from './skillConversationIdFactoryBase';

libraries/botbuilder/src/skills/skillConversationIdFactoryBase.ts renamed to libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Licensed under the MIT License.
77
*/
88

9-
import { ConversationReference } from 'botbuilder-core';
9+
import { ConversationReference } from 'botframework-schema';
1010

1111
/**
1212
* Defines the methods of a factory that is used to create unique conversation IDs for skill conversations.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @module botbuilder-dialogs
3+
*/
4+
/**
5+
* Copyright (c) Microsoft Corporation. All rights reserved.
6+
* Licensed under the MIT License.
7+
*/
8+
9+
import { Activity } from 'botbuilder-core';
10+
11+
/**
12+
* A class with dialog arguments for a SkillDialog.
13+
*/
14+
export interface BeginSkillDialogOptions {
15+
/**
16+
* The Activity to send to the skill.
17+
*/
18+
activity: Activity;
19+
}

libraries/botbuilder-dialogs/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ export * from './dialogContainer';
1515
export * from './dialogContext';
1616
export * from './dialogEvents';
1717
export * from './dialogSet';
18+
export * from './skillDialog';
19+
export * from './skillDialogOptions';
20+
export * from './beginSkillDialogOptions';
1821
export * from './waterfallDialog';
1922
export * from './waterfallStepContext';

0 commit comments

Comments
 (0)