@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.
- package/Errors.d.ts +29 -0
- package/Errors.js +2 -0
- package/Errors.js.map +1 -0
- package/{aux-format-2 → bots}/AuxStateHelpers.d.ts +2 -33
- package/{aux-format-2 → bots}/AuxStateHelpers.js +1 -116
- package/bots/AuxStateHelpers.js.map +1 -0
- package/bots/Bot.d.ts +1 -1
- package/bots/BotCalculations.d.ts +4 -1
- package/bots/BotCalculations.js +62 -0
- package/bots/BotCalculations.js.map +1 -1
- package/bots/BotEvents.d.ts +859 -3401
- package/bots/BotEvents.js +133 -1529
- package/bots/BotEvents.js.map +1 -1
- package/bots/StateUpdatedEvent.d.ts +1 -1
- package/bots/StateUpdatedEvent.js +1 -1
- package/bots/StateUpdatedEvent.js.map +1 -1
- package/bots/index.d.ts +1 -0
- package/bots/index.js +1 -0
- package/bots/index.js.map +1 -1
- package/common/Action.d.ts +17 -0
- package/common/Action.js +2 -0
- package/common/Action.js.map +1 -0
- package/common/ConnectionIndicator.d.ts +29 -0
- package/common/ConnectionIndicator.js +23 -0
- package/common/ConnectionIndicator.js.map +1 -0
- package/common/ConnectionInfo.d.ts +30 -0
- package/common/ConnectionInfo.js +14 -0
- package/common/ConnectionInfo.js.map +1 -0
- package/common/ConnectionToken.d.ts +37 -0
- package/common/ConnectionToken.js +93 -0
- package/common/ConnectionToken.js.map +1 -0
- package/common/CurrentVersion.d.ts +26 -0
- package/common/CurrentVersion.js +2 -0
- package/common/CurrentVersion.js.map +1 -0
- package/common/Iterators.d.ts +19 -0
- package/common/Iterators.js +39 -0
- package/common/Iterators.js.map +1 -0
- package/common/LoadingProgress.d.ts +26 -0
- package/common/LoadingProgress.js +2 -0
- package/common/LoadingProgress.js.map +1 -0
- package/common/RemoteActions.d.ts +558 -0
- package/common/RemoteActions.js +128 -0
- package/common/RemoteActions.js.map +1 -0
- package/common/StatusUpdate.d.ts +108 -0
- package/common/StatusUpdate.js +2 -0
- package/common/StatusUpdate.js.map +1 -0
- package/common/StatusUpdateUtils.d.ts +3 -0
- package/common/StatusUpdateUtils.js +11 -0
- package/common/StatusUpdateUtils.js.map +1 -0
- package/common/index.d.ts +11 -0
- package/common/index.js +11 -0
- package/common/index.js.map +1 -0
- package/index.d.ts +4 -1
- package/index.js +4 -1
- package/index.js.map +1 -1
- package/package.json +3 -4
- package/partitions/AuxPartition.d.ts +1 -11
- package/partitions/AuxPartition.js.map +1 -1
- package/partitions/AuxPartitionConfig.d.ts +39 -123
- package/partitions/MemoryPartition.d.ts +2 -2
- package/partitions/MemoryPartition.js +2 -2
- package/partitions/MemoryPartition.js.map +1 -1
- package/partitions/OtherPlayersPartition.d.ts +6 -7
- package/partitions/OtherPlayersPartition.js +40 -54
- package/partitions/OtherPlayersPartition.js.map +1 -1
- package/partitions/PartitionUtils.d.ts +28 -1
- package/partitions/PartitionUtils.js +174 -1
- package/partitions/PartitionUtils.js.map +1 -1
- package/partitions/ProxyBridgePartition.d.ts +1 -3
- package/partitions/ProxyBridgePartition.js +0 -14
- package/partitions/ProxyBridgePartition.js.map +1 -1
- package/partitions/RemoteYjsPartition.d.ts +7 -6
- package/partitions/RemoteYjsPartition.js +55 -75
- package/partitions/RemoteYjsPartition.js.map +1 -1
- package/partitions/YjsPartition.d.ts +1 -2
- package/partitions/YjsPartition.js +3 -6
- package/partitions/YjsPartition.js.map +1 -1
- package/partitions/index.d.ts +1 -7
- package/partitions/index.js +1 -7
- package/partitions/index.js.map +1 -1
- package/test/FuzzingHelpers.d.ts +1 -1
- package/test/FuzzingHelpers.js +1 -1
- package/test/FuzzingHelpers.js.map +1 -1
- package/test/TestHelpers.d.ts +8 -0
- package/test/TestHelpers.js +23 -0
- package/test/TestHelpers.js.map +1 -1
- package/utils.d.ts +10 -5
- package/utils.js +19 -7
- package/utils.js.map +1 -1
- package/websockets/AuthenticatedConnectionClient.d.ts +26 -0
- package/websockets/AuthenticatedConnectionClient.js +61 -0
- package/websockets/AuthenticatedConnectionClient.js.map +1 -0
- package/websockets/ConnectionClient.d.ts +59 -0
- package/websockets/ConnectionClient.js +2 -0
- package/websockets/ConnectionClient.js.map +1 -0
- package/websockets/InstRecordsClient.d.ts +118 -0
- package/websockets/InstRecordsClient.js +387 -0
- package/websockets/InstRecordsClient.js.map +1 -0
- package/websockets/InstRecordsClientTimeSyncConnection.d.ts +13 -0
- package/websockets/InstRecordsClientTimeSyncConnection.js +16 -0
- package/websockets/InstRecordsClientTimeSyncConnection.js.map +1 -0
- package/websockets/MemoryConnectionClient.d.ts +19 -0
- package/websockets/MemoryConnectionClient.js +41 -0
- package/websockets/MemoryConnectionClient.js.map +1 -0
- package/websockets/WebsocketEvents.d.ts +2670 -0
- package/websockets/WebsocketEvents.js +189 -0
- package/websockets/WebsocketEvents.js.map +1 -0
- package/websockets/index.d.ts +7 -0
- package/websockets/index.js +7 -0
- package/websockets/index.js.map +1 -0
- package/yjs/YjsHelpers.d.ts +1 -1
- package/LoadingProgress.d.ts +0 -54
- package/LoadingProgress.js +0 -105
- package/LoadingProgress.js.map +0 -1
- package/aux-format-2/AuxCausalTree2.d.ts +0 -98
- package/aux-format-2/AuxCausalTree2.js +0 -616
- package/aux-format-2/AuxCausalTree2.js.map +0 -1
- package/aux-format-2/AuxOpTypes.d.ts +0 -268
- package/aux-format-2/AuxOpTypes.js +0 -240
- package/aux-format-2/AuxOpTypes.js.map +0 -1
- package/aux-format-2/AuxStateHelpers.js.map +0 -1
- package/aux-format-2/AuxWeaveHelpers.d.ts +0 -132
- package/aux-format-2/AuxWeaveHelpers.js +0 -335
- package/aux-format-2/AuxWeaveHelpers.js.map +0 -1
- package/aux-format-2/AuxWeaveReducer.d.ts +0 -37
- package/aux-format-2/AuxWeaveReducer.js +0 -980
- package/aux-format-2/AuxWeaveReducer.js.map +0 -1
- package/aux-format-2/index.d.ts +0 -7
- package/aux-format-2/index.js +0 -7
- package/aux-format-2/index.js.map +0 -1
- package/partitions/AuxPartitionRealtimeEditModeProvider.d.ts +0 -9
- package/partitions/AuxPartitionRealtimeEditModeProvider.js +0 -21
- package/partitions/AuxPartitionRealtimeEditModeProvider.js.map +0 -1
- package/partitions/BotClient.d.ts +0 -24
- package/partitions/BotClient.js +0 -2
- package/partitions/BotClient.js.map +0 -1
- package/partitions/BotPartition.d.ts +0 -45
- package/partitions/BotPartition.js +0 -186
- package/partitions/BotPartition.js.map +0 -1
- package/partitions/CausalRepoPartition.d.ts +0 -45
- package/partitions/CausalRepoPartition.js +0 -157
- package/partitions/CausalRepoPartition.js.map +0 -1
- package/partitions/MemoryBotClient.d.ts +0 -11
- package/partitions/MemoryBotClient.js +0 -41
- package/partitions/MemoryBotClient.js.map +0 -1
- package/partitions/RemoteCausalRepoHistoryPartition.d.ts +0 -53
- package/partitions/RemoteCausalRepoHistoryPartition.js +0 -206
- package/partitions/RemoteCausalRepoHistoryPartition.js.map +0 -1
- package/partitions/RemoteCausalRepoPartition.d.ts +0 -72
- package/partitions/RemoteCausalRepoPartition.js +0 -468
- package/partitions/RemoteCausalRepoPartition.js.map +0 -1
- package/runtime/AuxCompiler.d.ts +0 -258
- package/runtime/AuxCompiler.js +0 -722
- package/runtime/AuxCompiler.js.map +0 -1
- package/runtime/AuxDevice.d.ts +0 -28
- package/runtime/AuxDevice.js +0 -2
- package/runtime/AuxDevice.js.map +0 -1
- package/runtime/AuxGlobalContext.d.ts +0 -571
- package/runtime/AuxGlobalContext.js +0 -606
- package/runtime/AuxGlobalContext.js.map +0 -1
- package/runtime/AuxLibrary.d.ts +0 -2702
- package/runtime/AuxLibrary.js +0 -11046
- package/runtime/AuxLibrary.js.map +0 -1
- package/runtime/AuxLibraryDefinitions.def +0 -13139
- package/runtime/AuxRealtimeEditModeProvider.d.ts +0 -35
- package/runtime/AuxRealtimeEditModeProvider.js +0 -34
- package/runtime/AuxRealtimeEditModeProvider.js.map +0 -1
- package/runtime/AuxResults.d.ts +0 -77
- package/runtime/AuxResults.js +0 -6
- package/runtime/AuxResults.js.map +0 -1
- package/runtime/AuxRuntime.d.ts +0 -253
- package/runtime/AuxRuntime.js +0 -2700
- package/runtime/AuxRuntime.js.map +0 -1
- package/runtime/AuxRuntimeDynamicImports.d.ts +0 -14
- package/runtime/AuxRuntimeDynamicImports.js +0 -24
- package/runtime/AuxRuntimeDynamicImports.js.map +0 -1
- package/runtime/AuxVersion.d.ts +0 -39
- package/runtime/AuxVersion.js +0 -2
- package/runtime/AuxVersion.js.map +0 -1
- package/runtime/CasualOSError.d.ts +0 -37
- package/runtime/CasualOSError.js +0 -25
- package/runtime/CasualOSError.js.map +0 -1
- package/runtime/CompiledBot.d.ts +0 -106
- package/runtime/CompiledBot.js +0 -44
- package/runtime/CompiledBot.js.map +0 -1
- package/runtime/PerformanceNowPolyfill.d.ts +0 -1
- package/runtime/PerformanceNowPolyfill.js +0 -8
- package/runtime/PerformanceNowPolyfill.js.map +0 -1
- package/runtime/RuntimeBot.d.ts +0 -176
- package/runtime/RuntimeBot.js +0 -732
- package/runtime/RuntimeBot.js.map +0 -1
- package/runtime/RuntimeStateVersion.d.ts +0 -23
- package/runtime/RuntimeStateVersion.js +0 -22
- package/runtime/RuntimeStateVersion.js.map +0 -1
- package/runtime/Transpiler.d.ts +0 -174
- package/runtime/Transpiler.js +0 -611
- package/runtime/Transpiler.js.map +0 -1
- package/runtime/Utils.d.ts +0 -74
- package/runtime/Utils.js +0 -488
- package/runtime/Utils.js.map +0 -1
- package/runtime/index.d.ts +0 -9
- package/runtime/index.js +0 -9
- package/runtime/index.js.map +0 -1
- package/runtime/test/RuntimeTestHelpers.d.ts +0 -11
- package/runtime/test/RuntimeTestHelpers.js +0 -26
- package/runtime/test/RuntimeTestHelpers.js.map +0 -1
- package/runtime/test/TestScriptBotFactory.d.ts +0 -16
- package/runtime/test/TestScriptBotFactory.js +0 -107
- package/runtime/test/TestScriptBotFactory.js.map +0 -1
- /package/{runtime/BlobPolyfill.d.ts → BlobPolyfill.d.ts} +0 -0
- /package/{runtime/BlobPolyfill.js → BlobPolyfill.js} +0 -0
- /package/{runtime/BlobPolyfill.js.map → BlobPolyfill.js.map} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { connectionInfoSchema } from '../common/ConnectionInfo';
|
|
2
|
+
import { remoteActionsSchema, deviceActionsSchema, } from '../common/RemoteActions';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export var WebsocketEventTypes;
|
|
5
|
+
(function (WebsocketEventTypes) {
|
|
6
|
+
WebsocketEventTypes[WebsocketEventTypes["Message"] = 1] = "Message";
|
|
7
|
+
WebsocketEventTypes[WebsocketEventTypes["UploadRequest"] = 2] = "UploadRequest";
|
|
8
|
+
WebsocketEventTypes[WebsocketEventTypes["UploadResponse"] = 3] = "UploadResponse";
|
|
9
|
+
WebsocketEventTypes[WebsocketEventTypes["DownloadRequest"] = 4] = "DownloadRequest";
|
|
10
|
+
WebsocketEventTypes[WebsocketEventTypes["Error"] = 5] = "Error";
|
|
11
|
+
})(WebsocketEventTypes || (WebsocketEventTypes = {}));
|
|
12
|
+
export const websocketEventSchema = z
|
|
13
|
+
.tuple([z.nativeEnum(WebsocketEventTypes), z.number()])
|
|
14
|
+
.rest(z.any());
|
|
15
|
+
export const websocketUploadRequestEventSchema = z.tuple([
|
|
16
|
+
z.literal(WebsocketEventTypes.UploadRequest),
|
|
17
|
+
z.number(),
|
|
18
|
+
]);
|
|
19
|
+
export const websocketUploadResponseEventSchema = z.tuple([
|
|
20
|
+
z.literal(WebsocketEventTypes.UploadResponse),
|
|
21
|
+
z.number(),
|
|
22
|
+
z.string(),
|
|
23
|
+
z.string(),
|
|
24
|
+
z.record(z.string()),
|
|
25
|
+
]);
|
|
26
|
+
export const websocketErrorEventSchema = z.tuple([
|
|
27
|
+
z.literal(WebsocketEventTypes.Error),
|
|
28
|
+
z.number(),
|
|
29
|
+
z.string(),
|
|
30
|
+
z.string(),
|
|
31
|
+
z.array(z.any()),
|
|
32
|
+
]);
|
|
33
|
+
export const websocketDownloadRequestEventSchema = z.tuple([
|
|
34
|
+
z.literal(WebsocketEventTypes.DownloadRequest),
|
|
35
|
+
z.number(),
|
|
36
|
+
z.string(),
|
|
37
|
+
z.string(),
|
|
38
|
+
z.record(z.string()),
|
|
39
|
+
]);
|
|
40
|
+
export const loginMessageSchema = z.object({
|
|
41
|
+
type: z.literal('login'),
|
|
42
|
+
connectionToken: z.string().optional(),
|
|
43
|
+
connectionId: z.string().optional(),
|
|
44
|
+
});
|
|
45
|
+
export const loginResultMessageSchema = z.object({
|
|
46
|
+
type: z.literal('login_result'),
|
|
47
|
+
});
|
|
48
|
+
export const watchBranchMessageSchema = z.object({
|
|
49
|
+
type: z.literal('repo/watch_branch'),
|
|
50
|
+
recordName: z.string().nonempty().nullable(),
|
|
51
|
+
inst: z.string(),
|
|
52
|
+
branch: z.string(),
|
|
53
|
+
temporary: z.boolean().optional(),
|
|
54
|
+
});
|
|
55
|
+
export const unwatchBranchMessageSchema = z.object({
|
|
56
|
+
type: z.literal('repo/unwatch_branch'),
|
|
57
|
+
recordName: z.string().nonempty().nullable(),
|
|
58
|
+
inst: z.string(),
|
|
59
|
+
branch: z.string(),
|
|
60
|
+
});
|
|
61
|
+
export const watchBranchDevicesMessageSchema = z.object({
|
|
62
|
+
type: z.literal('repo/watch_branch_devices'),
|
|
63
|
+
recordName: z.string().nonempty().nullable(),
|
|
64
|
+
inst: z.string(),
|
|
65
|
+
branch: z.string(),
|
|
66
|
+
});
|
|
67
|
+
export const unwatchBranchDevicesMessageSchema = z.object({
|
|
68
|
+
type: z.literal('repo/unwatch_branch_devices'),
|
|
69
|
+
recordName: z.string().nonempty().nullable(),
|
|
70
|
+
inst: z.string(),
|
|
71
|
+
branch: z.string(),
|
|
72
|
+
});
|
|
73
|
+
export const addUpdatesMessageSchema = z.object({
|
|
74
|
+
type: z.literal('repo/add_updates'),
|
|
75
|
+
recordName: z.string().nonempty().nullable(),
|
|
76
|
+
inst: z.string(),
|
|
77
|
+
branch: z.string(),
|
|
78
|
+
updates: z.array(z.string()),
|
|
79
|
+
updateId: z.number().optional(),
|
|
80
|
+
initial: z.boolean().optional(),
|
|
81
|
+
timestamps: z.array(z.number()).optional(),
|
|
82
|
+
});
|
|
83
|
+
export const getUpdatesMessageSchema = z.object({
|
|
84
|
+
type: z.literal('repo/get_updates'),
|
|
85
|
+
recordName: z.string().nonempty().nullable(),
|
|
86
|
+
inst: z.string(),
|
|
87
|
+
branch: z.string(),
|
|
88
|
+
});
|
|
89
|
+
export const updatesReceivedMessageSchema = z.object({
|
|
90
|
+
type: z.literal('repo/updates_received'),
|
|
91
|
+
recordName: z.string().nonempty().nullable(),
|
|
92
|
+
inst: z.string(),
|
|
93
|
+
branch: z.string(),
|
|
94
|
+
updateId: z.number(),
|
|
95
|
+
errorCode: z
|
|
96
|
+
.enum(['max_size_reached', 'record_not_found', 'inst_not_found'])
|
|
97
|
+
.optional(),
|
|
98
|
+
maxBranchSizeInBytes: z.number().optional(),
|
|
99
|
+
neededBranchSizeInBytes: z.number().optional(),
|
|
100
|
+
});
|
|
101
|
+
export const sendActionMessageSchema = z.object({
|
|
102
|
+
type: z.literal('repo/send_action'),
|
|
103
|
+
recordName: z.string().nonempty().nullable(),
|
|
104
|
+
inst: z.string(),
|
|
105
|
+
branch: z.string(),
|
|
106
|
+
action: remoteActionsSchema,
|
|
107
|
+
});
|
|
108
|
+
export const receiveDeviceActionMessageSchema = z.object({
|
|
109
|
+
type: z.literal('repo/receive_action'),
|
|
110
|
+
recordName: z.string().nonempty().nullable(),
|
|
111
|
+
inst: z.string(),
|
|
112
|
+
branch: z.string(),
|
|
113
|
+
action: deviceActionsSchema,
|
|
114
|
+
});
|
|
115
|
+
export const connectedToBranchMessageSchema = z.object({
|
|
116
|
+
type: z.literal('repo/connected_to_branch'),
|
|
117
|
+
broadcast: z.boolean(),
|
|
118
|
+
branch: watchBranchMessageSchema,
|
|
119
|
+
connection: connectionInfoSchema,
|
|
120
|
+
});
|
|
121
|
+
export const disconnectedFromBranchMessageSchema = z.object({
|
|
122
|
+
type: z.literal('repo/disconnected_from_branch'),
|
|
123
|
+
broadcast: z.boolean(),
|
|
124
|
+
recordName: z.string().nonempty().nullable(),
|
|
125
|
+
inst: z.string(),
|
|
126
|
+
branch: z.string(),
|
|
127
|
+
connection: connectionInfoSchema,
|
|
128
|
+
});
|
|
129
|
+
export const connectionCountMessageSchema = z.object({
|
|
130
|
+
type: z.literal('repo/connection_count'),
|
|
131
|
+
recordName: z.string().nonempty().nullable(),
|
|
132
|
+
inst: z.string().nullable(),
|
|
133
|
+
branch: z.string().nullable(),
|
|
134
|
+
count: z.number().optional(),
|
|
135
|
+
});
|
|
136
|
+
export const timeSyncRequestMessageSchema = z.object({
|
|
137
|
+
type: z.literal('sync/time'),
|
|
138
|
+
id: z.number(),
|
|
139
|
+
clientRequestTime: z.number(),
|
|
140
|
+
});
|
|
141
|
+
export const timeSyncResponseMessageSchema = z.object({
|
|
142
|
+
type: z.literal('sync/time/response'),
|
|
143
|
+
id: z.number(),
|
|
144
|
+
clientRequestTime: z.number(),
|
|
145
|
+
serverReceiveTime: z.number(),
|
|
146
|
+
serverTransmitTime: z.number(),
|
|
147
|
+
});
|
|
148
|
+
export const rateLimitExceededMessageSchema = z.object({
|
|
149
|
+
type: z.literal('rate_limit_exceeded'),
|
|
150
|
+
retryAfter: z.number(),
|
|
151
|
+
totalHits: z.number(),
|
|
152
|
+
});
|
|
153
|
+
export const websocketRequestMessageSchema = z.discriminatedUnion('type', [
|
|
154
|
+
loginMessageSchema,
|
|
155
|
+
watchBranchMessageSchema,
|
|
156
|
+
unwatchBranchMessageSchema,
|
|
157
|
+
addUpdatesMessageSchema,
|
|
158
|
+
sendActionMessageSchema,
|
|
159
|
+
watchBranchDevicesMessageSchema,
|
|
160
|
+
unwatchBranchDevicesMessageSchema,
|
|
161
|
+
connectionCountMessageSchema,
|
|
162
|
+
timeSyncRequestMessageSchema,
|
|
163
|
+
getUpdatesMessageSchema,
|
|
164
|
+
]);
|
|
165
|
+
export const websocketMessageSchema = z.discriminatedUnion('type', [
|
|
166
|
+
loginMessageSchema,
|
|
167
|
+
loginResultMessageSchema,
|
|
168
|
+
watchBranchMessageSchema,
|
|
169
|
+
unwatchBranchMessageSchema,
|
|
170
|
+
addUpdatesMessageSchema,
|
|
171
|
+
updatesReceivedMessageSchema,
|
|
172
|
+
sendActionMessageSchema,
|
|
173
|
+
receiveDeviceActionMessageSchema,
|
|
174
|
+
watchBranchDevicesMessageSchema,
|
|
175
|
+
unwatchBranchDevicesMessageSchema,
|
|
176
|
+
connectedToBranchMessageSchema,
|
|
177
|
+
disconnectedFromBranchMessageSchema,
|
|
178
|
+
connectionCountMessageSchema,
|
|
179
|
+
timeSyncRequestMessageSchema,
|
|
180
|
+
timeSyncResponseMessageSchema,
|
|
181
|
+
rateLimitExceededMessageSchema,
|
|
182
|
+
getUpdatesMessageSchema,
|
|
183
|
+
]);
|
|
184
|
+
export const websocketMessageEventSchema = z.tuple([
|
|
185
|
+
z.literal(WebsocketEventTypes.Message),
|
|
186
|
+
z.number(),
|
|
187
|
+
websocketMessageSchema,
|
|
188
|
+
]);
|
|
189
|
+
//# sourceMappingURL=WebsocketEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebsocketEvents.js","sourceRoot":"","sources":["WebsocketEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAOH,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAY,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBlC,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC3B,mEAAW,CAAA;IACX,+EAAiB,CAAA;IACjB,iFAAkB,CAAA;IAClB,mFAAmB,CAAA;IACnB,+DAAS,CAAA;AACb,CAAC,EANW,mBAAmB,KAAnB,mB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,6BAA6B;IAC7B,8BAA8B;IAC9B,uBAAuB;CAC1B,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/C,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC;IACtC,CAAC,CAAC,MAAM,EAAE;IACV,sBAAsB;CACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './WebsocketEvents';
|
|
2
|
+
export * from './ConnectionClient';
|
|
3
|
+
export * from './InstRecordsClient';
|
|
4
|
+
export * from './MemoryConnectionClient';
|
|
5
|
+
export * from './InstRecordsClientTimeSyncConnection';
|
|
6
|
+
export * from './AuthenticatedConnectionClient';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './WebsocketEvents';
|
|
2
|
+
export * from './ConnectionClient';
|
|
3
|
+
export * from './InstRecordsClient';
|
|
4
|
+
export * from './MemoryConnectionClient';
|
|
5
|
+
export * from './InstRecordsClientTimeSyncConnection';
|
|
6
|
+
export * from './AuthenticatedConnectionClient';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC"}
|
package/yjs/YjsHelpers.d.ts
CHANGED
package/LoadingProgress.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ArgEvent } from './Events';
|
|
2
|
-
import { ProgressStatus, LoadingProgressCallback } from '@casual-simulation/causal-trees';
|
|
3
|
-
export declare class LoadingProgress implements ProgressStatus {
|
|
4
|
-
/**
|
|
5
|
-
* This event is fired any time a value in this loading progress object changes.
|
|
6
|
-
*/
|
|
7
|
-
onChanged: ArgEvent<LoadingProgress>;
|
|
8
|
-
private _show;
|
|
9
|
-
private _progress;
|
|
10
|
-
private _status;
|
|
11
|
-
private _error;
|
|
12
|
-
constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Should a loading progress screen be shown?
|
|
15
|
-
*/
|
|
16
|
-
get show(): boolean;
|
|
17
|
-
set show(val: boolean);
|
|
18
|
-
/**
|
|
19
|
-
* Current progress of the load (0-100).
|
|
20
|
-
*/
|
|
21
|
-
get progress(): number;
|
|
22
|
-
set progress(val: number);
|
|
23
|
-
/**
|
|
24
|
-
* Current status message of the load.
|
|
25
|
-
*/
|
|
26
|
-
get status(): string;
|
|
27
|
-
set status(val: string);
|
|
28
|
-
/**
|
|
29
|
-
* Messsage to show when something bad occurs while loading (null for no error).
|
|
30
|
-
*/
|
|
31
|
-
get error(): string;
|
|
32
|
-
set error(val: string);
|
|
33
|
-
get progressPercent(): number;
|
|
34
|
-
get message(): string;
|
|
35
|
-
/**
|
|
36
|
-
* Set all values of loading progress at once. Will emit a single changed event.
|
|
37
|
-
* @param progress Current progress of the load (0-100).
|
|
38
|
-
* @param status Current status message of the load.
|
|
39
|
-
* @param error Messsage to show when something bad occurs while loading. (null for no error)
|
|
40
|
-
*/
|
|
41
|
-
set(progress: number, status: string, error: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* Creates a nested @see LoadingProgressCallback that can be used to relay progress from a child component into the parent.
|
|
44
|
-
* @param start The start progress percentage.
|
|
45
|
-
* @param end The end progress percentage.
|
|
46
|
-
*/
|
|
47
|
-
createNestedCallback(start: number, end: number): LoadingProgressCallback;
|
|
48
|
-
/**
|
|
49
|
-
* Clone this object and all its current data.
|
|
50
|
-
*/
|
|
51
|
-
clone(): LoadingProgress;
|
|
52
|
-
private _emitChanged;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=LoadingProgress.d.ts.map
|
package/LoadingProgress.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ArgEvent } from './Events';
|
|
2
|
-
import { lerp } from './utils';
|
|
3
|
-
export class LoadingProgress {
|
|
4
|
-
constructor() {
|
|
5
|
-
/**
|
|
6
|
-
* This event is fired any time a value in this loading progress object changes.
|
|
7
|
-
*/
|
|
8
|
-
this.onChanged = new ArgEvent();
|
|
9
|
-
this._show = true;
|
|
10
|
-
this._progress = 0;
|
|
11
|
-
this._status = '';
|
|
12
|
-
this._error = '';
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Should a loading progress screen be shown?
|
|
16
|
-
*/
|
|
17
|
-
get show() {
|
|
18
|
-
return this._show;
|
|
19
|
-
}
|
|
20
|
-
set show(val) {
|
|
21
|
-
this._show = val;
|
|
22
|
-
this._emitChanged();
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Current progress of the load (0-100).
|
|
26
|
-
*/
|
|
27
|
-
get progress() {
|
|
28
|
-
return this._progress;
|
|
29
|
-
}
|
|
30
|
-
set progress(val) {
|
|
31
|
-
this._progress = val;
|
|
32
|
-
this._emitChanged();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Current status message of the load.
|
|
36
|
-
*/
|
|
37
|
-
get status() {
|
|
38
|
-
return this._status;
|
|
39
|
-
}
|
|
40
|
-
set status(val) {
|
|
41
|
-
this._status = val;
|
|
42
|
-
this._emitChanged();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Messsage to show when something bad occurs while loading (null for no error).
|
|
46
|
-
*/
|
|
47
|
-
get error() {
|
|
48
|
-
return this._error;
|
|
49
|
-
}
|
|
50
|
-
set error(val) {
|
|
51
|
-
this._error = val;
|
|
52
|
-
this._emitChanged();
|
|
53
|
-
}
|
|
54
|
-
get progressPercent() {
|
|
55
|
-
return this.progress / 100;
|
|
56
|
-
}
|
|
57
|
-
get message() {
|
|
58
|
-
return this.status;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Set all values of loading progress at once. Will emit a single changed event.
|
|
62
|
-
* @param progress Current progress of the load (0-100).
|
|
63
|
-
* @param status Current status message of the load.
|
|
64
|
-
* @param error Messsage to show when something bad occurs while loading. (null for no error)
|
|
65
|
-
*/
|
|
66
|
-
set(progress, status, error) {
|
|
67
|
-
this._progress = getOptionalValue(progress, 0);
|
|
68
|
-
this._status = getOptionalValue(status, '');
|
|
69
|
-
this._error = getOptionalValue(error, '');
|
|
70
|
-
this._emitChanged();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Creates a nested @see LoadingProgressCallback that can be used to relay progress from a child component into the parent.
|
|
74
|
-
* @param start The start progress percentage.
|
|
75
|
-
* @param end The end progress percentage.
|
|
76
|
-
*/
|
|
77
|
-
createNestedCallback(start, end) {
|
|
78
|
-
return (status) => {
|
|
79
|
-
let percent = status.progressPercent
|
|
80
|
-
? lerp(start, end, status.progressPercent)
|
|
81
|
-
: this.progress;
|
|
82
|
-
let message = status.message ? status.message : this.status;
|
|
83
|
-
let error = status.error ? status.error : this.error;
|
|
84
|
-
this.set(percent, message, error);
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Clone this object and all its current data.
|
|
89
|
-
*/
|
|
90
|
-
clone() {
|
|
91
|
-
let clone = new LoadingProgress();
|
|
92
|
-
clone._show = this._show;
|
|
93
|
-
clone._progress = this._progress;
|
|
94
|
-
clone._status = this._status;
|
|
95
|
-
clone._error = this._error;
|
|
96
|
-
return clone;
|
|
97
|
-
}
|
|
98
|
-
_emitChanged() {
|
|
99
|
-
this.onChanged.invoke(this);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function getOptionalValue(obj, defaultValue) {
|
|
103
|
-
return obj !== undefined && obj !== null ? obj : defaultValue;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=LoadingProgress.js.map
|
package/LoadingProgress.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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G,IAAI,CAAC,OAAO,CAAC;QAC7B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,YAAY;QAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACJ;AAED,SAAS,gBAAgB,CAAC,GAAQ,EAAE,YAAiB;IACjD,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC;AAClE,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Atom, CausalTree, TreeResult, WeaveResult, AtomCardinality } from '@casual-simulation/causal-trees/core2';
|
|
2
|
-
import { AuxOp } from './AuxOpTypes';
|
|
3
|
-
import { BotsState, PartialBotsState } from '../bots/Bot';
|
|
4
|
-
import { BotStateUpdates } from './AuxStateHelpers';
|
|
5
|
-
import { BotActions } from '../bots/BotEvents';
|
|
6
|
-
import { Action } from '@casual-simulation/causal-trees';
|
|
7
|
-
/**
|
|
8
|
-
* Defines an interface that represents the state of a causal tree that contains AUX state.
|
|
9
|
-
*/
|
|
10
|
-
export interface AuxCausalTree extends CausalTree<AuxOp> {
|
|
11
|
-
state: BotsState;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Defines an interface that represents an update from adding an atom to the tree.
|
|
15
|
-
*/
|
|
16
|
-
export interface AuxResult extends TreeResult {
|
|
17
|
-
update: PartialBotsState;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new AUX tree with the given ID.
|
|
21
|
-
* @param id The ID.
|
|
22
|
-
* @param remoteId The remote ID. If given true then a remote ID will be auto generated.
|
|
23
|
-
*/
|
|
24
|
-
export declare function auxTree(id?: string, remoteId?: string | boolean): AuxCausalTree;
|
|
25
|
-
/**
|
|
26
|
-
* Adds a new atom to the given tree with the given cause, operation, and priority.
|
|
27
|
-
* Returns a result that can be applied to the tree to get the updated state.
|
|
28
|
-
* @param tree The tree.
|
|
29
|
-
* @param cause The cause of the operation.
|
|
30
|
-
* @param op The operation.
|
|
31
|
-
* @param priority The priority.
|
|
32
|
-
* @param space The space that new bots should be placed in.
|
|
33
|
-
*/
|
|
34
|
-
export declare function addAuxAtom(tree: CausalTree<AuxOp>, cause: Atom<AuxOp>, op: AuxOp, priority?: number, space?: string, cardinality?: AtomCardinality): AuxResult;
|
|
35
|
-
/**
|
|
36
|
-
* Inserts the given atom into the given tree.
|
|
37
|
-
* @param tree The tree.
|
|
38
|
-
* @param atom The atom.
|
|
39
|
-
*/
|
|
40
|
-
export declare function insertAuxAtom(tree: AuxCausalTree, atom: Atom<AuxOp>): AuxResult;
|
|
41
|
-
/**
|
|
42
|
-
* Removes the atom with the given hash from the given tree.
|
|
43
|
-
* @param tree The tree.
|
|
44
|
-
* @param hash The atom hash.
|
|
45
|
-
*/
|
|
46
|
-
export declare function removeAuxAtom(tree: AuxCausalTree, hash: string): AuxResult;
|
|
47
|
-
/**
|
|
48
|
-
* Merges two AUX results into a single final result.
|
|
49
|
-
* @param first The first result.
|
|
50
|
-
* @param second The second result.
|
|
51
|
-
*/
|
|
52
|
-
export declare function mergeAuxResults(first: AuxResult, second: AuxResult): AuxResult;
|
|
53
|
-
/**
|
|
54
|
-
* Adds the results from the second result to the first result.
|
|
55
|
-
* @param first The first result.
|
|
56
|
-
* @param second The second result.
|
|
57
|
-
*/
|
|
58
|
-
export declare function addAuxResults(first: AuxResult, second: AuxResult): AuxResult;
|
|
59
|
-
/**
|
|
60
|
-
* Applies the given AuxResult to the tree.
|
|
61
|
-
* @param tree The tree.
|
|
62
|
-
* @param result The result.
|
|
63
|
-
*/
|
|
64
|
-
export declare function applyAuxResult(tree: AuxCausalTree, result: AuxResult): AuxCausalTree;
|
|
65
|
-
/**
|
|
66
|
-
* Gets the identity AuxResult.
|
|
67
|
-
* That is, an AuxResult that when merged with another AuxResult returns the other AuxResult.
|
|
68
|
-
*/
|
|
69
|
-
export declare function auxResultIdentity(): AuxResult;
|
|
70
|
-
/**
|
|
71
|
-
* Applies the given bot actions to the given tree.
|
|
72
|
-
* Returns the new tree and the list of updates that occurred.
|
|
73
|
-
* @param tree The tree that the events should be applied on top of.
|
|
74
|
-
* @param actions The actions that should be applied.
|
|
75
|
-
* @param space The space that new bots should be placed in.
|
|
76
|
-
*/
|
|
77
|
-
export declare function applyEvents(tree: AuxCausalTree, actions: BotActions[], space?: string): {
|
|
78
|
-
tree: AuxCausalTree;
|
|
79
|
-
updates: BotStateUpdates;
|
|
80
|
-
result: AuxResult;
|
|
81
|
-
actions: Action[];
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Applies the given atoms to the given tree.
|
|
85
|
-
* Returns the new tree and list of updates that occurred.
|
|
86
|
-
* @param tree The tree.
|
|
87
|
-
* @param atoms The atoms.
|
|
88
|
-
* @param removedAtoms The atoms that were removed.
|
|
89
|
-
* @param space The space that the bots should have.
|
|
90
|
-
* @param delta Whether the atoms are the initial atoms being added to the tree.
|
|
91
|
-
*/
|
|
92
|
-
export declare function applyAtoms(tree: AuxCausalTree, atoms?: Atom<AuxOp>[], removedAtoms?: string[], space?: string, initial?: boolean): {
|
|
93
|
-
tree: AuxCausalTree;
|
|
94
|
-
updates: BotStateUpdates;
|
|
95
|
-
results: WeaveResult[];
|
|
96
|
-
update: PartialBotsState;
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=AuxCausalTree2.d.ts.map
|