@casual-simulation/aux-common 3.2.6 → 3.2.7-alpha.6227012901

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 (212) hide show
  1. package/Errors.d.ts +29 -0
  2. package/Errors.js +2 -0
  3. package/Errors.js.map +1 -0
  4. package/{aux-format-2 → bots}/AuxStateHelpers.d.ts +2 -33
  5. package/{aux-format-2 → bots}/AuxStateHelpers.js +1 -116
  6. package/bots/AuxStateHelpers.js.map +1 -0
  7. package/bots/Bot.d.ts +1 -1
  8. package/bots/BotCalculations.d.ts +4 -1
  9. package/bots/BotCalculations.js +62 -0
  10. package/bots/BotCalculations.js.map +1 -1
  11. package/bots/BotEvents.d.ts +859 -3401
  12. package/bots/BotEvents.js +133 -1529
  13. package/bots/BotEvents.js.map +1 -1
  14. package/bots/StateUpdatedEvent.d.ts +1 -1
  15. package/bots/StateUpdatedEvent.js +1 -1
  16. package/bots/StateUpdatedEvent.js.map +1 -1
  17. package/bots/index.d.ts +1 -0
  18. package/bots/index.js +1 -0
  19. package/bots/index.js.map +1 -1
  20. package/common/Action.d.ts +17 -0
  21. package/common/Action.js +2 -0
  22. package/common/Action.js.map +1 -0
  23. package/common/ConnectionIndicator.d.ts +29 -0
  24. package/common/ConnectionIndicator.js +23 -0
  25. package/common/ConnectionIndicator.js.map +1 -0
  26. package/common/ConnectionInfo.d.ts +30 -0
  27. package/common/ConnectionInfo.js +14 -0
  28. package/common/ConnectionInfo.js.map +1 -0
  29. package/common/ConnectionToken.d.ts +37 -0
  30. package/common/ConnectionToken.js +93 -0
  31. package/common/ConnectionToken.js.map +1 -0
  32. package/common/CurrentVersion.d.ts +26 -0
  33. package/common/CurrentVersion.js +2 -0
  34. package/common/CurrentVersion.js.map +1 -0
  35. package/common/Iterators.d.ts +19 -0
  36. package/common/Iterators.js +39 -0
  37. package/common/Iterators.js.map +1 -0
  38. package/common/LoadingProgress.d.ts +26 -0
  39. package/common/LoadingProgress.js +2 -0
  40. package/common/LoadingProgress.js.map +1 -0
  41. package/common/RemoteActions.d.ts +558 -0
  42. package/common/RemoteActions.js +128 -0
  43. package/common/RemoteActions.js.map +1 -0
  44. package/common/StatusUpdate.d.ts +108 -0
  45. package/common/StatusUpdate.js +2 -0
  46. package/common/StatusUpdate.js.map +1 -0
  47. package/common/StatusUpdateUtils.d.ts +3 -0
  48. package/common/StatusUpdateUtils.js +11 -0
  49. package/common/StatusUpdateUtils.js.map +1 -0
  50. package/common/index.d.ts +11 -0
  51. package/common/index.js +11 -0
  52. package/common/index.js.map +1 -0
  53. package/index.d.ts +4 -1
  54. package/index.js +4 -1
  55. package/index.js.map +1 -1
  56. package/package.json +3 -4
  57. package/partitions/AuxPartition.d.ts +1 -11
  58. package/partitions/AuxPartition.js.map +1 -1
  59. package/partitions/AuxPartitionConfig.d.ts +39 -123
  60. package/partitions/MemoryPartition.d.ts +2 -2
  61. package/partitions/MemoryPartition.js +2 -2
  62. package/partitions/MemoryPartition.js.map +1 -1
  63. package/partitions/OtherPlayersPartition.d.ts +6 -7
  64. package/partitions/OtherPlayersPartition.js +40 -54
  65. package/partitions/OtherPlayersPartition.js.map +1 -1
  66. package/partitions/PartitionUtils.d.ts +28 -1
  67. package/partitions/PartitionUtils.js +174 -1
  68. package/partitions/PartitionUtils.js.map +1 -1
  69. package/partitions/ProxyBridgePartition.d.ts +1 -3
  70. package/partitions/ProxyBridgePartition.js +0 -14
  71. package/partitions/ProxyBridgePartition.js.map +1 -1
  72. package/partitions/RemoteYjsPartition.d.ts +7 -6
  73. package/partitions/RemoteYjsPartition.js +55 -75
  74. package/partitions/RemoteYjsPartition.js.map +1 -1
  75. package/partitions/YjsPartition.d.ts +1 -2
  76. package/partitions/YjsPartition.js +3 -6
  77. package/partitions/YjsPartition.js.map +1 -1
  78. package/partitions/index.d.ts +1 -7
  79. package/partitions/index.js +1 -7
  80. package/partitions/index.js.map +1 -1
  81. package/test/FuzzingHelpers.d.ts +1 -1
  82. package/test/FuzzingHelpers.js +1 -1
  83. package/test/FuzzingHelpers.js.map +1 -1
  84. package/test/TestHelpers.d.ts +8 -0
  85. package/test/TestHelpers.js +23 -0
  86. package/test/TestHelpers.js.map +1 -1
  87. package/utils.d.ts +10 -5
  88. package/utils.js +19 -7
  89. package/utils.js.map +1 -1
  90. package/websockets/AuthenticatedConnectionClient.d.ts +26 -0
  91. package/websockets/AuthenticatedConnectionClient.js +61 -0
  92. package/websockets/AuthenticatedConnectionClient.js.map +1 -0
  93. package/websockets/ConnectionClient.d.ts +59 -0
  94. package/websockets/ConnectionClient.js +2 -0
  95. package/websockets/ConnectionClient.js.map +1 -0
  96. package/websockets/InstRecordsClient.d.ts +118 -0
  97. package/websockets/InstRecordsClient.js +387 -0
  98. package/websockets/InstRecordsClient.js.map +1 -0
  99. package/websockets/InstRecordsClientTimeSyncConnection.d.ts +13 -0
  100. package/websockets/InstRecordsClientTimeSyncConnection.js +16 -0
  101. package/websockets/InstRecordsClientTimeSyncConnection.js.map +1 -0
  102. package/websockets/MemoryConnectionClient.d.ts +19 -0
  103. package/websockets/MemoryConnectionClient.js +41 -0
  104. package/websockets/MemoryConnectionClient.js.map +1 -0
  105. package/websockets/WebsocketEvents.d.ts +2670 -0
  106. package/websockets/WebsocketEvents.js +189 -0
  107. package/websockets/WebsocketEvents.js.map +1 -0
  108. package/websockets/index.d.ts +7 -0
  109. package/websockets/index.js +7 -0
  110. package/websockets/index.js.map +1 -0
  111. package/yjs/YjsHelpers.d.ts +1 -1
  112. package/LoadingProgress.d.ts +0 -54
  113. package/LoadingProgress.js +0 -105
  114. package/LoadingProgress.js.map +0 -1
  115. package/aux-format-2/AuxCausalTree2.d.ts +0 -98
  116. package/aux-format-2/AuxCausalTree2.js +0 -616
  117. package/aux-format-2/AuxCausalTree2.js.map +0 -1
  118. package/aux-format-2/AuxOpTypes.d.ts +0 -268
  119. package/aux-format-2/AuxOpTypes.js +0 -240
  120. package/aux-format-2/AuxOpTypes.js.map +0 -1
  121. package/aux-format-2/AuxStateHelpers.js.map +0 -1
  122. package/aux-format-2/AuxWeaveHelpers.d.ts +0 -132
  123. package/aux-format-2/AuxWeaveHelpers.js +0 -335
  124. package/aux-format-2/AuxWeaveHelpers.js.map +0 -1
  125. package/aux-format-2/AuxWeaveReducer.d.ts +0 -37
  126. package/aux-format-2/AuxWeaveReducer.js +0 -980
  127. package/aux-format-2/AuxWeaveReducer.js.map +0 -1
  128. package/aux-format-2/index.d.ts +0 -7
  129. package/aux-format-2/index.js +0 -7
  130. package/aux-format-2/index.js.map +0 -1
  131. package/partitions/AuxPartitionRealtimeEditModeProvider.d.ts +0 -9
  132. package/partitions/AuxPartitionRealtimeEditModeProvider.js +0 -21
  133. package/partitions/AuxPartitionRealtimeEditModeProvider.js.map +0 -1
  134. package/partitions/BotClient.d.ts +0 -24
  135. package/partitions/BotClient.js +0 -2
  136. package/partitions/BotClient.js.map +0 -1
  137. package/partitions/BotPartition.d.ts +0 -45
  138. package/partitions/BotPartition.js +0 -186
  139. package/partitions/BotPartition.js.map +0 -1
  140. package/partitions/CausalRepoPartition.d.ts +0 -45
  141. package/partitions/CausalRepoPartition.js +0 -157
  142. package/partitions/CausalRepoPartition.js.map +0 -1
  143. package/partitions/MemoryBotClient.d.ts +0 -11
  144. package/partitions/MemoryBotClient.js +0 -41
  145. package/partitions/MemoryBotClient.js.map +0 -1
  146. package/partitions/RemoteCausalRepoHistoryPartition.d.ts +0 -53
  147. package/partitions/RemoteCausalRepoHistoryPartition.js +0 -206
  148. package/partitions/RemoteCausalRepoHistoryPartition.js.map +0 -1
  149. package/partitions/RemoteCausalRepoPartition.d.ts +0 -72
  150. package/partitions/RemoteCausalRepoPartition.js +0 -468
  151. package/partitions/RemoteCausalRepoPartition.js.map +0 -1
  152. package/runtime/AuxCompiler.d.ts +0 -258
  153. package/runtime/AuxCompiler.js +0 -722
  154. package/runtime/AuxCompiler.js.map +0 -1
  155. package/runtime/AuxDevice.d.ts +0 -28
  156. package/runtime/AuxDevice.js +0 -2
  157. package/runtime/AuxDevice.js.map +0 -1
  158. package/runtime/AuxGlobalContext.d.ts +0 -571
  159. package/runtime/AuxGlobalContext.js +0 -606
  160. package/runtime/AuxGlobalContext.js.map +0 -1
  161. package/runtime/AuxLibrary.d.ts +0 -2702
  162. package/runtime/AuxLibrary.js +0 -11046
  163. package/runtime/AuxLibrary.js.map +0 -1
  164. package/runtime/AuxLibraryDefinitions.def +0 -13139
  165. package/runtime/AuxRealtimeEditModeProvider.d.ts +0 -35
  166. package/runtime/AuxRealtimeEditModeProvider.js +0 -34
  167. package/runtime/AuxRealtimeEditModeProvider.js.map +0 -1
  168. package/runtime/AuxResults.d.ts +0 -77
  169. package/runtime/AuxResults.js +0 -6
  170. package/runtime/AuxResults.js.map +0 -1
  171. package/runtime/AuxRuntime.d.ts +0 -253
  172. package/runtime/AuxRuntime.js +0 -2700
  173. package/runtime/AuxRuntime.js.map +0 -1
  174. package/runtime/AuxRuntimeDynamicImports.d.ts +0 -14
  175. package/runtime/AuxRuntimeDynamicImports.js +0 -24
  176. package/runtime/AuxRuntimeDynamicImports.js.map +0 -1
  177. package/runtime/AuxVersion.d.ts +0 -39
  178. package/runtime/AuxVersion.js +0 -2
  179. package/runtime/AuxVersion.js.map +0 -1
  180. package/runtime/CasualOSError.d.ts +0 -37
  181. package/runtime/CasualOSError.js +0 -25
  182. package/runtime/CasualOSError.js.map +0 -1
  183. package/runtime/CompiledBot.d.ts +0 -106
  184. package/runtime/CompiledBot.js +0 -44
  185. package/runtime/CompiledBot.js.map +0 -1
  186. package/runtime/PerformanceNowPolyfill.d.ts +0 -1
  187. package/runtime/PerformanceNowPolyfill.js +0 -8
  188. package/runtime/PerformanceNowPolyfill.js.map +0 -1
  189. package/runtime/RuntimeBot.d.ts +0 -176
  190. package/runtime/RuntimeBot.js +0 -732
  191. package/runtime/RuntimeBot.js.map +0 -1
  192. package/runtime/RuntimeStateVersion.d.ts +0 -23
  193. package/runtime/RuntimeStateVersion.js +0 -22
  194. package/runtime/RuntimeStateVersion.js.map +0 -1
  195. package/runtime/Transpiler.d.ts +0 -174
  196. package/runtime/Transpiler.js +0 -611
  197. package/runtime/Transpiler.js.map +0 -1
  198. package/runtime/Utils.d.ts +0 -74
  199. package/runtime/Utils.js +0 -488
  200. package/runtime/Utils.js.map +0 -1
  201. package/runtime/index.d.ts +0 -9
  202. package/runtime/index.js +0 -9
  203. package/runtime/index.js.map +0 -1
  204. package/runtime/test/RuntimeTestHelpers.d.ts +0 -11
  205. package/runtime/test/RuntimeTestHelpers.js +0 -26
  206. package/runtime/test/RuntimeTestHelpers.js.map +0 -1
  207. package/runtime/test/TestScriptBotFactory.d.ts +0 -16
  208. package/runtime/test/TestScriptBotFactory.js +0 -107
  209. package/runtime/test/TestScriptBotFactory.js.map +0 -1
  210. /package/{runtime/BlobPolyfill.d.ts → BlobPolyfill.d.ts} +0 -0
  211. /package/{runtime/BlobPolyfill.js → BlobPolyfill.js} +0 -0
  212. /package/{runtime/BlobPolyfill.js.map → BlobPolyfill.js.map} +0 -0
@@ -1,176 +0,0 @@
1
- import type { InterpreterContinuation, InterpreterStop } from '@casual-simulation/js-interpreter';
2
- import { BotTags, Bot, BotTagMasks, RuntimeBot, CompiledBotListener, BotAction } from '../bots';
3
- import { CompiledBot } from './CompiledBot';
4
- import { RuntimeStateVersion } from './RuntimeStateVersion';
5
- /**
6
- * 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.
7
- * @param target The target.
8
- * @param keys The keys that the symbols should be added to.
9
- */
10
- export declare function addKnownSymbolsToList(target: any, keys: string[]): (string | symbol)[];
11
- /**
12
- * Defines an interface that contains runtime bots state.
13
- * That is, a map of bot IDs to the runtime bot instances.
14
- */
15
- export interface RuntimeBotsState {
16
- [id: string]: RuntimeBot;
17
- }
18
- /**
19
- * Flattens the given tag masks into a normal tags object.
20
- * Spaces are prioritized accoring to the TAG_MASK_SPACE_PRIORITIES_REVERSE list.
21
- * @param masks The masks to flatten.
22
- */
23
- export declare function flattenTagMasks(masks: BotTagMasks): BotTags;
24
- /**
25
- * Constructs a new script bot for the given bot.
26
- * Script bots provide special behaviors by implemlementing getters and setters for tag values as well
27
- * as handling extra compatibility concerns like serialization.
28
- *
29
- * @param bot The bot.
30
- * @param manager The service that is able to track updates on a bot.
31
- * @param context The global context.
32
- */
33
- export declare function createRuntimeBot(bot: CompiledBot, manager: RuntimeBotInterface): RuntimeBot;
34
- /**
35
- * Defines an interface for an object that provides the API that script bots use for housekeeping.
36
- */
37
- export interface RuntimeBotInterface extends RuntimeBatcher {
38
- /**
39
- * Updates the tag of the given bot.
40
- * Returns the realtime edit mode that should be used for this particular assignment.
41
- * @param bot The bot.
42
- * @param tag The tag that should be updated.
43
- * @param newValue The new tag value.
44
- */
45
- updateTag(bot: CompiledBot, tag: string, newValue: any): RealtimeEditConfig;
46
- /**
47
- * Updates the tag mask of the given bot.
48
- * @param bot The bot.
49
- * @param tag The tag that should be updated.
50
- * @param space The spaces that the tag mask should be applied in.
51
- * @param value The new tag value. If null, then the mask will be deleted.
52
- */
53
- updateTagMask(bot: CompiledBot, tag: string, spaces: string[], value: any): RealtimeEditConfig;
54
- /**
55
- * Gets the value for the given tag on the given bot.
56
- * @param bot The bot.
57
- * @param tag The tag.
58
- */
59
- getValue(bot: CompiledBot, tag: string): any;
60
- /**
61
- * Gets the raw value for the given tag on the given bot.
62
- * @param bot The bot.
63
- * @param tag The tag.
64
- */
65
- getRawValue(bot: CompiledBot, tag: string): any;
66
- /**
67
- * Gets the raw tag mask value for the given tag.
68
- * @param bot The bot.
69
- * @param tag The tag.
70
- * @param space The space.
71
- */
72
- getTagMask(bot: CompiledBot, tag: string): any;
73
- /**
74
- * Gets the tag link for the given tag.
75
- * @param bot The bot.
76
- * @param tag The tag.
77
- */
78
- getTagLink(bot: CompiledBot, tag: string): RuntimeBot | RuntimeBot[];
79
- /**
80
- * Gets the listener for the given bot and tag, resolving any formulas that may be present.
81
- * Returns null if no listener is available.
82
- * @param bot The bot.
83
- * @param tag The tag.
84
- */
85
- getListener(bot: CompiledBot, tag: string): CompiledBotListener;
86
- /**
87
- * Gets whether the given signature on the bot is valid.
88
- * @param bot The bot.
89
- * @param signature The tag.
90
- */
91
- getSignature(bot: CompiledBot, signature: string): string;
92
- /**
93
- * Gets the current version that the interface is at.
94
- */
95
- currentVersion: RuntimeStateVersion;
96
- }
97
- /**
98
- * Defines an interface for an object that is able to manage the creation and destruction of script bots in the runtime.
99
- */
100
- export interface RuntimeBotFactory {
101
- /**
102
- * Creates a new script bot from the given bot and adds it to the runtime.
103
- *
104
- * Returns null if a runtime bot could not be created for the given bot.
105
- * This can happen when a bot is being created in a space that doesn't support immediate realtime edits.
106
- *
107
- * @param bot The bot.
108
- */
109
- createRuntimeBot(bot: Bot): RuntimeBot;
110
- /**
111
- * Destroyes the given script bot and removes it from the runtime.
112
- * Returns the realtime edit mode that should apply for this operation.
113
- *
114
- * @param bot The bot.
115
- */
116
- destroyScriptBot(bot: RuntimeBot): RealtimeEditMode;
117
- }
118
- /**
119
- * Defines an interface for an object that is able to batch script results.
120
- */
121
- export interface RuntimeBatcher {
122
- /**
123
- * Notifies the batcher that a change has happened and that it should schedule
124
- * a handler to grab the changes and apply them.
125
- */
126
- notifyChange(): void;
127
- /**
128
- * Notifies the batcher of an action that was added.
129
- */
130
- notifyActionEnqueued(action: BotAction): void;
131
- }
132
- /**
133
- * Defines an interface for an object that is able to process interpreter generators.
134
- */
135
- export interface RuntimeInterpreterGeneratorProcessor {
136
- /**
137
- * Processes the given generator.
138
- * @param generator The generator that should be processed.
139
- */
140
- processGenerator<T>(generator: Generator<InterpreterStop, T, InterpreterContinuation>): void;
141
- }
142
- /**
143
- * The list of possible realtime edit modes.
144
- */
145
- export declare enum RealtimeEditMode {
146
- /**
147
- * Specifies that bots in this edit mode cannot be edited.
148
- */
149
- None = 0,
150
- /**
151
- * Specifies that all changes to the bot will be accepted.
152
- * This allows the changes to be immediately used.
153
- */
154
- Immediate = 1,
155
- /**
156
- * Specifies that some changes to the bot may be rejected.
157
- * This requires that changes be delayed until the related
158
- * partition accepts/denies them.
159
- */
160
- Delayed = 2
161
- }
162
- /**
163
- * The options that should be used when editing a tag.
164
- */
165
- export interface RealtimeEditConfig {
166
- /**
167
- * The edit mode that should be used.
168
- */
169
- mode: RealtimeEditMode;
170
- /**
171
- * The value that should be used for the bot changes.
172
- * If not included, then the value that was originally provided should be used.
173
- */
174
- changedValue: any;
175
- }
176
- //# sourceMappingURL=RuntimeBot.d.ts.map