@casual-simulation/aux-runtime 3.2.7-alpha.6226622763

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 (70) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +82 -0
  3. package/index.d.ts +26 -0
  4. package/index.js +26 -0
  5. package/index.js.map +1 -0
  6. package/package.json +79 -0
  7. package/runtime/AuxCompiler.d.ts +258 -0
  8. package/runtime/AuxCompiler.js +722 -0
  9. package/runtime/AuxCompiler.js.map +1 -0
  10. package/runtime/AuxDevice.d.ts +28 -0
  11. package/runtime/AuxDevice.js +2 -0
  12. package/runtime/AuxDevice.js.map +1 -0
  13. package/runtime/AuxGlobalContext.d.ts +572 -0
  14. package/runtime/AuxGlobalContext.js +606 -0
  15. package/runtime/AuxGlobalContext.js.map +1 -0
  16. package/runtime/AuxLibrary.d.ts +2566 -0
  17. package/runtime/AuxLibrary.js +10210 -0
  18. package/runtime/AuxLibrary.js.map +1 -0
  19. package/runtime/AuxLibraryDefinitions.def +12288 -0
  20. package/runtime/AuxPartitionRealtimeEditModeProvider.d.ts +9 -0
  21. package/runtime/AuxPartitionRealtimeEditModeProvider.js +21 -0
  22. package/runtime/AuxPartitionRealtimeEditModeProvider.js.map +1 -0
  23. package/runtime/AuxRealtimeEditModeProvider.d.ts +35 -0
  24. package/runtime/AuxRealtimeEditModeProvider.js +34 -0
  25. package/runtime/AuxRealtimeEditModeProvider.js.map +1 -0
  26. package/runtime/AuxResults.d.ts +77 -0
  27. package/runtime/AuxResults.js +6 -0
  28. package/runtime/AuxResults.js.map +1 -0
  29. package/runtime/AuxRuntime.d.ts +252 -0
  30. package/runtime/AuxRuntime.js +2688 -0
  31. package/runtime/AuxRuntime.js.map +1 -0
  32. package/runtime/AuxRuntimeDynamicImports.d.ts +14 -0
  33. package/runtime/AuxRuntimeDynamicImports.js +24 -0
  34. package/runtime/AuxRuntimeDynamicImports.js.map +1 -0
  35. package/runtime/AuxVersion.d.ts +39 -0
  36. package/runtime/AuxVersion.js +2 -0
  37. package/runtime/AuxVersion.js.map +1 -0
  38. package/runtime/CasualOSError.d.ts +37 -0
  39. package/runtime/CasualOSError.js +25 -0
  40. package/runtime/CasualOSError.js.map +1 -0
  41. package/runtime/CompiledBot.d.ts +107 -0
  42. package/runtime/CompiledBot.js +44 -0
  43. package/runtime/CompiledBot.js.map +1 -0
  44. package/runtime/PerformanceNowPolyfill.d.ts +1 -0
  45. package/runtime/PerformanceNowPolyfill.js +8 -0
  46. package/runtime/PerformanceNowPolyfill.js.map +1 -0
  47. package/runtime/RecordsEvents.d.ts +1025 -0
  48. package/runtime/RecordsEvents.js +449 -0
  49. package/runtime/RecordsEvents.js.map +1 -0
  50. package/runtime/RuntimeBot.d.ts +177 -0
  51. package/runtime/RuntimeBot.js +732 -0
  52. package/runtime/RuntimeBot.js.map +1 -0
  53. package/runtime/RuntimeEvents.d.ts +126 -0
  54. package/runtime/RuntimeEvents.js +29 -0
  55. package/runtime/RuntimeEvents.js.map +1 -0
  56. package/runtime/RuntimeStateVersion.d.ts +23 -0
  57. package/runtime/RuntimeStateVersion.js +22 -0
  58. package/runtime/RuntimeStateVersion.js.map +1 -0
  59. package/runtime/Transpiler.d.ts +174 -0
  60. package/runtime/Transpiler.js +611 -0
  61. package/runtime/Transpiler.js.map +1 -0
  62. package/runtime/Utils.d.ts +44 -0
  63. package/runtime/Utils.js +253 -0
  64. package/runtime/Utils.js.map +1 -0
  65. package/runtime/index.d.ts +13 -0
  66. package/runtime/index.js +13 -0
  67. package/runtime/index.js.map +1 -0
  68. package/runtime/test/TestScriptBotFactory.d.ts +16 -0
  69. package/runtime/test/TestScriptBotFactory.js +107 -0
  70. package/runtime/test/TestScriptBotFactory.js.map +1 -0
@@ -0,0 +1,449 @@
1
+ import { APPROVED_SYMBOL, } from '@casual-simulation/aux-common';
2
+ /**
3
+ * Creates a new AIChatAction.
4
+ *
5
+ * @param messages The messages to include in the chat.
6
+ * @param options The options for the chat.
7
+ * @param taskId The ID of the async task.
8
+ */
9
+ export function aiChat(messages, options, taskId) {
10
+ return {
11
+ type: 'ai_chat',
12
+ messages,
13
+ options: options !== null && options !== void 0 ? options : {},
14
+ taskId,
15
+ };
16
+ }
17
+ /**
18
+ * Creates a new AIGenerateSkyboxAction.
19
+ * @param prompt The prompt that describes what the generated skybox should look like.
20
+ * @param negativePrompt The negative prompt that describes what the generated skybox should not look like.
21
+ * @param options The options for the skybox.
22
+ * @param taskId The ID of the async task.
23
+ */
24
+ export function aiGenerateSkybox(prompt, negativePrompt, options, taskId) {
25
+ return {
26
+ type: 'ai_generate_skybox',
27
+ prompt,
28
+ negativePrompt,
29
+ options: options !== null && options !== void 0 ? options : {},
30
+ taskId,
31
+ };
32
+ }
33
+ /**
34
+ * Creates a new AIGenerateImageAction.
35
+ * @param options The options.
36
+ * @param taskId The ID of the async task.
37
+ */
38
+ export function aiGenerateImage(parameters, options, taskId) {
39
+ return Object.assign(Object.assign({ type: 'ai_generate_image' }, parameters), { options: options !== null && options !== void 0 ? options : {}, taskId });
40
+ }
41
+ /**
42
+ * Creates a GetPublicRecordKeyAction.
43
+ * @param recordName The name of the record.
44
+ * @param policy The policy that the requested record key should have.
45
+ * @param taskId The ID of the task.
46
+ */
47
+ export function getPublicRecordKey(recordName, policy, taskId) {
48
+ return {
49
+ type: 'get_public_record_key',
50
+ recordName,
51
+ policy,
52
+ taskId,
53
+ };
54
+ }
55
+ /**
56
+ * Creates a GrantRecordMarkerPermissionAction.
57
+ * @param recordName The name of the record.
58
+ * @param marker The marker.
59
+ * @param permission The permission that should be granted.
60
+ * @param options The options for the action.
61
+ * @param taskId The ID of the task.
62
+ */
63
+ export function grantRecordMarkerPermission(recordName, marker, permission, options, taskId) {
64
+ return {
65
+ type: 'grant_record_marker_permission',
66
+ recordName,
67
+ marker,
68
+ permission,
69
+ options,
70
+ taskId,
71
+ };
72
+ }
73
+ /**
74
+ * Creates a RevokeRecordMarkerPermissionAction.
75
+ * @param recordName The name of the record.
76
+ * @param marker The marker.
77
+ * @param permission The permission that should be granted.
78
+ * @param options The options for the action.
79
+ * @param taskId The ID of the task.
80
+ */
81
+ export function revokeRecordMarkerPermission(recordName, marker, permission, options, taskId) {
82
+ return {
83
+ type: 'revoke_record_marker_permission',
84
+ recordName,
85
+ marker,
86
+ permission,
87
+ options,
88
+ taskId,
89
+ };
90
+ }
91
+ /**
92
+ * Creates a GrantRoleAction for a user.
93
+ * @param recordName The name of the record.
94
+ * @param role The role that should be granted.
95
+ * @param userId The ID of the user.
96
+ * @param expireTimeMs The Unix time (in miliseconds) that the role grant expires.
97
+ * @param options The options for the action.
98
+ * @param taskId The ID of the task.
99
+ */
100
+ export function grantUserRole(recordName, role, userId, expireTimeMs, options, taskId) {
101
+ return {
102
+ type: 'grant_role',
103
+ recordName,
104
+ role,
105
+ userId,
106
+ expireTimeMs,
107
+ options,
108
+ taskId,
109
+ };
110
+ }
111
+ /**
112
+ * Creates a GrantRoleAction for an inst.
113
+ * @param recordName The name of the record.
114
+ * @param role The role that should be granted.
115
+ * @param inst The ID of the inst.
116
+ * @param expireTimeMs The Unix time (in miliseconds) that the role grant expires.
117
+ * @param options The options for the action.
118
+ * @param taskId The ID of the task.
119
+ */
120
+ export function grantInstRole(recordName, role, inst, expireTimeMs, options, taskId) {
121
+ return {
122
+ type: 'grant_role',
123
+ recordName,
124
+ role,
125
+ inst,
126
+ expireTimeMs,
127
+ options,
128
+ taskId,
129
+ };
130
+ }
131
+ /**
132
+ * Creates a GrantRoleAction for a user.
133
+ * @param recordName The name of the record.
134
+ * @param role The role that should be granted.
135
+ * @param userId The ID of the user.
136
+ * @param options The options for the action.
137
+ * @param taskId The ID of the task.
138
+ */
139
+ export function revokeUserRole(recordName, role, userId, options, taskId) {
140
+ return {
141
+ type: 'revoke_role',
142
+ recordName,
143
+ role,
144
+ userId,
145
+ options,
146
+ taskId,
147
+ };
148
+ }
149
+ /**
150
+ * Creates a revokeRoleAction for an inst.
151
+ * @param recordName The name of the record.
152
+ * @param role The role that should be revokeed.
153
+ * @param inst The ID of the inst.
154
+ * @param options The options for the action.
155
+ * @param taskId The ID of the task.
156
+ */
157
+ export function revokeInstRole(recordName, role, inst, options, taskId) {
158
+ return {
159
+ type: 'revoke_role',
160
+ recordName,
161
+ role,
162
+ inst,
163
+ options,
164
+ taskId,
165
+ };
166
+ }
167
+ /**
168
+ * Creates a GrantInstAdminPermissionAction.
169
+ * @param recordName The name of the record.
170
+ * @param options The options for the action.
171
+ * @param taskId The ID of the task.
172
+ */
173
+ export function grantInstAdminPermission(recordName, options, taskId) {
174
+ return {
175
+ type: 'grant_inst_admin_permission',
176
+ recordName,
177
+ options,
178
+ taskId,
179
+ };
180
+ }
181
+ /**
182
+ * Creates a RecordDataAction.
183
+ * @param recordKey The key that should be used to access the record.
184
+ * @param address The address that the data should be stored at in the record.
185
+ * @param data The data to store.
186
+ * @param requiresApproval Whether to try to record data that requires approval.
187
+ * @param options The options that should be used for the action.
188
+ * @param taskId The ID of the task.
189
+ */
190
+ export function recordData(recordKey, address, data, requiresApproval, options, taskId) {
191
+ return {
192
+ type: 'record_data',
193
+ recordKey,
194
+ address,
195
+ data,
196
+ requiresApproval,
197
+ options,
198
+ taskId,
199
+ };
200
+ }
201
+ /**
202
+ * Creates a GetRecordDataAction.
203
+ * @param recordName The name of the record to retrieve.
204
+ * @param address The address of the data to retrieve.
205
+ * @param requiresApproval Whether to try to get a record that requires manual approval.
206
+ * @param options The options that should be used for the action.
207
+ * @param taskId The ID of the task.
208
+ */
209
+ export function getRecordData(recordName, address, requiresApproval, options, taskId) {
210
+ return {
211
+ type: 'get_record_data',
212
+ recordName,
213
+ address,
214
+ requiresApproval,
215
+ options,
216
+ taskId,
217
+ };
218
+ }
219
+ /**
220
+ * Creates a ListRecordDataAction.
221
+ * @param recordName The name of the record.
222
+ * @param startingAddress The address that the list should start with.
223
+ * @param options The options that should be used for the action.
224
+ * @param taskId The ID of the task.
225
+ */
226
+ export function listDataRecord(recordName, startingAddress, options, taskId) {
227
+ return {
228
+ type: 'list_record_data',
229
+ recordName,
230
+ startingAddress,
231
+ requiresApproval: false,
232
+ options,
233
+ taskId,
234
+ };
235
+ }
236
+ /**
237
+ * Creates a EraseRecordDataAction.
238
+ * @param recordKey The key that should be used to access the record.
239
+ * @param address The address of the data to erase.
240
+ * @param requiresApproval Whether to try to erase a record that requires manual approval.
241
+ * @param options The options that should be used for the action.
242
+ * @param taskId The ID of the task.
243
+ */
244
+ export function eraseRecordData(recordKey, address, requiresApproval, options, taskId) {
245
+ return {
246
+ type: 'erase_record_data',
247
+ recordKey,
248
+ address,
249
+ requiresApproval,
250
+ options,
251
+ taskId,
252
+ };
253
+ }
254
+ /**
255
+ * Creates a RecordFileAction.
256
+ * @param recordKey The key that should be used to access the record.
257
+ * @param data The data to store.
258
+ * @param description The description of the file.
259
+ * @param mimeType The MIME type of the file.
260
+ * @param markers The markers to associate with the file.
261
+ * @param options The options that should be used for the action.
262
+ */
263
+ export function recordFile(recordKey, data, description, mimeType, options, taskId) {
264
+ return {
265
+ type: 'record_file',
266
+ recordKey,
267
+ data,
268
+ description,
269
+ mimeType,
270
+ options,
271
+ taskId,
272
+ };
273
+ }
274
+ /**
275
+ * Creates a GetFileAction.
276
+ * @param recordKey The key that should be used to access the record.
277
+ * @param fileUrl The URL that the file was stored at.
278
+ * @param options The options that should be used for the action.
279
+ * @param taskId The ID of the task.
280
+ */
281
+ export function getFile(fileUrl, options, taskId) {
282
+ return {
283
+ type: 'get_file',
284
+ fileUrl,
285
+ options,
286
+ taskId,
287
+ };
288
+ }
289
+ /**
290
+ * Creates a EraseFileAction.
291
+ * @param recordKey The key that should be used to access the record.
292
+ * @param fileUrl The URL that the file was stored at.
293
+ * @param options The options that should be used for the action.
294
+ * @param taskId The ID of the task.
295
+ */
296
+ export function eraseFile(recordKey, fileUrl, options, taskId) {
297
+ return {
298
+ type: 'erase_file',
299
+ recordKey,
300
+ fileUrl,
301
+ options,
302
+ taskId,
303
+ };
304
+ }
305
+ /**
306
+ * Creates a RecordEventAction.
307
+ * @param recordKey The key that should be used to access the record.
308
+ * @param eventName The name of the event.
309
+ * @param count The number of times that the event occurred.
310
+ * @param options The options that should be used for the action.
311
+ * @param taskId The Id of the task.
312
+ */
313
+ export function recordEvent(recordKey, eventName, count, options, taskId) {
314
+ return {
315
+ type: 'record_event',
316
+ recordKey,
317
+ eventName,
318
+ count,
319
+ options,
320
+ taskId,
321
+ };
322
+ }
323
+ /**
324
+ * Creates a GetEventCountAction.
325
+ * @param recordName The name of the record.
326
+ * @param eventName The name of the events.
327
+ * @param options The options that should be used for the action.
328
+ * @param taskId The ID.
329
+ */
330
+ export function getEventCount(recordName, eventName, options, taskId) {
331
+ return {
332
+ type: 'get_event_count',
333
+ recordName,
334
+ eventName,
335
+ options,
336
+ taskId,
337
+ };
338
+ }
339
+ /**
340
+ * Creates a ListUserStudiosAction.
341
+ * @param options The options that should be used for the action.
342
+ * @param taskId The ID of the task.
343
+ */
344
+ export function listUserStudios(options, taskId) {
345
+ return {
346
+ type: 'list_user_studios',
347
+ options,
348
+ taskId,
349
+ };
350
+ }
351
+ /**
352
+ * Creates a new JoinRoomAction.
353
+ * @param roomName The name of the room.
354
+ * @param options The options to use for the event.
355
+ * @param taskId The ID of the async task.
356
+ */
357
+ export function joinRoom(roomName, options, taskId) {
358
+ return {
359
+ type: 'join_room',
360
+ roomName,
361
+ options,
362
+ taskId,
363
+ };
364
+ }
365
+ /**
366
+ * Creates a new LeaveRoomAction.
367
+ * @param roomName The name of the room.
368
+ * @param options The options to use for the event.
369
+ * @param taskId The ID of the async task.
370
+ */
371
+ export function leaveRoom(roomName, options, taskId) {
372
+ return {
373
+ type: 'leave_room',
374
+ roomName,
375
+ options,
376
+ taskId,
377
+ };
378
+ }
379
+ /**
380
+ * Creates a new SetRoomOptionsAction.
381
+ * @param roomName The name of the room.
382
+ * @param options The options to use for the event.
383
+ * @param taskId The ID of the async task.
384
+ */
385
+ export function setRoomOptions(roomName, options, taskId) {
386
+ return {
387
+ type: 'set_room_options',
388
+ roomName,
389
+ options,
390
+ taskId,
391
+ };
392
+ }
393
+ /**
394
+ * Creates a new GetRoomOptionsAction.
395
+ * @param roomName The name of the room.
396
+ * @param taskId The ID of the async task.
397
+ */
398
+ export function getRoomOptions(roomName, taskId) {
399
+ return {
400
+ type: 'get_room_options',
401
+ roomName,
402
+ taskId,
403
+ };
404
+ }
405
+ /**
406
+ * Creates a new GetRoomTrackOptionsAction.
407
+ * @param roomName The name of the room.
408
+ * @param address The address of the track.
409
+ * @param taskId The ID of the task.
410
+ */
411
+ export function getRoomTrackOptions(roomName, address, taskId) {
412
+ return {
413
+ type: 'get_room_track_options',
414
+ roomName,
415
+ address,
416
+ taskId,
417
+ };
418
+ }
419
+ /**
420
+ * Creates a new SetRoomTrackOptionsAction.
421
+ * @param roomName The name of the room.
422
+ * @param address The address of the track.
423
+ * @param options The options that should be set.
424
+ * @param taskId The ID of the task.
425
+ */
426
+ export function setRoomTrackOptions(roomName, address, options, taskId) {
427
+ return {
428
+ type: 'set_room_track_options',
429
+ roomName,
430
+ address,
431
+ options,
432
+ taskId,
433
+ };
434
+ }
435
+ /**
436
+ * Creates a new GetRoomRemoteOptionsAction.
437
+ * @param roomName The name of the room.
438
+ * @param remoteId The ID of the remote user.
439
+ * @param taskId The ID of the task.
440
+ */
441
+ export function getRoomRemoteOptions(roomName, remoteId, taskId) {
442
+ return {
443
+ type: 'get_room_remote_options',
444
+ roomName,
445
+ remoteId,
446
+ taskId,
447
+ };
448
+ }
449
+ //# sourceMappingURL=RecordsEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordsEvents.js","sourceRoot":"","sources":["RecordsEvents.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,eAAe,GAGlB,MAAM,+BAA+B,CAAC;AAm9BvC;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAClB,QAAyB,EACzB,OAAuB,EACvB,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,S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IG;AACH,MAAM,UAAU,cAAc,CAC1B,QAAgB,EAChB,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,kBAAkB;QACxB,QAAQ;QACR,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAC/B,QAAgB,EAChB,OAAe,EACf,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,wBAAwB;QAC9B,QAAQ;QACR,OAAO;QACP,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAC/B,QAAgB,EAChB,OAAe,EACf,OAA4B,EAC5B,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,wBAAwB;QAC9B,QAAQ;QACR,OAAO;QACP,OAAO;QACP,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAChC,QAAgB,EAChB,QAAgB,EAChB,MAAwB;IAExB,OAAO;QACH,IAAI,EAAE,yBAAyB;QAC/B,QAAQ;QACR,QAAQ;QACR,MAAM;KACT,CAAC;AACN,CAAC"}
@@ -0,0 +1,177 @@
1
+ import type { InterpreterContinuation, InterpreterStop } from '@casual-simulation/js-interpreter';
2
+ import { BotTags, Bot, BotTagMasks, RuntimeBot, CompiledBotListener } from '@casual-simulation/aux-common/bots';
3
+ import { CompiledBot } from './CompiledBot';
4
+ import { RuntimeStateVersion } from './RuntimeStateVersion';
5
+ import { RuntimeActions } from './RuntimeEvents';
6
+ /**
7
+ * Adds any known symbols that the given target contains to the end of the given list of keys and returns a new list containing the combination of both.
8
+ * @param target The target.
9
+ * @param keys The keys that the symbols should be added to.
10
+ */
11
+ export declare function addKnownSymbolsToList(target: any, keys: string[]): (string | symbol)[];
12
+ /**
13
+ * Defines an interface that contains runtime bots state.
14
+ * That is, a map of bot IDs to the runtime bot instances.
15
+ */
16
+ export interface RuntimeBotsState {
17
+ [id: string]: RuntimeBot;
18
+ }
19
+ /**
20
+ * Flattens the given tag masks into a normal tags object.
21
+ * Spaces are prioritized accoring to the TAG_MASK_SPACE_PRIORITIES_REVERSE list.
22
+ * @param masks The masks to flatten.
23
+ */
24
+ export declare function flattenTagMasks(masks: BotTagMasks): BotTags;
25
+ /**
26
+ * Constructs a new script bot for the given bot.
27
+ * Script bots provide special behaviors by implemlementing getters and setters for tag values as well
28
+ * as handling extra compatibility concerns like serialization.
29
+ *
30
+ * @param bot The bot.
31
+ * @param manager The service that is able to track updates on a bot.
32
+ * @param context The global context.
33
+ */
34
+ export declare function createRuntimeBot(bot: CompiledBot, manager: RuntimeBotInterface): RuntimeBot;
35
+ /**
36
+ * Defines an interface for an object that provides the API that script bots use for housekeeping.
37
+ */
38
+ export interface RuntimeBotInterface extends RuntimeBatcher {
39
+ /**
40
+ * Updates the tag of the given bot.
41
+ * Returns the realtime edit mode that should be used for this particular assignment.
42
+ * @param bot The bot.
43
+ * @param tag The tag that should be updated.
44
+ * @param newValue The new tag value.
45
+ */
46
+ updateTag(bot: CompiledBot, tag: string, newValue: any): RealtimeEditConfig;
47
+ /**
48
+ * Updates the tag mask of the given bot.
49
+ * @param bot The bot.
50
+ * @param tag The tag that should be updated.
51
+ * @param space The spaces that the tag mask should be applied in.
52
+ * @param value The new tag value. If null, then the mask will be deleted.
53
+ */
54
+ updateTagMask(bot: CompiledBot, tag: string, spaces: string[], value: any): RealtimeEditConfig;
55
+ /**
56
+ * Gets the value for the given tag on the given bot.
57
+ * @param bot The bot.
58
+ * @param tag The tag.
59
+ */
60
+ getValue(bot: CompiledBot, tag: string): any;
61
+ /**
62
+ * Gets the raw value for the given tag on the given bot.
63
+ * @param bot The bot.
64
+ * @param tag The tag.
65
+ */
66
+ getRawValue(bot: CompiledBot, tag: string): any;
67
+ /**
68
+ * Gets the raw tag mask value for the given tag.
69
+ * @param bot The bot.
70
+ * @param tag The tag.
71
+ * @param space The space.
72
+ */
73
+ getTagMask(bot: CompiledBot, tag: string): any;
74
+ /**
75
+ * Gets the tag link for the given tag.
76
+ * @param bot The bot.
77
+ * @param tag The tag.
78
+ */
79
+ getTagLink(bot: CompiledBot, tag: string): RuntimeBot | RuntimeBot[];
80
+ /**
81
+ * Gets the listener for the given bot and tag, resolving any formulas that may be present.
82
+ * Returns null if no listener is available.
83
+ * @param bot The bot.
84
+ * @param tag The tag.
85
+ */
86
+ getListener(bot: CompiledBot, tag: string): CompiledBotListener;
87
+ /**
88
+ * Gets whether the given signature on the bot is valid.
89
+ * @param bot The bot.
90
+ * @param signature The tag.
91
+ */
92
+ getSignature(bot: CompiledBot, signature: string): string;
93
+ /**
94
+ * Gets the current version that the interface is at.
95
+ */
96
+ currentVersion: RuntimeStateVersion;
97
+ }
98
+ /**
99
+ * Defines an interface for an object that is able to manage the creation and destruction of script bots in the runtime.
100
+ */
101
+ export interface RuntimeBotFactory {
102
+ /**
103
+ * Creates a new script bot from the given bot and adds it to the runtime.
104
+ *
105
+ * Returns null if a runtime bot could not be created for the given bot.
106
+ * This can happen when a bot is being created in a space that doesn't support immediate realtime edits.
107
+ *
108
+ * @param bot The bot.
109
+ */
110
+ createRuntimeBot(bot: Bot): RuntimeBot;
111
+ /**
112
+ * Destroyes the given script bot and removes it from the runtime.
113
+ * Returns the realtime edit mode that should apply for this operation.
114
+ *
115
+ * @param bot The bot.
116
+ */
117
+ destroyScriptBot(bot: RuntimeBot): RealtimeEditMode;
118
+ }
119
+ /**
120
+ * Defines an interface for an object that is able to batch script results.
121
+ */
122
+ export interface RuntimeBatcher {
123
+ /**
124
+ * Notifies the batcher that a change has happened and that it should schedule
125
+ * a handler to grab the changes and apply them.
126
+ */
127
+ notifyChange(): void;
128
+ /**
129
+ * Notifies the batcher of an action that was added.
130
+ */
131
+ notifyActionEnqueued(action: RuntimeActions): void;
132
+ }
133
+ /**
134
+ * Defines an interface for an object that is able to process interpreter generators.
135
+ */
136
+ export interface RuntimeInterpreterGeneratorProcessor {
137
+ /**
138
+ * Processes the given generator.
139
+ * @param generator The generator that should be processed.
140
+ */
141
+ processGenerator<T>(generator: Generator<InterpreterStop, T, InterpreterContinuation>): void;
142
+ }
143
+ /**
144
+ * The list of possible realtime edit modes.
145
+ */
146
+ export declare enum RealtimeEditMode {
147
+ /**
148
+ * Specifies that bots in this edit mode cannot be edited.
149
+ */
150
+ None = 0,
151
+ /**
152
+ * Specifies that all changes to the bot will be accepted.
153
+ * This allows the changes to be immediately used.
154
+ */
155
+ Immediate = 1,
156
+ /**
157
+ * Specifies that some changes to the bot may be rejected.
158
+ * This requires that changes be delayed until the related
159
+ * partition accepts/denies them.
160
+ */
161
+ Delayed = 2
162
+ }
163
+ /**
164
+ * The options that should be used when editing a tag.
165
+ */
166
+ export interface RealtimeEditConfig {
167
+ /**
168
+ * The edit mode that should be used.
169
+ */
170
+ mode: RealtimeEditMode;
171
+ /**
172
+ * The value that should be used for the bot changes.
173
+ * If not included, then the value that was originally provided should be used.
174
+ */
175
+ changedValue: any;
176
+ }
177
+ //# sourceMappingURL=RuntimeBot.d.ts.map