@microsoft/agents-hosting-dialogs 0.2.14 → 0.3.5
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/agentComponent.d.ts +18 -4
- package/dist/src/agentComponent.js +12 -4
- package/dist/src/agentComponent.js.map +1 -1
- package/dist/src/agentStateSet.d.ts +2 -2
- package/dist/src/agentStateSet.js +2 -2
- package/dist/src/choices/choice.d.ts +9 -0
- package/dist/src/choices/findChoices.d.ts +12 -0
- package/dist/src/choices/findChoices.js.map +1 -1
- package/dist/src/choices/findValues.d.ts +27 -0
- package/dist/src/choices/findValues.js.map +1 -1
- package/dist/src/choices/modelResult.d.ts +20 -0
- package/dist/src/choices/modelResult.js +4 -0
- package/dist/src/choices/modelResult.js.map +1 -1
- package/dist/src/choices/tokenizer.d.ts +15 -0
- package/dist/src/choices/tokenizer.js +4 -0
- package/dist/src/choices/tokenizer.js.map +1 -1
- package/dist/src/configurable.d.ts +1 -0
- package/dist/src/configurable.js +1 -0
- package/dist/src/configurable.js.map +1 -1
- package/dist/src/converter.d.ts +10 -1
- package/dist/src/dialog.d.ts +14 -13
- package/dist/src/dialog.js +11 -10
- package/dist/src/dialog.js.map +1 -1
- package/dist/src/dialogContext.d.ts +31 -32
- package/dist/src/dialogContext.js +22 -23
- package/dist/src/dialogContext.js.map +1 -1
- package/dist/src/dialogEvent.d.ts +3 -0
- package/dist/src/dialogEvents.d.ts +20 -0
- package/dist/src/dialogEvents.js +20 -0
- package/dist/src/dialogEvents.js.map +1 -1
- package/dist/src/dialogHelper.js +14 -0
- package/dist/src/dialogHelper.js.map +1 -1
- package/dist/src/dialogManager.d.ts +0 -1
- package/dist/src/dialogManager.js +0 -1
- package/dist/src/dialogManager.js.map +1 -1
- package/dist/src/dialogSet.d.ts +4 -8
- package/dist/src/dialogSet.js +4 -8
- package/dist/src/dialogSet.js.map +1 -1
- package/dist/src/dialogTurnStateConstants.d.ts +13 -1
- package/dist/src/dialogTurnStateConstants.js +13 -1
- package/dist/src/dialogTurnStateConstants.js.map +1 -1
- package/dist/src/intentScore.d.ts +6 -0
- package/dist/src/memory/dialogPath.d.ts +40 -8
- package/dist/src/memory/dialogPath.js +32 -8
- package/dist/src/memory/dialogPath.js.map +1 -1
- package/dist/src/memory/dialogStateManager.d.ts +2 -2
- package/dist/src/memory/dialogStateManager.js +2 -2
- package/dist/src/memory/pathResolvers/aliasPathResolver.d.ts +4 -0
- package/dist/src/memory/pathResolvers/aliasPathResolver.js +4 -0
- package/dist/src/memory/pathResolvers/aliasPathResolver.js.map +1 -1
- package/dist/src/memory/pathResolvers/atAtPathResolver.d.ts +6 -2
- package/dist/src/memory/pathResolvers/atAtPathResolver.js +6 -2
- package/dist/src/memory/pathResolvers/atAtPathResolver.js.map +1 -1
- package/dist/src/memory/pathResolvers/atPathResolver.d.ts +13 -7
- package/dist/src/memory/pathResolvers/atPathResolver.js +13 -7
- package/dist/src/memory/pathResolvers/atPathResolver.js.map +1 -1
- package/dist/src/memory/pathResolvers/dollarPathResolver.d.ts +7 -2
- package/dist/src/memory/pathResolvers/dollarPathResolver.js +7 -2
- package/dist/src/memory/pathResolvers/dollarPathResolver.js.map +1 -1
- package/dist/src/memory/pathResolvers/hashPathResolver.d.ts +7 -2
- package/dist/src/memory/pathResolvers/hashPathResolver.js +7 -2
- package/dist/src/memory/pathResolvers/hashPathResolver.js.map +1 -1
- package/dist/src/memory/pathResolvers/pathResolver.d.ts +10 -5
- package/dist/src/memory/pathResolvers/percentPathResolver.d.ts +7 -2
- package/dist/src/memory/pathResolvers/percentPathResolver.js +7 -2
- package/dist/src/memory/pathResolvers/percentPathResolver.js.map +1 -1
- package/dist/src/memory/scopePath.d.ts +27 -0
- package/dist/src/memory/scopePath.js +27 -0
- package/dist/src/memory/scopePath.js.map +1 -1
- package/dist/src/memory/scopes/classMemoryScope.d.ts +18 -14
- package/dist/src/memory/scopes/classMemoryScope.js +18 -14
- package/dist/src/memory/scopes/classMemoryScope.js.map +1 -1
- package/dist/src/memory/scopes/dialogClassMemoryScope.d.ts +12 -6
- package/dist/src/memory/scopes/dialogClassMemoryScope.js +12 -6
- package/dist/src/memory/scopes/dialogClassMemoryScope.js.map +1 -1
- package/dist/src/memory/scopes/dialogContextMemoryScope.d.ts +11 -7
- package/dist/src/memory/scopes/dialogContextMemoryScope.js +11 -7
- package/dist/src/memory/scopes/dialogContextMemoryScope.js.map +1 -1
- package/dist/src/memory/scopes/dialogMemoryScope.d.ts +23 -16
- package/dist/src/memory/scopes/dialogMemoryScope.js +23 -16
- package/dist/src/memory/scopes/dialogMemoryScope.js.map +1 -1
- package/dist/src/memory/scopes/turnMemoryScope.d.ts +14 -13
- package/dist/src/memory/scopes/turnMemoryScope.js +14 -13
- package/dist/src/memory/scopes/turnMemoryScope.js.map +1 -1
- package/dist/src/memory/turnPath.d.ts +61 -13
- package/dist/src/memory/turnPath.js +49 -13
- package/dist/src/memory/turnPath.js.map +1 -1
- package/dist/src/prompts/attachmentPrompt.d.ts +1 -1
- package/dist/src/prompts/attachmentPrompt.js +1 -1
- package/dist/src/prompts/choicePrompt.d.ts +17 -3
- package/dist/src/prompts/choicePrompt.js +1 -1
- package/dist/src/prompts/choicePrompt.js.map +1 -1
- package/dist/src/prompts/confirmPrompt.d.ts +6 -6
- package/dist/src/prompts/confirmPrompt.js +3 -3
- package/dist/src/prompts/datetimePrompt.d.ts +6 -6
- package/dist/src/prompts/datetimePrompt.js +3 -3
- package/dist/src/prompts/numberPrompt.d.ts +6 -6
- package/dist/src/prompts/numberPrompt.js +6 -6
- package/dist/src/prompts/prompt.d.ts +7 -7
- package/dist/src/prompts/prompt.js +2 -2
- package/dist/src/prompts/promptCultureModels.d.ts +38 -3
- package/dist/src/prompts/promptCultureModels.js +38 -3
- package/dist/src/prompts/promptCultureModels.js.map +1 -1
- package/dist/src/recognizer.d.ts +8 -1
- package/dist/src/recognizer.js +5 -1
- package/dist/src/recognizer.js.map +1 -1
- package/dist/src/recognizerResult.d.ts +15 -0
- package/dist/src/recognizerResult.js.map +1 -1
- package/dist/src/serviceCollection.d.ts +22 -22
- package/dist/src/serviceCollection.js +11 -11
- package/dist/src/waterfallDialog.d.ts +5 -5
- package/dist/src/waterfallDialog.js +5 -5
- package/dist/src/waterfallStepContext.d.ts +21 -0
- package/dist/src/waterfallStepContext.js.map +1 -1
- package/package.json +2 -2
- package/src/agentComponent.ts +18 -4
- package/src/agentStateSet.ts +2 -2
- package/src/choices/choice.ts +11 -0
- package/src/choices/findChoices.ts +15 -0
- package/src/choices/findValues.ts +33 -0
- package/src/choices/modelResult.ts +25 -0
- package/src/choices/tokenizer.ts +19 -0
- package/src/configurable.ts +1 -0
- package/src/converter.ts +10 -1
- package/src/dialog.ts +14 -13
- package/src/dialogContext.ts +37 -38
- package/src/dialogEvent.ts +3 -0
- package/src/dialogEvents.ts +25 -0
- package/src/dialogHelper.ts +14 -1
- package/src/dialogManager.ts +0 -1
- package/src/dialogSet.ts +4 -8
- package/src/dialogTurnStateConstants.ts +15 -1
- package/src/intentScore.ts +9 -2
- package/src/memory/dialogPath.ts +47 -23
- package/src/memory/dialogStateManager.ts +2 -2
- package/src/memory/pathResolvers/aliasPathResolver.ts +4 -0
- package/src/memory/pathResolvers/atAtPathResolver.ts +6 -2
- package/src/memory/pathResolvers/atPathResolver.ts +13 -7
- package/src/memory/pathResolvers/dollarPathResolver.ts +7 -2
- package/src/memory/pathResolvers/hashPathResolver.ts +7 -2
- package/src/memory/pathResolvers/pathResolver.ts +10 -5
- package/src/memory/pathResolvers/percentPathResolver.ts +7 -2
- package/src/memory/scopePath.ts +35 -0
- package/src/memory/scopes/classMemoryScope.ts +18 -14
- package/src/memory/scopes/dialogClassMemoryScope.ts +12 -6
- package/src/memory/scopes/dialogContextMemoryScope.ts +11 -7
- package/src/memory/scopes/dialogMemoryScope.ts +23 -16
- package/src/memory/scopes/turnMemoryScope.ts +14 -13
- package/src/memory/turnPath.ts +61 -25
- package/src/prompts/attachmentPrompt.ts +1 -1
- package/src/prompts/choicePrompt.ts +18 -3
- package/src/prompts/confirmPrompt.ts +6 -6
- package/src/prompts/datetimePrompt.ts +6 -6
- package/src/prompts/numberPrompt.ts +6 -6
- package/src/prompts/prompt.ts +7 -7
- package/src/prompts/promptCultureModels.ts +38 -3
- package/src/recognizer.ts +8 -1
- package/src/recognizerResult.ts +24 -5
- package/src/serviceCollection.ts +22 -22
- package/src/waterfallDialog.ts +5 -5
- package/src/waterfallStepContext.ts +32 -6
|
@@ -6,13 +6,27 @@ import * as z from 'zod';
|
|
|
6
6
|
import { ServiceCollection } from './serviceCollection';
|
|
7
7
|
import { Configuration } from './configuration';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Abstract base class for defining an AgentComponent.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* An `AgentComponent` allows the registration of services, custom actions, memory scopes, and adapters.
|
|
13
|
+
* To make components available to the system, derive from this class and implement the `configureServices` method.
|
|
14
|
+
* These components are consumed by the system in appropriate places. When using Composer, the `configureServices`
|
|
15
|
+
* method is called automatically by the agent runtime, provided the components are registered in the configuration.
|
|
14
16
|
*/
|
|
15
17
|
export declare abstract class AgentComponent {
|
|
18
|
+
/**
|
|
19
|
+
* A Zod schema for validating that an object is an `AgentComponent`.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* This schema checks if the object has a `configureServices` method.
|
|
23
|
+
*/
|
|
16
24
|
static z: z.ZodType<AgentComponent, z.ZodTypeDef, AgentComponent>;
|
|
25
|
+
/**
|
|
26
|
+
* Configures the services, custom actions, memory scopes, and adapters for the component.
|
|
27
|
+
*
|
|
28
|
+
* @param services - The service collection to which services can be added.
|
|
29
|
+
* @param configuration - The configuration object for accessing settings.
|
|
30
|
+
*/
|
|
17
31
|
abstract configureServices(services: ServiceCollection, configuration: Configuration): void;
|
|
18
32
|
}
|
|
@@ -40,15 +40,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.AgentComponent = void 0;
|
|
41
41
|
const z = __importStar(require("zod"));
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Abstract base class for defining an AgentComponent.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* An `AgentComponent` allows the registration of services, custom actions, memory scopes, and adapters.
|
|
47
|
+
* To make components available to the system, derive from this class and implement the `configureServices` method.
|
|
48
|
+
* These components are consumed by the system in appropriate places. When using Composer, the `configureServices`
|
|
49
|
+
* method is called automatically by the agent runtime, provided the components are registered in the configuration.
|
|
48
50
|
*/
|
|
49
51
|
class AgentComponent {
|
|
50
52
|
}
|
|
51
53
|
exports.AgentComponent = AgentComponent;
|
|
54
|
+
/**
|
|
55
|
+
* A Zod schema for validating that an object is an `AgentComponent`.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* This schema checks if the object has a `configureServices` method.
|
|
59
|
+
*/
|
|
52
60
|
AgentComponent.z = z.custom((val) => typeof val.configureServices === 'function', {
|
|
53
61
|
message: 'AgentComponent',
|
|
54
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentComponent.js","sourceRoot":"","sources":["../../src/agentComponent.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAwB;AAIxB
|
|
1
|
+
{"version":3,"file":"agentComponent.js","sourceRoot":"","sources":["../../src/agentComponent.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAwB;AAIxB;;;;;;;;GAQG;AACH,MAAsB,cAAc;;AAApC,wCAkBC;AAjBC;;;;;GAKG;AACI,gBAAC,GAAG,CAAC,CAAC,MAAM,CAAiB,CAAC,GAAQ,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,iBAAiB,KAAK,UAAU,EAAE;IAC7F,OAAO,EAAE,gBAAgB;CAC1B,CAAC,CAAA"}
|
|
@@ -26,7 +26,7 @@ export declare class AgentStateSet {
|
|
|
26
26
|
*/
|
|
27
27
|
add(...agentStates: AgentState[]): this;
|
|
28
28
|
/**
|
|
29
|
-
* Calls
|
|
29
|
+
* Calls the {@link AgentState.load | AgentState.load method} on all of the AgentState plugins in the set.
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
32
|
* This will trigger all of the plugins to read in their state in parallel.
|
|
@@ -36,7 +36,7 @@ export declare class AgentStateSet {
|
|
|
36
36
|
*/
|
|
37
37
|
loadAll(context: TurnContext, force?: boolean): Promise<void>;
|
|
38
38
|
/**
|
|
39
|
-
* Calls
|
|
39
|
+
* Calls {@link AgentState.saveChanges | AgentState.saveChanges method} on all of the AgentState plugins in the set.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
42
|
* This will trigger all of the plugins to write out their state in parallel.
|
|
@@ -36,7 +36,7 @@ class AgentStateSet {
|
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Calls
|
|
39
|
+
* Calls the {@link AgentState.load | AgentState.load method} on all of the AgentState plugins in the set.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
42
|
* This will trigger all of the plugins to read in their state in parallel.
|
|
@@ -49,7 +49,7 @@ class AgentStateSet {
|
|
|
49
49
|
await Promise.all(promises);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Calls
|
|
52
|
+
* Calls {@link AgentState.saveChanges | AgentState.saveChanges method} on all of the AgentState plugins in the set.
|
|
53
53
|
*
|
|
54
54
|
* @remarks
|
|
55
55
|
* This will trigger all of the plugins to write out their state in parallel.
|
|
@@ -8,7 +8,16 @@ import { CardAction } from '@microsoft/agents-activity';
|
|
|
8
8
|
* user picked.
|
|
9
9
|
*/
|
|
10
10
|
export interface Choice {
|
|
11
|
+
/**
|
|
12
|
+
* The value of the choice, which is used to identify the choice.
|
|
13
|
+
*/
|
|
11
14
|
value: string;
|
|
15
|
+
/**
|
|
16
|
+
* An optional action associated with the choice, such as a button click.
|
|
17
|
+
*/
|
|
12
18
|
action?: CardAction;
|
|
19
|
+
/**
|
|
20
|
+
* Optional synonyms that can be used to recognize the choice.
|
|
21
|
+
*/
|
|
13
22
|
synonyms?: string[];
|
|
14
23
|
}
|
|
@@ -6,9 +6,21 @@ import { FindValuesOptions } from './findValues';
|
|
|
6
6
|
import { ModelResult } from './modelResult';
|
|
7
7
|
import { Choice } from './choice';
|
|
8
8
|
export interface FindChoicesOptions extends FindValuesOptions {
|
|
9
|
+
/**
|
|
10
|
+
* If true, the value of the choice will not be included in the search.
|
|
11
|
+
*/
|
|
9
12
|
noValue?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If true, the action title of the choice will not be included in the search.
|
|
15
|
+
*/
|
|
10
16
|
noAction?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* If true, numbers will be recognized as choices.
|
|
19
|
+
*/
|
|
11
20
|
recognizeNumbers?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If true, ordinals (e.g., first, second) will be recognized as choices.
|
|
23
|
+
*/
|
|
12
24
|
recognizeOrdinals?: boolean;
|
|
13
25
|
}
|
|
14
26
|
export interface FoundChoice {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findChoices.js","sourceRoot":"","sources":["../../../src/choices/findChoices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;
|
|
1
|
+
{"version":3,"file":"findChoices.js","sourceRoot":"","sources":["../../../src/choices/findChoices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA2CH,kCAsCC;AA/ED,6CAAqF;AAiCrF;;;;;;;GAOG;AACH,SAAgB,WAAW,CACzB,SAAiB,EACjB,OAA4B,EAC5B,OAA4B;IAE5B,MAAM,GAAG,GAAuB,OAAO,IAAI,EAAE,CAAA;IAE7C,MAAM,IA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YACZ,UAAU,EAAE;gBACV,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;gBACzB,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;gBACzB,OAAO,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;aAC5B;SAC0B,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -8,18 +8,45 @@ import { TokenizerFunction } from './tokenizer';
|
|
|
8
8
|
* Basic search options used to control how choices are recognized in a users utterance.
|
|
9
9
|
*/
|
|
10
10
|
export interface FindValuesOptions {
|
|
11
|
+
/**
|
|
12
|
+
* If true, allows partial matches of values in the search.
|
|
13
|
+
*/
|
|
11
14
|
allowPartialMatches?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The locale to use for tokenization and comparison.
|
|
17
|
+
*/
|
|
12
18
|
locale?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum token distance allowed between matches.
|
|
21
|
+
*/
|
|
13
22
|
maxTokenDistance?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The tokenizer function to use for breaking the utterance into tokens.
|
|
25
|
+
*/
|
|
14
26
|
tokenizer?: TokenizerFunction;
|
|
15
27
|
}
|
|
16
28
|
export interface FoundValue {
|
|
29
|
+
/**
|
|
30
|
+
* The value that was found in the search.
|
|
31
|
+
*/
|
|
17
32
|
value: string;
|
|
33
|
+
/**
|
|
34
|
+
* The index of the value in the original list.
|
|
35
|
+
*/
|
|
18
36
|
index: number;
|
|
37
|
+
/**
|
|
38
|
+
* The confidence score of the match.
|
|
39
|
+
*/
|
|
19
40
|
score: number;
|
|
20
41
|
}
|
|
21
42
|
export interface SortedValue {
|
|
43
|
+
/**
|
|
44
|
+
* The value to be searched for.
|
|
45
|
+
*/
|
|
22
46
|
value: string;
|
|
47
|
+
/**
|
|
48
|
+
* The index of the value in the original list.
|
|
49
|
+
*/
|
|
23
50
|
index: number;
|
|
24
51
|
}
|
|
25
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findValues.js","sourceRoot":"","sources":["../../../src/choices/findValues.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"findValues.js","sourceRoot":"","sources":["../../../src/choices/findValues.ts"],"names":[],"mappings":";;AAwEA,gCA2IC;AA9MD,2CAAwE;AAwDxE;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CACxB,SAAiB,EACjB,MAAqB,EACrB,OAA2B;IAE3B,SAAS,YAAY,CAAE,KAAY,EAAE,QAAgB;QACnD,KAAK,IAAI,CAAC,GAAW,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtD,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;gBAC9C,OAAO,CAAC,CAAA;YACV,CAAC;QACH,CAAC;QAED,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IAED,SAAS,cAAc,CAAE,SAAiB,EAAE,MAAqB;QAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,WAAW,EAAE,CAAC,CAAA;QACzF,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;YACzB,QAAQ,EAAE,OAAO;YACjB,UAAU,EAAE;gBACV,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,KAAK,EAAE,CAAC;aACT;SACF,CAAA;IACH,CAAC;IAED,MAAM,UAAU,GAAG,cAAc,CAAC,SAAS,EAAE,MAAM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S,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YAC5D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAA0B,EAAE,CAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAA;AACpG,CAAC"}
|
|
@@ -2,10 +2,30 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the result of a model recognition process.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the resolution containing additional details about the match.
|
|
9
|
+
*/
|
|
5
10
|
export interface ModelResult<T extends Record<string, any> = {}> {
|
|
11
|
+
/**
|
|
12
|
+
* The text that was matched.
|
|
13
|
+
*/
|
|
6
14
|
text: string;
|
|
15
|
+
/**
|
|
16
|
+
* The start index of the match in the input text.
|
|
17
|
+
*/
|
|
7
18
|
start: number;
|
|
19
|
+
/**
|
|
20
|
+
* The end index of the match in the input text.
|
|
21
|
+
*/
|
|
8
22
|
end: number;
|
|
23
|
+
/**
|
|
24
|
+
* The type of the recognized model result.
|
|
25
|
+
*/
|
|
9
26
|
typeName: string;
|
|
27
|
+
/**
|
|
28
|
+
* The resolution containing additional details about the match.
|
|
29
|
+
*/
|
|
10
30
|
resolution: T;
|
|
11
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelResult.js","sourceRoot":"","sources":["../../../src/choices/modelResult.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"modelResult.js","sourceRoot":"","sources":["../../../src/choices/modelResult.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -2,10 +2,25 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a token extracted from a text string.
|
|
7
|
+
*/
|
|
5
8
|
export interface Token {
|
|
9
|
+
/**
|
|
10
|
+
* The start index of the token in the original text.
|
|
11
|
+
*/
|
|
6
12
|
start: number;
|
|
13
|
+
/**
|
|
14
|
+
* The end index of the token in the original text.
|
|
15
|
+
*/
|
|
7
16
|
end: number;
|
|
17
|
+
/**
|
|
18
|
+
* The original text of the token.
|
|
19
|
+
*/
|
|
8
20
|
text: string;
|
|
21
|
+
/**
|
|
22
|
+
* The normalized (lowercase) version of the token text.
|
|
23
|
+
*/
|
|
9
24
|
normalized: string;
|
|
10
25
|
}
|
|
11
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../../../src/choices/tokenizer.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../../../src/choices/tokenizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA0CH,4CAwCC;AA/CD;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAE,IAAY,EAAE,OAAgB;IAC9D,MAAM,MAAM,GAAY,EAAE,CAAA;IAC1B,IAAI,KAAwB,CAAA;IAE5B,SAAS,WAAW,CAAE,GAAW;QAC/B,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;YACf,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAA;YAC3C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAClB,KAAK,GAAG,SAAS,CAAA;QACnB,CAAC;IACH,CAAC;IAED,aAAa;IACb,MAAM,MAAM,GAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAA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EAAE,MAAM,EAAE,MAAM,CAAC;QACpC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC;QACpC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC;QACpC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CACzC,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,SAAS,CAAE,KAAa,EAAE,IAAY,EAAE,EAAU;IACzD,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAA;AACrC,CAAC"}
|
|
@@ -15,6 +15,7 @@ export declare abstract class Configurable {
|
|
|
15
15
|
*/
|
|
16
16
|
configure(config: Record<string, unknown>): this;
|
|
17
17
|
/**
|
|
18
|
+
* Gets the converter for the selector configuration.
|
|
18
19
|
* @param _property The key of the conditional selector configuration.
|
|
19
20
|
* @returns The converter for the selector configuration.
|
|
20
21
|
*/
|
package/dist/src/configurable.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../src/configurable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,MAAsB,YAAY;IAChC;;;;;SAKK;IACL,SAAS,CAAE,MAA+B;QACxC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;gBACtD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;gBAChC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;gBACxC,IAAI,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;oBAC/C,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;gBAC7C,CA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;IAClB,CAAC;CACF;AA7CD,oCA6CC"}
|
package/dist/src/converter.d.ts
CHANGED
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* The converter converts
|
|
6
|
+
* The converter converts objects from one type to another.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam From - The type of the input value to be converted.
|
|
9
|
+
* @typeParam To - The type of the output value after conversion.
|
|
7
10
|
*/
|
|
8
11
|
export interface Converter<From = unknown, To = unknown> {
|
|
9
12
|
convert(value: From | To): To;
|
|
10
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A factory type for creating instances of a `Converter`.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam From - The type of the input value to be converted.
|
|
18
|
+
* @typeParam To - The type of the output value after conversion.
|
|
19
|
+
*/
|
|
11
20
|
export type ConverterFactory<From = unknown, To = unknown> = {
|
|
12
21
|
new (...args: unknown[]): Converter<From, To>;
|
|
13
22
|
};
|
package/dist/src/dialog.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
44
44
|
* An encoded string used to aid in the detection of agent changes on re-deployment.
|
|
45
45
|
*
|
|
46
46
|
* @remarks
|
|
47
|
-
* This defaults to returning the
|
|
47
|
+
* This defaults to returning the dialog's `id` but can be overridden to provide more
|
|
48
48
|
* precise change detection logic. Any dialog on the stack that has its version change will
|
|
49
49
|
* result in a `versionChanged` event will be raised. If this event is not handled by the agent,
|
|
50
50
|
* an error will be thrown resulting in the agent error handler logic being run.
|
|
@@ -62,12 +62,12 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
62
62
|
* @remarks
|
|
63
63
|
* Derived dialogs must override this method.
|
|
64
64
|
*
|
|
65
|
-
* The DialogContext calls this method when it creates
|
|
66
|
-
* a new DialogInstance for this dialog, pushes it
|
|
65
|
+
* The {@link DialogContext} calls this method when it creates
|
|
66
|
+
* a new {@link DialogInstance} for this dialog, pushes it
|
|
67
67
|
* onto the dialog stack, and starts the dialog.
|
|
68
68
|
*
|
|
69
69
|
* A dialog that represents a single-turn conversation should await
|
|
70
|
-
* DialogContext.endDialog before exiting this method.
|
|
70
|
+
* {@link DialogContext.endDialog} before exiting this method.
|
|
71
71
|
*
|
|
72
72
|
*/
|
|
73
73
|
abstract beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult>;
|
|
@@ -80,11 +80,11 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
80
80
|
* Derived dialogs that support multiple-turn conversations should override this method.
|
|
81
81
|
* By default, this method signals that the dialog is complete and returns.
|
|
82
82
|
*
|
|
83
|
-
* The DialogContext calls this method when it continues
|
|
83
|
+
* The {@link DialogContext} calls this method when it continues
|
|
84
84
|
* the dialog.
|
|
85
85
|
*
|
|
86
86
|
* To signal to the dialog context that this dialog has completed, await
|
|
87
|
-
* DialogContext.endDialog before exiting this method.
|
|
87
|
+
* {@link DialogContext.endDialog} before exiting this method.
|
|
88
88
|
*
|
|
89
89
|
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result.
|
|
90
90
|
*/
|
|
@@ -100,19 +100,19 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
100
100
|
* Derived dialogs that support multiple-turn conversations should override this method.
|
|
101
101
|
* By default, this method signals that the dialog is complete and returns.
|
|
102
102
|
*
|
|
103
|
-
* The DialogContext calls this method when it resumes
|
|
103
|
+
* The {@link DialogContext} calls this method when it resumes
|
|
104
104
|
* the dialog. If the previous dialog on the stack returned a value, that value is in the `result`
|
|
105
105
|
* parameter.
|
|
106
106
|
*
|
|
107
|
-
* To start a _child_ dialog, use DialogContext.beginDialog or DialogContext.prompt; however, this dialog will not
|
|
107
|
+
* To start a _child_ dialog, use {@link DialogContext.beginDialog} or {@link DialogContext.prompt}; however, this dialog will not
|
|
108
108
|
* necessarily be the one that started the child dialog.
|
|
109
|
-
* To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.
|
|
109
|
+
* To signal to the dialog context that this dialog has completed, await {@link DialogContext.endDialog} before exiting this method.
|
|
110
110
|
*
|
|
111
111
|
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result.
|
|
112
112
|
*/
|
|
113
113
|
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>;
|
|
114
114
|
/**
|
|
115
|
-
* When overridden in a derived class,
|
|
115
|
+
* When overridden in a derived class, prompts the user again for input.
|
|
116
116
|
*
|
|
117
117
|
* @param _context The context object for the turn.
|
|
118
118
|
* @param _instance Current state information for this dialog.
|
|
@@ -121,7 +121,7 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
121
121
|
* Derived dialogs that support validation and re-prompt logic should override this method.
|
|
122
122
|
* By default, this method has no effect.
|
|
123
123
|
*
|
|
124
|
-
* The DialogContext calls this method when the current
|
|
124
|
+
* The {@link DialogContext} calls this method when the current
|
|
125
125
|
* dialog should re-request input from the user. This method is implemented for prompt dialogs.
|
|
126
126
|
*
|
|
127
127
|
*/
|
|
@@ -137,13 +137,14 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable
|
|
|
137
137
|
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
|
|
138
138
|
* By default, this method has no effect.
|
|
139
139
|
*
|
|
140
|
-
* The DialogContext calls this method when the current
|
|
140
|
+
* The {@link DialogContext} calls this method when the current
|
|
141
141
|
* dialog is ending.
|
|
142
142
|
*
|
|
143
143
|
*/
|
|
144
144
|
endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>;
|
|
145
145
|
/**
|
|
146
|
-
* Called when an event has been raised, using
|
|
146
|
+
* Called when an event has been raised, using {@link DialogContext.emitEvent | DialogContext.emitEvent method },
|
|
147
|
+
* by either the current dialog or a dialog that the current dialog started.
|
|
147
148
|
*
|
|
148
149
|
* @param dialogContext - The dialog context for the current turn of conversation.
|
|
149
150
|
* @param event - The event being raised.
|
package/dist/src/dialog.js
CHANGED
|
@@ -39,7 +39,7 @@ class Dialog extends configurable_1.Configurable {
|
|
|
39
39
|
* An encoded string used to aid in the detection of agent changes on re-deployment.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
|
-
* This defaults to returning the
|
|
42
|
+
* This defaults to returning the dialog's `id` but can be overridden to provide more
|
|
43
43
|
* precise change detection logic. Any dialog on the stack that has its version change will
|
|
44
44
|
* result in a `versionChanged` event will be raised. If this event is not handled by the agent,
|
|
45
45
|
* an error will be thrown resulting in the agent error handler logic being run.
|
|
@@ -59,11 +59,11 @@ class Dialog extends configurable_1.Configurable {
|
|
|
59
59
|
* Derived dialogs that support multiple-turn conversations should override this method.
|
|
60
60
|
* By default, this method signals that the dialog is complete and returns.
|
|
61
61
|
*
|
|
62
|
-
* The DialogContext calls this method when it continues
|
|
62
|
+
* The {@link DialogContext} calls this method when it continues
|
|
63
63
|
* the dialog.
|
|
64
64
|
*
|
|
65
65
|
* To signal to the dialog context that this dialog has completed, await
|
|
66
|
-
* DialogContext.endDialog before exiting this method.
|
|
66
|
+
* {@link DialogContext.endDialog} before exiting this method.
|
|
67
67
|
*
|
|
68
68
|
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result.
|
|
69
69
|
*/
|
|
@@ -82,13 +82,13 @@ class Dialog extends configurable_1.Configurable {
|
|
|
82
82
|
* Derived dialogs that support multiple-turn conversations should override this method.
|
|
83
83
|
* By default, this method signals that the dialog is complete and returns.
|
|
84
84
|
*
|
|
85
|
-
* The DialogContext calls this method when it resumes
|
|
85
|
+
* The {@link DialogContext} calls this method when it resumes
|
|
86
86
|
* the dialog. If the previous dialog on the stack returned a value, that value is in the `result`
|
|
87
87
|
* parameter.
|
|
88
88
|
*
|
|
89
|
-
* To start a _child_ dialog, use DialogContext.beginDialog or DialogContext.prompt; however, this dialog will not
|
|
89
|
+
* To start a _child_ dialog, use {@link DialogContext.beginDialog} or {@link DialogContext.prompt}; however, this dialog will not
|
|
90
90
|
* necessarily be the one that started the child dialog.
|
|
91
|
-
* To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.
|
|
91
|
+
* To signal to the dialog context that this dialog has completed, await {@link DialogContext.endDialog} before exiting this method.
|
|
92
92
|
*
|
|
93
93
|
* @returns {Promise<DialogTurnResult>} A promise resolving to the dialog turn result.
|
|
94
94
|
*/
|
|
@@ -97,7 +97,7 @@ class Dialog extends configurable_1.Configurable {
|
|
|
97
97
|
return dc.endDialog(result);
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* When overridden in a derived class,
|
|
100
|
+
* When overridden in a derived class, prompts the user again for input.
|
|
101
101
|
*
|
|
102
102
|
* @param _context The context object for the turn.
|
|
103
103
|
* @param _instance Current state information for this dialog.
|
|
@@ -106,7 +106,7 @@ class Dialog extends configurable_1.Configurable {
|
|
|
106
106
|
* Derived dialogs that support validation and re-prompt logic should override this method.
|
|
107
107
|
* By default, this method has no effect.
|
|
108
108
|
*
|
|
109
|
-
* The DialogContext calls this method when the current
|
|
109
|
+
* The {@link DialogContext} calls this method when the current
|
|
110
110
|
* dialog should re-request input from the user. This method is implemented for prompt dialogs.
|
|
111
111
|
*
|
|
112
112
|
*/
|
|
@@ -124,7 +124,7 @@ class Dialog extends configurable_1.Configurable {
|
|
|
124
124
|
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
|
|
125
125
|
* By default, this method has no effect.
|
|
126
126
|
*
|
|
127
|
-
* The DialogContext calls this method when the current
|
|
127
|
+
* The {@link DialogContext} calls this method when the current
|
|
128
128
|
* dialog is ending.
|
|
129
129
|
*
|
|
130
130
|
*/
|
|
@@ -132,7 +132,8 @@ class Dialog extends configurable_1.Configurable {
|
|
|
132
132
|
// No-op by default
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Called when an event has been raised, using
|
|
135
|
+
* Called when an event has been raised, using {@link DialogContext.emitEvent | DialogContext.emitEvent method },
|
|
136
|
+
* by either the current dialog or a dialog that the current dialog started.
|
|
136
137
|
*
|
|
137
138
|
* @param dialogContext - The dialog context for the current turn of conversation.
|
|
138
139
|
* @param event - The event being raised.
|
package/dist/src/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/dialog.ts"],"names":[],"mappings":";;;AAMA,iDAA6C;AAK7C,yDAAqD;AAErD;;GAEG;AACH,MAAsB,MAA8B,SAAQ,2BAAY;IAYtE;;;;SAIK;IACL,YAAa,QAAiB;QAC5B,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAA;IACpB,CAAC;IAED;;;;;;SAMK;IACL,IAAI,EAAE;QACJ,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED;;SAEK;IACL,IAAI,EAAE,CAAE,KAAa;QACnB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAA;IAClB,CAAC;IAED;;;;;;;;;;;SAWK;IACL,UAAU;QACR,OAAO,IAAI,CAAC,EAAE,CAAA;IAChB,CAAC;IAqBD;;;;;;;;;;;;;;;;SAgBK;IACL,KAAK,CAAC,cAAc,CAAE,EAAiB;QACrC,0CAA0C;QAC1C,OAAO,EAAE,CAAC,SAAS,EAAE,CAAA;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;SAoBK;IACL,KAAK,CAAC,YAAY,CAAE,EAAiB,EAAE,MAAoB,EAAE,MAAY;QACvE,sEAAsE;QACtE,OAAO,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED;;;;;;;;;;;;;SAaK;IACL,KAAK,CAAC,cAAc,CAAE,QAAqB,EAAE,SAAyB;QACpE,mBAAmB;IACrB,CAAC;IAED;;;;;;;;;;;;;;SAcK;IAC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