@sddsjs/design-system-builder-cli 0.0.0-stage → 0.2.0

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 (63) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +969 -2
  3. package/bin/dsbuilder.js +2 -0
  4. package/dist/kotlin/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +3170 -0
  5. package/dist/kotlin/Stately-stately-concurrency.js +32 -0
  6. package/dist/kotlin/Stately-stately-concurrent-collections.js +302 -0
  7. package/dist/kotlin/Stately-stately-strict.js +12 -0
  8. package/dist/kotlin/clikt-clikt-mordant.js +304 -0
  9. package/dist/kotlin/clikt-clikt.js +6960 -0
  10. package/dist/kotlin/colormath-root-colormath.js +1653 -0
  11. package/dist/kotlin/design-system-builder-frontend-analytics-metrica.js +1026 -0
  12. package/dist/kotlin/design-system-builder-frontend-cli.js +10690 -0
  13. package/dist/kotlin/design-system-builder-frontend-core-analytics.js +128 -0
  14. package/dist/kotlin/design-system-builder-frontend-core-application.js +3634 -0
  15. package/dist/kotlin/design-system-builder-frontend-core-auth.js +1772 -0
  16. package/dist/kotlin/design-system-builder-frontend-core-domain.js +501 -0
  17. package/dist/kotlin/design-system-builder-frontend-core-network.js +3318 -0
  18. package/dist/kotlin/design-system-builder-frontend-core-platform.js +972 -0
  19. package/dist/kotlin/design-system-builder-frontend-core-process.js +236 -0
  20. package/dist/kotlin/design-system-builder-frontend-core-workspace.js +1058 -0
  21. package/dist/kotlin/design-system-builder-frontend-feature-auth.js +1664 -0
  22. package/dist/kotlin/design-system-builder-frontend-feature-components.js +24819 -0
  23. package/dist/kotlin/design-system-builder-frontend-feature-docs.js +7625 -0
  24. package/dist/kotlin/design-system-builder-frontend-feature-ds.js +2219 -0
  25. package/dist/kotlin/design-system-builder-frontend-feature-init.js +318 -0
  26. package/dist/kotlin/design-system-builder-frontend-feature-projects.js +624 -0
  27. package/dist/kotlin/design-system-builder-frontend-feature-status.js +984 -0
  28. package/dist/kotlin/design-system-builder-frontend-feature-theme.js +10456 -0
  29. package/dist/kotlin/design-system-builder-frontend-feature-toolchain.js +586 -0
  30. package/dist/kotlin/design-system-builder-frontend-mcp-server-core.js +6878 -0
  31. package/dist/kotlin/design-system-builder-frontend-platform-android.js +451 -0
  32. package/dist/kotlin/design-system-builder-frontend-platform-ios.js +1858 -0
  33. package/dist/kotlin/design-system-builder-frontend-platform-web.js +1555 -0
  34. package/dist/kotlin/design-system-builder-frontend-runtime-node.js +1763 -0
  35. package/dist/kotlin/kotlin-kotlin-stdlib.js +17881 -0
  36. package/dist/kotlin/kotlin-logging.js +440 -0
  37. package/dist/kotlin/kotlin-sdk-kotlin-sdk-core.js +20228 -0
  38. package/dist/kotlin/kotlin-sdk-kotlin-sdk-server.js +2771 -0
  39. package/dist/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  40. package/dist/kotlin/kotlinx-atomicfu.js +252 -0
  41. package/dist/kotlin/kotlinx-coroutines-core.js +10822 -0
  42. package/dist/kotlin/kotlinx-io-kotlinx-io-bytestring.js +203 -0
  43. package/dist/kotlin/kotlinx-io-kotlinx-io-core.js +2032 -0
  44. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +6171 -0
  45. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +5690 -0
  46. package/dist/kotlin/ktor-ktor-client-core.js +8382 -0
  47. package/dist/kotlin/ktor-ktor-events.js +80 -0
  48. package/dist/kotlin/ktor-ktor-http-cio.js +2252 -0
  49. package/dist/kotlin/ktor-ktor-http.js +3320 -0
  50. package/dist/kotlin/ktor-ktor-io.js +3328 -0
  51. package/dist/kotlin/ktor-ktor-serialization.js +8 -0
  52. package/dist/kotlin/ktor-ktor-server-core.js +12 -0
  53. package/dist/kotlin/ktor-ktor-server-sse.js +8 -0
  54. package/dist/kotlin/ktor-ktor-server-websockets.js +8 -0
  55. package/dist/kotlin/ktor-ktor-sse.js +8 -0
  56. package/dist/kotlin/ktor-ktor-utils.js +2524 -0
  57. package/dist/kotlin/ktor-ktor-websocket-serialization.js +8 -0
  58. package/dist/kotlin/ktor-ktor-websockets.js +433 -0
  59. package/dist/kotlin/mordant-mordant-omnibus.js +8 -0
  60. package/dist/kotlin/mordant-mordant.js +12111 -0
  61. package/dist/kotlin/okio-parent-okio.js +2335 -0
  62. package/dist/kotlin/projects-core-koin-core.js +1285 -0
  63. package/package.json +26 -5
@@ -0,0 +1,2771 @@
1
+ (function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_io_modelcontextprotocol_kotlin_sdk_core, kotlin_org_jetbrains_kotlinx_kotlinx_collections_immutable, kotlin_org_jetbrains_kotlinx_atomicfu, kotlin_io_github_oshai_kotlin_logging, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var protoOf = kotlin_kotlin.$_$.te;
6
+ var initMetadataForInterface = kotlin_kotlin.$_$.ud;
7
+ var VOID = kotlin_kotlin.$_$.c;
8
+ var initMetadataForClass = kotlin_kotlin.$_$.qd;
9
+ var toString = kotlin_kotlin.$_$.we;
10
+ var hashCode = kotlin_kotlin.$_$.pd;
11
+ var equals = kotlin_kotlin.$_$.jd;
12
+ var CoroutineStart_LAZY_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b;
13
+ var launch = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.v1;
14
+ var Unit_instance = kotlin_kotlin.$_$.r5;
15
+ var ToolListChangedNotification = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.l2;
16
+ var PromptListChangedNotification = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.y1;
17
+ var ResourceListChangedNotification = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.b2;
18
+ var ResourceUpdatedNotificationParams = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.c2;
19
+ var ResourceUpdatedNotification = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.d2;
20
+ var CoroutineImpl = kotlin_kotlin.$_$.tb;
21
+ var THROW_CCE = kotlin_kotlin.$_$.wk;
22
+ var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j1;
23
+ var isInterface = kotlin_kotlin.$_$.fe;
24
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.db;
25
+ var initMetadataForLambda = kotlin_kotlin.$_$.vd;
26
+ var joinAll = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e;
27
+ var cancel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.p1;
28
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.sd;
29
+ var System_instance = kotlin_kotlin.$_$.f5;
30
+ var SupervisorJob = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m1;
31
+ var Dispatchers_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.l;
32
+ var CoroutineScope_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i1;
33
+ var BufferOverflow_SUSPEND_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
34
+ var MutableSharedFlow = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.v;
35
+ var persistentSetOf = kotlin_org_jetbrains_kotlinx_kotlinx_collections_immutable.$_$.c;
36
+ var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d;
37
+ var persistentMapOf = kotlin_org_jetbrains_kotlinx_kotlinx_collections_immutable.$_$.b;
38
+ var KotlinLogging_instance = kotlin_io_github_oshai_kotlin_logging.$_$.c;
39
+ var objectCreate = kotlin_kotlin.$_$.se;
40
+ var FunctionAdapter = kotlin_kotlin.$_$.wc;
41
+ var FlowCollector = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.u;
42
+ var takeWhile = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.x;
43
+ var compare = kotlin_kotlin.$_$.fc;
44
+ var persistentListOf = kotlin_org_jetbrains_kotlinx_kotlinx_collections_immutable.$_$.a;
45
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.y6;
46
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
47
+ var ListToolsResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.w1;
48
+ var ListPromptsResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.q1;
49
+ var ListResourcesResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.u1;
50
+ var ListResourceTemplatesResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.s1;
51
+ var Comparator = kotlin_kotlin.$_$.hk;
52
+ var ListToolsRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.v1;
53
+ var RequestHandlerExtra = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.c1;
54
+ var CallToolRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.f1;
55
+ var ListPromptsRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.p1;
56
+ var GetPromptRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.i1;
57
+ var ListResourcesRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.t1;
58
+ var ReadResourceRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.a2;
59
+ var ListResourceTemplatesRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.r1;
60
+ var SubscribeRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.i2;
61
+ var UnsubscribeRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.o2;
62
+ var toString_0 = kotlin_kotlin.$_$.bm;
63
+ var compareValues = kotlin_kotlin.$_$.ab;
64
+ var Defined_ToolsList_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.u;
65
+ var Defined_ToolsCall_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.t;
66
+ var Defined_PromptsList_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.m;
67
+ var Defined_PromptsGet_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.l;
68
+ var Defined_ResourcesList_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.n;
69
+ var Defined_ResourcesRead_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.o;
70
+ var Defined_ResourcesTemplatesList_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.q;
71
+ var Defined_ResourcesSubscribe_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.p;
72
+ var Defined_ResourcesUnsubscribe_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.r;
73
+ var TextContent = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.j2;
74
+ var listOf = kotlin_kotlin.$_$.e9;
75
+ var CallToolResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.g1;
76
+ var Exception = kotlin_kotlin.$_$.mk;
77
+ var CancellationException = kotlin_kotlin.$_$.cb;
78
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.v1;
79
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.m;
80
+ var to = kotlin_kotlin.$_$.cm;
81
+ var maxWithOrNull = kotlin_kotlin.$_$.k9;
82
+ var JsonObjectBuilder = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.m;
83
+ var put = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.a1;
84
+ var McpException = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.x1;
85
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.b2;
86
+ var Tool = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.n2;
87
+ var ToolSchema = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.m2;
88
+ var Companion_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.x;
89
+ var ProtocolOptions = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.z;
90
+ var get_SUPPORTED_PROTOCOL_VERSIONS = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.e2;
91
+ var InitializeResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.l1;
92
+ var InitializeRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.k1;
93
+ var CompletableDeferred = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.d1;
94
+ var SetLevelRequest = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.h2;
95
+ var EmptyResult = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.h1;
96
+ var Protocol = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.a1;
97
+ var Companion_getInstance_0 = kotlin_kotlin.$_$.j5;
98
+ var Defined_Initialize_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.a;
99
+ var Defined_NotificationsInitialized_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.d;
100
+ var Defined_LoggingSetLevel_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.b;
101
+ var Defined_NotificationsCancelled_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.c;
102
+ var Defined_NotificationsProgress_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.f;
103
+ var Defined_NotificationsPromptsListChanged_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.g;
104
+ var Defined_NotificationsToolsListChanged_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.j;
105
+ var Defined_NotificationsResourcesUpdated_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.i;
106
+ var Defined_NotificationsResourcesListChanged_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.h;
107
+ var Defined_NotificationsMessage_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.e;
108
+ var Defined_Ping_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.k;
109
+ var Defined_SamplingCreateMessage_getInstance = kotlin_io_modelcontextprotocol_kotlin_sdk_core.$_$.s;
110
+ var getStringHashCode = kotlin_kotlin.$_$.od;
111
+ //endregion
112
+ //region block: pre-declaration
113
+ initMetadataForInterface(ClientConnection, 'ClientConnection', VOID, VOID, VOID, [2, 3, 1, 0]);
114
+ initMetadataForClass(ClientConnectionImpl, 'ClientConnectionImpl', VOID, VOID, [ClientConnection], [2, 3, 1, 0]);
115
+ initMetadataForClass(RegisteredTool, 'RegisteredTool');
116
+ initMetadataForClass(FeatureNotificationService$featureListener$1);
117
+ initMetadataForLambda(FeatureNotificationService$emit$slambda, CoroutineImpl, VOID, [1]);
118
+ initMetadataForLambda(FeatureNotificationService$close$slambda, CoroutineImpl, VOID, [1]);
119
+ initMetadataForCoroutine($closeCOROUTINE$, CoroutineImpl);
120
+ initMetadataForClass(FeatureNotificationService, 'FeatureNotificationService', FeatureNotificationService, VOID, VOID, [0]);
121
+ initMetadataForClass(NotificationEvent, 'NotificationEvent');
122
+ initMetadataForLambda(SessionNotificationJob$_init_$slambda$slambda_j15kmy, CoroutineImpl, VOID, [1]);
123
+ initMetadataForLambda(SessionNotificationJob$_init_$slambda$slambda_j15kmy_1, CoroutineImpl, VOID, [1]);
124
+ initMetadataForClass(sam$kotlinx_coroutines_flow_FlowCollector$0, 'sam$kotlinx_coroutines_flow_FlowCollector$0', VOID, VOID, [FlowCollector, FunctionAdapter], [1]);
125
+ initMetadataForLambda(SessionNotificationJob$_init_$slambda_qzwnhs, CoroutineImpl, VOID, [1]);
126
+ initMetadataForCoroutine($handleSendNotificationEventCOROUTINE$, CoroutineImpl);
127
+ initMetadataForClass(SessionNotificationJob, 'SessionNotificationJob', VOID, VOID, VOID, [3, 0]);
128
+ initMetadataForClass(SendEvent, 'SendEvent', VOID, NotificationEvent);
129
+ initMetadataForClass(EndEvent, 'EndEvent', VOID, NotificationEvent);
130
+ initMetadataForClass(FeatureRegistry, 'FeatureRegistry');
131
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
132
+ initMetadataForLambda(Server$createSession$slambda, CoroutineImpl, VOID, [2]);
133
+ initMetadataForLambda(Server$createSession$slambda_1, CoroutineImpl, VOID, [2]);
134
+ initMetadataForLambda(Server$createSession$slambda_3, CoroutineImpl, VOID, [2]);
135
+ initMetadataForLambda(Server$createSession$slambda_5, CoroutineImpl, VOID, [2]);
136
+ initMetadataForLambda(Server$createSession$slambda_7, CoroutineImpl, VOID, [2]);
137
+ initMetadataForLambda(Server$createSession$slambda_9, CoroutineImpl, VOID, [2]);
138
+ initMetadataForLambda(Server$createSession$slambda_11, CoroutineImpl, VOID, [2]);
139
+ initMetadataForLambda(Server$createSession$slambda_13, CoroutineImpl, VOID, [2]);
140
+ initMetadataForLambda(Server$createSession$slambda_15, CoroutineImpl, VOID, [2]);
141
+ initMetadataForCoroutine($closeCOROUTINE$_0, CoroutineImpl);
142
+ initMetadataForCoroutine($createSessionCOROUTINE$, CoroutineImpl);
143
+ initMetadataForCoroutine($handleCallToolCOROUTINE$, CoroutineImpl);
144
+ initMetadataForCoroutine($handleGetPromptCOROUTINE$, CoroutineImpl);
145
+ initMetadataForCoroutine($handleReadResourceCOROUTINE$, CoroutineImpl);
146
+ initMetadataForClass(Server, 'Server', VOID, VOID, VOID, [0, 1, 2, 3, 4]);
147
+ initMetadataForClass(ServerOptions, 'ServerOptions', VOID, ProtocolOptions);
148
+ initMetadataForLambda(ServerSession$slambda, CoroutineImpl, VOID, [2]);
149
+ initMetadataForLambda(ServerSession$slambda_1, CoroutineImpl, VOID, [2]);
150
+ initMetadataForClass(ServerSession, 'ServerSession', VOID, Protocol, VOID, [0, 2, 3, 1]);
151
+ initMetadataForClass(ServerSessionRegistry, 'ServerSessionRegistry', ServerSessionRegistry);
152
+ //endregion
153
+ function ClientConnection() {
154
+ }
155
+ function ClientConnectionImpl(session) {
156
+ this.gad_1 = session;
157
+ }
158
+ function RegisteredTool(tool, handler) {
159
+ this.had_1 = tool;
160
+ this.iad_1 = handler;
161
+ this.jad_1 = this.had_1.tab_1;
162
+ }
163
+ protoOf(RegisteredTool).x = function () {
164
+ return this.jad_1;
165
+ };
166
+ protoOf(RegisteredTool).toString = function () {
167
+ return 'RegisteredTool(tool=' + this.had_1.toString() + ', handler=' + toString(this.iad_1) + ')';
168
+ };
169
+ protoOf(RegisteredTool).hashCode = function () {
170
+ var result = this.had_1.hashCode();
171
+ result = imul(result, 31) + hashCode(this.iad_1) | 0;
172
+ return result;
173
+ };
174
+ protoOf(RegisteredTool).equals = function (other) {
175
+ if (this === other)
176
+ return true;
177
+ if (!(other instanceof RegisteredTool))
178
+ return false;
179
+ if (!this.had_1.equals(other.had_1))
180
+ return false;
181
+ if (!equals(this.iad_1, other.iad_1))
182
+ return false;
183
+ return true;
184
+ };
185
+ function FeatureNotificationService$featureListener$o$onFeatureUpdated$lambda($notification) {
186
+ return function () {
187
+ return 'Emitting notification: ' + $notification.c3u().y();
188
+ };
189
+ }
190
+ function FeatureNotificationService$emit$slambda$lambda($timestamp, $notification) {
191
+ return function () {
192
+ return 'Actually emitting notification ' + $timestamp.toString() + ': ' + toString($notification);
193
+ };
194
+ }
195
+ function FeatureNotificationService$emit$slambda$lambda_0($timestamp, $notification) {
196
+ return function () {
197
+ return 'Notification emitted ' + $timestamp.toString() + ': ' + toString($notification);
198
+ };
199
+ }
200
+ function FeatureNotificationService$close$slambda$lambda() {
201
+ return 'Emitting end event';
202
+ }
203
+ function FeatureNotificationService$close$slambda$lambda_0() {
204
+ return 'End event emitted';
205
+ }
206
+ function featureListener($this, notificationProvider) {
207
+ return new FeatureNotificationService$featureListener$1(notificationProvider, $this);
208
+ }
209
+ function emit($this, notification) {
210
+ var timestamp = getCurrentTimestamp($this);
211
+ $this.pad_1.m98(FeatureNotificationService$emit$lambda(timestamp, notification));
212
+ var tmp = CoroutineStart_LAZY_getInstance();
213
+ var job = launch($this.lad_1, VOID, tmp, FeatureNotificationService$emit$slambda_0($this, timestamp, notification, null));
214
+ var tmp0 = $this.nad_1;
215
+ $l$block: {
216
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
217
+ while (true) {
218
+ var cur = tmp0.kotlinx$atomicfu$value;
219
+ var upd = cur.j(job);
220
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
221
+ break $l$block;
222
+ }
223
+ }
224
+ }
225
+ job.yw(FeatureNotificationService$emit$lambda_0($this, job));
226
+ job.tw();
227
+ }
228
+ function getCurrentTimestamp($this) {
229
+ return $this.kad_1.zn().io();
230
+ }
231
+ function FeatureNotificationService$logger$lambda() {
232
+ return Unit_instance;
233
+ }
234
+ function FeatureNotificationService$featureListener$1($notificationProvider, this$0) {
235
+ this.uad_1 = $notificationProvider;
236
+ this.vad_1 = this$0;
237
+ }
238
+ protoOf(FeatureNotificationService$featureListener$1).wad = function (featureKey) {
239
+ var notification = this.uad_1(featureKey);
240
+ this.vad_1.pad_1.l98(FeatureNotificationService$featureListener$o$onFeatureUpdated$lambda(notification));
241
+ emit(this.vad_1, notification);
242
+ };
243
+ function FeatureNotificationService$toolListChangedListener$lambda(it) {
244
+ return new ToolListChangedNotification();
245
+ }
246
+ function FeatureNotificationService$promptListChangedListener$lambda(it) {
247
+ return new PromptListChangedNotification();
248
+ }
249
+ function FeatureNotificationService$resourceListChangedListener$lambda(it) {
250
+ return new ResourceListChangedNotification();
251
+ }
252
+ function FeatureNotificationService$resourceUpdatedListener$lambda(it) {
253
+ return new ResourceUpdatedNotification(new ResourceUpdatedNotificationParams(it));
254
+ }
255
+ function FeatureNotificationService$subscribeSession$lambda($session) {
256
+ return function () {
257
+ return 'Subscribing session for notifications sessionId: ' + $session.hae_1;
258
+ };
259
+ }
260
+ function FeatureNotificationService$subscribeSession$lambda_0($session) {
261
+ return function () {
262
+ return 'Session already subscribed: ' + $session.hae_1;
263
+ };
264
+ }
265
+ function FeatureNotificationService$subscribeSession$lambda_1($session) {
266
+ return function () {
267
+ return 'Subscribed session for notifications sessionId: ' + $session.hae_1;
268
+ };
269
+ }
270
+ function FeatureNotificationService$unsubscribeSession$lambda($session) {
271
+ return function () {
272
+ return 'Unsubscribing from list changed notifications for sessionId: ' + $session.hae_1;
273
+ };
274
+ }
275
+ function FeatureNotificationService$unsubscribeSession$lambda_0($session) {
276
+ return function () {
277
+ return 'Unsubscribed from list changed notifications for sessionId: ' + $session.hae_1;
278
+ };
279
+ }
280
+ function FeatureNotificationService$subscribeToResourceUpdate$lambda($resourceKey, $session) {
281
+ return function () {
282
+ return 'Subscribing to resource ' + $resourceKey + ' update notifications for sessionId: ' + $session.hae_1;
283
+ };
284
+ }
285
+ function FeatureNotificationService$subscribeToResourceUpdate$lambda_0($resourceKey, $session) {
286
+ return function () {
287
+ return 'Subscribed to resource ' + $resourceKey + ' update notifications for sessionId: ' + $session.hae_1;
288
+ };
289
+ }
290
+ function FeatureNotificationService$unsubscribeFromResourceUpdate$lambda($resourceKey, $session) {
291
+ return function () {
292
+ return 'Unsubscribing from resource ' + $resourceKey + ' update notifications for sessionId: ' + $session.hae_1;
293
+ };
294
+ }
295
+ function FeatureNotificationService$unsubscribeFromResourceUpdate$lambda_0($resourceKey, $session) {
296
+ return function () {
297
+ return 'Unsubscribed from resource ' + $resourceKey + ' update notifications for sessionId: ' + $session.hae_1;
298
+ };
299
+ }
300
+ function FeatureNotificationService$emit$lambda($timestamp, $notification) {
301
+ return function () {
302
+ return 'Emitting notification ' + $timestamp.toString() + ': ' + toString($notification);
303
+ };
304
+ }
305
+ function FeatureNotificationService$emit$slambda(this$0, $timestamp, $notification, resultContinuation) {
306
+ this.xae_1 = this$0;
307
+ this.yae_1 = $timestamp;
308
+ this.zae_1 = $notification;
309
+ CoroutineImpl.call(this, resultContinuation);
310
+ }
311
+ protoOf(FeatureNotificationService$emit$slambda).o1y = function ($this$launch, $completion) {
312
+ var tmp = this.p1y($this$launch, $completion);
313
+ tmp.y8_1 = Unit_instance;
314
+ tmp.z8_1 = null;
315
+ return tmp.e9();
316
+ };
317
+ protoOf(FeatureNotificationService$emit$slambda).q9 = function (p1, $completion) {
318
+ return this.o1y((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
319
+ };
320
+ protoOf(FeatureNotificationService$emit$slambda).e9 = function () {
321
+ var suspendResult = this.y8_1;
322
+ $sm: do
323
+ try {
324
+ var tmp = this.w8_1;
325
+ switch (tmp) {
326
+ case 0:
327
+ this.x8_1 = 2;
328
+ this.xae_1.pad_1.l98(FeatureNotificationService$emit$slambda$lambda(this.yae_1, this.zae_1));
329
+ this.w8_1 = 1;
330
+ suspendResult = this.xae_1.mad_1.i1e(new SendEvent(this.yae_1, this.zae_1), this);
331
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
332
+ return suspendResult;
333
+ }
334
+
335
+ continue $sm;
336
+ case 1:
337
+ this.xae_1.pad_1.l98(FeatureNotificationService$emit$slambda$lambda_0(this.yae_1, this.zae_1));
338
+ return Unit_instance;
339
+ case 2:
340
+ throw this.z8_1;
341
+ }
342
+ } catch ($p) {
343
+ var e = $p;
344
+ if (this.x8_1 === 2) {
345
+ throw e;
346
+ } else {
347
+ this.w8_1 = this.x8_1;
348
+ this.z8_1 = e;
349
+ }
350
+ }
351
+ while (true);
352
+ };
353
+ protoOf(FeatureNotificationService$emit$slambda).p1y = function ($this$launch, completion) {
354
+ var i = new FeatureNotificationService$emit$slambda(this.xae_1, this.yae_1, this.zae_1, completion);
355
+ i.aaf_1 = $this$launch;
356
+ return i;
357
+ };
358
+ function FeatureNotificationService$emit$slambda_0(this$0, $timestamp, $notification, resultContinuation) {
359
+ var i = new FeatureNotificationService$emit$slambda(this$0, $timestamp, $notification, resultContinuation);
360
+ var l = function ($this$launch, $completion) {
361
+ return i.o1y($this$launch, $completion);
362
+ };
363
+ l.$arity = 1;
364
+ return l;
365
+ }
366
+ function FeatureNotificationService$emit$lambda_0(this$0, $job) {
367
+ return function (it) {
368
+ var tmp0 = this$0.nad_1;
369
+ $l$block: {
370
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
371
+ while (true) {
372
+ var cur = tmp0.kotlinx$atomicfu$value;
373
+ var upd = cur.j2($job);
374
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
375
+ break $l$block;
376
+ }
377
+ }
378
+ }
379
+ return Unit_instance;
380
+ };
381
+ }
382
+ function FeatureNotificationService$close$lambda() {
383
+ return 'Closing feature notification service';
384
+ }
385
+ function FeatureNotificationService$close$slambda(this$0, resultContinuation) {
386
+ this.jaf_1 = this$0;
387
+ CoroutineImpl.call(this, resultContinuation);
388
+ }
389
+ protoOf(FeatureNotificationService$close$slambda).o1y = function ($this$launch, $completion) {
390
+ var tmp = this.p1y($this$launch, $completion);
391
+ tmp.y8_1 = Unit_instance;
392
+ tmp.z8_1 = null;
393
+ return tmp.e9();
394
+ };
395
+ protoOf(FeatureNotificationService$close$slambda).q9 = function (p1, $completion) {
396
+ return this.o1y((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
397
+ };
398
+ protoOf(FeatureNotificationService$close$slambda).e9 = function () {
399
+ var suspendResult = this.y8_1;
400
+ $sm: do
401
+ try {
402
+ var tmp = this.w8_1;
403
+ switch (tmp) {
404
+ case 0:
405
+ this.x8_1 = 2;
406
+ this.jaf_1.pad_1.m98(FeatureNotificationService$close$slambda$lambda);
407
+ this.w8_1 = 1;
408
+ suspendResult = this.jaf_1.mad_1.i1e(new EndEvent(getCurrentTimestamp(this.jaf_1)), this);
409
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
410
+ return suspendResult;
411
+ }
412
+
413
+ continue $sm;
414
+ case 1:
415
+ this.jaf_1.pad_1.m98(FeatureNotificationService$close$slambda$lambda_0);
416
+ return Unit_instance;
417
+ case 2:
418
+ throw this.z8_1;
419
+ }
420
+ } catch ($p) {
421
+ var e = $p;
422
+ if (this.x8_1 === 2) {
423
+ throw e;
424
+ } else {
425
+ this.w8_1 = this.x8_1;
426
+ this.z8_1 = e;
427
+ }
428
+ }
429
+ while (true);
430
+ };
431
+ protoOf(FeatureNotificationService$close$slambda).p1y = function ($this$launch, completion) {
432
+ var i = new FeatureNotificationService$close$slambda(this.jaf_1, completion);
433
+ i.kaf_1 = $this$launch;
434
+ return i;
435
+ };
436
+ function FeatureNotificationService$close$slambda_0(this$0, resultContinuation) {
437
+ var i = new FeatureNotificationService$close$slambda(this$0, resultContinuation);
438
+ var l = function ($this$launch, $completion) {
439
+ return i.o1y($this$launch, $completion);
440
+ };
441
+ l.$arity = 1;
442
+ return l;
443
+ }
444
+ function $closeCOROUTINE$(_this__u8e3s4, resultContinuation) {
445
+ CoroutineImpl.call(this, resultContinuation);
446
+ this.taf_1 = _this__u8e3s4;
447
+ }
448
+ protoOf($closeCOROUTINE$).e9 = function () {
449
+ var suspendResult = this.y8_1;
450
+ $sm: do
451
+ try {
452
+ var tmp = this.w8_1;
453
+ switch (tmp) {
454
+ case 0:
455
+ this.x8_1 = 6;
456
+ this.taf_1.pad_1.m98(FeatureNotificationService$close$lambda);
457
+ this.w8_1 = 1;
458
+ suspendResult = joinAll(this.taf_1.nad_1.kotlinx$atomicfu$value, this);
459
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
460
+ return suspendResult;
461
+ }
462
+
463
+ continue $sm;
464
+ case 1:
465
+ this.w8_1 = 2;
466
+ suspendResult = launch(this.taf_1.lad_1, VOID, VOID, FeatureNotificationService$close$slambda_0(this.taf_1, null)).cx(this);
467
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
468
+ return suspendResult;
469
+ }
470
+
471
+ continue $sm;
472
+ case 2:
473
+ this.uaf_1 = this.taf_1.oad_1.kotlinx$atomicfu$value.e2().l();
474
+ this.w8_1 = 3;
475
+ continue $sm;
476
+ case 3:
477
+ if (!this.uaf_1.m()) {
478
+ this.w8_1 = 5;
479
+ continue $sm;
480
+ }
481
+
482
+ var element = this.uaf_1.n();
483
+ this.w8_1 = 4;
484
+ suspendResult = element.cx(this);
485
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
486
+ return suspendResult;
487
+ }
488
+
489
+ continue $sm;
490
+ case 4:
491
+ this.w8_1 = 3;
492
+ continue $sm;
493
+ case 5:
494
+ cancel(this.taf_1.lad_1);
495
+ return Unit_instance;
496
+ case 6:
497
+ throw this.z8_1;
498
+ }
499
+ } catch ($p) {
500
+ var e = $p;
501
+ if (this.x8_1 === 6) {
502
+ throw e;
503
+ } else {
504
+ this.w8_1 = this.x8_1;
505
+ this.z8_1 = e;
506
+ }
507
+ }
508
+ while (true);
509
+ };
510
+ function FeatureNotificationService(notificationBufferCapacity, clock) {
511
+ notificationBufferCapacity = notificationBufferCapacity === VOID ? 2147483647 : notificationBufferCapacity;
512
+ clock = clock === VOID ? System_instance : clock;
513
+ this.kad_1 = clock;
514
+ this.lad_1 = CoroutineScope_0(SupervisorJob().gj(Dispatchers_getInstance().s13_1));
515
+ this.mad_1 = MutableSharedFlow(VOID, notificationBufferCapacity, BufferOverflow_SUSPEND_getInstance());
516
+ this.nad_1 = atomic$ref$1(persistentSetOf());
517
+ this.oad_1 = atomic$ref$1(persistentMapOf());
518
+ var tmp = this;
519
+ var tmp_0 = KotlinLogging_instance;
520
+ tmp.pad_1 = tmp_0.r98(FeatureNotificationService$logger$lambda);
521
+ var tmp_1 = this;
522
+ tmp_1.qad_1 = featureListener(this, FeatureNotificationService$toolListChangedListener$lambda);
523
+ var tmp_2 = this;
524
+ tmp_2.rad_1 = featureListener(this, FeatureNotificationService$promptListChangedListener$lambda);
525
+ var tmp_3 = this;
526
+ tmp_3.sad_1 = featureListener(this, FeatureNotificationService$resourceListChangedListener$lambda);
527
+ var tmp_4 = this;
528
+ tmp_4.tad_1 = featureListener(this, FeatureNotificationService$resourceUpdatedListener$lambda);
529
+ }
530
+ protoOf(FeatureNotificationService).yaf = function (session) {
531
+ this.pad_1.m98(FeatureNotificationService$subscribeSession$lambda(session));
532
+ var timestamp = getCurrentTimestamp(this);
533
+ var tmp0 = this.oad_1;
534
+ $l$block_0: {
535
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
536
+ while (true) {
537
+ var cur = tmp0.kotlinx$atomicfu$value;
538
+ var tmp$ret$0;
539
+ $l$block: {
540
+ var tmp;
541
+ if (cur.a2(session.hae_1)) {
542
+ this.pad_1.m98(FeatureNotificationService$subscribeSession$lambda_0(session));
543
+ tmp$ret$0 = cur;
544
+ break $l$block;
545
+ } else {
546
+ tmp = cur.f2(session.hae_1, SessionNotificationJob_init_$Create$(session, this.lad_1, this.mad_1, timestamp));
547
+ }
548
+ tmp$ret$0 = tmp;
549
+ }
550
+ var upd = tmp$ret$0;
551
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
552
+ break $l$block_0;
553
+ }
554
+ }
555
+ }
556
+ this.pad_1.m98(FeatureNotificationService$subscribeSession$lambda_1(session));
557
+ };
558
+ protoOf(FeatureNotificationService).zaf = function (session) {
559
+ this.pad_1.m98(FeatureNotificationService$unsubscribeSession$lambda(session));
560
+ var tmp0 = this.oad_1;
561
+ $l$block: {
562
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
563
+ while (true) {
564
+ var cur = tmp0.kotlinx$atomicfu$value;
565
+ var tmp0_safe_receiver = cur.c2(session.hae_1);
566
+ if (tmp0_safe_receiver == null)
567
+ null;
568
+ else {
569
+ tmp0_safe_receiver.aag();
570
+ }
571
+ var upd = cur.g2(session.hae_1);
572
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
573
+ break $l$block;
574
+ }
575
+ }
576
+ }
577
+ this.pad_1.m98(FeatureNotificationService$unsubscribeSession$lambda_0(session));
578
+ };
579
+ protoOf(FeatureNotificationService).bag = function (session, resourceKey) {
580
+ this.pad_1.m98(FeatureNotificationService$subscribeToResourceUpdate$lambda(resourceKey, session));
581
+ var tmp0_safe_receiver = this.oad_1.kotlinx$atomicfu$value.c2(session.hae_1);
582
+ if (tmp0_safe_receiver == null)
583
+ null;
584
+ else {
585
+ tmp0_safe_receiver.cag(resourceKey, getCurrentTimestamp(this));
586
+ }
587
+ this.pad_1.m98(FeatureNotificationService$subscribeToResourceUpdate$lambda_0(resourceKey, session));
588
+ };
589
+ protoOf(FeatureNotificationService).dag = function (session, resourceKey) {
590
+ this.pad_1.m98(FeatureNotificationService$unsubscribeFromResourceUpdate$lambda(resourceKey, session));
591
+ var tmp0_safe_receiver = this.oad_1.kotlinx$atomicfu$value.c2(session.hae_1);
592
+ if (tmp0_safe_receiver == null)
593
+ null;
594
+ else {
595
+ tmp0_safe_receiver.eag(resourceKey);
596
+ }
597
+ this.pad_1.m98(FeatureNotificationService$unsubscribeFromResourceUpdate$lambda_0(resourceKey, session));
598
+ };
599
+ protoOf(FeatureNotificationService).h9i = function ($completion) {
600
+ var tmp = new $closeCOROUTINE$(this, $completion);
601
+ tmp.y8_1 = Unit_instance;
602
+ tmp.z8_1 = null;
603
+ return tmp.e9();
604
+ };
605
+ function NotificationEvent(timestamp) {
606
+ this.fag_1 = timestamp;
607
+ }
608
+ function SessionNotificationJob$_init_$slambda$slambda$lambda_s3p2qj($event) {
609
+ return function () {
610
+ return 'Skipping event: ' + toString($event);
611
+ };
612
+ }
613
+ function SessionNotificationJob$_init_$slambda$slambda_j15kmy(resultContinuation) {
614
+ CoroutineImpl.call(this, resultContinuation);
615
+ }
616
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy).pag = function (it, $completion) {
617
+ var tmp = this.qag(it, $completion);
618
+ tmp.y8_1 = Unit_instance;
619
+ tmp.z8_1 = null;
620
+ return tmp.e9();
621
+ };
622
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy).q9 = function (p1, $completion) {
623
+ return this.pag(p1 instanceof NotificationEvent ? p1 : THROW_CCE(), $completion);
624
+ };
625
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy).e9 = function () {
626
+ var suspendResult = this.y8_1;
627
+ $sm: do
628
+ try {
629
+ var tmp = this.w8_1;
630
+ if (tmp === 0) {
631
+ this.x8_1 = 1;
632
+ var tmp_0 = this.oag_1;
633
+ return !(tmp_0 instanceof EndEvent);
634
+ } else if (tmp === 1) {
635
+ throw this.z8_1;
636
+ }
637
+ } catch ($p) {
638
+ var e = $p;
639
+ throw e;
640
+ }
641
+ while (true);
642
+ };
643
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy).qag = function (it, completion) {
644
+ var i = new SessionNotificationJob$_init_$slambda$slambda_j15kmy(completion);
645
+ i.oag_1 = it;
646
+ return i;
647
+ };
648
+ function SessionNotificationJob$_init_$slambda$slambda_j15kmy_0(resultContinuation) {
649
+ var i = new SessionNotificationJob$_init_$slambda$slambda_j15kmy(resultContinuation);
650
+ var l = function (it, $completion) {
651
+ return i.pag(it, $completion);
652
+ };
653
+ l.$arity = 1;
654
+ return l;
655
+ }
656
+ function SessionNotificationJob$_init_$slambda$slambda_j15kmy_1(this$0, $session, $fromTimestamp, resultContinuation) {
657
+ this.zag_1 = this$0;
658
+ this.aah_1 = $session;
659
+ this.bah_1 = $fromTimestamp;
660
+ CoroutineImpl.call(this, resultContinuation);
661
+ }
662
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy_1).dah = function (event, $completion) {
663
+ var tmp = this.qag(event, $completion);
664
+ tmp.y8_1 = Unit_instance;
665
+ tmp.z8_1 = null;
666
+ return tmp.e9();
667
+ };
668
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy_1).q9 = function (p1, $completion) {
669
+ return this.dah(p1 instanceof NotificationEvent ? p1 : THROW_CCE(), $completion);
670
+ };
671
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy_1).e9 = function () {
672
+ var suspendResult = this.y8_1;
673
+ $sm: do
674
+ try {
675
+ var tmp = this.w8_1;
676
+ switch (tmp) {
677
+ case 0:
678
+ this.x8_1 = 3;
679
+ if (this.cah_1 instanceof SendEvent) {
680
+ this.w8_1 = 1;
681
+ suspendResult = handleSendNotificationEvent(this.zag_1, this.cah_1, this.aah_1, this.bah_1, this);
682
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
683
+ return suspendResult;
684
+ }
685
+ continue $sm;
686
+ } else {
687
+ this.zag_1.xaf_1.n98(SessionNotificationJob$_init_$slambda$slambda$lambda_s3p2qj(this.cah_1));
688
+ this.w8_1 = 2;
689
+ continue $sm;
690
+ }
691
+
692
+ case 1:
693
+ this.w8_1 = 2;
694
+ continue $sm;
695
+ case 2:
696
+ return Unit_instance;
697
+ case 3:
698
+ throw this.z8_1;
699
+ }
700
+ } catch ($p) {
701
+ var e = $p;
702
+ if (this.x8_1 === 3) {
703
+ throw e;
704
+ } else {
705
+ this.w8_1 = this.x8_1;
706
+ this.z8_1 = e;
707
+ }
708
+ }
709
+ while (true);
710
+ };
711
+ protoOf(SessionNotificationJob$_init_$slambda$slambda_j15kmy_1).qag = function (event, completion) {
712
+ var i = new SessionNotificationJob$_init_$slambda$slambda_j15kmy_1(this.zag_1, this.aah_1, this.bah_1, completion);
713
+ i.cah_1 = event;
714
+ return i;
715
+ };
716
+ function SessionNotificationJob$_init_$slambda$slambda_j15kmy_2(this$0, $session, $fromTimestamp, resultContinuation) {
717
+ var i = new SessionNotificationJob$_init_$slambda$slambda_j15kmy_1(this$0, $session, $fromTimestamp, resultContinuation);
718
+ var l = function (event, $completion) {
719
+ return i.dah(event, $completion);
720
+ };
721
+ l.$arity = 1;
722
+ return l;
723
+ }
724
+ function SessionNotificationJob_init_$Init$(session, scope, events, fromTimestamp, $this) {
725
+ SessionNotificationJob.call($this);
726
+ $this.xaf_1.m98(SessionNotificationJob$_init_$lambda_kb2ihd(fromTimestamp, session));
727
+ var tmp = $this;
728
+ tmp.vaf_1 = launch(scope, VOID, VOID, SessionNotificationJob$_init_$slambda_qzwnhs_0(events, $this, session, fromTimestamp, null));
729
+ return $this;
730
+ }
731
+ function SessionNotificationJob_init_$Create$(session, scope, events, fromTimestamp) {
732
+ return SessionNotificationJob_init_$Init$(session, scope, events, fromTimestamp, objectCreate(protoOf(SessionNotificationJob)));
733
+ }
734
+ function handleSendNotificationEvent($this, event, session, fromTimestamp, $completion) {
735
+ var tmp = new $handleSendNotificationEventCOROUTINE$($this, event, session, fromTimestamp, $completion);
736
+ tmp.y8_1 = Unit_instance;
737
+ tmp.z8_1 = null;
738
+ return tmp.e9();
739
+ }
740
+ function sam$kotlinx_coroutines_flow_FlowCollector$0(function_0) {
741
+ this.tah_1 = function_0;
742
+ }
743
+ protoOf(sam$kotlinx_coroutines_flow_FlowCollector$0).i1e = function (value, $completion) {
744
+ return this.tah_1(value, $completion);
745
+ };
746
+ protoOf(sam$kotlinx_coroutines_flow_FlowCollector$0).x2 = function () {
747
+ return this.tah_1;
748
+ };
749
+ protoOf(sam$kotlinx_coroutines_flow_FlowCollector$0).equals = function (other) {
750
+ var tmp;
751
+ if (!(other == null) ? isInterface(other, FlowCollector) : false) {
752
+ var tmp_0;
753
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
754
+ tmp_0 = equals(this.x2(), other.x2());
755
+ } else {
756
+ tmp_0 = false;
757
+ }
758
+ tmp = tmp_0;
759
+ } else {
760
+ tmp = false;
761
+ }
762
+ return tmp;
763
+ };
764
+ protoOf(sam$kotlinx_coroutines_flow_FlowCollector$0).hashCode = function () {
765
+ return hashCode(this.x2());
766
+ };
767
+ function SessionNotificationJob$logger$lambda() {
768
+ return Unit_instance;
769
+ }
770
+ function SessionNotificationJob$_init_$lambda_kb2ihd($fromTimestamp, $session) {
771
+ return function () {
772
+ return 'Starting notification job from timestamp ' + $fromTimestamp.toString() + ' for sessionId: ' + $session.hae_1 + ' ';
773
+ };
774
+ }
775
+ function SessionNotificationJob$_init_$slambda_qzwnhs($events, this$0, $session, $fromTimestamp, resultContinuation) {
776
+ this.cai_1 = $events;
777
+ this.dai_1 = this$0;
778
+ this.eai_1 = $session;
779
+ this.fai_1 = $fromTimestamp;
780
+ CoroutineImpl.call(this, resultContinuation);
781
+ }
782
+ protoOf(SessionNotificationJob$_init_$slambda_qzwnhs).o1y = function ($this$launch, $completion) {
783
+ var tmp = this.p1y($this$launch, $completion);
784
+ tmp.y8_1 = Unit_instance;
785
+ tmp.z8_1 = null;
786
+ return tmp.e9();
787
+ };
788
+ protoOf(SessionNotificationJob$_init_$slambda_qzwnhs).q9 = function (p1, $completion) {
789
+ return this.o1y((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
790
+ };
791
+ protoOf(SessionNotificationJob$_init_$slambda_qzwnhs).e9 = function () {
792
+ var suspendResult = this.y8_1;
793
+ $sm: do
794
+ try {
795
+ var tmp = this.w8_1;
796
+ switch (tmp) {
797
+ case 0:
798
+ this.x8_1 = 2;
799
+ this.w8_1 = 1;
800
+ var tmp_0 = takeWhile(this.cai_1, SessionNotificationJob$_init_$slambda$slambda_j15kmy_0(null));
801
+ var tmp_1 = SessionNotificationJob$_init_$slambda$slambda_j15kmy_2(this.dai_1, this.eai_1, this.fai_1, null);
802
+ suspendResult = tmp_0.a1g(new sam$kotlinx_coroutines_flow_FlowCollector$0(tmp_1), this);
803
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
804
+ return suspendResult;
805
+ }
806
+
807
+ continue $sm;
808
+ case 1:
809
+ return Unit_instance;
810
+ case 2:
811
+ throw this.z8_1;
812
+ }
813
+ } catch ($p) {
814
+ var e = $p;
815
+ if (this.x8_1 === 2) {
816
+ throw e;
817
+ } else {
818
+ this.w8_1 = this.x8_1;
819
+ this.z8_1 = e;
820
+ }
821
+ }
822
+ while (true);
823
+ };
824
+ protoOf(SessionNotificationJob$_init_$slambda_qzwnhs).p1y = function ($this$launch, completion) {
825
+ var i = new SessionNotificationJob$_init_$slambda_qzwnhs(this.cai_1, this.dai_1, this.eai_1, this.fai_1, completion);
826
+ i.gai_1 = $this$launch;
827
+ return i;
828
+ };
829
+ function SessionNotificationJob$_init_$slambda_qzwnhs_0($events, this$0, $session, $fromTimestamp, resultContinuation) {
830
+ var i = new SessionNotificationJob$_init_$slambda_qzwnhs($events, this$0, $session, $fromTimestamp, resultContinuation);
831
+ var l = function ($this$launch, $completion) {
832
+ return i.o1y($this$launch, $completion);
833
+ };
834
+ l.$arity = 1;
835
+ return l;
836
+ }
837
+ function SessionNotificationJob$handleSendNotificationEvent$lambda($event, $fromTimestamp) {
838
+ return function () {
839
+ return 'Skipping event with id: ' + $event.iai_1.toString() + ' as it is older than startingEventId ' + $fromTimestamp.toString() + ': ' + toString($event);
840
+ };
841
+ }
842
+ function SessionNotificationJob$handleSendNotificationEvent$lambda_0($session) {
843
+ return function () {
844
+ return 'Sending list changed notification for sessionId: ' + $session.hae_1;
845
+ };
846
+ }
847
+ function SessionNotificationJob$handleSendNotificationEvent$lambda_1($notification, $session) {
848
+ return function () {
849
+ return 'Sending resource updated notification for resource ' + $notification.u9w_1.n9y_1 + ' ' + ('to sessionId: ' + $session.hae_1);
850
+ };
851
+ }
852
+ function SessionNotificationJob$handleSendNotificationEvent$lambda_2($notification, $resourceFromTimestamp) {
853
+ return function () {
854
+ return 'Skipping resource updated notification for resource ' + $notification.u9w_1.n9y_1 + ' ' + ('as it is older than subscription timestamp ' + $resourceFromTimestamp.toString());
855
+ };
856
+ }
857
+ function SessionNotificationJob$handleSendNotificationEvent$lambda$lambda($notification) {
858
+ return function () {
859
+ return 'No subscription for resource ' + $notification.u9w_1.n9y_1 + '. ' + ('Skipping notification: ' + $notification.toString());
860
+ };
861
+ }
862
+ function SessionNotificationJob$handleSendNotificationEvent$lambda_3(this$0, $notification) {
863
+ return function () {
864
+ this$0.xaf_1.m98(SessionNotificationJob$handleSendNotificationEvent$lambda$lambda($notification));
865
+ return Unit_instance;
866
+ };
867
+ }
868
+ function SessionNotificationJob$handleSendNotificationEvent$lambda_4($notification) {
869
+ return function () {
870
+ return 'Skipping notification: ' + toString($notification);
871
+ };
872
+ }
873
+ function $handleSendNotificationEventCOROUTINE$(_this__u8e3s4, event, session, fromTimestamp, resultContinuation) {
874
+ CoroutineImpl.call(this, resultContinuation);
875
+ this.mah_1 = _this__u8e3s4;
876
+ this.nah_1 = event;
877
+ this.oah_1 = session;
878
+ this.pah_1 = fromTimestamp;
879
+ }
880
+ protoOf($handleSendNotificationEventCOROUTINE$).e9 = function () {
881
+ var suspendResult = this.y8_1;
882
+ $sm: do
883
+ try {
884
+ var tmp = this.w8_1;
885
+ switch (tmp) {
886
+ case 0:
887
+ this.x8_1 = 6;
888
+ if (compare(this.nah_1.iai_1, this.pah_1) < 0) {
889
+ this.mah_1.xaf_1.m98(SessionNotificationJob$handleSendNotificationEvent$lambda(this.nah_1, this.pah_1));
890
+ return Unit_instance;
891
+ }
892
+
893
+ this.rah_1 = this.nah_1.jai_1;
894
+ var tmp_0;
895
+ var tmp_1 = this.rah_1;
896
+ if (tmp_1 instanceof PromptListChangedNotification) {
897
+ tmp_0 = true;
898
+ } else {
899
+ var tmp_2;
900
+ var tmp_3 = this.rah_1;
901
+ if (tmp_3 instanceof ResourceListChangedNotification) {
902
+ tmp_2 = true;
903
+ } else {
904
+ var tmp_4 = this.rah_1;
905
+ tmp_2 = tmp_4 instanceof ToolListChangedNotification;
906
+ }
907
+ tmp_0 = tmp_2;
908
+ }
909
+
910
+ if (tmp_0) {
911
+ this.mah_1.xaf_1.m98(SessionNotificationJob$handleSendNotificationEvent$lambda_0(this.oah_1));
912
+ this.w8_1 = 4;
913
+ suspendResult = this.oah_1.h9n(this.rah_1, VOID, this);
914
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
915
+ return suspendResult;
916
+ }
917
+ continue $sm;
918
+ } else {
919
+ var tmp_5 = this.rah_1;
920
+ if (tmp_5 instanceof ResourceUpdatedNotification) {
921
+ var tmp0_safe_receiver = this.mah_1.waf_1.kotlinx$atomicfu$value.c2(this.rah_1.u9w_1.n9y_1);
922
+ if (tmp0_safe_receiver == null) {
923
+ this.sah_1 = null;
924
+ this.w8_1 = 3;
925
+ continue $sm;
926
+ } else {
927
+ if (compare(this.nah_1.iai_1, tmp0_safe_receiver) >= 0) {
928
+ this.mah_1.xaf_1.m98(SessionNotificationJob$handleSendNotificationEvent$lambda_1(this.rah_1, this.oah_1));
929
+ this.w8_1 = 1;
930
+ suspendResult = this.oah_1.h9n(this.rah_1, VOID, this);
931
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
932
+ return suspendResult;
933
+ }
934
+ continue $sm;
935
+ } else {
936
+ this.mah_1.xaf_1.m98(SessionNotificationJob$handleSendNotificationEvent$lambda_2(this.rah_1, tmp0_safe_receiver));
937
+ this.w8_1 = 2;
938
+ continue $sm;
939
+ }
940
+ }
941
+ } else {
942
+ var tmp_6 = this;
943
+ this.mah_1.xaf_1.n98(SessionNotificationJob$handleSendNotificationEvent$lambda_4(this.rah_1));
944
+ tmp_6.qah_1 = Unit_instance;
945
+ this.w8_1 = 5;
946
+ continue $sm;
947
+ }
948
+ }
949
+
950
+ case 1:
951
+ this.w8_1 = 2;
952
+ continue $sm;
953
+ case 2:
954
+ var tmp_7 = this;
955
+ tmp_7.sah_1 = Unit_instance;
956
+ this.w8_1 = 3;
957
+ continue $sm;
958
+ case 3:
959
+ var tmp1_elvis_lhs = this.sah_1;
960
+ var tmp_8 = this;
961
+ var tmp_9;
962
+ if (tmp1_elvis_lhs == null) {
963
+ tmp_9 = SessionNotificationJob$handleSendNotificationEvent$lambda_3(this.mah_1, this.rah_1);
964
+ } else {
965
+ tmp_9 = tmp1_elvis_lhs;
966
+ }
967
+
968
+ tmp_8.qah_1 = tmp_9;
969
+ this.w8_1 = 5;
970
+ continue $sm;
971
+ case 4:
972
+ var tmp_10 = this;
973
+ tmp_10.qah_1 = Unit_instance;
974
+ this.w8_1 = 5;
975
+ continue $sm;
976
+ case 5:
977
+ return Unit_instance;
978
+ case 6:
979
+ throw this.z8_1;
980
+ }
981
+ } catch ($p) {
982
+ var e = $p;
983
+ if (this.x8_1 === 6) {
984
+ throw e;
985
+ } else {
986
+ this.w8_1 = this.x8_1;
987
+ this.z8_1 = e;
988
+ }
989
+ }
990
+ while (true);
991
+ };
992
+ protoOf(SessionNotificationJob).cag = function (resourceKey, timestamp) {
993
+ var tmp0 = this.waf_1;
994
+ $l$block: {
995
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
996
+ while (true) {
997
+ var cur = tmp0.kotlinx$atomicfu$value;
998
+ var upd = cur.f2(resourceKey, timestamp);
999
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1000
+ break $l$block;
1001
+ }
1002
+ }
1003
+ }
1004
+ };
1005
+ protoOf(SessionNotificationJob).eag = function (resourceKey) {
1006
+ var tmp0 = this.waf_1;
1007
+ $l$block: {
1008
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
1009
+ while (true) {
1010
+ var cur = tmp0.kotlinx$atomicfu$value;
1011
+ var upd = cur.g2(resourceKey);
1012
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1013
+ break $l$block;
1014
+ }
1015
+ }
1016
+ }
1017
+ };
1018
+ protoOf(SessionNotificationJob).cx = function ($completion) {
1019
+ return this.vaf_1.cx($completion);
1020
+ };
1021
+ protoOf(SessionNotificationJob).aag = function () {
1022
+ this.vaf_1.gx();
1023
+ };
1024
+ function SessionNotificationJob() {
1025
+ this.waf_1 = atomic$ref$1(persistentMapOf());
1026
+ var tmp = this;
1027
+ var tmp_0 = KotlinLogging_instance;
1028
+ tmp.xaf_1 = tmp_0.r98(SessionNotificationJob$logger$lambda);
1029
+ }
1030
+ function SendEvent(timestamp, notification) {
1031
+ NotificationEvent.call(this, timestamp);
1032
+ this.iai_1 = timestamp;
1033
+ this.jai_1 = notification;
1034
+ }
1035
+ function EndEvent(timestamp) {
1036
+ NotificationEvent.call(this, timestamp);
1037
+ this.lai_1 = timestamp;
1038
+ }
1039
+ function notifyFeatureUpdated($this, oldFeature, newFeature) {
1040
+ var tmp1_elvis_lhs = oldFeature == null ? null : oldFeature.x();
1041
+ var tmp;
1042
+ if (tmp1_elvis_lhs == null) {
1043
+ tmp = newFeature == null ? null : newFeature.x();
1044
+ } else {
1045
+ tmp = tmp1_elvis_lhs;
1046
+ }
1047
+ var tmp3_elvis_lhs = tmp;
1048
+ var tmp_0;
1049
+ if (tmp3_elvis_lhs == null) {
1050
+ // Inline function 'kotlin.run' call
1051
+ $this.nai_1.o98(FeatureRegistry$notifyFeatureUpdated$lambda);
1052
+ return Unit_instance;
1053
+ } else {
1054
+ tmp_0 = tmp3_elvis_lhs;
1055
+ }
1056
+ var featureKey = tmp_0;
1057
+ $this.nai_1.m98(FeatureRegistry$notifyFeatureUpdated$lambda_0);
1058
+ // Inline function 'kotlin.collections.forEach' call
1059
+ var _iterator__ex2g4s = $this.pai_1.kotlinx$atomicfu$value.l();
1060
+ while (_iterator__ex2g4s.m()) {
1061
+ var element = _iterator__ex2g4s.n();
1062
+ element.wad(featureKey);
1063
+ }
1064
+ }
1065
+ function FeatureRegistry$add$lambda(this$0, $feature) {
1066
+ return function () {
1067
+ return 'Adding ' + this$0.mai_1 + ': "' + $feature.x() + '"';
1068
+ };
1069
+ }
1070
+ function FeatureRegistry$add$lambda_0(this$0, $feature) {
1071
+ return function () {
1072
+ return 'Added ' + this$0.mai_1 + ': "' + $feature.x() + '"';
1073
+ };
1074
+ }
1075
+ function FeatureRegistry$get$lambda(this$0, $key) {
1076
+ return function () {
1077
+ return 'Getting ' + this$0.mai_1 + ': "' + $key + '"';
1078
+ };
1079
+ }
1080
+ function FeatureRegistry$get$lambda_0(this$0, $key) {
1081
+ return function () {
1082
+ return 'Got ' + this$0.mai_1 + ': "' + $key + '"';
1083
+ };
1084
+ }
1085
+ function FeatureRegistry$get$lambda_1(this$0, $key) {
1086
+ return function () {
1087
+ return this$0.mai_1 + ' not found: "' + $key + '"';
1088
+ };
1089
+ }
1090
+ function FeatureRegistry$notifyFeatureUpdated$lambda() {
1091
+ return 'Notification should have feature key, but none found';
1092
+ }
1093
+ function FeatureRegistry$notifyFeatureUpdated$lambda_0() {
1094
+ return 'Notifying listeners on feature update';
1095
+ }
1096
+ function FeatureRegistry(featureType) {
1097
+ this.mai_1 = featureType;
1098
+ this.nai_1 = KotlinLogging_instance.t98('FeatureRegistry[' + this.mai_1 + ']');
1099
+ this.oai_1 = atomic$ref$1(persistentMapOf());
1100
+ this.pai_1 = atomic$ref$1(persistentListOf());
1101
+ }
1102
+ protoOf(FeatureRegistry).qai = function () {
1103
+ return this.oai_1.kotlinx$atomicfu$value;
1104
+ };
1105
+ protoOf(FeatureRegistry).rai = function (listener) {
1106
+ var tmp0 = this.pai_1;
1107
+ $l$block: {
1108
+ // Inline function 'kotlinx.atomicfu.update' call
1109
+ while (true) {
1110
+ var cur = tmp0.kotlinx$atomicfu$value;
1111
+ var upd = cur.j(listener);
1112
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1113
+ break $l$block;
1114
+ }
1115
+ }
1116
+ }
1117
+ };
1118
+ protoOf(FeatureRegistry).sai = function (feature) {
1119
+ this.nai_1.m98(FeatureRegistry$add$lambda(this, feature));
1120
+ var tmp0 = this.oai_1;
1121
+ var tmp$ret$1;
1122
+ $l$block: {
1123
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
1124
+ while (true) {
1125
+ var cur = tmp0.kotlinx$atomicfu$value;
1126
+ var upd = cur.f2(feature.x(), feature);
1127
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1128
+ tmp$ret$1 = cur;
1129
+ break $l$block;
1130
+ }
1131
+ }
1132
+ }
1133
+ var oldMap = tmp$ret$1;
1134
+ var oldFeature = oldMap.c2(feature.x());
1135
+ this.nai_1.m98(FeatureRegistry$add$lambda_0(this, feature));
1136
+ notifyFeatureUpdated(this, oldFeature, feature);
1137
+ };
1138
+ protoOf(FeatureRegistry).tai = function (key) {
1139
+ this.nai_1.m98(FeatureRegistry$get$lambda(this, key));
1140
+ var feature = this.oai_1.kotlinx$atomicfu$value.c2(key);
1141
+ if (!(feature == null)) {
1142
+ this.nai_1.m98(FeatureRegistry$get$lambda_0(this, key));
1143
+ } else {
1144
+ this.nai_1.m98(FeatureRegistry$get$lambda_1(this, key));
1145
+ }
1146
+ return feature;
1147
+ };
1148
+ function get_logger() {
1149
+ _init_properties_Server_kt__wof2g3();
1150
+ return logger;
1151
+ }
1152
+ var logger;
1153
+ function handleSubscribeResources($this, session, request) {
1154
+ var tmp0_safe_receiver = $this.zai_1.wai_1.b9p_1;
1155
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s9o_1;
1156
+ if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
1157
+ var tmp = get_logger();
1158
+ tmp.l98(Server$handleSubscribeResources$lambda);
1159
+ $this.daj_1.bag(session, request.za1_1.pa2_1);
1160
+ } else {
1161
+ var tmp_0 = get_logger();
1162
+ tmp_0.l98(Server$handleSubscribeResources$lambda_0);
1163
+ }
1164
+ }
1165
+ function handleUnsubscribeResources($this, session, request) {
1166
+ var tmp0_safe_receiver = $this.zai_1.wai_1.b9p_1;
1167
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s9o_1;
1168
+ if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
1169
+ var tmp = get_logger();
1170
+ tmp.l98(Server$handleUnsubscribeResources$lambda);
1171
+ $this.daj_1.dag(session, request.da2_1.ta2_1);
1172
+ } else {
1173
+ var tmp_0 = get_logger();
1174
+ tmp_0.l98(Server$handleUnsubscribeResources$lambda_0);
1175
+ }
1176
+ }
1177
+ function handleListTools($this) {
1178
+ // Inline function 'kotlin.collections.map' call
1179
+ var this_0 = $this.jaj().e2();
1180
+ // Inline function 'kotlin.collections.mapTo' call
1181
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
1182
+ var _iterator__ex2g4s = this_0.l();
1183
+ while (_iterator__ex2g4s.m()) {
1184
+ var item = _iterator__ex2g4s.n();
1185
+ var tmp$ret$0 = item.had_1;
1186
+ destination.j(tmp$ret$0);
1187
+ }
1188
+ var toolList = destination;
1189
+ return new ListToolsResult(toolList, null);
1190
+ }
1191
+ function handleCallTool($this, session, request, $completion) {
1192
+ var tmp = new $handleCallToolCOROUTINE$($this, session, request, $completion);
1193
+ tmp.y8_1 = Unit_instance;
1194
+ tmp.z8_1 = null;
1195
+ return tmp.e9();
1196
+ }
1197
+ function handleListPrompts($this) {
1198
+ var tmp = get_logger();
1199
+ tmp.l98(Server$handleListPrompts$lambda);
1200
+ // Inline function 'kotlin.collections.map' call
1201
+ var this_0 = $this.xaj().e2();
1202
+ // Inline function 'kotlin.collections.mapTo' call
1203
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
1204
+ var _iterator__ex2g4s = this_0.l();
1205
+ while (_iterator__ex2g4s.m()) {
1206
+ var item = _iterator__ex2g4s.n();
1207
+ var tmp$ret$0 = item.yaj_1;
1208
+ destination.j(tmp$ret$0);
1209
+ }
1210
+ return new ListPromptsResult(destination);
1211
+ }
1212
+ function handleGetPrompt($this, session, request, $completion) {
1213
+ var tmp = new $handleGetPromptCOROUTINE$($this, session, request, $completion);
1214
+ tmp.y8_1 = Unit_instance;
1215
+ tmp.z8_1 = null;
1216
+ return tmp.e9();
1217
+ }
1218
+ function handleListResources($this) {
1219
+ var tmp = get_logger();
1220
+ tmp.l98(Server$handleListResources$lambda);
1221
+ // Inline function 'kotlin.collections.map' call
1222
+ var this_0 = $this.mak().e2();
1223
+ // Inline function 'kotlin.collections.mapTo' call
1224
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
1225
+ var _iterator__ex2g4s = this_0.l();
1226
+ while (_iterator__ex2g4s.m()) {
1227
+ var item = _iterator__ex2g4s.n();
1228
+ var tmp$ret$0 = item.nak_1;
1229
+ destination.j(tmp$ret$0);
1230
+ }
1231
+ return new ListResourcesResult(destination);
1232
+ }
1233
+ function handleReadResource($this, session, request, $completion) {
1234
+ var tmp = new $handleReadResourceCOROUTINE$($this, session, request, $completion);
1235
+ tmp.y8_1 = Unit_instance;
1236
+ tmp.z8_1 = null;
1237
+ return tmp.e9();
1238
+ }
1239
+ function handleListResourceTemplates($this) {
1240
+ var tmp = get_logger();
1241
+ tmp.l98(Server$handleListResourceTemplates$lambda);
1242
+ // Inline function 'kotlin.collections.map' call
1243
+ var this_0 = $this.iaj_1.qai().e2();
1244
+ // Inline function 'kotlin.collections.mapTo' call
1245
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
1246
+ var _iterator__ex2g4s = this_0.l();
1247
+ while (_iterator__ex2g4s.m()) {
1248
+ var item = _iterator__ex2g4s.n();
1249
+ var tmp$ret$0 = item.dal_1;
1250
+ destination.j(tmp$ret$0);
1251
+ }
1252
+ return new ListResourceTemplatesResult(destination);
1253
+ }
1254
+ function sam$kotlin_Comparator$0(function_0) {
1255
+ this.hal_1 = function_0;
1256
+ }
1257
+ protoOf(sam$kotlin_Comparator$0).ne = function (a, b) {
1258
+ return this.hal_1(a, b);
1259
+ };
1260
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
1261
+ return this.ne(a, b);
1262
+ };
1263
+ protoOf(sam$kotlin_Comparator$0).x2 = function () {
1264
+ return this.hal_1;
1265
+ };
1266
+ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
1267
+ var tmp;
1268
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1269
+ var tmp_0;
1270
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1271
+ tmp_0 = equals(this.x2(), other.x2());
1272
+ } else {
1273
+ tmp_0 = false;
1274
+ }
1275
+ tmp = tmp_0;
1276
+ } else {
1277
+ tmp = false;
1278
+ }
1279
+ return tmp;
1280
+ };
1281
+ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
1282
+ return hashCode(this.x2());
1283
+ };
1284
+ function Server$_init_$lambda_y5rr20(_this__u8e3s4) {
1285
+ return Unit_instance;
1286
+ }
1287
+ function Server$_onConnect$lambda() {
1288
+ return Unit_instance;
1289
+ }
1290
+ function Server$_onClose$lambda() {
1291
+ return Unit_instance;
1292
+ }
1293
+ function Server$close$lambda() {
1294
+ return 'Closing MCP server';
1295
+ }
1296
+ function Server$close$lambda_0($sessionId) {
1297
+ return function () {
1298
+ return 'Closing session ' + $sessionId;
1299
+ };
1300
+ }
1301
+ function Server$createSession$slambda(this$0, resultContinuation) {
1302
+ this.qal_1 = this$0;
1303
+ CoroutineImpl.call(this, resultContinuation);
1304
+ }
1305
+ protoOf(Server$createSession$slambda).tal = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1306
+ var tmp = this.ual(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1307
+ tmp.y8_1 = Unit_instance;
1308
+ tmp.z8_1 = null;
1309
+ return tmp.e9();
1310
+ };
1311
+ protoOf(Server$createSession$slambda).r9 = function (p1, p2, $completion) {
1312
+ var tmp = p1 instanceof ListToolsRequest ? p1 : THROW_CCE();
1313
+ return this.tal(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1314
+ };
1315
+ protoOf(Server$createSession$slambda).e9 = function () {
1316
+ var suspendResult = this.y8_1;
1317
+ $sm: do
1318
+ try {
1319
+ var tmp = this.w8_1;
1320
+ if (tmp === 0) {
1321
+ this.x8_1 = 1;
1322
+ return handleListTools(this.qal_1);
1323
+ } else if (tmp === 1) {
1324
+ throw this.z8_1;
1325
+ }
1326
+ } catch ($p) {
1327
+ var e = $p;
1328
+ throw e;
1329
+ }
1330
+ while (true);
1331
+ };
1332
+ protoOf(Server$createSession$slambda).ual = function (_unused_var__etf5q3, _unused_var__etf5q3_0, completion) {
1333
+ var i = new Server$createSession$slambda(this.qal_1, completion);
1334
+ i.ral_1 = _unused_var__etf5q3;
1335
+ i.sal_1 = _unused_var__etf5q3_0;
1336
+ return i;
1337
+ };
1338
+ function Server$createSession$slambda_0(this$0, resultContinuation) {
1339
+ var i = new Server$createSession$slambda(this$0, resultContinuation);
1340
+ var l = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1341
+ return i.tal(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1342
+ };
1343
+ l.$arity = 2;
1344
+ return l;
1345
+ }
1346
+ function Server$createSession$slambda_1(this$0, $session, resultContinuation) {
1347
+ this.dam_1 = this$0;
1348
+ this.eam_1 = $session;
1349
+ CoroutineImpl.call(this, resultContinuation);
1350
+ }
1351
+ protoOf(Server$createSession$slambda_1).ham = function (request, _unused_var__etf5q3, $completion) {
1352
+ var tmp = this.iam(request, _unused_var__etf5q3, $completion);
1353
+ tmp.y8_1 = Unit_instance;
1354
+ tmp.z8_1 = null;
1355
+ return tmp.e9();
1356
+ };
1357
+ protoOf(Server$createSession$slambda_1).r9 = function (p1, p2, $completion) {
1358
+ var tmp = p1 instanceof CallToolRequest ? p1 : THROW_CCE();
1359
+ return this.ham(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1360
+ };
1361
+ protoOf(Server$createSession$slambda_1).e9 = function () {
1362
+ var suspendResult = this.y8_1;
1363
+ $sm: do
1364
+ try {
1365
+ var tmp = this.w8_1;
1366
+ switch (tmp) {
1367
+ case 0:
1368
+ this.x8_1 = 2;
1369
+ this.w8_1 = 1;
1370
+ suspendResult = handleCallTool(this.dam_1, this.eam_1, this.fam_1, this);
1371
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1372
+ return suspendResult;
1373
+ }
1374
+
1375
+ continue $sm;
1376
+ case 1:
1377
+ return suspendResult;
1378
+ case 2:
1379
+ throw this.z8_1;
1380
+ }
1381
+ } catch ($p) {
1382
+ var e = $p;
1383
+ if (this.x8_1 === 2) {
1384
+ throw e;
1385
+ } else {
1386
+ this.w8_1 = this.x8_1;
1387
+ this.z8_1 = e;
1388
+ }
1389
+ }
1390
+ while (true);
1391
+ };
1392
+ protoOf(Server$createSession$slambda_1).iam = function (request, _unused_var__etf5q3, completion) {
1393
+ var i = new Server$createSession$slambda_1(this.dam_1, this.eam_1, completion);
1394
+ i.fam_1 = request;
1395
+ i.gam_1 = _unused_var__etf5q3;
1396
+ return i;
1397
+ };
1398
+ function Server$createSession$slambda_2(this$0, $session, resultContinuation) {
1399
+ var i = new Server$createSession$slambda_1(this$0, $session, resultContinuation);
1400
+ var l = function (request, _unused_var__etf5q3, $completion) {
1401
+ return i.ham(request, _unused_var__etf5q3, $completion);
1402
+ };
1403
+ l.$arity = 2;
1404
+ return l;
1405
+ }
1406
+ function Server$createSession$slambda_3(this$0, resultContinuation) {
1407
+ this.ram_1 = this$0;
1408
+ CoroutineImpl.call(this, resultContinuation);
1409
+ }
1410
+ protoOf(Server$createSession$slambda_3).uam = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1411
+ var tmp = this.vam(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1412
+ tmp.y8_1 = Unit_instance;
1413
+ tmp.z8_1 = null;
1414
+ return tmp.e9();
1415
+ };
1416
+ protoOf(Server$createSession$slambda_3).r9 = function (p1, p2, $completion) {
1417
+ var tmp = p1 instanceof ListPromptsRequest ? p1 : THROW_CCE();
1418
+ return this.uam(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1419
+ };
1420
+ protoOf(Server$createSession$slambda_3).e9 = function () {
1421
+ var suspendResult = this.y8_1;
1422
+ $sm: do
1423
+ try {
1424
+ var tmp = this.w8_1;
1425
+ if (tmp === 0) {
1426
+ this.x8_1 = 1;
1427
+ return handleListPrompts(this.ram_1);
1428
+ } else if (tmp === 1) {
1429
+ throw this.z8_1;
1430
+ }
1431
+ } catch ($p) {
1432
+ var e = $p;
1433
+ throw e;
1434
+ }
1435
+ while (true);
1436
+ };
1437
+ protoOf(Server$createSession$slambda_3).vam = function (_unused_var__etf5q3, _unused_var__etf5q3_0, completion) {
1438
+ var i = new Server$createSession$slambda_3(this.ram_1, completion);
1439
+ i.sam_1 = _unused_var__etf5q3;
1440
+ i.tam_1 = _unused_var__etf5q3_0;
1441
+ return i;
1442
+ };
1443
+ function Server$createSession$slambda_4(this$0, resultContinuation) {
1444
+ var i = new Server$createSession$slambda_3(this$0, resultContinuation);
1445
+ var l = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1446
+ return i.uam(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1447
+ };
1448
+ l.$arity = 2;
1449
+ return l;
1450
+ }
1451
+ function Server$createSession$slambda_5(this$0, $session, resultContinuation) {
1452
+ this.ean_1 = this$0;
1453
+ this.fan_1 = $session;
1454
+ CoroutineImpl.call(this, resultContinuation);
1455
+ }
1456
+ protoOf(Server$createSession$slambda_5).ian = function (request, _unused_var__etf5q3, $completion) {
1457
+ var tmp = this.jan(request, _unused_var__etf5q3, $completion);
1458
+ tmp.y8_1 = Unit_instance;
1459
+ tmp.z8_1 = null;
1460
+ return tmp.e9();
1461
+ };
1462
+ protoOf(Server$createSession$slambda_5).r9 = function (p1, p2, $completion) {
1463
+ var tmp = p1 instanceof GetPromptRequest ? p1 : THROW_CCE();
1464
+ return this.ian(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1465
+ };
1466
+ protoOf(Server$createSession$slambda_5).e9 = function () {
1467
+ var suspendResult = this.y8_1;
1468
+ $sm: do
1469
+ try {
1470
+ var tmp = this.w8_1;
1471
+ switch (tmp) {
1472
+ case 0:
1473
+ this.x8_1 = 2;
1474
+ this.w8_1 = 1;
1475
+ suspendResult = handleGetPrompt(this.ean_1, this.fan_1, this.gan_1, this);
1476
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1477
+ return suspendResult;
1478
+ }
1479
+
1480
+ continue $sm;
1481
+ case 1:
1482
+ return suspendResult;
1483
+ case 2:
1484
+ throw this.z8_1;
1485
+ }
1486
+ } catch ($p) {
1487
+ var e = $p;
1488
+ if (this.x8_1 === 2) {
1489
+ throw e;
1490
+ } else {
1491
+ this.w8_1 = this.x8_1;
1492
+ this.z8_1 = e;
1493
+ }
1494
+ }
1495
+ while (true);
1496
+ };
1497
+ protoOf(Server$createSession$slambda_5).jan = function (request, _unused_var__etf5q3, completion) {
1498
+ var i = new Server$createSession$slambda_5(this.ean_1, this.fan_1, completion);
1499
+ i.gan_1 = request;
1500
+ i.han_1 = _unused_var__etf5q3;
1501
+ return i;
1502
+ };
1503
+ function Server$createSession$slambda_6(this$0, $session, resultContinuation) {
1504
+ var i = new Server$createSession$slambda_5(this$0, $session, resultContinuation);
1505
+ var l = function (request, _unused_var__etf5q3, $completion) {
1506
+ return i.ian(request, _unused_var__etf5q3, $completion);
1507
+ };
1508
+ l.$arity = 2;
1509
+ return l;
1510
+ }
1511
+ function Server$createSession$slambda_7(this$0, resultContinuation) {
1512
+ this.san_1 = this$0;
1513
+ CoroutineImpl.call(this, resultContinuation);
1514
+ }
1515
+ protoOf(Server$createSession$slambda_7).van = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1516
+ var tmp = this.wan(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1517
+ tmp.y8_1 = Unit_instance;
1518
+ tmp.z8_1 = null;
1519
+ return tmp.e9();
1520
+ };
1521
+ protoOf(Server$createSession$slambda_7).r9 = function (p1, p2, $completion) {
1522
+ var tmp = p1 instanceof ListResourcesRequest ? p1 : THROW_CCE();
1523
+ return this.van(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1524
+ };
1525
+ protoOf(Server$createSession$slambda_7).e9 = function () {
1526
+ var suspendResult = this.y8_1;
1527
+ $sm: do
1528
+ try {
1529
+ var tmp = this.w8_1;
1530
+ if (tmp === 0) {
1531
+ this.x8_1 = 1;
1532
+ return handleListResources(this.san_1);
1533
+ } else if (tmp === 1) {
1534
+ throw this.z8_1;
1535
+ }
1536
+ } catch ($p) {
1537
+ var e = $p;
1538
+ throw e;
1539
+ }
1540
+ while (true);
1541
+ };
1542
+ protoOf(Server$createSession$slambda_7).wan = function (_unused_var__etf5q3, _unused_var__etf5q3_0, completion) {
1543
+ var i = new Server$createSession$slambda_7(this.san_1, completion);
1544
+ i.tan_1 = _unused_var__etf5q3;
1545
+ i.uan_1 = _unused_var__etf5q3_0;
1546
+ return i;
1547
+ };
1548
+ function Server$createSession$slambda_8(this$0, resultContinuation) {
1549
+ var i = new Server$createSession$slambda_7(this$0, resultContinuation);
1550
+ var l = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1551
+ return i.van(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1552
+ };
1553
+ l.$arity = 2;
1554
+ return l;
1555
+ }
1556
+ function Server$createSession$slambda_9(this$0, $session, resultContinuation) {
1557
+ this.fao_1 = this$0;
1558
+ this.gao_1 = $session;
1559
+ CoroutineImpl.call(this, resultContinuation);
1560
+ }
1561
+ protoOf(Server$createSession$slambda_9).jao = function (request, _unused_var__etf5q3, $completion) {
1562
+ var tmp = this.kao(request, _unused_var__etf5q3, $completion);
1563
+ tmp.y8_1 = Unit_instance;
1564
+ tmp.z8_1 = null;
1565
+ return tmp.e9();
1566
+ };
1567
+ protoOf(Server$createSession$slambda_9).r9 = function (p1, p2, $completion) {
1568
+ var tmp = p1 instanceof ReadResourceRequest ? p1 : THROW_CCE();
1569
+ return this.jao(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1570
+ };
1571
+ protoOf(Server$createSession$slambda_9).e9 = function () {
1572
+ var suspendResult = this.y8_1;
1573
+ $sm: do
1574
+ try {
1575
+ var tmp = this.w8_1;
1576
+ switch (tmp) {
1577
+ case 0:
1578
+ this.x8_1 = 2;
1579
+ this.w8_1 = 1;
1580
+ suspendResult = handleReadResource(this.fao_1, this.gao_1, this.hao_1, this);
1581
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1582
+ return suspendResult;
1583
+ }
1584
+
1585
+ continue $sm;
1586
+ case 1:
1587
+ return suspendResult;
1588
+ case 2:
1589
+ throw this.z8_1;
1590
+ }
1591
+ } catch ($p) {
1592
+ var e = $p;
1593
+ if (this.x8_1 === 2) {
1594
+ throw e;
1595
+ } else {
1596
+ this.w8_1 = this.x8_1;
1597
+ this.z8_1 = e;
1598
+ }
1599
+ }
1600
+ while (true);
1601
+ };
1602
+ protoOf(Server$createSession$slambda_9).kao = function (request, _unused_var__etf5q3, completion) {
1603
+ var i = new Server$createSession$slambda_9(this.fao_1, this.gao_1, completion);
1604
+ i.hao_1 = request;
1605
+ i.iao_1 = _unused_var__etf5q3;
1606
+ return i;
1607
+ };
1608
+ function Server$createSession$slambda_10(this$0, $session, resultContinuation) {
1609
+ var i = new Server$createSession$slambda_9(this$0, $session, resultContinuation);
1610
+ var l = function (request, _unused_var__etf5q3, $completion) {
1611
+ return i.jao(request, _unused_var__etf5q3, $completion);
1612
+ };
1613
+ l.$arity = 2;
1614
+ return l;
1615
+ }
1616
+ function Server$createSession$slambda_11(this$0, resultContinuation) {
1617
+ this.tao_1 = this$0;
1618
+ CoroutineImpl.call(this, resultContinuation);
1619
+ }
1620
+ protoOf(Server$createSession$slambda_11).wao = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1621
+ var tmp = this.xao(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1622
+ tmp.y8_1 = Unit_instance;
1623
+ tmp.z8_1 = null;
1624
+ return tmp.e9();
1625
+ };
1626
+ protoOf(Server$createSession$slambda_11).r9 = function (p1, p2, $completion) {
1627
+ var tmp = p1 instanceof ListResourceTemplatesRequest ? p1 : THROW_CCE();
1628
+ return this.wao(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1629
+ };
1630
+ protoOf(Server$createSession$slambda_11).e9 = function () {
1631
+ var suspendResult = this.y8_1;
1632
+ $sm: do
1633
+ try {
1634
+ var tmp = this.w8_1;
1635
+ if (tmp === 0) {
1636
+ this.x8_1 = 1;
1637
+ return handleListResourceTemplates(this.tao_1);
1638
+ } else if (tmp === 1) {
1639
+ throw this.z8_1;
1640
+ }
1641
+ } catch ($p) {
1642
+ var e = $p;
1643
+ throw e;
1644
+ }
1645
+ while (true);
1646
+ };
1647
+ protoOf(Server$createSession$slambda_11).xao = function (_unused_var__etf5q3, _unused_var__etf5q3_0, completion) {
1648
+ var i = new Server$createSession$slambda_11(this.tao_1, completion);
1649
+ i.uao_1 = _unused_var__etf5q3;
1650
+ i.vao_1 = _unused_var__etf5q3_0;
1651
+ return i;
1652
+ };
1653
+ function Server$createSession$slambda_12(this$0, resultContinuation) {
1654
+ var i = new Server$createSession$slambda_11(this$0, resultContinuation);
1655
+ var l = function (_unused_var__etf5q3, _unused_var__etf5q3_0, $completion) {
1656
+ return i.wao(_unused_var__etf5q3, _unused_var__etf5q3_0, $completion);
1657
+ };
1658
+ l.$arity = 2;
1659
+ return l;
1660
+ }
1661
+ function Server$createSession$slambda_13(this$0, $session, resultContinuation) {
1662
+ this.gap_1 = this$0;
1663
+ this.hap_1 = $session;
1664
+ CoroutineImpl.call(this, resultContinuation);
1665
+ }
1666
+ protoOf(Server$createSession$slambda_13).kap = function (request, _unused_var__etf5q3, $completion) {
1667
+ var tmp = this.lap(request, _unused_var__etf5q3, $completion);
1668
+ tmp.y8_1 = Unit_instance;
1669
+ tmp.z8_1 = null;
1670
+ return tmp.e9();
1671
+ };
1672
+ protoOf(Server$createSession$slambda_13).r9 = function (p1, p2, $completion) {
1673
+ var tmp = p1 instanceof SubscribeRequest ? p1 : THROW_CCE();
1674
+ return this.kap(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1675
+ };
1676
+ protoOf(Server$createSession$slambda_13).e9 = function () {
1677
+ var suspendResult = this.y8_1;
1678
+ $sm: do
1679
+ try {
1680
+ var tmp = this.w8_1;
1681
+ if (tmp === 0) {
1682
+ this.x8_1 = 1;
1683
+ handleSubscribeResources(this.gap_1, this.hap_1, this.iap_1);
1684
+ return null;
1685
+ } else if (tmp === 1) {
1686
+ throw this.z8_1;
1687
+ }
1688
+ } catch ($p) {
1689
+ var e = $p;
1690
+ throw e;
1691
+ }
1692
+ while (true);
1693
+ };
1694
+ protoOf(Server$createSession$slambda_13).lap = function (request, _unused_var__etf5q3, completion) {
1695
+ var i = new Server$createSession$slambda_13(this.gap_1, this.hap_1, completion);
1696
+ i.iap_1 = request;
1697
+ i.jap_1 = _unused_var__etf5q3;
1698
+ return i;
1699
+ };
1700
+ function Server$createSession$slambda_14(this$0, $session, resultContinuation) {
1701
+ var i = new Server$createSession$slambda_13(this$0, $session, resultContinuation);
1702
+ var l = function (request, _unused_var__etf5q3, $completion) {
1703
+ return i.kap(request, _unused_var__etf5q3, $completion);
1704
+ };
1705
+ l.$arity = 2;
1706
+ return l;
1707
+ }
1708
+ function Server$createSession$slambda_15(this$0, $session, resultContinuation) {
1709
+ this.uap_1 = this$0;
1710
+ this.vap_1 = $session;
1711
+ CoroutineImpl.call(this, resultContinuation);
1712
+ }
1713
+ protoOf(Server$createSession$slambda_15).yap = function (request, _unused_var__etf5q3, $completion) {
1714
+ var tmp = this.zap(request, _unused_var__etf5q3, $completion);
1715
+ tmp.y8_1 = Unit_instance;
1716
+ tmp.z8_1 = null;
1717
+ return tmp.e9();
1718
+ };
1719
+ protoOf(Server$createSession$slambda_15).r9 = function (p1, p2, $completion) {
1720
+ var tmp = p1 instanceof UnsubscribeRequest ? p1 : THROW_CCE();
1721
+ return this.yap(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
1722
+ };
1723
+ protoOf(Server$createSession$slambda_15).e9 = function () {
1724
+ var suspendResult = this.y8_1;
1725
+ $sm: do
1726
+ try {
1727
+ var tmp = this.w8_1;
1728
+ if (tmp === 0) {
1729
+ this.x8_1 = 1;
1730
+ handleUnsubscribeResources(this.uap_1, this.vap_1, this.wap_1);
1731
+ return null;
1732
+ } else if (tmp === 1) {
1733
+ throw this.z8_1;
1734
+ }
1735
+ } catch ($p) {
1736
+ var e = $p;
1737
+ throw e;
1738
+ }
1739
+ while (true);
1740
+ };
1741
+ protoOf(Server$createSession$slambda_15).zap = function (request, _unused_var__etf5q3, completion) {
1742
+ var i = new Server$createSession$slambda_15(this.uap_1, this.vap_1, completion);
1743
+ i.wap_1 = request;
1744
+ i.xap_1 = _unused_var__etf5q3;
1745
+ return i;
1746
+ };
1747
+ function Server$createSession$slambda_16(this$0, $session, resultContinuation) {
1748
+ var i = new Server$createSession$slambda_15(this$0, $session, resultContinuation);
1749
+ var l = function (request, _unused_var__etf5q3, $completion) {
1750
+ return i.yap(request, _unused_var__etf5q3, $completion);
1751
+ };
1752
+ l.$arity = 2;
1753
+ return l;
1754
+ }
1755
+ function Server$createSession$lambda$lambda() {
1756
+ return 'Removing closed session from active sessions list';
1757
+ }
1758
+ function Server$createSession$lambda(this$0, $session) {
1759
+ return function () {
1760
+ var tmp = get_logger();
1761
+ tmp.l98(Server$createSession$lambda$lambda);
1762
+ this$0.daj_1.zaf($session);
1763
+ this$0.eaj_1.caq($session.hae_1);
1764
+ return Unit_instance;
1765
+ };
1766
+ }
1767
+ function Server$createSession$lambda_0() {
1768
+ return 'Server session connecting to transport';
1769
+ }
1770
+ function Server$createSession$lambda_1() {
1771
+ return 'Server session successfully connected to transport';
1772
+ }
1773
+ function Server$addTool$lambda($tool) {
1774
+ return function () {
1775
+ return "Failed to add tool '" + $tool.tab_1 + "': Server does not support tools capability";
1776
+ };
1777
+ }
1778
+ function Server$handleSubscribeResources$lambda() {
1779
+ return 'Subscribing to resources';
1780
+ }
1781
+ function Server$handleSubscribeResources$lambda_0() {
1782
+ return 'Failed to subscribe to resources: Server does not support resources capability';
1783
+ }
1784
+ function Server$handleUnsubscribeResources$lambda() {
1785
+ return 'Unsubscribing from resources';
1786
+ }
1787
+ function Server$handleUnsubscribeResources$lambda_0() {
1788
+ return 'Failed to unsubscribe from resources: Server does not support resources capability';
1789
+ }
1790
+ function Server$handleCallTool$lambda($requestParams) {
1791
+ return function () {
1792
+ return 'Handling tool call request for tool: ' + $requestParams.waa_1;
1793
+ };
1794
+ }
1795
+ function Server$handleCallTool$lambda_0($requestParams) {
1796
+ return function () {
1797
+ return 'Tool not found: ' + $requestParams.waa_1;
1798
+ };
1799
+ }
1800
+ function Server$handleCallTool$lambda_1($requestParams) {
1801
+ return function () {
1802
+ return 'Executing tool ' + $requestParams.waa_1 + ' with input: ' + toString_0($requestParams.xaa_1);
1803
+ };
1804
+ }
1805
+ function Server$handleCallTool$lambda_2($requestParams) {
1806
+ return function () {
1807
+ return 'Error executing tool ' + $requestParams.waa_1;
1808
+ };
1809
+ }
1810
+ function Server$handleListPrompts$lambda() {
1811
+ return 'Handling list prompts request';
1812
+ }
1813
+ function Server$handleGetPrompt$lambda($requestParams) {
1814
+ return function () {
1815
+ return 'Handling get prompt request for: ' + $requestParams.j9z_1;
1816
+ };
1817
+ }
1818
+ function Server$handleGetPrompt$lambda_0($requestParams) {
1819
+ return function () {
1820
+ return 'Prompt not found: ' + $requestParams.j9z_1;
1821
+ };
1822
+ }
1823
+ function Server$handleListResources$lambda() {
1824
+ return 'Handling list resources request';
1825
+ }
1826
+ function Server$handleReadResource$lambda($uri) {
1827
+ return function () {
1828
+ return 'Handling read resource request for: ' + $uri;
1829
+ };
1830
+ }
1831
+ function Server$handleReadResource$lambda_0(a, b) {
1832
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1833
+ var result = a.bh();
1834
+ var tmp = result.fad_1;
1835
+ var result_0 = b.bh();
1836
+ var tmp$ret$1 = result_0.fad_1;
1837
+ return compareValues(tmp, tmp$ret$1);
1838
+ }
1839
+ function Server$handleReadResource$lambda_1($this) {
1840
+ return function (a, b) {
1841
+ var previousCompare = $this.compare(a, b);
1842
+ var tmp;
1843
+ if (!(previousCompare === 0)) {
1844
+ tmp = previousCompare;
1845
+ } else {
1846
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1847
+ var result = b.bh();
1848
+ var tmp_0 = result.ead_1.o();
1849
+ var result_0 = a.bh();
1850
+ var tmp$ret$1 = result_0.ead_1.o();
1851
+ tmp = compareValues(tmp_0, tmp$ret$1);
1852
+ }
1853
+ return tmp;
1854
+ };
1855
+ }
1856
+ function Server$handleReadResource$lambda_2($uri) {
1857
+ return function () {
1858
+ return 'Resource not found: ' + $uri;
1859
+ };
1860
+ }
1861
+ function Server$handleReadResource$lambda_3($template, $uri) {
1862
+ return function () {
1863
+ return "Matched resource template '" + $template.gal_1 + "' for URI: " + $uri;
1864
+ };
1865
+ }
1866
+ function Server$handleListResourceTemplates$lambda() {
1867
+ return 'Handling list resource templates request';
1868
+ }
1869
+ function $closeCOROUTINE$_0(_this__u8e3s4, resultContinuation) {
1870
+ CoroutineImpl.call(this, resultContinuation);
1871
+ this.laq_1 = _this__u8e3s4;
1872
+ }
1873
+ protoOf($closeCOROUTINE$_0).e9 = function () {
1874
+ var suspendResult = this.y8_1;
1875
+ $sm: do
1876
+ try {
1877
+ var tmp = this.w8_1;
1878
+ switch (tmp) {
1879
+ case 0:
1880
+ this.x8_1 = 5;
1881
+ var tmp_0 = get_logger();
1882
+ tmp_0.l98(Server$close$lambda);
1883
+ this.w8_1 = 1;
1884
+ suspendResult = this.laq_1.daj_1.h9i(this);
1885
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1886
+ return suspendResult;
1887
+ }
1888
+
1889
+ continue $sm;
1890
+ case 1:
1891
+ var tmp_1 = this;
1892
+ tmp_1.maq_1 = this.laq_1.naq().w().l();
1893
+ this.w8_1 = 2;
1894
+ continue $sm;
1895
+ case 2:
1896
+ if (!this.maq_1.m()) {
1897
+ this.w8_1 = 4;
1898
+ continue $sm;
1899
+ }
1900
+
1901
+ var element = this.maq_1.n();
1902
+ var sessionId = element.x();
1903
+ var session = element.y();
1904
+ var tmp_2 = get_logger();
1905
+ tmp_2.m98(Server$close$lambda_0(sessionId));
1906
+ this.w8_1 = 3;
1907
+ suspendResult = session.h9i(this);
1908
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1909
+ return suspendResult;
1910
+ }
1911
+
1912
+ continue $sm;
1913
+ case 3:
1914
+ this.w8_1 = 2;
1915
+ continue $sm;
1916
+ case 4:
1917
+ this.laq_1.caj_1();
1918
+ return Unit_instance;
1919
+ case 5:
1920
+ throw this.z8_1;
1921
+ }
1922
+ } catch ($p) {
1923
+ var e = $p;
1924
+ if (this.x8_1 === 5) {
1925
+ throw e;
1926
+ } else {
1927
+ this.w8_1 = this.x8_1;
1928
+ this.z8_1 = e;
1929
+ }
1930
+ }
1931
+ while (true);
1932
+ };
1933
+ function $createSessionCOROUTINE$(_this__u8e3s4, transport, resultContinuation) {
1934
+ CoroutineImpl.call(this, resultContinuation);
1935
+ this.waq_1 = _this__u8e3s4;
1936
+ this.xaq_1 = transport;
1937
+ }
1938
+ protoOf($createSessionCOROUTINE$).e9 = function () {
1939
+ var suspendResult = this.y8_1;
1940
+ $sm: do
1941
+ try {
1942
+ var tmp = this.w8_1;
1943
+ switch (tmp) {
1944
+ case 0:
1945
+ this.x8_1 = 2;
1946
+ var tmp_0 = this;
1947
+ var tmp0_safe_receiver = this.waq_1.aaj_1;
1948
+ tmp_0.yaq_1 = new ServerSession(this.waq_1.yai_1, this.waq_1.zai_1, tmp0_safe_receiver == null ? null : tmp0_safe_receiver());
1949
+ if (!(this.waq_1.zai_1.wai_1.a9p_1 == null)) {
1950
+ var tmp0 = this.yaq_1;
1951
+ var tmp2 = Defined_ToolsList_getInstance();
1952
+ var block = Server$createSession$slambda_0(this.waq_1, null);
1953
+ tmp0.c9n(tmp2, block);
1954
+ var tmp0_0 = this.yaq_1;
1955
+ var tmp2_0 = Defined_ToolsCall_getInstance();
1956
+ var block_0 = Server$createSession$slambda_2(this.waq_1, this.yaq_1, null);
1957
+ tmp0_0.c9n(tmp2_0, block_0);
1958
+ }
1959
+
1960
+ if (!(this.waq_1.zai_1.wai_1.c9p_1 == null)) {
1961
+ var tmp0_1 = this.yaq_1;
1962
+ var tmp2_1 = Defined_PromptsList_getInstance();
1963
+ var block_1 = Server$createSession$slambda_4(this.waq_1, null);
1964
+ tmp0_1.c9n(tmp2_1, block_1);
1965
+ var tmp0_2 = this.yaq_1;
1966
+ var tmp2_2 = Defined_PromptsGet_getInstance();
1967
+ var block_2 = Server$createSession$slambda_6(this.waq_1, this.yaq_1, null);
1968
+ tmp0_2.c9n(tmp2_2, block_2);
1969
+ }
1970
+
1971
+ if (!(this.waq_1.zai_1.wai_1.b9p_1 == null)) {
1972
+ var tmp0_3 = this.yaq_1;
1973
+ var tmp2_3 = Defined_ResourcesList_getInstance();
1974
+ var block_3 = Server$createSession$slambda_8(this.waq_1, null);
1975
+ tmp0_3.c9n(tmp2_3, block_3);
1976
+ var tmp0_4 = this.yaq_1;
1977
+ var tmp2_4 = Defined_ResourcesRead_getInstance();
1978
+ var block_4 = Server$createSession$slambda_10(this.waq_1, this.yaq_1, null);
1979
+ tmp0_4.c9n(tmp2_4, block_4);
1980
+ var tmp0_5 = this.yaq_1;
1981
+ var tmp2_5 = Defined_ResourcesTemplatesList_getInstance();
1982
+ var block_5 = Server$createSession$slambda_12(this.waq_1, null);
1983
+ tmp0_5.c9n(tmp2_5, block_5);
1984
+ var tmp1_safe_receiver = this.waq_1.zai_1.wai_1.b9p_1;
1985
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.s9o_1;
1986
+ if (tmp2_elvis_lhs == null ? false : tmp2_elvis_lhs) {
1987
+ var tmp0_6 = this.yaq_1;
1988
+ var tmp2_6 = Defined_ResourcesSubscribe_getInstance();
1989
+ var block_6 = Server$createSession$slambda_14(this.waq_1, this.yaq_1, null);
1990
+ tmp0_6.c9n(tmp2_6, block_6);
1991
+ var tmp0_7 = this.yaq_1;
1992
+ var tmp2_7 = Defined_ResourcesUnsubscribe_getInstance();
1993
+ var block_7 = Server$createSession$slambda_16(this.waq_1, this.yaq_1, null);
1994
+ tmp0_7.c9n(tmp2_7, block_7);
1995
+ }
1996
+ }
1997
+
1998
+ this.yaq_1.a9i(Server$createSession$lambda(this.waq_1, this.yaq_1));
1999
+ var tmp_1 = get_logger();
2000
+ tmp_1.l98(Server$createSession$lambda_0);
2001
+ this.w8_1 = 1;
2002
+ suspendResult = this.yaq_1.d9n(this.xaq_1, this);
2003
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2004
+ return suspendResult;
2005
+ }
2006
+
2007
+ continue $sm;
2008
+ case 1:
2009
+ var tmp_2 = get_logger();
2010
+ tmp_2.l98(Server$createSession$lambda_1);
2011
+ this.waq_1.eaj_1.zaq(this.yaq_1);
2012
+ this.waq_1.daj_1.yaf(this.yaq_1);
2013
+ this.waq_1.baj_1();
2014
+ return this.yaq_1;
2015
+ case 2:
2016
+ throw this.z8_1;
2017
+ }
2018
+ } catch ($p) {
2019
+ var e = $p;
2020
+ if (this.x8_1 === 2) {
2021
+ throw e;
2022
+ } else {
2023
+ this.w8_1 = this.x8_1;
2024
+ this.z8_1 = e;
2025
+ }
2026
+ }
2027
+ while (true);
2028
+ };
2029
+ function $handleCallToolCOROUTINE$(_this__u8e3s4, session, request, resultContinuation) {
2030
+ CoroutineImpl.call(this, resultContinuation);
2031
+ this.saj_1 = _this__u8e3s4;
2032
+ this.taj_1 = session;
2033
+ this.uaj_1 = request;
2034
+ }
2035
+ protoOf($handleCallToolCOROUTINE$).e9 = function () {
2036
+ var suspendResult = this.y8_1;
2037
+ $sm: do
2038
+ try {
2039
+ var tmp = this.w8_1;
2040
+ switch (tmp) {
2041
+ case 0:
2042
+ this.x8_1 = 4;
2043
+ this.waj_1 = this.uaj_1.uaa_1;
2044
+ var tmp_0 = get_logger();
2045
+ tmp_0.l98(Server$handleCallTool$lambda(this.waj_1));
2046
+ var tmp0_elvis_lhs = this.saj_1.faj_1.tai(this.waj_1.waa_1);
2047
+ var tmp_1;
2048
+ if (tmp0_elvis_lhs == null) {
2049
+ this.saj_1;
2050
+ var tmp_2 = get_logger();
2051
+ tmp_2.o98(Server$handleCallTool$lambda_0(this.waj_1));
2052
+ return new CallToolResult(listOf(new TextContent('Tool ' + this.waj_1.waa_1 + ' not found')), true);
2053
+ } else {
2054
+ tmp_1 = tmp0_elvis_lhs;
2055
+ }
2056
+
2057
+ var tool = tmp_1;
2058
+ this.x8_1 = 2;
2059
+ var tmp_3 = get_logger();
2060
+ tmp_3.j98(Server$handleCallTool$lambda_1(this.waj_1));
2061
+ this.w8_1 = 1;
2062
+ suspendResult = tool.iad_1(this.taj_1.oae_1, this.uaj_1, this);
2063
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2064
+ return suspendResult;
2065
+ }
2066
+
2067
+ continue $sm;
2068
+ case 1:
2069
+ this.vaj_1 = suspendResult;
2070
+ this.x8_1 = 4;
2071
+ this.w8_1 = 3;
2072
+ continue $sm;
2073
+ case 2:
2074
+ this.x8_1 = 4;
2075
+ var tmp_4 = this.z8_1;
2076
+ if (tmp_4 instanceof CancellationException) {
2077
+ var e = this.z8_1;
2078
+ var tmp_5 = this;
2079
+ throw e;
2080
+ } else {
2081
+ var tmp_6 = this.z8_1;
2082
+ if (tmp_6 instanceof Exception) {
2083
+ var e_0 = this.z8_1;
2084
+ var tmp_7 = this;
2085
+ var tmp_8 = get_logger();
2086
+ tmp_8.p98(e_0, Server$handleCallTool$lambda_2(this.waj_1));
2087
+ tmp_7.vaj_1 = new CallToolResult(listOf(new TextContent('Error executing tool ' + this.waj_1.waa_1 + ': ' + e_0.message)), true);
2088
+ this.w8_1 = 3;
2089
+ continue $sm;
2090
+ } else {
2091
+ throw this.z8_1;
2092
+ }
2093
+ }
2094
+
2095
+ case 3:
2096
+ this.x8_1 = 4;
2097
+ return this.vaj_1;
2098
+ case 4:
2099
+ throw this.z8_1;
2100
+ }
2101
+ } catch ($p) {
2102
+ var e_1 = $p;
2103
+ if (this.x8_1 === 4) {
2104
+ throw e_1;
2105
+ } else {
2106
+ this.w8_1 = this.x8_1;
2107
+ this.z8_1 = e_1;
2108
+ }
2109
+ }
2110
+ while (true);
2111
+ };
2112
+ function $handleGetPromptCOROUTINE$(_this__u8e3s4, session, request, resultContinuation) {
2113
+ CoroutineImpl.call(this, resultContinuation);
2114
+ this.jak_1 = _this__u8e3s4;
2115
+ this.kak_1 = session;
2116
+ this.lak_1 = request;
2117
+ }
2118
+ protoOf($handleGetPromptCOROUTINE$).e9 = function () {
2119
+ var suspendResult = this.y8_1;
2120
+ $sm: do
2121
+ try {
2122
+ var tmp = this.w8_1;
2123
+ switch (tmp) {
2124
+ case 0:
2125
+ this.x8_1 = 2;
2126
+ var requestParams = this.lak_1.a9z_1;
2127
+ var tmp_0 = get_logger();
2128
+ tmp_0.l98(Server$handleGetPrompt$lambda(requestParams));
2129
+ var tmp0_elvis_lhs = this.jak_1.gaj_1.tai(requestParams.j9z_1);
2130
+ var tmp_1;
2131
+ if (tmp0_elvis_lhs == null) {
2132
+ this.jak_1;
2133
+ var tmp_2 = get_logger();
2134
+ tmp_2.o98(Server$handleGetPrompt$lambda_0(requestParams));
2135
+ throw IllegalArgumentException_init_$Create$('Prompt not found: ' + requestParams.j9z_1);
2136
+ } else {
2137
+ tmp_1 = tmp0_elvis_lhs;
2138
+ }
2139
+
2140
+ var prompt = tmp_1;
2141
+ this.w8_1 = 1;
2142
+ suspendResult = prompt.zaj_1(this.kak_1.oae_1, this.lak_1, this);
2143
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2144
+ return suspendResult;
2145
+ }
2146
+
2147
+ continue $sm;
2148
+ case 1:
2149
+ return suspendResult;
2150
+ case 2:
2151
+ throw this.z8_1;
2152
+ }
2153
+ } catch ($p) {
2154
+ var e = $p;
2155
+ if (this.x8_1 === 2) {
2156
+ throw e;
2157
+ } else {
2158
+ this.w8_1 = this.x8_1;
2159
+ this.z8_1 = e;
2160
+ }
2161
+ }
2162
+ while (true);
2163
+ };
2164
+ function $handleReadResourceCOROUTINE$(_this__u8e3s4, session, request, resultContinuation) {
2165
+ CoroutineImpl.call(this, resultContinuation);
2166
+ this.yak_1 = _this__u8e3s4;
2167
+ this.zak_1 = session;
2168
+ this.aal_1 = request;
2169
+ }
2170
+ protoOf($handleReadResourceCOROUTINE$).e9 = function () {
2171
+ var suspendResult = this.y8_1;
2172
+ $sm: do
2173
+ try {
2174
+ var tmp = this.w8_1;
2175
+ switch (tmp) {
2176
+ case 0:
2177
+ this.x8_1 = 4;
2178
+ this.bal_1 = this.aal_1.va1_1.la2_1;
2179
+ var tmp_0 = get_logger();
2180
+ tmp_0.l98(Server$handleReadResource$lambda(this.bal_1));
2181
+ var tmp0_safe_receiver = this.yak_1.haj_1.tai(this.bal_1);
2182
+ if (tmp0_safe_receiver == null) {
2183
+ this.cal_1 = null;
2184
+ this.w8_1 = 2;
2185
+ continue $sm;
2186
+ } else {
2187
+ this.w8_1 = 1;
2188
+ suspendResult = tmp0_safe_receiver.oak_1(this.zak_1.oae_1, this.aal_1, this);
2189
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2190
+ return suspendResult;
2191
+ }
2192
+ continue $sm;
2193
+ }
2194
+
2195
+ case 1:
2196
+ var tmp_1 = this;
2197
+ return suspendResult;
2198
+ case 2:
2199
+ var tmp0 = this.yak_1.iaj_1.qai().e2();
2200
+ var destination = ArrayList_init_$Create$_0();
2201
+ var _iterator__ex2g4s = tmp0.l();
2202
+ while (_iterator__ex2g4s.m()) {
2203
+ var element = _iterator__ex2g4s.n();
2204
+ var tmp0_safe_receiver_0 = element.eal_1.dad(this.bal_1);
2205
+ var tmp_2;
2206
+ if (tmp0_safe_receiver_0 == null) {
2207
+ tmp_2 = null;
2208
+ } else {
2209
+ tmp_2 = to(element, tmp0_safe_receiver_0);
2210
+ }
2211
+ var tmp0_safe_receiver_1 = tmp_2;
2212
+ if (tmp0_safe_receiver_1 == null)
2213
+ null;
2214
+ else {
2215
+ destination.j(tmp0_safe_receiver_1);
2216
+ }
2217
+ }
2218
+
2219
+ var tmp_3 = Server$handleReadResource$lambda_0;
2220
+ var this_0 = new sam$kotlin_Comparator$0(tmp_3);
2221
+ var tmp_4 = Server$handleReadResource$lambda_1(this_0);
2222
+ var tmp1_elvis_lhs = maxWithOrNull(destination, new sam$kotlin_Comparator$0(tmp_4));
2223
+ var tmp_5;
2224
+ if (tmp1_elvis_lhs == null) {
2225
+ this.yak_1;
2226
+ var tmp_6 = get_logger();
2227
+ tmp_6.o98(Server$handleReadResource$lambda_2(this.bal_1));
2228
+ var builder = new JsonObjectBuilder();
2229
+ put(builder, 'uri', this.bal_1);
2230
+ throw new McpException(-32002, 'Resource not found', builder.z36());
2231
+ } else {
2232
+ tmp_5 = tmp1_elvis_lhs;
2233
+ }
2234
+
2235
+ var _destruct__k2r9zo = tmp_5;
2236
+ var template = _destruct__k2r9zo.ah();
2237
+ var matchResult = _destruct__k2r9zo.bh();
2238
+ var tmp_7 = get_logger();
2239
+ tmp_7.l98(Server$handleReadResource$lambda_3(template, this.bal_1));
2240
+ this.w8_1 = 3;
2241
+ suspendResult = template.fal_1(this.zak_1.oae_1, this.aal_1, matchResult.ead_1, this);
2242
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2243
+ return suspendResult;
2244
+ }
2245
+
2246
+ continue $sm;
2247
+ case 3:
2248
+ return suspendResult;
2249
+ case 4:
2250
+ throw this.z8_1;
2251
+ }
2252
+ } catch ($p) {
2253
+ var e = $p;
2254
+ if (this.x8_1 === 4) {
2255
+ throw e;
2256
+ } else {
2257
+ this.w8_1 = this.x8_1;
2258
+ this.z8_1 = e;
2259
+ }
2260
+ }
2261
+ while (true);
2262
+ };
2263
+ function Server(serverInfo, options, instructionsProvider, block) {
2264
+ instructionsProvider = instructionsProvider === VOID ? null : instructionsProvider;
2265
+ var tmp;
2266
+ if (block === VOID) {
2267
+ tmp = Server$_init_$lambda_y5rr20;
2268
+ } else {
2269
+ tmp = block;
2270
+ }
2271
+ block = tmp;
2272
+ this.yai_1 = serverInfo;
2273
+ this.zai_1 = options;
2274
+ this.aaj_1 = instructionsProvider;
2275
+ var tmp_0 = this;
2276
+ tmp_0.baj_1 = Server$_onConnect$lambda;
2277
+ var tmp_1 = this;
2278
+ tmp_1.caj_1 = Server$_onClose$lambda;
2279
+ this.daj_1 = new FeatureNotificationService();
2280
+ this.eaj_1 = new ServerSessionRegistry();
2281
+ var tmp_2 = this;
2282
+ // Inline function 'kotlin.apply' call
2283
+ var this_0 = new FeatureRegistry('Tool');
2284
+ var tmp0_safe_receiver = this.zai_1.wai_1.a9p_1;
2285
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.o9o_1;
2286
+ if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
2287
+ this_0.rai(this.daj_1.qad_1);
2288
+ }
2289
+ tmp_2.faj_1 = this_0;
2290
+ var tmp_3 = this;
2291
+ // Inline function 'kotlin.apply' call
2292
+ var this_1 = new FeatureRegistry('Prompt');
2293
+ var tmp0_safe_receiver_0 = this.zai_1.wai_1.c9p_1;
2294
+ var tmp1_elvis_lhs_0 = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.v9o_1;
2295
+ if (tmp1_elvis_lhs_0 == null ? false : tmp1_elvis_lhs_0) {
2296
+ this_1.rai(this.daj_1.rad_1);
2297
+ }
2298
+ tmp_3.gaj_1 = this_1;
2299
+ var tmp_4 = this;
2300
+ // Inline function 'kotlin.apply' call
2301
+ var this_2 = new FeatureRegistry('Resource');
2302
+ var tmp0_safe_receiver_1 = this.zai_1.wai_1.b9p_1;
2303
+ var tmp1_elvis_lhs_1 = tmp0_safe_receiver_1 == null ? null : tmp0_safe_receiver_1.r9o_1;
2304
+ if (tmp1_elvis_lhs_1 == null ? false : tmp1_elvis_lhs_1) {
2305
+ this_2.rai(this.daj_1.sad_1);
2306
+ }
2307
+ var tmp2_safe_receiver = this.zai_1.wai_1.b9p_1;
2308
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.s9o_1;
2309
+ if (tmp3_elvis_lhs == null ? false : tmp3_elvis_lhs) {
2310
+ this_2.rai(this.daj_1.tad_1);
2311
+ }
2312
+ tmp_4.haj_1 = this_2;
2313
+ var tmp_5 = this;
2314
+ // Inline function 'kotlin.apply' call
2315
+ var this_3 = new FeatureRegistry('ResourceTemplate');
2316
+ var tmp0_safe_receiver_2 = this.zai_1.wai_1.b9p_1;
2317
+ if ((tmp0_safe_receiver_2 == null ? null : tmp0_safe_receiver_2.r9o_1) === true) {
2318
+ this_3.rai(this.daj_1.sad_1);
2319
+ }
2320
+ tmp_5.iaj_1 = this_3;
2321
+ block(this);
2322
+ }
2323
+ protoOf(Server).naq = function () {
2324
+ return this.eaj_1.aar();
2325
+ };
2326
+ protoOf(Server).jaj = function () {
2327
+ return this.faj_1.qai();
2328
+ };
2329
+ protoOf(Server).xaj = function () {
2330
+ return this.gaj_1.qai();
2331
+ };
2332
+ protoOf(Server).mak = function () {
2333
+ return this.haj_1.qai();
2334
+ };
2335
+ protoOf(Server).h9i = function ($completion) {
2336
+ var tmp = new $closeCOROUTINE$_0(this, $completion);
2337
+ tmp.y8_1 = Unit_instance;
2338
+ tmp.z8_1 = null;
2339
+ return tmp.e9();
2340
+ };
2341
+ protoOf(Server).bar = function (transport, $completion) {
2342
+ var tmp = new $createSessionCOROUTINE$(this, transport, $completion);
2343
+ tmp.y8_1 = Unit_instance;
2344
+ tmp.z8_1 = null;
2345
+ return tmp.e9();
2346
+ };
2347
+ protoOf(Server).car = function (tool, handler) {
2348
+ var tmp0 = this.zai_1.wai_1.a9p_1;
2349
+ $l$block: {
2350
+ // Inline function 'kotlin.checkNotNull' call
2351
+ if (tmp0 == null) {
2352
+ var tmp = get_logger();
2353
+ tmp.o98(Server$addTool$lambda(tool));
2354
+ var message = 'Server does not support tools capability. Enable it in ServerOptions.';
2355
+ throw IllegalStateException_init_$Create$(toString(message));
2356
+ } else {
2357
+ break $l$block;
2358
+ }
2359
+ }
2360
+ this.faj_1.sai(new RegisteredTool(tool, handler));
2361
+ };
2362
+ protoOf(Server).dar = function (name, description, inputSchema, title, outputSchema, toolAnnotations, execution, meta, handler) {
2363
+ var tool = new Tool(name, inputSchema, description, outputSchema, title, toolAnnotations, VOID, execution, meta);
2364
+ this.car(tool, handler);
2365
+ };
2366
+ protoOf(Server).ear = function (name, description, inputSchema, title, outputSchema, toolAnnotations, execution, meta, handler, $super) {
2367
+ inputSchema = inputSchema === VOID ? new ToolSchema() : inputSchema;
2368
+ title = title === VOID ? null : title;
2369
+ outputSchema = outputSchema === VOID ? null : outputSchema;
2370
+ toolAnnotations = toolAnnotations === VOID ? null : toolAnnotations;
2371
+ execution = execution === VOID ? null : execution;
2372
+ meta = meta === VOID ? null : meta;
2373
+ var tmp;
2374
+ if ($super === VOID) {
2375
+ this.dar(name, description, inputSchema, title, outputSchema, toolAnnotations, execution, meta, handler);
2376
+ tmp = Unit_instance;
2377
+ } else {
2378
+ tmp = $super.dar.call(this, name, description, inputSchema, title, outputSchema, toolAnnotations, execution, meta, handler);
2379
+ }
2380
+ return tmp;
2381
+ };
2382
+ function ServerOptions_init_$Init$(capabilities, enforceStrictCapabilities, $this) {
2383
+ enforceStrictCapabilities = enforceStrictCapabilities === VOID ? true : enforceStrictCapabilities;
2384
+ ServerOptions.call($this, capabilities, enforceStrictCapabilities, Companion_getInstance().wac_1);
2385
+ return $this;
2386
+ }
2387
+ function ServerOptions_init_$Create$(capabilities, enforceStrictCapabilities) {
2388
+ return ServerOptions_init_$Init$(capabilities, enforceStrictCapabilities, objectCreate(protoOf(ServerOptions)));
2389
+ }
2390
+ function ServerOptions(capabilities, enforceStrictCapabilities, resourceTemplateMatcherFactory) {
2391
+ enforceStrictCapabilities = enforceStrictCapabilities === VOID ? true : enforceStrictCapabilities;
2392
+ resourceTemplateMatcherFactory = resourceTemplateMatcherFactory === VOID ? Companion_getInstance().wac_1 : resourceTemplateMatcherFactory;
2393
+ ProtocolOptions.call(this, enforceStrictCapabilities);
2394
+ this.wai_1 = capabilities;
2395
+ this.xai_1 = resourceTemplateMatcherFactory;
2396
+ }
2397
+ function logger$lambda() {
2398
+ _init_properties_Server_kt__wof2g3();
2399
+ return Unit_instance;
2400
+ }
2401
+ var properties_initialized_Server_kt_wvt4d7;
2402
+ function _init_properties_Server_kt__wof2g3() {
2403
+ if (!properties_initialized_Server_kt_wvt4d7) {
2404
+ properties_initialized_Server_kt_wvt4d7 = true;
2405
+ var tmp = KotlinLogging_instance;
2406
+ logger = tmp.r98(logger$lambda);
2407
+ }
2408
+ }
2409
+ function get_logger_0() {
2410
+ _init_properties_ServerSession_kt__9ioezl();
2411
+ return logger_0;
2412
+ }
2413
+ var logger_0;
2414
+ function ServerSession$slambda$lambda($request) {
2415
+ return function () {
2416
+ return 'Logging level set to: ' + $request.h9v_1.n9v_1.toString();
2417
+ };
2418
+ }
2419
+ function handleInitialize($this, request) {
2420
+ var tmp = get_logger_0();
2421
+ tmp.l98(ServerSession$handleInitialize$lambda);
2422
+ $this.kae_1 = request.v9t_1.a9u_1;
2423
+ $this.lae_1 = request.v9t_1.b9u_1;
2424
+ var requestedVersion = request.v9t_1.z9t_1;
2425
+ var tmp_0;
2426
+ if (get_SUPPORTED_PROTOCOL_VERSIONS().t(requestedVersion)) {
2427
+ tmp_0 = requestedVersion;
2428
+ } else {
2429
+ var tmp_1 = get_logger_0();
2430
+ tmp_1.n98(ServerSession$handleInitialize$lambda_0(requestedVersion));
2431
+ tmp_0 = '2025-11-25';
2432
+ }
2433
+ var protocolVersion = tmp_0;
2434
+ return new InitializeResult(protocolVersion, $this.mae_1, $this.fae_1, $this.gae_1);
2435
+ }
2436
+ function ServerSession$_onInitialized$lambda() {
2437
+ return Unit_instance;
2438
+ }
2439
+ function ServerSession$_onClose$lambda() {
2440
+ return Unit_instance;
2441
+ }
2442
+ function ServerSession$slambda(this$0, resultContinuation) {
2443
+ this.nar_1 = this$0;
2444
+ CoroutineImpl.call(this, resultContinuation);
2445
+ }
2446
+ protoOf(ServerSession$slambda).qar = function (request, _unused_var__etf5q3, $completion) {
2447
+ var tmp = this.rar(request, _unused_var__etf5q3, $completion);
2448
+ tmp.y8_1 = Unit_instance;
2449
+ tmp.z8_1 = null;
2450
+ return tmp.e9();
2451
+ };
2452
+ protoOf(ServerSession$slambda).r9 = function (p1, p2, $completion) {
2453
+ var tmp = p1 instanceof InitializeRequest ? p1 : THROW_CCE();
2454
+ return this.qar(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
2455
+ };
2456
+ protoOf(ServerSession$slambda).e9 = function () {
2457
+ var suspendResult = this.y8_1;
2458
+ $sm: do
2459
+ try {
2460
+ var tmp = this.w8_1;
2461
+ if (tmp === 0) {
2462
+ this.x8_1 = 1;
2463
+ return handleInitialize(this.nar_1, this.oar_1);
2464
+ } else if (tmp === 1) {
2465
+ throw this.z8_1;
2466
+ }
2467
+ } catch ($p) {
2468
+ var e = $p;
2469
+ throw e;
2470
+ }
2471
+ while (true);
2472
+ };
2473
+ protoOf(ServerSession$slambda).rar = function (request, _unused_var__etf5q3, completion) {
2474
+ var i = new ServerSession$slambda(this.nar_1, completion);
2475
+ i.oar_1 = request;
2476
+ i.par_1 = _unused_var__etf5q3;
2477
+ return i;
2478
+ };
2479
+ function ServerSession$slambda_0(this$0, resultContinuation) {
2480
+ var i = new ServerSession$slambda(this$0, resultContinuation);
2481
+ var l = function (request, _unused_var__etf5q3, $completion) {
2482
+ return i.qar(request, _unused_var__etf5q3, $completion);
2483
+ };
2484
+ l.$arity = 2;
2485
+ return l;
2486
+ }
2487
+ function ServerSession$lambda(this$0) {
2488
+ return function (it) {
2489
+ this$0.iae_1();
2490
+ return CompletableDeferred(Unit_instance);
2491
+ };
2492
+ }
2493
+ function ServerSession$slambda_1(this$0, resultContinuation) {
2494
+ this.aas_1 = this$0;
2495
+ CoroutineImpl.call(this, resultContinuation);
2496
+ }
2497
+ protoOf(ServerSession$slambda_1).das = function (request, _unused_var__etf5q3, $completion) {
2498
+ var tmp = this.eas(request, _unused_var__etf5q3, $completion);
2499
+ tmp.y8_1 = Unit_instance;
2500
+ tmp.z8_1 = null;
2501
+ return tmp.e9();
2502
+ };
2503
+ protoOf(ServerSession$slambda_1).r9 = function (p1, p2, $completion) {
2504
+ var tmp = p1 instanceof SetLevelRequest ? p1 : THROW_CCE();
2505
+ return this.das(tmp, p2 instanceof RequestHandlerExtra ? p2 : THROW_CCE(), $completion);
2506
+ };
2507
+ protoOf(ServerSession$slambda_1).e9 = function () {
2508
+ var suspendResult = this.y8_1;
2509
+ $sm: do
2510
+ try {
2511
+ var tmp = this.w8_1;
2512
+ if (tmp === 0) {
2513
+ this.x8_1 = 1;
2514
+ this.aas_1.nae_1.kotlinx$atomicfu$value = this.bas_1.h9v_1.n9v_1;
2515
+ var tmp_0 = get_logger_0();
2516
+ tmp_0.l98(ServerSession$slambda$lambda(this.bas_1));
2517
+ return new EmptyResult();
2518
+ } else if (tmp === 1) {
2519
+ throw this.z8_1;
2520
+ }
2521
+ } catch ($p) {
2522
+ var e = $p;
2523
+ throw e;
2524
+ }
2525
+ while (true);
2526
+ };
2527
+ protoOf(ServerSession$slambda_1).eas = function (request, _unused_var__etf5q3, completion) {
2528
+ var i = new ServerSession$slambda_1(this.aas_1, completion);
2529
+ i.bas_1 = request;
2530
+ i.cas_1 = _unused_var__etf5q3;
2531
+ return i;
2532
+ };
2533
+ function ServerSession$slambda_2(this$0, resultContinuation) {
2534
+ var i = new ServerSession$slambda_1(this$0, resultContinuation);
2535
+ var l = function (request, _unused_var__etf5q3, $completion) {
2536
+ return i.das(request, _unused_var__etf5q3, $completion);
2537
+ };
2538
+ l.$arity = 2;
2539
+ return l;
2540
+ }
2541
+ function ServerSession$onClose$lambda($old, $block) {
2542
+ return function () {
2543
+ $old();
2544
+ $block();
2545
+ return Unit_instance;
2546
+ };
2547
+ }
2548
+ function ServerSession$onClose$lambda_0() {
2549
+ return 'Server connection closing';
2550
+ }
2551
+ function ServerSession$assertNotificationCapability$lambda($method) {
2552
+ return function () {
2553
+ return 'Asserting notification capability for method: ' + $method.y();
2554
+ };
2555
+ }
2556
+ function ServerSession$assertNotificationCapability$lambda_0() {
2557
+ return 'Server capability assertion failed: logging not supported';
2558
+ }
2559
+ function ServerSession$assertRequestHandlerCapability$lambda($method) {
2560
+ return function () {
2561
+ return 'Asserting request handler capability for method: ' + $method.y();
2562
+ };
2563
+ }
2564
+ function ServerSession$assertRequestHandlerCapability$lambda_0() {
2565
+ return 'Server capability assertion failed: sampling not supported';
2566
+ }
2567
+ function ServerSession$assertRequestHandlerCapability$lambda_1($method) {
2568
+ return function () {
2569
+ return 'Server does not support logging (required for ' + toString($method) + ')';
2570
+ };
2571
+ }
2572
+ function ServerSession$handleInitialize$lambda() {
2573
+ return 'Handling initialization request from client';
2574
+ }
2575
+ function ServerSession$handleInitialize$lambda_0($requestedVersion) {
2576
+ return function () {
2577
+ return 'Client requested unsupported protocol version ' + $requestedVersion + ', ' + 'falling back to 2025-11-25';
2578
+ };
2579
+ }
2580
+ function ServerSession(serverInfo, options, instructions) {
2581
+ Protocol.call(this, options);
2582
+ this.fae_1 = serverInfo;
2583
+ this.gae_1 = instructions;
2584
+ this.hae_1 = Companion_getInstance_0().up().toString();
2585
+ var tmp = this;
2586
+ tmp.iae_1 = ServerSession$_onInitialized$lambda;
2587
+ var tmp_0 = this;
2588
+ tmp_0.jae_1 = ServerSession$_onClose$lambda;
2589
+ this.kae_1 = null;
2590
+ this.lae_1 = null;
2591
+ this.mae_1 = options.wai_1;
2592
+ this.nae_1 = atomic$ref$1(null);
2593
+ var tmp2 = Defined_Initialize_getInstance();
2594
+ // Inline function 'io.modelcontextprotocol.kotlin.sdk.shared.Protocol.setRequestHandler' call
2595
+ var block = ServerSession$slambda_0(this, null);
2596
+ this.c9n(tmp2, block);
2597
+ var tmp_1 = Defined_NotificationsInitialized_getInstance();
2598
+ this.b9n(tmp_1, ServerSession$lambda(this));
2599
+ if (!(options.wai_1.d9p_1 == null)) {
2600
+ var tmp2_0 = Defined_LoggingSetLevel_getInstance();
2601
+ // Inline function 'io.modelcontextprotocol.kotlin.sdk.shared.Protocol.setRequestHandler' call
2602
+ var block_0 = ServerSession$slambda_2(this, null);
2603
+ this.c9n(tmp2_0, block_0);
2604
+ }
2605
+ this.oae_1 = new ClientConnectionImpl(this);
2606
+ }
2607
+ protoOf(ServerSession).a9i = function (block) {
2608
+ var old = this.jae_1;
2609
+ var tmp = this;
2610
+ tmp.jae_1 = ServerSession$onClose$lambda(old, block);
2611
+ };
2612
+ protoOf(ServerSession).s9i = function () {
2613
+ var tmp = get_logger_0();
2614
+ tmp.l98(ServerSession$onClose$lambda_0);
2615
+ this.jae_1();
2616
+ };
2617
+ protoOf(ServerSession).e9n = function (method) {
2618
+ var tmp = get_logger_0();
2619
+ tmp.j98(ServerSession$assertNotificationCapability$lambda(method));
2620
+ if (equals(method, Defined_NotificationsMessage_getInstance())) {
2621
+ if (this.mae_1.d9p_1 == null) {
2622
+ var tmp_0 = get_logger_0();
2623
+ tmp_0.o98(ServerSession$assertNotificationCapability$lambda_0);
2624
+ // Inline function 'kotlin.error' call
2625
+ var message = 'Server does not support logging (required for ' + method.y() + ')';
2626
+ throw IllegalStateException_init_$Create$(toString(message));
2627
+ }
2628
+ } else if (equals(method, Defined_NotificationsResourcesUpdated_getInstance()) || equals(method, Defined_NotificationsResourcesListChanged_getInstance())) {
2629
+ if (this.mae_1.b9p_1 == null) {
2630
+ // Inline function 'kotlin.error' call
2631
+ var message_0 = 'Server does not support notifying about resources (required for ' + method.y() + ')';
2632
+ throw IllegalStateException_init_$Create$(toString(message_0));
2633
+ }
2634
+ } else if (equals(method, Defined_NotificationsToolsListChanged_getInstance())) {
2635
+ if (this.mae_1.a9p_1 == null) {
2636
+ // Inline function 'kotlin.error' call
2637
+ var message_1 = 'Server does not support notifying of tool list changes (required for ' + method.y() + ')';
2638
+ throw IllegalStateException_init_$Create$(toString(message_1));
2639
+ }
2640
+ } else if (equals(method, Defined_NotificationsPromptsListChanged_getInstance())) {
2641
+ if (this.mae_1.c9p_1 == null) {
2642
+ // Inline function 'kotlin.error' call
2643
+ var message_2 = 'Server does not support notifying of prompt list changes (required for ' + method.y() + ')';
2644
+ throw IllegalStateException_init_$Create$(toString(message_2));
2645
+ }
2646
+ } else
2647
+ equals(method, Defined_NotificationsCancelled_getInstance()) || equals(method, Defined_NotificationsProgress_getInstance());
2648
+ };
2649
+ protoOf(ServerSession).f9n = function (method) {
2650
+ var tmp = get_logger_0();
2651
+ tmp.j98(ServerSession$assertRequestHandlerCapability$lambda(method));
2652
+ if (equals(method, Defined_SamplingCreateMessage_getInstance())) {
2653
+ var tmp1_safe_receiver = this.mae_1.f9p_1;
2654
+ if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver.xd('sampling')) == null) {
2655
+ var tmp_0 = get_logger_0();
2656
+ tmp_0.o98(ServerSession$assertRequestHandlerCapability$lambda_0);
2657
+ // Inline function 'kotlin.error' call
2658
+ var message = 'Server does not support sampling (required for ' + toString(method) + ')';
2659
+ throw IllegalStateException_init_$Create$(toString(message));
2660
+ }
2661
+ } else if (equals(method, Defined_LoggingSetLevel_getInstance())) {
2662
+ if (this.mae_1.d9p_1 == null) {
2663
+ var tmp_1 = get_logger_0();
2664
+ tmp_1.o98(ServerSession$assertRequestHandlerCapability$lambda_1(method));
2665
+ // Inline function 'kotlin.error' call
2666
+ var message_0 = 'Server does not support logging (required for ' + toString(method) + ')';
2667
+ throw IllegalStateException_init_$Create$(toString(message_0));
2668
+ }
2669
+ } else if (equals(method, Defined_PromptsGet_getInstance()) || equals(method, Defined_PromptsList_getInstance())) {
2670
+ if (this.mae_1.c9p_1 == null) {
2671
+ // Inline function 'kotlin.error' call
2672
+ var message_1 = 'Server does not support prompts (required for ' + toString(method) + ')';
2673
+ throw IllegalStateException_init_$Create$(toString(message_1));
2674
+ }
2675
+ } else if (equals(method, Defined_ResourcesList_getInstance()) || equals(method, Defined_ResourcesTemplatesList_getInstance()) || (equals(method, Defined_ResourcesRead_getInstance()) || (equals(method, Defined_ResourcesSubscribe_getInstance()) || equals(method, Defined_ResourcesUnsubscribe_getInstance())))) {
2676
+ if (this.mae_1.b9p_1 == null) {
2677
+ // Inline function 'kotlin.error' call
2678
+ var message_2 = 'Server does not support resources (required for ' + toString(method) + ')';
2679
+ throw IllegalStateException_init_$Create$(toString(message_2));
2680
+ }
2681
+ } else if (equals(method, Defined_ToolsCall_getInstance()) || equals(method, Defined_ToolsList_getInstance())) {
2682
+ if (this.mae_1.a9p_1 == null) {
2683
+ // Inline function 'kotlin.error' call
2684
+ var message_3 = 'Server does not support tools (required for ' + toString(method) + ')';
2685
+ throw IllegalStateException_init_$Create$(toString(message_3));
2686
+ }
2687
+ } else
2688
+ equals(method, Defined_Ping_getInstance()) || equals(method, Defined_Initialize_getInstance());
2689
+ };
2690
+ protoOf(ServerSession).equals = function (other) {
2691
+ if (this === other)
2692
+ return true;
2693
+ if (!(other instanceof ServerSession))
2694
+ return false;
2695
+ return this.hae_1 === other.hae_1;
2696
+ };
2697
+ protoOf(ServerSession).hashCode = function () {
2698
+ return getStringHashCode(this.hae_1);
2699
+ };
2700
+ function logger$lambda_0() {
2701
+ _init_properties_ServerSession_kt__9ioezl();
2702
+ return Unit_instance;
2703
+ }
2704
+ var properties_initialized_ServerSession_kt_dtek9p;
2705
+ function _init_properties_ServerSession_kt__9ioezl() {
2706
+ if (!properties_initialized_ServerSession_kt_dtek9p) {
2707
+ properties_initialized_ServerSession_kt_dtek9p = true;
2708
+ var tmp = KotlinLogging_instance;
2709
+ logger_0 = tmp.r98(logger$lambda_0);
2710
+ }
2711
+ }
2712
+ function ServerSessionRegistry$logger$lambda() {
2713
+ return Unit_instance;
2714
+ }
2715
+ function ServerSessionRegistry$addSession$lambda($session) {
2716
+ return function () {
2717
+ return 'Adding session: ' + $session.hae_1;
2718
+ };
2719
+ }
2720
+ function ServerSessionRegistry$removeSession$lambda($sessionId) {
2721
+ return function () {
2722
+ return 'Removing session: ' + $sessionId;
2723
+ };
2724
+ }
2725
+ function ServerSessionRegistry() {
2726
+ var tmp = this;
2727
+ var tmp_0 = KotlinLogging_instance;
2728
+ tmp.aaq_1 = tmp_0.r98(ServerSessionRegistry$logger$lambda);
2729
+ this.baq_1 = atomic$ref$1(persistentMapOf());
2730
+ }
2731
+ protoOf(ServerSessionRegistry).aar = function () {
2732
+ return this.baq_1.kotlinx$atomicfu$value;
2733
+ };
2734
+ protoOf(ServerSessionRegistry).zaq = function (session) {
2735
+ this.aaq_1.m98(ServerSessionRegistry$addSession$lambda(session));
2736
+ var tmp0 = this.baq_1;
2737
+ $l$block: {
2738
+ // Inline function 'kotlinx.atomicfu.update' call
2739
+ while (true) {
2740
+ var cur = tmp0.kotlinx$atomicfu$value;
2741
+ var upd = cur.f2(session.hae_1, session);
2742
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
2743
+ break $l$block;
2744
+ }
2745
+ }
2746
+ }
2747
+ };
2748
+ protoOf(ServerSessionRegistry).caq = function (sessionId) {
2749
+ this.aaq_1.m98(ServerSessionRegistry$removeSession$lambda(sessionId));
2750
+ var tmp0 = this.baq_1;
2751
+ $l$block: {
2752
+ // Inline function 'kotlinx.atomicfu.update' call
2753
+ while (true) {
2754
+ var cur = tmp0.kotlinx$atomicfu$value;
2755
+ var upd = cur.g2(sessionId);
2756
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
2757
+ break $l$block;
2758
+ }
2759
+ }
2760
+ }
2761
+ };
2762
+ //region block: exports
2763
+ _.$_$ = _.$_$ || {};
2764
+ _.$_$.a = ServerOptions_init_$Create$;
2765
+ _.$_$.b = ClientConnection;
2766
+ _.$_$.c = Server;
2767
+ //endregion
2768
+ return _;
2769
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'), require('./kotlin-sdk-kotlin-sdk-core.js'), require('./Kotlin-Immutable-Collections-kotlinx-collections-immutable.js'), require('./kotlinx-atomicfu.js'), require('./kotlin-logging.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js')));
2770
+
2771
+ //# sourceMappingURL=kotlin-sdk-kotlin-sdk-server.js.map