@microsoft/agents-hosting 1.9.0-beta.8.gf58e66b2ee → 1.9.1

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.
Files changed (139) hide show
  1. package/README.md +182 -4
  2. package/dist/package.json +3 -3
  3. package/dist/src/app/agentApplication.d.ts +4 -3
  4. package/dist/src/app/agentApplication.js +24 -21
  5. package/dist/src/app/agentApplication.js.map +1 -1
  6. package/dist/src/app/agentApplicationBuilder.d.ts +9 -2
  7. package/dist/src/app/agentApplicationBuilder.js +9 -0
  8. package/dist/src/app/agentApplicationBuilder.js.map +1 -1
  9. package/dist/src/app/agentApplicationOptions.d.ts +16 -4
  10. package/dist/src/app/auth/authorizationManager.d.ts +0 -8
  11. package/dist/src/app/auth/authorizationManager.js +104 -178
  12. package/dist/src/app/auth/authorizationManager.js.map +1 -1
  13. package/dist/src/app/auth/handlerStorage.d.ts +5 -3
  14. package/dist/src/app/auth/handlerStorage.js +36 -10
  15. package/dist/src/app/auth/handlerStorage.js.map +1 -1
  16. package/dist/src/app/auth/types.d.ts +2 -2
  17. package/dist/src/app/index.d.ts +1 -0
  18. package/dist/src/app/proactive/proactive.js +10 -6
  19. package/dist/src/app/proactive/proactive.js.map +1 -1
  20. package/dist/src/app/proactive/proactiveOptions.d.ts +2 -2
  21. package/dist/src/app/rateLimit.d.ts +315 -0
  22. package/dist/src/app/rateLimit.js +333 -0
  23. package/dist/src/app/rateLimit.js.map +1 -0
  24. package/dist/src/app/turnState.d.ts +6 -3
  25. package/dist/src/app/turnState.js +43 -4
  26. package/dist/src/app/turnState.js.map +1 -1
  27. package/dist/src/auth/authConfiguration.d.ts +10 -3
  28. package/dist/src/auth/authConfiguration.js +292 -259
  29. package/dist/src/auth/authConfiguration.js.map +1 -1
  30. package/dist/src/auth/settings.d.ts +8 -70
  31. package/dist/src/auth/settings.js +5 -67
  32. package/dist/src/auth/settings.js.map +1 -1
  33. package/dist/src/cloudAdapter.d.ts +5 -0
  34. package/dist/src/cloudAdapter.js +13 -103
  35. package/dist/src/cloudAdapter.js.map +1 -1
  36. package/dist/src/configuration/botFrameworkEnvironmentCompatibility.d.ts +23 -0
  37. package/dist/src/configuration/botFrameworkEnvironmentCompatibility.js +183 -0
  38. package/dist/src/configuration/botFrameworkEnvironmentCompatibility.js.map +1 -0
  39. package/dist/src/configuration/configuration.d.ts +83 -0
  40. package/dist/src/configuration/configuration.js +836 -0
  41. package/dist/src/configuration/configuration.js.map +1 -0
  42. package/dist/src/configuration/configurationSource.d.ts +57 -0
  43. package/dist/src/configuration/configurationSource.js +7 -0
  44. package/dist/src/configuration/configurationSource.js.map +1 -0
  45. package/dist/src/configuration/environmentConfiguration.d.ts +14 -0
  46. package/dist/src/configuration/environmentConfiguration.js +271 -0
  47. package/dist/src/configuration/environmentConfiguration.js.map +1 -0
  48. package/dist/src/configuration/index.d.ts +7 -0
  49. package/dist/src/configuration/index.js +14 -0
  50. package/dist/src/configuration/index.js.map +1 -0
  51. package/dist/src/configuration/jsonFileConfigurationSource.d.ts +15 -0
  52. package/dist/src/configuration/jsonFileConfigurationSource.js +58 -0
  53. package/dist/src/configuration/jsonFileConfigurationSource.js.map +1 -0
  54. package/dist/src/createCloudAdapter.d.ts +30 -5
  55. package/dist/src/createCloudAdapter.js +17 -10
  56. package/dist/src/createCloudAdapter.js.map +1 -1
  57. package/dist/src/errorHelper.js +117 -5
  58. package/dist/src/errorHelper.js.map +1 -1
  59. package/dist/src/index.d.ts +1 -0
  60. package/dist/src/index.js +1 -0
  61. package/dist/src/index.js.map +1 -1
  62. package/dist/src/observability/traces.d.ts +6 -4
  63. package/dist/src/observability/traces.js +10 -9
  64. package/dist/src/observability/traces.js.map +1 -1
  65. package/dist/src/outboundHostValidator.d.ts +4 -1
  66. package/dist/src/outboundHostValidator.js +25 -48
  67. package/dist/src/outboundHostValidator.js.map +1 -1
  68. package/dist/src/state/agentState.d.ts +8 -3
  69. package/dist/src/state/agentState.js +26 -8
  70. package/dist/src/state/agentState.js.map +1 -1
  71. package/dist/src/state/conversationState.d.ts +2 -2
  72. package/dist/src/state/conversationState.js.map +1 -1
  73. package/dist/src/state/userState.d.ts +2 -2
  74. package/dist/src/state/userState.js.map +1 -1
  75. package/dist/src/statusCodes.d.ts +5 -0
  76. package/dist/src/statusCodes.js +5 -0
  77. package/dist/src/statusCodes.js.map +1 -1
  78. package/dist/src/storage/fileStorage.d.ts +83 -68
  79. package/dist/src/storage/fileStorage.js +279 -105
  80. package/dist/src/storage/fileStorage.js.map +1 -1
  81. package/dist/src/storage/index.d.ts +1 -0
  82. package/dist/src/storage/index.js +1 -0
  83. package/dist/src/storage/index.js.map +1 -1
  84. package/dist/src/storage/memoryStorage.d.ts +85 -60
  85. package/dist/src/storage/memoryStorage.js +244 -87
  86. package/dist/src/storage/memoryStorage.js.map +1 -1
  87. package/dist/src/storage/storage.d.ts +100 -2
  88. package/dist/src/storage/storage.js +25 -0
  89. package/dist/src/storage/storage.js.map +1 -1
  90. package/dist/src/storage/storageCompatibility.d.ts +17 -0
  91. package/dist/src/storage/storageCompatibility.js +157 -0
  92. package/dist/src/storage/storageCompatibility.js.map +1 -0
  93. package/dist/src/storage/storageExpiry.d.ts +6 -0
  94. package/dist/src/storage/storageExpiry.js +20 -0
  95. package/dist/src/storage/storageExpiry.js.map +1 -0
  96. package/dist/src/utils/env.d.ts +43 -0
  97. package/dist/src/utils/env.js +42 -6
  98. package/dist/src/utils/env.js.map +1 -1
  99. package/dist/src/utils.d.ts +1 -0
  100. package/dist/src/utils.js +10 -1
  101. package/dist/src/utils.js.map +1 -1
  102. package/package.json +3 -3
  103. package/src/app/agentApplication.ts +27 -14
  104. package/src/app/agentApplicationBuilder.ts +13 -2
  105. package/src/app/agentApplicationOptions.ts +18 -4
  106. package/src/app/auth/authorizationManager.ts +126 -204
  107. package/src/app/auth/handlerStorage.ts +51 -7
  108. package/src/app/auth/types.ts +2 -2
  109. package/src/app/index.ts +7 -0
  110. package/src/app/proactive/proactive.ts +19 -9
  111. package/src/app/proactive/proactiveOptions.ts +2 -2
  112. package/src/app/rateLimit.ts +659 -0
  113. package/src/app/turnState.ts +50 -7
  114. package/src/auth/authConfiguration.ts +415 -260
  115. package/src/auth/settings.ts +5 -82
  116. package/src/cloudAdapter.ts +38 -113
  117. package/src/configuration/botFrameworkEnvironmentCompatibility.ts +245 -0
  118. package/src/configuration/configuration.ts +1076 -0
  119. package/src/configuration/configurationSource.ts +76 -0
  120. package/src/configuration/environmentConfiguration.ts +377 -0
  121. package/src/configuration/index.ts +19 -0
  122. package/src/configuration/jsonFileConfigurationSource.ts +74 -0
  123. package/src/createCloudAdapter.ts +52 -9
  124. package/src/errorHelper.ts +143 -5
  125. package/src/index.ts +1 -0
  126. package/src/observability/traces.ts +8 -7
  127. package/src/outboundHostValidator.ts +37 -44
  128. package/src/state/agentState.ts +39 -13
  129. package/src/state/conversationState.ts +2 -2
  130. package/src/state/userState.ts +2 -2
  131. package/src/statusCodes.ts +6 -0
  132. package/src/storage/fileStorage.ts +299 -106
  133. package/src/storage/index.ts +1 -0
  134. package/src/storage/memoryStorage.ts +268 -85
  135. package/src/storage/storage.ts +114 -2
  136. package/src/storage/storageCompatibility.ts +185 -0
  137. package/src/storage/storageExpiry.ts +21 -0
  138. package/src/utils/env.ts +63 -0
  139. package/src/utils.ts +10 -0
@@ -0,0 +1,836 @@
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.ConfigurationContext = void 0;
8
+ exports.createConfigurationLayer = createConfigurationLayer;
9
+ exports.freezeConfigurationLayer = freezeConfigurationLayer;
10
+ exports.mergeConfigurationLayers = mergeConfigurationLayers;
11
+ exports.suggestConfigurationPath = suggestConfigurationPath;
12
+ exports.setConfigurationValue = setConfigurationValue;
13
+ exports.isConfigurationInputError = isConfigurationInputError;
14
+ exports.isInvalidConfigurationValueError = isInvalidConfigurationValueError;
15
+ exports.createConfigurationContext = createConfigurationContext;
16
+ exports.preloadConfigurationSources = preloadConfigurationSources;
17
+ exports.getConfigurationSnapshot = getConfigurationSnapshot;
18
+ exports.resetConfigurationSourcesForTest = resetConfigurationSourcesForTest;
19
+ const agents_activity_1 = require("@microsoft/agents-activity");
20
+ const errorHelper_1 = require("../errorHelper");
21
+ const env_1 = require("../utils/env");
22
+ const jsonFileConfigurationSource_1 = require("./jsonFileConfigurationSource");
23
+ const modes = ['fallback', 'overrideEnvironment', 'enforce'];
24
+ const authParsers = {
25
+ authType: asString,
26
+ tenantId: asString,
27
+ clientId: asString,
28
+ clientSecret: asString,
29
+ certPemFile: asString,
30
+ certKeyFile: asString,
31
+ connectionName: asString,
32
+ federatedClientId: asString,
33
+ authorityEndpoint: asString,
34
+ scopes: asList,
35
+ altBlueprintConnectionName: asString,
36
+ WIDAssertionFile: asString,
37
+ federatedTokenFile: asString,
38
+ idpmResource: asString,
39
+ azureRegion: asString,
40
+ sendX5C: asBoolean,
41
+ msalRetryCount: asNonNegativeInteger,
42
+ sidecarBaseUrl: asString,
43
+ serviceName: asString,
44
+ blueprintServiceName: asString,
45
+ bypassLocalNetworkRestriction: asBoolean,
46
+ // Superset field: the JavaScript millisecond form parses here. A document
47
+ // string is the .NET-only TimeSpan form and is rejected by
48
+ // dotNetOnlyTimeSpanSettings below, not by this parser.
49
+ requestTimeout: asPositiveInteger,
50
+ retryCount: asNonNegativeInteger,
51
+ issuers: asList,
52
+ validateIssuer: asBoolean
53
+ };
54
+ const cloudAdapterParsers = {
55
+ emitStackTrace: asBoolean,
56
+ validateServiceUrl: asBoolean
57
+ };
58
+ const connectionMapParsers = {
59
+ serviceUrl: asString,
60
+ audience: asString,
61
+ connection: asString
62
+ };
63
+ const outboundHostValidatorParsers = {
64
+ enabled: asBoolean,
65
+ includeDefaultMicrosoftHosts: asBoolean,
66
+ hosts: asList
67
+ };
68
+ const authorizationParsers = {
69
+ type: asString,
70
+ azureBotOAuthConnectionName: asString,
71
+ title: asString,
72
+ text: asString,
73
+ invalidSignInRetryMessage: asString,
74
+ invalidSignInRetryMessageFormat: asString,
75
+ invalidSignInRetryMaxExceededMessage: asString,
76
+ oboConnectionName: asString,
77
+ enableSso: asBoolean,
78
+ invalidSignInRetryMax: asNonNegativeInteger,
79
+ oboScopes: asList,
80
+ altBlueprintConnectionName: asString,
81
+ scopes: asList
82
+ };
83
+ const authPropertyAliases = {
84
+ alternateblueprintconnectionname: 'altBlueprintConnectionName',
85
+ ficclientid: 'federatedClientId',
86
+ authority: 'authorityEndpoint',
87
+ scope: 'scopes'
88
+ };
89
+ const authorizationPropertyAliases = {
90
+ alternateblueprintconnectionname: 'altBlueprintConnectionName'
91
+ };
92
+ const dotNetOnlyConnectionSettings = new Set([
93
+ 'certificatethumbprint',
94
+ 'certificatesubjectname',
95
+ 'certificatestorelocation',
96
+ 'certificatestorename',
97
+ 'validcertificateonly'
98
+ ]);
99
+ const dotNetOnlyAuthorizationSettings = new Set([
100
+ 'cancelsignincommands',
101
+ 'endoninvalidmessage',
102
+ 'showsigninlink',
103
+ 'signincancelledmessage',
104
+ 'teamssignininprogressmessage',
105
+ 'timeout'
106
+ ]);
107
+ // Connection settings that are a JS/.NET superset: JavaScript accepts the
108
+ // positive-integer millisecond form, while a document string is the
109
+ // .NET-only TimeSpan representation and is rejected as unsupported rather
110
+ // than as a generic invalid value. Canonical (environment) string values are
111
+ // unaffected, since every canonical value is a string regardless of runtime.
112
+ const dotNetOnlyTimeSpanSettings = new Set([
113
+ 'requesttimeout'
114
+ ]);
115
+ let state = { kind: 'uninitialized' };
116
+ const contextSnapshots = new WeakMap();
117
+ let instantiateConfigurationContext;
118
+ /**
119
+ * An immutable, host-scoped set of resolved external configuration sources.
120
+ *
121
+ * @remarks
122
+ * Create instances with {@link createConfigurationContext}. The context is
123
+ * intentionally opaque; consumers pass it through their named options.
124
+ */
125
+ class ConfigurationContext {
126
+ constructor() {
127
+ this.configurationContextBrand = undefined;
128
+ }
129
+ }
130
+ exports.ConfigurationContext = ConfigurationContext;
131
+ (() => {
132
+ instantiateConfigurationContext = () => new ConfigurationContext();
133
+ })();
134
+ function asString(value) {
135
+ return value;
136
+ }
137
+ function asBoolean(value) {
138
+ return (0, env_1.parseBooleanEnv)(value);
139
+ }
140
+ function asInteger(value) {
141
+ const normalized = value.trim();
142
+ if (!/^-?\d+$/.test(normalized)) {
143
+ return undefined;
144
+ }
145
+ const parsed = Number.parseInt(normalized, 10);
146
+ return Number.isSafeInteger(parsed) ? parsed : undefined;
147
+ }
148
+ function asNonNegativeInteger(value) {
149
+ const parsed = asInteger(value);
150
+ return parsed !== undefined && parsed >= 0 ? parsed : undefined;
151
+ }
152
+ function asPositiveInteger(value) {
153
+ const parsed = asInteger(value);
154
+ return parsed !== undefined && parsed > 0 ? parsed : undefined;
155
+ }
156
+ function asList(value) {
157
+ return value.includes(',')
158
+ ? value.split(',').map(item => item.trim()).filter(Boolean)
159
+ : value.split(/\s+/).filter(Boolean);
160
+ }
161
+ function createConfigurationLayer() {
162
+ return {
163
+ connections: new Map(),
164
+ connectionsMap: new Map(),
165
+ cloudAdapterOptions: {},
166
+ outboundHostValidator: {},
167
+ agentApplication: {
168
+ userAuthorization: {
169
+ handlers: new Map()
170
+ }
171
+ }
172
+ };
173
+ }
174
+ function emptySnapshot() {
175
+ return Object.freeze({
176
+ fallback: freezeConfigurationLayer(createConfigurationLayer()),
177
+ overrideEnvironment: freezeConfigurationLayer(createConfigurationLayer()),
178
+ enforce: freezeConfigurationLayer(createConfigurationLayer())
179
+ });
180
+ }
181
+ function freezeConfigurationLayer(layer) {
182
+ return Object.freeze({
183
+ connections: new Map([...layer.connections].map(([lookup, connection]) => [
184
+ lookup,
185
+ Object.freeze({
186
+ id: connection.id,
187
+ settings: freezeRecord(connection.settings)
188
+ })
189
+ ])),
190
+ connectionsMap: new Map([...layer.connectionsMap].map(([index, item]) => [
191
+ index,
192
+ Object.freeze({ ...item })
193
+ ])),
194
+ cloudAdapterOptions: Object.freeze({ ...layer.cloudAdapterOptions }),
195
+ outboundHostValidator: Object.freeze({
196
+ ...layer.outboundHostValidator,
197
+ ...(layer.outboundHostValidator.hosts === undefined
198
+ ? {}
199
+ : { hosts: Object.freeze([...layer.outboundHostValidator.hosts]) })
200
+ }),
201
+ agentApplication: Object.freeze({
202
+ userAuthorization: Object.freeze({
203
+ handlers: new Map([...layer.agentApplication.userAuthorization.handlers].map(([lookup, handler]) => [
204
+ lookup,
205
+ Object.freeze({ id: handler.id, settings: freezeRecord(handler.settings) })
206
+ ]))
207
+ })
208
+ })
209
+ });
210
+ }
211
+ function mergeConfigurationLayers(...layers) {
212
+ var _a, _b;
213
+ const merged = createConfigurationLayer();
214
+ for (const layer of layers) {
215
+ for (const connection of layer.connections.values()) {
216
+ const lookup = connection.id.toLowerCase();
217
+ const current = merged.connections.get(lookup);
218
+ merged.connections.set(lookup, {
219
+ id: (_a = current === null || current === void 0 ? void 0 : current.id) !== null && _a !== void 0 ? _a : connection.id,
220
+ settings: {
221
+ ...current === null || current === void 0 ? void 0 : current.settings,
222
+ ...connection.settings
223
+ }
224
+ });
225
+ }
226
+ for (const [index, item] of layer.connectionsMap) {
227
+ ;
228
+ merged.connectionsMap.set(index, {
229
+ ...merged.connectionsMap.get(index),
230
+ ...item
231
+ });
232
+ }
233
+ Object.assign(merged.cloudAdapterOptions, layer.cloudAdapterOptions);
234
+ Object.assign(merged.outboundHostValidator, layer.outboundHostValidator);
235
+ const mergedHandlers = merged.agentApplication.userAuthorization.handlers;
236
+ for (const handler of layer.agentApplication.userAuthorization.handlers.values()) {
237
+ const lookup = handler.id.toLowerCase();
238
+ const current = mergedHandlers.get(lookup);
239
+ mergedHandlers.set(lookup, {
240
+ id: (_b = current === null || current === void 0 ? void 0 : current.id) !== null && _b !== void 0 ? _b : handler.id,
241
+ settings: {
242
+ ...current === null || current === void 0 ? void 0 : current.settings,
243
+ ...handler.settings
244
+ }
245
+ });
246
+ }
247
+ }
248
+ return freezeConfigurationLayer(merged);
249
+ }
250
+ function freezeRecord(record) {
251
+ return Object.freeze(Object.fromEntries(Object.entries(record).map(([key, value]) => [
252
+ key,
253
+ Array.isArray(value) ? Object.freeze([...value]) : value
254
+ ])));
255
+ }
256
+ const canonicalRoots = [
257
+ 'connections',
258
+ 'connectionsMap',
259
+ 'cloudAdapterOptions',
260
+ 'outboundHostValidator',
261
+ 'agentApplication'
262
+ ];
263
+ /**
264
+ * Suggests a canonical path by correcting only fixed schema segments.
265
+ * Dynamic connection/handler IDs and route indexes are preserved verbatim.
266
+ */
267
+ function suggestConfigurationPath(path) {
268
+ var _a, _b;
269
+ const parts = path.split('.');
270
+ const root = findCanonicalSegment(parts[0], canonicalRoots);
271
+ if (!root) {
272
+ return undefined;
273
+ }
274
+ let suggested;
275
+ if (parts.length === 1) {
276
+ suggested = [root];
277
+ }
278
+ else if (root === 'connections' && parts.length === 3) {
279
+ const settings = findCanonicalSegment(parts[2], ['settings']);
280
+ if (settings) {
281
+ suggested = [root, parts[1], settings];
282
+ }
283
+ }
284
+ else if (root === 'connections' && parts.length >= 4) {
285
+ const settingsIndex = parts.length - 2;
286
+ const settings = findCanonicalSegment(parts[settingsIndex], ['settings']);
287
+ const property = findCanonicalProperty((_a = parts.at(-1)) !== null && _a !== void 0 ? _a : '', authParsers, authPropertyAliases);
288
+ if (settings && property && settingsIndex > 1) {
289
+ suggested = [root, ...parts.slice(1, settingsIndex), settings, property];
290
+ }
291
+ }
292
+ else if (root === 'connectionsMap' && parts.length === 3 && /^\d+$/.test(parts[1])) {
293
+ const property = findCanonicalProperty(parts[2], connectionMapParsers);
294
+ if (property) {
295
+ suggested = [root, parts[1], property];
296
+ }
297
+ }
298
+ else if (root === 'cloudAdapterOptions' && parts.length === 2) {
299
+ const property = findCanonicalProperty(parts[1], cloudAdapterParsers);
300
+ if (property) {
301
+ suggested = [root, property];
302
+ }
303
+ }
304
+ else if (root === 'outboundHostValidator' && parts.length === 2) {
305
+ const property = findCanonicalProperty(parts[1], outboundHostValidatorParsers);
306
+ if (property) {
307
+ suggested = [root, property];
308
+ }
309
+ }
310
+ else if (root === 'agentApplication' && parts.length === 2) {
311
+ const userAuthorization = findCanonicalSegment(parts[1], ['userAuthorization']);
312
+ if (userAuthorization) {
313
+ suggested = [root, userAuthorization];
314
+ }
315
+ }
316
+ else if (root === 'agentApplication' && parts.length === 3) {
317
+ const userAuthorization = findCanonicalSegment(parts[1], ['userAuthorization']);
318
+ const handlers = findCanonicalSegment(parts[2], ['handlers']);
319
+ if (userAuthorization && handlers) {
320
+ suggested = [root, userAuthorization, handlers];
321
+ }
322
+ }
323
+ else if (root === 'agentApplication' && parts.length === 5) {
324
+ const userAuthorization = findCanonicalSegment(parts[1], ['userAuthorization']);
325
+ const handlers = findCanonicalSegment(parts[2], ['handlers']);
326
+ const settings = findCanonicalSegment(parts[4], ['settings']);
327
+ if (userAuthorization && handlers && settings) {
328
+ suggested = [root, userAuthorization, handlers, parts[3], settings];
329
+ }
330
+ }
331
+ else if (root === 'agentApplication' && parts.length >= 6) {
332
+ const settingsIndex = parts.length - 2;
333
+ const userAuthorization = findCanonicalSegment(parts[1], ['userAuthorization']);
334
+ const handlers = findCanonicalSegment(parts[2], ['handlers']);
335
+ const settings = findCanonicalSegment(parts[settingsIndex], ['settings']);
336
+ const property = findCanonicalProperty((_b = parts.at(-1)) !== null && _b !== void 0 ? _b : '', authorizationParsers, authorizationPropertyAliases);
337
+ if (userAuthorization && handlers && settings && property && settingsIndex > 3) {
338
+ suggested = [
339
+ root,
340
+ userAuthorization,
341
+ handlers,
342
+ ...parts.slice(3, settingsIndex),
343
+ settings,
344
+ property
345
+ ];
346
+ }
347
+ }
348
+ const result = suggested === null || suggested === void 0 ? void 0 : suggested.join('.');
349
+ return result && result.toLowerCase() !== path.toLowerCase() ? result : undefined;
350
+ }
351
+ function findCanonicalSegment(value, candidates) {
352
+ var _a;
353
+ if (!value) {
354
+ return undefined;
355
+ }
356
+ return (_a = candidates.find(candidate => candidate.toLowerCase() === value.toLowerCase())) !== null && _a !== void 0 ? _a : (0, env_1.suggestClosest)(value, candidates, 4);
357
+ }
358
+ function findCanonicalProperty(value, parsers, aliases = {}) {
359
+ const alias = aliases[value.toLowerCase()];
360
+ return alias !== null && alias !== void 0 ? alias : findCanonicalSegment(value, Object.keys(parsers));
361
+ }
362
+ function invalidConfigurationPath(path, sourceName) {
363
+ const suggestion = suggestConfigurationPath(path);
364
+ const definition = suggestion
365
+ ? {
366
+ ...errorHelper_1.Errors.InvalidConfigurationPath,
367
+ description: `${errorHelper_1.Errors.InvalidConfigurationPath.description} Did you mean \`${suggestion}\`?`
368
+ }
369
+ : errorHelper_1.Errors.InvalidConfigurationPath;
370
+ return agents_activity_1.ExceptionHelper.generateException(Error, definition, undefined, { path, sourceName });
371
+ }
372
+ function parseValue(parsers, property, value, path, sourceName, format, aliases = {}, allowExtension = false) {
373
+ const lookup = property.toLowerCase();
374
+ const aliasedKey = format === 'canonical' ? undefined : aliases[lookup];
375
+ const key = aliasedKey !== null && aliasedKey !== void 0 ? aliasedKey : Object.keys(parsers).find(candidate => candidate.toLowerCase() === lookup);
376
+ if (!key) {
377
+ if (format === 'canonical' && aliases[lookup]) {
378
+ throw invalidConfigurationPath(path, sourceName);
379
+ }
380
+ if (allowExtension) {
381
+ validateDynamicSegment(property, path, sourceName);
382
+ const extensionValue = format === 'document'
383
+ ? parseExtensionValue(value)
384
+ : typeof value === 'string' ? value : undefined;
385
+ if (extensionValue !== undefined) {
386
+ return { key: property, value: extensionValue };
387
+ }
388
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, { path, sourceName });
389
+ }
390
+ throw invalidConfigurationPath(path, sourceName);
391
+ }
392
+ const parser = parsers[key];
393
+ const parsed = format === 'document'
394
+ ? parseDocumentValue(parser, value)
395
+ : typeof value === 'string' ? parser(value) : undefined;
396
+ if (parsed === undefined) {
397
+ if (key === 'validateIssuer') {
398
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidBooleanConfigurationValue, undefined, { path, sourceName });
399
+ }
400
+ if (format === 'document' && typeof value === 'string' && dotNetOnlyTimeSpanSettings.has(lookup)) {
401
+ unsupportedRuntimeField(path, sourceName);
402
+ }
403
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, { path, sourceName });
404
+ }
405
+ function parseDocumentValue(parser, value) {
406
+ if (parser === asString) {
407
+ return typeof value === 'string' ? value : undefined;
408
+ }
409
+ if (parser === asBoolean) {
410
+ return typeof value === 'boolean' ? value : undefined;
411
+ }
412
+ if (parser === asInteger) {
413
+ return typeof value === 'number' && Number.isSafeInteger(value) ? value : undefined;
414
+ }
415
+ if (parser === asNonNegativeInteger) {
416
+ return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
417
+ }
418
+ if (parser === asPositiveInteger) {
419
+ return typeof value === 'number' && Number.isSafeInteger(value) && value > 0 ? value : undefined;
420
+ }
421
+ if (parser === asList) {
422
+ return Array.isArray(value) &&
423
+ value.every(item => typeof item === 'string' && item.trim().length > 0)
424
+ ? [...value]
425
+ : undefined;
426
+ }
427
+ return undefined;
428
+ }
429
+ return { key, value: parsed };
430
+ }
431
+ function parseExtensionValue(value) {
432
+ if (typeof value === 'string' || typeof value === 'boolean' ||
433
+ (typeof value === 'number' && Number.isSafeInteger(value))) {
434
+ return value;
435
+ }
436
+ if (Array.isArray(value) &&
437
+ value.every(item => typeof item === 'string' && item.trim().length > 0)) {
438
+ return [...value];
439
+ }
440
+ return undefined;
441
+ }
442
+ function validateDynamicSegment(segment, path, sourceName) {
443
+ if (['__proto__', 'constructor', 'prototype'].includes(segment.toLowerCase())) {
444
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationPath, undefined, { path, sourceName });
445
+ }
446
+ }
447
+ function setConfigurationValue(target, path, rawValue, sourceName, format) {
448
+ var _a;
449
+ const parts = path.split('.');
450
+ const authConnectionMatch = /^connections\.(.+)\.settings\.([^.]+)$/.exec(path);
451
+ if (authConnectionMatch) {
452
+ const [, id, property] = authConnectionMatch;
453
+ validateDynamicSegment(id, path, sourceName);
454
+ const parsed = parseValue(authParsers, property, rawValue, path, sourceName, format, authPropertyAliases, true);
455
+ const current = ensureConnection(target, id);
456
+ current.settings[parsed.key] = parsed.value;
457
+ return;
458
+ }
459
+ if (parts.length === 3 && parts[0] === 'connectionsMap' && /^\d+$/.test(parts[1])) {
460
+ const index = Number.parseInt(parts[1], 10);
461
+ const parsed = parseValue(connectionMapParsers, parts[2], rawValue, path, sourceName, format);
462
+ const current = { ...((_a = target.connectionsMap.get(index)) !== null && _a !== void 0 ? _a : {}) };
463
+ current[parsed.key] = parsed.value;
464
+ target.connectionsMap.set(index, current);
465
+ return;
466
+ }
467
+ if (parts.length === 2 && parts[0] === 'cloudAdapterOptions') {
468
+ const parsed = parseValue(cloudAdapterParsers, parts[1], rawValue, path, sourceName, format);
469
+ target.cloudAdapterOptions[parsed.key] = parsed.value;
470
+ return;
471
+ }
472
+ if (parts.length === 2 && parts[0] === 'outboundHostValidator') {
473
+ const parsed = parseValue(outboundHostValidatorParsers, parts[1], rawValue, path, sourceName, format);
474
+ if (parsed.key === 'hosts') {
475
+ ;
476
+ target.outboundHostValidator.hosts = parsed.value;
477
+ }
478
+ else {
479
+ ;
480
+ target.outboundHostValidator[parsed.key] = parsed.value;
481
+ }
482
+ return;
483
+ }
484
+ const authorizationHandlerMatch = /^agentApplication\.userAuthorization\.handlers\.(.+)\.settings\.([^.]+)$/.exec(path);
485
+ if (authorizationHandlerMatch) {
486
+ const [, id, property] = authorizationHandlerMatch;
487
+ validateDynamicSegment(id, path, sourceName);
488
+ const parsed = parseValue(authorizationParsers, property, rawValue, path, sourceName, format, authorizationPropertyAliases, true);
489
+ const current = ensureAuthorizationHandler(target, id);
490
+ current.settings[parsed.key] = parsed.value;
491
+ return;
492
+ }
493
+ throw invalidConfigurationPath(path, sourceName);
494
+ }
495
+ function ensureConnection(target, id) {
496
+ var _a;
497
+ const connections = target.connections;
498
+ const lookup = id.toLowerCase();
499
+ const connection = (_a = connections.get(lookup)) !== null && _a !== void 0 ? _a : { id, settings: {} };
500
+ connections.set(lookup, connection);
501
+ return connection;
502
+ }
503
+ function ensureAuthorizationHandler(target, id) {
504
+ var _a;
505
+ const handlers = target.agentApplication.userAuthorization.handlers;
506
+ const lookup = id.toLowerCase();
507
+ const handler = (_a = handlers.get(lookup)) !== null && _a !== void 0 ? _a : { id, settings: {} };
508
+ handlers.set(lookup, handler);
509
+ return handler;
510
+ }
511
+ function isConfigurationInputError(error) {
512
+ const code = error === null || error === void 0 ? void 0 : error.code;
513
+ return code === errorHelper_1.Errors.InvalidConfigurationPath.code ||
514
+ isInvalidConfigurationValueError(error) ||
515
+ code === errorHelper_1.Errors.UnsupportedRuntimeConfigurationField.code;
516
+ }
517
+ function isInvalidConfigurationValueError(error) {
518
+ const code = error === null || error === void 0 ? void 0 : error.code;
519
+ return code === errorHelper_1.Errors.InvalidConfigurationValue.code ||
520
+ code === errorHelper_1.Errors.InvalidBooleanConfigurationValue.code;
521
+ }
522
+ function asDocumentObject(value, path, sourceName) {
523
+ if (value === null || Array.isArray(value) || typeof value !== 'object') {
524
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, { path, sourceName });
525
+ }
526
+ return value;
527
+ }
528
+ function uniqueEntries(value, path, sourceName) {
529
+ const normalized = new Set();
530
+ return Object.entries(value).map(([key, entryValue]) => {
531
+ const lookup = key.toLowerCase();
532
+ if (normalized.has(lookup)) {
533
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationPath, undefined, {
534
+ path: path ? `${path}.${key}` : key,
535
+ sourceName
536
+ });
537
+ }
538
+ normalized.add(lookup);
539
+ return [key, entryValue];
540
+ });
541
+ }
542
+ function unsupportedRuntimeField(path, sourceName) {
543
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.UnsupportedRuntimeConfigurationField, undefined, { path, sourceName });
544
+ }
545
+ function compileDocument(target, document, sourceName) {
546
+ for (const [section, sectionValue] of uniqueEntries(document, '', sourceName)) {
547
+ switch (section.toLowerCase()) {
548
+ case 'connections':
549
+ compileDocumentConnections(target, sectionValue, section, sourceName);
550
+ break;
551
+ case 'connectionsmap':
552
+ compileDocumentConnectionsMap(target, sectionValue, section, sourceName);
553
+ break;
554
+ case 'cloudadapteroptions':
555
+ compileDocumentLeafObject(target, sectionValue, section, sourceName, 'cloudAdapterOptions');
556
+ break;
557
+ case 'outboundhostvalidator':
558
+ compileDocumentLeafObject(target, sectionValue, section, sourceName, 'outboundHostValidator');
559
+ break;
560
+ case 'agentapplication':
561
+ compileDocumentAgentApplication(target, sectionValue, section, sourceName);
562
+ break;
563
+ default:
564
+ // Shared appsettings files may contain unrelated host configuration.
565
+ if (suggestConfigurationPath(section)) {
566
+ throw invalidConfigurationPath(section, sourceName);
567
+ }
568
+ break;
569
+ }
570
+ }
571
+ }
572
+ function compileDocumentConnections(target, value, path, sourceName) {
573
+ const connections = asDocumentObject(value, path, sourceName);
574
+ for (const [id, definitionValue] of uniqueEntries(connections, path, sourceName)) {
575
+ validateDynamicSegment(id, `${path}.${id}`, sourceName);
576
+ const definition = asDocumentObject(definitionValue, `${path}.${id}`, sourceName);
577
+ ensureConnection(target, id);
578
+ let settingsFound = false;
579
+ for (const [key, entryValue] of uniqueEntries(definition, `${path}.${id}`, sourceName)) {
580
+ const entryPath = `${path}.${id}.${key}`;
581
+ if (key.toLowerCase() === 'settings') {
582
+ settingsFound = true;
583
+ compileDocumentLeafObject(target, entryValue, entryPath, sourceName, `connections.${id}.settings`);
584
+ }
585
+ else if (key.toLowerCase() === 'assembly' || key.toLowerCase() === 'type') {
586
+ unsupportedRuntimeField(entryPath, sourceName);
587
+ }
588
+ else {
589
+ throw invalidConfigurationPath(entryPath, sourceName);
590
+ }
591
+ }
592
+ if (!settingsFound) {
593
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, {
594
+ path: `${path}.${id}.settings`,
595
+ sourceName
596
+ });
597
+ }
598
+ }
599
+ }
600
+ function compileDocumentConnectionsMap(target, value, path, sourceName) {
601
+ if (!Array.isArray(value)) {
602
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, { path, sourceName });
603
+ }
604
+ value.forEach((item, index) => {
605
+ compileDocumentLeafObject(target, item, `${path}.${index}`, sourceName, `connectionsMap.${index}`);
606
+ });
607
+ }
608
+ function compileDocumentAgentApplication(target, value, path, sourceName) {
609
+ const application = asDocumentObject(value, path, sourceName);
610
+ for (const [key, entryValue] of uniqueEntries(application, path, sourceName)) {
611
+ const entryPath = `${path}.${key}`;
612
+ if (key.toLowerCase() !== 'userauthorization') {
613
+ if (suggestConfigurationPath(entryPath)) {
614
+ throw invalidConfigurationPath(entryPath, sourceName);
615
+ }
616
+ continue;
617
+ }
618
+ const authorization = asDocumentObject(entryValue, entryPath, sourceName);
619
+ for (const [authorizationKey, authorizationValue] of uniqueEntries(authorization, entryPath, sourceName)) {
620
+ const authorizationPath = `${entryPath}.${authorizationKey}`;
621
+ if (authorizationKey.toLowerCase() === 'handlers') {
622
+ compileDocumentAuthorizationHandlers(target, authorizationValue, authorizationPath, sourceName);
623
+ }
624
+ else if (suggestConfigurationPath(authorizationPath)) {
625
+ throw invalidConfigurationPath(authorizationPath, sourceName);
626
+ }
627
+ else {
628
+ unsupportedRuntimeField(authorizationPath, sourceName);
629
+ }
630
+ }
631
+ }
632
+ }
633
+ function compileDocumentAuthorizationHandlers(target, value, path, sourceName) {
634
+ const handlers = asDocumentObject(value, path, sourceName);
635
+ for (const [id, definitionValue] of uniqueEntries(handlers, path, sourceName)) {
636
+ validateDynamicSegment(id, `${path}.${id}`, sourceName);
637
+ const definition = asDocumentObject(definitionValue, `${path}.${id}`, sourceName);
638
+ ensureAuthorizationHandler(target, id);
639
+ let settingsFound = false;
640
+ for (const [key, entryValue] of uniqueEntries(definition, `${path}.${id}`, sourceName)) {
641
+ const entryPath = `${path}.${id}.${key}`;
642
+ if (key.toLowerCase() === 'settings') {
643
+ settingsFound = true;
644
+ compileDocumentLeafObject(target, entryValue, entryPath, sourceName, `agentApplication.userAuthorization.handlers.${id}.settings`);
645
+ }
646
+ else if (key.toLowerCase() === 'assembly' || key.toLowerCase() === 'type') {
647
+ unsupportedRuntimeField(entryPath, sourceName);
648
+ }
649
+ else {
650
+ throw invalidConfigurationPath(entryPath, sourceName);
651
+ }
652
+ }
653
+ if (!settingsFound) {
654
+ throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.InvalidConfigurationValue, undefined, {
655
+ path: `${path}.${id}.settings`,
656
+ sourceName
657
+ });
658
+ }
659
+ }
660
+ }
661
+ function compileDocumentLeafObject(target, value, path, sourceName, canonicalPrefix) {
662
+ var _a, _b;
663
+ const record = asDocumentObject(value, path, sourceName);
664
+ const normalizedProperties = new Set();
665
+ for (const [key, entryValue] of uniqueEntries(record, path, sourceName)) {
666
+ const lookup = key.toLowerCase();
667
+ if (canonicalPrefix.startsWith('connections.') && dotNetOnlyConnectionSettings.has(lookup)) {
668
+ unsupportedRuntimeField(`${path}.${key}`, sourceName);
669
+ }
670
+ if (canonicalPrefix.startsWith('agentApplication.userAuthorization.handlers.') &&
671
+ dotNetOnlyAuthorizationSettings.has(lookup)) {
672
+ unsupportedRuntimeField(`${path}.${key}`, sourceName);
673
+ }
674
+ const normalizedProperty = canonicalPrefix.startsWith('connections.')
675
+ ? (_a = authPropertyAliases[lookup]) !== null && _a !== void 0 ? _a : lookup : canonicalPrefix.startsWith('agentApplication.userAuthorization.handlers.')
676
+ ? (_b = authorizationPropertyAliases[lookup]) !== null && _b !== void 0 ? _b : lookup : lookup;
677
+ const normalizedLookup = normalizedProperty.toLowerCase();
678
+ if (normalizedProperties.has(normalizedLookup)) {
679
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationPath, undefined, {
680
+ path: `${path}.${key}`,
681
+ sourceName
682
+ });
683
+ }
684
+ normalizedProperties.add(normalizedLookup);
685
+ setConfigurationValue(target, `${canonicalPrefix}.${key}`, entryValue, sourceName, 'document');
686
+ }
687
+ }
688
+ function compileSourceResult(target, result, sourceName) {
689
+ if (result !== null &&
690
+ typeof result === 'object' &&
691
+ !Array.isArray(result) &&
692
+ !('format' in result) &&
693
+ Object.values(result).every(value => typeof value === 'string')) {
694
+ compileCanonicalEntries(target, Object.entries(result), sourceName);
695
+ return;
696
+ }
697
+ if ((result === null || result === void 0 ? void 0 : result.format) === 'canonical' && result.values !== null && typeof result.values === 'object' && !Array.isArray(result.values)) {
698
+ compileCanonicalEntries(target, Object.entries(result.values), sourceName);
699
+ return;
700
+ }
701
+ if ((result === null || result === void 0 ? void 0 : result.format) === 'document' && result.value !== null && typeof result.value === 'object' && !Array.isArray(result.value)) {
702
+ compileDocument(target, result.value, sourceName);
703
+ return;
704
+ }
705
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationSourceResult, undefined, { sourceName });
706
+ }
707
+ function compileCanonicalEntries(target, entries, sourceName) {
708
+ const destinations = new Set();
709
+ for (const [path, value] of entries) {
710
+ const destination = normalizeCanonicalDestination(path);
711
+ if (destinations.has(destination)) {
712
+ const definition = {
713
+ ...errorHelper_1.Errors.InvalidConfigurationPath,
714
+ description: 'Configuration source `{sourceName}` returned duplicate canonical destination `{path}`.'
715
+ };
716
+ throw agents_activity_1.ExceptionHelper.generateException(Error, definition, undefined, { path, sourceName });
717
+ }
718
+ destinations.add(destination);
719
+ setConfigurationValue(target, path, value, sourceName, 'canonical');
720
+ }
721
+ }
722
+ function normalizeCanonicalDestination(path) {
723
+ var _a;
724
+ const parts = path.split('.').map(part => part.toLowerCase());
725
+ if (parts[0] === 'connectionsmap' && /^\d+$/.test((_a = parts[1]) !== null && _a !== void 0 ? _a : '')) {
726
+ parts[1] = Number.parseInt(parts[1], 10).toString();
727
+ }
728
+ return parts.join('.');
729
+ }
730
+ async function loadConfigurationSnapshot(registrations) {
731
+ const names = new Set();
732
+ for (const { source, mode } of registrations) {
733
+ if (!source.name.trim()) {
734
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationSourceNameRequired);
735
+ }
736
+ if (!modes.includes(mode)) {
737
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationSourceMode, undefined, { sourceName: source.name, mode: String(mode) });
738
+ }
739
+ if (names.has(source.name)) {
740
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.DuplicateConfigurationSource, undefined, { sourceName: source.name });
741
+ }
742
+ names.add(source.name);
743
+ }
744
+ const settled = await Promise.allSettled(registrations.map(async (registration) => {
745
+ try {
746
+ return {
747
+ ...registration,
748
+ result: await registration.source.load()
749
+ };
750
+ }
751
+ catch (cause) {
752
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationSourceLoadFailed, (0, jsonFileConfigurationSource_1.isSafeJsonFileConfigurationError)(cause) ? cause : undefined, { sourceName: registration.source.name });
753
+ }
754
+ }));
755
+ const loaded = settled.map(result => {
756
+ if (result.status === 'rejected') {
757
+ throw result.reason;
758
+ }
759
+ return result.value;
760
+ });
761
+ const mutable = Object.fromEntries(modes.map(mode => [mode, createConfigurationLayer()]));
762
+ for (const { source, mode, result } of loaded) {
763
+ compileSourceResult(mutable[mode], result, source.name);
764
+ }
765
+ return Object.freeze(Object.fromEntries(modes.map(mode => [mode, freezeConfigurationLayer(mutable[mode])])));
766
+ }
767
+ /**
768
+ * Loads configuration sources into a new immutable, host-scoped context.
769
+ *
770
+ * @param registrations Configuration sources and their explicit resolution modes.
771
+ * @returns A context that can be shared by consumers belonging to one host.
772
+ */
773
+ async function createConfigurationContext(registrations) {
774
+ const snapshot = await loadConfigurationSnapshot(registrations);
775
+ const context = Object.freeze(instantiateConfigurationContext());
776
+ contextSnapshots.set(context, snapshot);
777
+ return context;
778
+ }
779
+ /**
780
+ * Preloads external configuration sources into an immutable process-level snapshot.
781
+ *
782
+ * @remarks
783
+ * Call this function once, before constructing configuration consumers such as
784
+ * `CloudAdapter` or `AgentApplication`. Sources in the same mode are applied in
785
+ * registration order, with later values winning.
786
+ *
787
+ * @param registrations Configuration sources and their explicit resolution modes.
788
+ */
789
+ async function preloadConfigurationSources(registrations) {
790
+ if (state.kind === 'loading') {
791
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationPreloadInProgress);
792
+ }
793
+ if (state.kind === 'ready') {
794
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationAlreadyPreloaded);
795
+ }
796
+ if (state.kind === 'consumed') {
797
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationAlreadyConsumed);
798
+ }
799
+ state = { kind: 'loading' };
800
+ try {
801
+ state = {
802
+ kind: 'ready',
803
+ snapshot: await loadConfigurationSnapshot(registrations)
804
+ };
805
+ }
806
+ catch (cause) {
807
+ state = { kind: 'uninitialized' };
808
+ throw cause;
809
+ }
810
+ }
811
+ function getConfigurationSnapshot(context) {
812
+ if (context) {
813
+ const snapshot = contextSnapshots.get(context);
814
+ if (!snapshot) {
815
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.InvalidConfigurationContext);
816
+ }
817
+ return snapshot;
818
+ }
819
+ if (state.kind === 'loading') {
820
+ throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.ConfigurationPreloadInProgress);
821
+ }
822
+ if (state.kind === 'uninitialized') {
823
+ const snapshot = emptySnapshot();
824
+ state = { kind: 'consumed', snapshot };
825
+ return snapshot;
826
+ }
827
+ if (state.kind === 'ready') {
828
+ state = { kind: 'consumed', snapshot: state.snapshot };
829
+ return state.snapshot;
830
+ }
831
+ return state.snapshot;
832
+ }
833
+ function resetConfigurationSourcesForTest() {
834
+ state = { kind: 'uninitialized' };
835
+ }
836
+ //# sourceMappingURL=configuration.js.map