@microsoft/agents-hosting 1.0.0 → 1.0.3-g444d99f704
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/package.json +2 -2
- package/dist/src/activityHandler.d.ts +0 -1
- package/dist/src/activityHandler.js +0 -1
- package/dist/src/activityHandler.js.map +1 -1
- package/dist/src/agent-client/agentResponseHandler.d.ts +6 -6
- package/dist/src/agent-client/agentResponseHandler.js +6 -6
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.d.ts +12 -4
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js +5 -1
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +24 -7
- package/dist/src/app/agentApplication.js +24 -7
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/appRoute.d.ts +8 -4
- package/dist/src/app/attachmentDownloader.d.ts +3 -1
- package/dist/src/app/attachmentDownloader.js +3 -1
- package/dist/src/app/attachmentDownloader.js.map +1 -1
- package/dist/src/app/authorization.d.ts +26 -18
- package/dist/src/app/authorization.js +26 -18
- package/dist/src/app/authorization.js.map +1 -1
- package/dist/src/app/routeRank.d.ts +10 -3
- package/dist/src/app/routeRank.js +10 -3
- package/dist/src/app/routeRank.js.map +1 -1
- package/dist/src/app/streaming/streamingResponse.d.ts +23 -2
- package/dist/src/app/streaming/streamingResponse.js +23 -2
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/app/turnState.d.ts +69 -19
- package/dist/src/app/turnState.js +69 -19
- package/dist/src/app/turnState.js.map +1 -1
- package/dist/src/auth/authConfiguration.d.ts +16 -9
- package/dist/src/auth/authConfiguration.js +11 -6
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/jwt-middleware.js +26 -18
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/cards/adaptiveCard.d.ts +1 -1
- package/dist/src/headerPropagation.d.ts +18 -6
- package/dist/src/state/agentState.d.ts +23 -7
- package/dist/src/state/agentState.js +19 -7
- package/dist/src/state/agentState.js.map +1 -1
- package/dist/src/state/agentStatePropertyAccesor.d.ts +63 -41
- package/dist/src/state/agentStatePropertyAccesor.js +43 -32
- package/dist/src/state/agentStatePropertyAccesor.js.map +1 -1
- package/dist/src/storage/fileStorage.d.ts +8 -6
- package/dist/src/storage/fileStorage.js +8 -6
- package/dist/src/storage/fileStorage.js.map +1 -1
- package/dist/src/storage/memoryStorage.d.ts +12 -7
- package/dist/src/storage/memoryStorage.js +12 -7
- package/dist/src/storage/memoryStorage.js.map +1 -1
- package/dist/src/storage/storage.d.ts +18 -1
- package/dist/src/turnContext.d.ts +31 -20
- package/dist/src/turnContext.js +31 -20
- package/dist/src/turnContext.js.map +1 -1
- package/package.json +2 -2
- package/src/activityHandler.ts +0 -1
- package/src/agent-client/agentResponseHandler.ts +6 -6
- package/src/app/adaptiveCards/adaptiveCardsActions.ts +12 -4
- package/src/app/agentApplication.ts +24 -7
- package/src/app/appRoute.ts +8 -4
- package/src/app/attachmentDownloader.ts +3 -1
- package/src/app/authorization.ts +26 -18
- package/src/app/routeRank.ts +10 -3
- package/src/app/streaming/streamingResponse.ts +23 -2
- package/src/app/turnState.ts +69 -19
- package/src/auth/authConfiguration.ts +16 -9
- package/src/auth/jwt-middleware.ts +24 -17
- package/src/cards/adaptiveCard.ts +1 -1
- package/src/headerPropagation.ts +18 -6
- package/src/state/agentState.ts +23 -7
- package/src/state/agentStatePropertyAccesor.ts +63 -41
- package/src/storage/fileStorage.ts +8 -6
- package/src/storage/memoryStorage.ts +12 -7
- package/src/storage/storage.ts +18 -1
- package/src/turnContext.ts +31 -20
|
@@ -28,12 +28,18 @@ export interface DefaultTempState {
|
|
|
28
28
|
inputFiles: InputFile[];
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Base class defining a collection of turn state scopes.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam TConversationState - Type for conversation-scoped state
|
|
34
|
+
* @typeParam TUserState - Type for user-scoped state
|
|
35
|
+
* @typeParam TTempState - Type for temporary state that exists only for the current turn
|
|
36
|
+
* @typeParam TSSOState - Type for Single Sign-On (SSO) state
|
|
37
|
+
*
|
|
32
38
|
* @remarks
|
|
33
39
|
* Developers can create a derived class that extends `TurnState` to add additional state scopes.
|
|
34
40
|
*
|
|
35
41
|
* @example
|
|
36
|
-
* ```
|
|
42
|
+
* ```javascript
|
|
37
43
|
* class MyTurnState extends TurnState {
|
|
38
44
|
* protected async onComputeStorageKeys(context) {
|
|
39
45
|
* const keys = await super.onComputeStorageKeys(context);
|
|
@@ -58,10 +64,7 @@ export interface DefaultTempState {
|
|
|
58
64
|
* }
|
|
59
65
|
* }
|
|
60
66
|
* ```
|
|
61
|
-
*
|
|
62
|
-
* @typeParam TUserState - Type for user-scoped state
|
|
63
|
-
* @typeParam TTempState - Type for temporary state that exists only for the current turn
|
|
64
|
-
* @typeParam TSSOState - Type for Single Sign-On (SSO) state
|
|
67
|
+
*
|
|
65
68
|
*/
|
|
66
69
|
export declare class TurnState<TConversationState = DefaultConversationState, TUserState = DefaultUserState, TTempState = DefaultTempState> implements AppMemory {
|
|
67
70
|
private _scopes;
|
|
@@ -70,102 +73,138 @@ export declare class TurnState<TConversationState = DefaultConversationState, TU
|
|
|
70
73
|
private _stateNotLoadedString;
|
|
71
74
|
/**
|
|
72
75
|
* Gets the conversation-scoped state.
|
|
73
|
-
*
|
|
76
|
+
*
|
|
74
77
|
* @returns The conversation state object
|
|
75
78
|
* @throws Error if state hasn't been loaded
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* This state is shared by all users in the same conversation.
|
|
76
82
|
*/
|
|
77
83
|
get conversation(): TConversationState;
|
|
78
84
|
/**
|
|
79
85
|
* Sets the conversation-scoped state.
|
|
86
|
+
*
|
|
80
87
|
* @param value - The new conversation state object
|
|
81
88
|
* @throws Error if state hasn't been loaded
|
|
82
89
|
*/
|
|
83
90
|
set conversation(value: TConversationState);
|
|
84
91
|
/**
|
|
85
92
|
* Gets whether the state has been loaded from storage
|
|
93
|
+
*
|
|
86
94
|
* @returns True if the state has been loaded, false otherwise
|
|
87
95
|
*/
|
|
88
96
|
get isLoaded(): boolean;
|
|
89
97
|
/**
|
|
90
98
|
* Gets the temporary state for the current turn.
|
|
91
|
-
*
|
|
99
|
+
*
|
|
92
100
|
* @returns The temporary state object
|
|
93
101
|
* @throws Error if state hasn't been loaded
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* This state is not persisted between turns.
|
|
94
105
|
*/
|
|
95
106
|
get temp(): TTempState;
|
|
96
107
|
/**
|
|
97
108
|
* Sets the temporary state for the current turn.
|
|
109
|
+
*
|
|
98
110
|
* @param value - The new temporary state object
|
|
99
111
|
* @throws Error if state hasn't been loaded
|
|
100
112
|
*/
|
|
101
113
|
set temp(value: TTempState);
|
|
102
114
|
/**
|
|
103
115
|
* Gets the user-scoped state.
|
|
104
|
-
*
|
|
116
|
+
*
|
|
105
117
|
* @returns The user state object
|
|
106
118
|
* @throws Error if state hasn't been loaded
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
* This state is unique to each user and persists across conversations.
|
|
107
122
|
*/
|
|
108
123
|
get user(): TUserState;
|
|
109
124
|
/**
|
|
110
125
|
* Sets the user-scoped state.
|
|
126
|
+
*
|
|
111
127
|
* @param value - The new user state object
|
|
112
128
|
* @throws Error if state hasn't been loaded
|
|
113
129
|
*/
|
|
114
130
|
set user(value: TUserState);
|
|
115
131
|
/**
|
|
116
132
|
* Marks the conversation state for deletion.
|
|
117
|
-
*
|
|
133
|
+
*
|
|
118
134
|
* @throws Error if state hasn't been loaded
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* The state will be deleted from storage on the next call to save().
|
|
119
138
|
*/
|
|
120
139
|
deleteConversationState(): void;
|
|
121
140
|
/**
|
|
122
141
|
* Marks the temporary state for deletion.
|
|
123
|
-
*
|
|
142
|
+
*
|
|
124
143
|
* @throws Error if state hasn't been loaded
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* Since temporary state is not persisted, this just clears the in-memory object.
|
|
125
147
|
*/
|
|
126
148
|
deleteTempState(): void;
|
|
127
149
|
/**
|
|
128
150
|
* Marks the user state for deletion.
|
|
129
|
-
*
|
|
151
|
+
*
|
|
130
152
|
* @throws Error if state hasn't been loaded
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* The state will be deleted from storage on the next call to save().
|
|
131
156
|
*/
|
|
132
157
|
deleteUserState(): void;
|
|
133
158
|
/**
|
|
134
159
|
* Gets a specific state scope by name.
|
|
160
|
+
*
|
|
135
161
|
* @param scope - The name of the scope to retrieve
|
|
136
162
|
* @returns The state entry for the scope, or undefined if not found
|
|
137
163
|
*/
|
|
138
164
|
getScope(scope: string): TurnStateEntry | undefined;
|
|
139
165
|
/**
|
|
140
166
|
* Deletes a value from state by dot-notation path.
|
|
141
|
-
*
|
|
167
|
+
*
|
|
142
168
|
* @param path - The path to the value to delete
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
143
172
|
*/
|
|
144
173
|
deleteValue(path: string): void;
|
|
145
174
|
/**
|
|
146
175
|
* Checks if a value exists in state by dot-notation path.
|
|
147
|
-
*
|
|
176
|
+
*
|
|
148
177
|
* @param path - The path to check
|
|
149
178
|
* @returns True if the value exists, false otherwise
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
150
182
|
*/
|
|
151
183
|
hasValue(path: string): boolean;
|
|
152
184
|
/**
|
|
153
185
|
* Gets a value from state by dot-notation path.
|
|
154
|
-
*
|
|
186
|
+
*
|
|
155
187
|
* @typeParam TValue - The type of the value to retrieve
|
|
156
188
|
* @param path - The path to the value
|
|
157
189
|
* @returns The value at the specified path
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
158
193
|
*/
|
|
159
194
|
getValue<TValue = unknown>(path: string): TValue;
|
|
160
195
|
/**
|
|
161
196
|
* Sets a value in state by dot-notation path.
|
|
162
|
-
*
|
|
197
|
+
*
|
|
163
198
|
* @param path - The path to set
|
|
164
199
|
* @param value - The value to set
|
|
200
|
+
*
|
|
201
|
+
* @remarks
|
|
202
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
165
203
|
*/
|
|
166
204
|
setValue(path: string, value: unknown): void;
|
|
167
205
|
/**
|
|
168
206
|
* Loads state from storage into memory.
|
|
207
|
+
*
|
|
169
208
|
* @param context - The turn context
|
|
170
209
|
* @param storage - Optional storage provider (if not provided, state will be in-memory only)
|
|
171
210
|
* @param force - If true, forces a reload from storage even if state is already loaded
|
|
@@ -174,26 +213,37 @@ export declare class TurnState<TConversationState = DefaultConversationState, TU
|
|
|
174
213
|
load(context: TurnContext, storage?: Storage, force?: boolean): Promise<boolean>;
|
|
175
214
|
/**
|
|
176
215
|
* Saves state changes to storage.
|
|
177
|
-
*
|
|
216
|
+
*
|
|
178
217
|
* @param context - The turn context
|
|
179
218
|
* @param storage - Optional storage provider (if not provided, state changes won't be persisted)
|
|
180
219
|
* @returns Promise that resolves when the save operation is complete
|
|
181
220
|
* @throws Error if state hasn't been loaded
|
|
221
|
+
*
|
|
222
|
+
* @remarks
|
|
223
|
+
* Only changed scopes will be persisted.
|
|
182
224
|
*/
|
|
183
225
|
save(context: TurnContext, storage?: Storage): Promise<void>;
|
|
184
226
|
/**
|
|
185
227
|
* Computes the storage keys for each scope based on the turn context.
|
|
186
|
-
*
|
|
228
|
+
*
|
|
187
229
|
* @param context - The turn context
|
|
188
230
|
* @returns Promise that resolves to a dictionary of scope names to storage keys
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* Override this method in derived classes to add or modify storage keys.
|
|
234
|
+
*
|
|
189
235
|
* @protected
|
|
190
236
|
*/
|
|
191
237
|
protected onComputeStorageKeys(context: TurnContext): Promise<Record<string, string>>;
|
|
192
238
|
/**
|
|
193
239
|
* Parses a dot-notation path into scope and property name.
|
|
194
|
-
*
|
|
240
|
+
*
|
|
195
241
|
* @param path - The path to parse (format: "scope.property" or just "property")
|
|
196
242
|
* @returns Object containing the scope entry and property name
|
|
243
|
+
*
|
|
244
|
+
* @remarks
|
|
245
|
+
* If no scope is specified, defaults to the temp scope.
|
|
246
|
+
*
|
|
197
247
|
* @private
|
|
198
248
|
*/
|
|
199
249
|
private getScopeAndName;
|
|
@@ -12,12 +12,18 @@ const CONVERSATION_SCOPE = 'conversation';
|
|
|
12
12
|
const USER_SCOPE = 'user';
|
|
13
13
|
const TEMP_SCOPE = 'temp';
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Base class defining a collection of turn state scopes.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam TConversationState - Type for conversation-scoped state
|
|
18
|
+
* @typeParam TUserState - Type for user-scoped state
|
|
19
|
+
* @typeParam TTempState - Type for temporary state that exists only for the current turn
|
|
20
|
+
* @typeParam TSSOState - Type for Single Sign-On (SSO) state
|
|
21
|
+
*
|
|
16
22
|
* @remarks
|
|
17
23
|
* Developers can create a derived class that extends `TurnState` to add additional state scopes.
|
|
18
24
|
*
|
|
19
25
|
* @example
|
|
20
|
-
* ```
|
|
26
|
+
* ```javascript
|
|
21
27
|
* class MyTurnState extends TurnState {
|
|
22
28
|
* protected async onComputeStorageKeys(context) {
|
|
23
29
|
* const keys = await super.onComputeStorageKeys(context);
|
|
@@ -42,10 +48,7 @@ const TEMP_SCOPE = 'temp';
|
|
|
42
48
|
* }
|
|
43
49
|
* }
|
|
44
50
|
* ```
|
|
45
|
-
*
|
|
46
|
-
* @typeParam TUserState - Type for user-scoped state
|
|
47
|
-
* @typeParam TTempState - Type for temporary state that exists only for the current turn
|
|
48
|
-
* @typeParam TSSOState - Type for Single Sign-On (SSO) state
|
|
51
|
+
*
|
|
49
52
|
*/
|
|
50
53
|
class TurnState {
|
|
51
54
|
constructor() {
|
|
@@ -55,9 +58,12 @@ class TurnState {
|
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* Gets the conversation-scoped state.
|
|
58
|
-
*
|
|
61
|
+
*
|
|
59
62
|
* @returns The conversation state object
|
|
60
63
|
* @throws Error if state hasn't been loaded
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* This state is shared by all users in the same conversation.
|
|
61
67
|
*/
|
|
62
68
|
get conversation() {
|
|
63
69
|
const scope = this.getScope(CONVERSATION_SCOPE);
|
|
@@ -68,6 +74,7 @@ class TurnState {
|
|
|
68
74
|
}
|
|
69
75
|
/**
|
|
70
76
|
* Sets the conversation-scoped state.
|
|
77
|
+
*
|
|
71
78
|
* @param value - The new conversation state object
|
|
72
79
|
* @throws Error if state hasn't been loaded
|
|
73
80
|
*/
|
|
@@ -80,6 +87,7 @@ class TurnState {
|
|
|
80
87
|
}
|
|
81
88
|
/**
|
|
82
89
|
* Gets whether the state has been loaded from storage
|
|
90
|
+
*
|
|
83
91
|
* @returns True if the state has been loaded, false otherwise
|
|
84
92
|
*/
|
|
85
93
|
get isLoaded() {
|
|
@@ -87,9 +95,12 @@ class TurnState {
|
|
|
87
95
|
}
|
|
88
96
|
/**
|
|
89
97
|
* Gets the temporary state for the current turn.
|
|
90
|
-
*
|
|
98
|
+
*
|
|
91
99
|
* @returns The temporary state object
|
|
92
100
|
* @throws Error if state hasn't been loaded
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* This state is not persisted between turns.
|
|
93
104
|
*/
|
|
94
105
|
get temp() {
|
|
95
106
|
const scope = this.getScope(TEMP_SCOPE);
|
|
@@ -100,6 +111,7 @@ class TurnState {
|
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
102
113
|
* Sets the temporary state for the current turn.
|
|
114
|
+
*
|
|
103
115
|
* @param value - The new temporary state object
|
|
104
116
|
* @throws Error if state hasn't been loaded
|
|
105
117
|
*/
|
|
@@ -112,9 +124,12 @@ class TurnState {
|
|
|
112
124
|
}
|
|
113
125
|
/**
|
|
114
126
|
* Gets the user-scoped state.
|
|
115
|
-
*
|
|
127
|
+
*
|
|
116
128
|
* @returns The user state object
|
|
117
129
|
* @throws Error if state hasn't been loaded
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* This state is unique to each user and persists across conversations.
|
|
118
133
|
*/
|
|
119
134
|
get user() {
|
|
120
135
|
const scope = this.getScope(USER_SCOPE);
|
|
@@ -125,6 +140,7 @@ class TurnState {
|
|
|
125
140
|
}
|
|
126
141
|
/**
|
|
127
142
|
* Sets the user-scoped state.
|
|
143
|
+
*
|
|
128
144
|
* @param value - The new user state object
|
|
129
145
|
* @throws Error if state hasn't been loaded
|
|
130
146
|
*/
|
|
@@ -137,8 +153,11 @@ class TurnState {
|
|
|
137
153
|
}
|
|
138
154
|
/**
|
|
139
155
|
* Marks the conversation state for deletion.
|
|
140
|
-
*
|
|
156
|
+
*
|
|
141
157
|
* @throws Error if state hasn't been loaded
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* The state will be deleted from storage on the next call to save().
|
|
142
161
|
*/
|
|
143
162
|
deleteConversationState() {
|
|
144
163
|
const scope = this.getScope(CONVERSATION_SCOPE);
|
|
@@ -149,8 +168,11 @@ class TurnState {
|
|
|
149
168
|
}
|
|
150
169
|
/**
|
|
151
170
|
* Marks the temporary state for deletion.
|
|
152
|
-
*
|
|
171
|
+
*
|
|
153
172
|
* @throws Error if state hasn't been loaded
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* Since temporary state is not persisted, this just clears the in-memory object.
|
|
154
176
|
*/
|
|
155
177
|
deleteTempState() {
|
|
156
178
|
const scope = this.getScope(TEMP_SCOPE);
|
|
@@ -161,8 +183,11 @@ class TurnState {
|
|
|
161
183
|
}
|
|
162
184
|
/**
|
|
163
185
|
* Marks the user state for deletion.
|
|
164
|
-
*
|
|
186
|
+
*
|
|
165
187
|
* @throws Error if state hasn't been loaded
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* The state will be deleted from storage on the next call to save().
|
|
166
191
|
*/
|
|
167
192
|
deleteUserState() {
|
|
168
193
|
const scope = this.getScope(USER_SCOPE);
|
|
@@ -173,6 +198,7 @@ class TurnState {
|
|
|
173
198
|
}
|
|
174
199
|
/**
|
|
175
200
|
* Gets a specific state scope by name.
|
|
201
|
+
*
|
|
176
202
|
* @param scope - The name of the scope to retrieve
|
|
177
203
|
* @returns The state entry for the scope, or undefined if not found
|
|
178
204
|
*/
|
|
@@ -181,8 +207,11 @@ class TurnState {
|
|
|
181
207
|
}
|
|
182
208
|
/**
|
|
183
209
|
* Deletes a value from state by dot-notation path.
|
|
184
|
-
*
|
|
210
|
+
*
|
|
185
211
|
* @param path - The path to the value to delete
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
186
215
|
*/
|
|
187
216
|
deleteValue(path) {
|
|
188
217
|
const { scope, name } = this.getScopeAndName(path);
|
|
@@ -192,9 +221,12 @@ class TurnState {
|
|
|
192
221
|
}
|
|
193
222
|
/**
|
|
194
223
|
* Checks if a value exists in state by dot-notation path.
|
|
195
|
-
*
|
|
224
|
+
*
|
|
196
225
|
* @param path - The path to check
|
|
197
226
|
* @returns True if the value exists, false otherwise
|
|
227
|
+
*
|
|
228
|
+
* @remarks
|
|
229
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
198
230
|
*/
|
|
199
231
|
hasValue(path) {
|
|
200
232
|
const { scope, name } = this.getScopeAndName(path);
|
|
@@ -202,10 +234,13 @@ class TurnState {
|
|
|
202
234
|
}
|
|
203
235
|
/**
|
|
204
236
|
* Gets a value from state by dot-notation path.
|
|
205
|
-
*
|
|
237
|
+
*
|
|
206
238
|
* @typeParam TValue - The type of the value to retrieve
|
|
207
239
|
* @param path - The path to the value
|
|
208
240
|
* @returns The value at the specified path
|
|
241
|
+
*
|
|
242
|
+
* @remarks
|
|
243
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
209
244
|
*/
|
|
210
245
|
getValue(path) {
|
|
211
246
|
const { scope, name } = this.getScopeAndName(path);
|
|
@@ -213,9 +248,12 @@ class TurnState {
|
|
|
213
248
|
}
|
|
214
249
|
/**
|
|
215
250
|
* Sets a value in state by dot-notation path.
|
|
216
|
-
*
|
|
251
|
+
*
|
|
217
252
|
* @param path - The path to set
|
|
218
253
|
* @param value - The value to set
|
|
254
|
+
*
|
|
255
|
+
* @remarks
|
|
256
|
+
* Format: "scope.property" or just "property" (defaults to temp scope)
|
|
219
257
|
*/
|
|
220
258
|
setValue(path, value) {
|
|
221
259
|
const { scope, name } = this.getScopeAndName(path);
|
|
@@ -223,6 +261,7 @@ class TurnState {
|
|
|
223
261
|
}
|
|
224
262
|
/**
|
|
225
263
|
* Loads state from storage into memory.
|
|
264
|
+
*
|
|
226
265
|
* @param context - The turn context
|
|
227
266
|
* @param storage - Optional storage provider (if not provided, state will be in-memory only)
|
|
228
267
|
* @param force - If true, forces a reload from storage even if state is already loaded
|
|
@@ -267,11 +306,14 @@ class TurnState {
|
|
|
267
306
|
}
|
|
268
307
|
/**
|
|
269
308
|
* Saves state changes to storage.
|
|
270
|
-
*
|
|
309
|
+
*
|
|
271
310
|
* @param context - The turn context
|
|
272
311
|
* @param storage - Optional storage provider (if not provided, state changes won't be persisted)
|
|
273
312
|
* @returns Promise that resolves when the save operation is complete
|
|
274
313
|
* @throws Error if state hasn't been loaded
|
|
314
|
+
*
|
|
315
|
+
* @remarks
|
|
316
|
+
* Only changed scopes will be persisted.
|
|
275
317
|
*/
|
|
276
318
|
async save(context, storage) {
|
|
277
319
|
if (!this._isLoaded && this._loadingPromise) {
|
|
@@ -319,9 +361,13 @@ class TurnState {
|
|
|
319
361
|
}
|
|
320
362
|
/**
|
|
321
363
|
* Computes the storage keys for each scope based on the turn context.
|
|
322
|
-
*
|
|
364
|
+
*
|
|
323
365
|
* @param context - The turn context
|
|
324
366
|
* @returns Promise that resolves to a dictionary of scope names to storage keys
|
|
367
|
+
*
|
|
368
|
+
* @remarks
|
|
369
|
+
* Override this method in derived classes to add or modify storage keys.
|
|
370
|
+
*
|
|
325
371
|
* @protected
|
|
326
372
|
*/
|
|
327
373
|
onComputeStorageKeys(context) {
|
|
@@ -350,9 +396,13 @@ class TurnState {
|
|
|
350
396
|
}
|
|
351
397
|
/**
|
|
352
398
|
* Parses a dot-notation path into scope and property name.
|
|
353
|
-
*
|
|
399
|
+
*
|
|
354
400
|
* @param path - The path to parse (format: "scope.property" or just "property")
|
|
355
401
|
* @returns Object containing the scope entry and property name
|
|
402
|
+
*
|
|
403
|
+
* @remarks
|
|
404
|
+
* If no scope is specified, defaults to the temp scope.
|
|
405
|
+
*
|
|
356
406
|
* @private
|
|
357
407
|
*/
|
|
358
408
|
getScopeAndName(path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnState.js","sourceRoot":"","sources":["../../../src/app/turnState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,qDAAiD;AAEjD,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,kBAAkB,CAAC,CAAA;AAExC,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAEzC,MAAM,UAAU,GAAG,MAAM,CAAA;AAEzB,MAAM,UAAU,GAAG,MAAM,CAAA;AAuBzB
|
|
1
|
+
{"version":3,"file":"turnState.js","sourceRoot":"","sources":["../../../src/app/turnState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,qDAAiD;AAEjD,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,kBAAkB,CAAC,CAAA;AAExC,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAEzC,MAAM,UAAU,GAAG,MAAM,CAAA;AAEzB,MAAM,UAAU,G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CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC3B,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACrD,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAClC,CAAC;CACF;AArZD,8BAqZC"}
|
|
@@ -39,16 +39,24 @@ export interface AuthConfiguration {
|
|
|
39
39
|
*/
|
|
40
40
|
FICClientId?: string;
|
|
41
41
|
/**
|
|
42
|
-
* Entra Authentication Endpoint to use
|
|
42
|
+
* Entra Authentication Endpoint to use.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* If not populated the Entra Public Cloud endpoint is assumed.
|
|
43
46
|
* This example of Public Cloud Endpoint is https://login.microsoftonline.com
|
|
44
|
-
|
|
45
|
-
see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
|
|
47
|
+
* see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
|
|
46
48
|
*/
|
|
47
49
|
authority?: string;
|
|
48
50
|
}
|
|
49
51
|
/**
|
|
50
52
|
* Loads the authentication configuration from environment variables.
|
|
51
53
|
*
|
|
54
|
+
* @returns The authentication configuration.
|
|
55
|
+
* @throws Will throw an error if clientId is not provided in production.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* - `clientId` is required
|
|
59
|
+
*
|
|
52
60
|
* @example
|
|
53
61
|
* ```
|
|
54
62
|
* tenantId=your-tenant-id
|
|
@@ -63,22 +71,21 @@ export interface AuthConfiguration {
|
|
|
63
71
|
* connectionName=your-connection-name
|
|
64
72
|
* authority=your-authority-endpoint
|
|
65
73
|
* ```
|
|
66
|
-
*
|
|
67
|
-
* - `clientId` is required
|
|
68
|
-
* @returns The authentication configuration.
|
|
69
|
-
* @throws Will throw an error if clientId is not provided in production.
|
|
74
|
+
*
|
|
70
75
|
*/
|
|
71
76
|
export declare const loadAuthConfigFromEnv: (cnxName?: string) => AuthConfiguration;
|
|
72
77
|
/**
|
|
73
78
|
* Loads the agent authentication configuration from previous version environment variables.
|
|
74
79
|
*
|
|
80
|
+
* @returns The agent authentication configuration.
|
|
81
|
+
* @throws Will throw an error if MicrosoftAppId is not provided in production.
|
|
82
|
+
*
|
|
75
83
|
* @example
|
|
76
84
|
* ```
|
|
77
85
|
* MicrosoftAppId=your-client-id
|
|
78
86
|
* MicrosoftAppPassword=your-client-secret
|
|
79
87
|
* MicrosoftAppTenantId=your-tenant-id
|
|
80
88
|
* ```
|
|
81
|
-
*
|
|
82
|
-
* @throws Will throw an error if MicrosoftAppId is not provided in production.
|
|
89
|
+
*
|
|
83
90
|
*/
|
|
84
91
|
export declare const loadPrevAuthConfigFromEnv: () => AuthConfiguration;
|
|
@@ -8,6 +8,12 @@ exports.loadPrevAuthConfigFromEnv = exports.loadAuthConfigFromEnv = void 0;
|
|
|
8
8
|
/**
|
|
9
9
|
* Loads the authentication configuration from environment variables.
|
|
10
10
|
*
|
|
11
|
+
* @returns The authentication configuration.
|
|
12
|
+
* @throws Will throw an error if clientId is not provided in production.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* - `clientId` is required
|
|
16
|
+
*
|
|
11
17
|
* @example
|
|
12
18
|
* ```
|
|
13
19
|
* tenantId=your-tenant-id
|
|
@@ -22,10 +28,7 @@ exports.loadPrevAuthConfigFromEnv = exports.loadAuthConfigFromEnv = void 0;
|
|
|
22
28
|
* connectionName=your-connection-name
|
|
23
29
|
* authority=your-authority-endpoint
|
|
24
30
|
* ```
|
|
25
|
-
*
|
|
26
|
-
* - `clientId` is required
|
|
27
|
-
* @returns The authentication configuration.
|
|
28
|
-
* @throws Will throw an error if clientId is not provided in production.
|
|
31
|
+
*
|
|
29
32
|
*/
|
|
30
33
|
const loadAuthConfigFromEnv = (cnxName) => {
|
|
31
34
|
var _a, _b, _c;
|
|
@@ -73,14 +76,16 @@ exports.loadAuthConfigFromEnv = loadAuthConfigFromEnv;
|
|
|
73
76
|
/**
|
|
74
77
|
* Loads the agent authentication configuration from previous version environment variables.
|
|
75
78
|
*
|
|
79
|
+
* @returns The agent authentication configuration.
|
|
80
|
+
* @throws Will throw an error if MicrosoftAppId is not provided in production.
|
|
81
|
+
*
|
|
76
82
|
* @example
|
|
77
83
|
* ```
|
|
78
84
|
* MicrosoftAppId=your-client-id
|
|
79
85
|
* MicrosoftAppPassword=your-client-secret
|
|
80
86
|
* MicrosoftAppTenantId=your-tenant-id
|
|
81
87
|
* ```
|
|
82
|
-
*
|
|
83
|
-
* @throws Will throw an error if MicrosoftAppId is not provided in production.
|
|
88
|
+
*
|
|
84
89
|
*/
|
|
85
90
|
const loadPrevAuthConfigFromEnv = () => {
|
|
86
91
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authConfiguration.js","sourceRoot":"","sources":["../../../src/auth/authConfiguration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"authConfiguration.js","sourceRoot":"","sources":["../../../src/auth/authConfiguration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,qBAAqB,GAA4C,CAAC,OAAgB,EAAE,EAAE;;IACjG,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAI,mCAAmC,CAAA;QACtF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAChF,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAA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