accelr8 3.1.1 → 3.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.
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/protocol.ts
4
+ var VERSION = true ? "3.2.0" : "3.2.0";
5
+ var PROTO = 3;
6
+ var PORT = 8787;
7
+ var DEFAULT_SERVER = "wss://accelr8-canvas.patonchain.workers.dev";
8
+ var CANVAS_W = 100;
9
+ var CANVAS_H = 30;
10
+ var LIMITS = {
11
+ chatMaxCp: 4e3,
12
+ // code points per chat message
13
+ chatMaxJson: 8192,
14
+ // serialized bytes per chat message
15
+ chatPerWindow: 10,
16
+ // messages per 10s per session
17
+ chatTail: 50,
18
+ // messages delivered in `joined`
19
+ chatPage: 50,
20
+ // default history page (max 100)
21
+ chatSyncMaxGap: 200,
22
+ // bigger gap -> full resync
23
+ chatRetain: 2e3,
24
+ // messages kept per project
25
+ draftMinIntervalMs: 100,
26
+ // server drops faster arrivals
27
+ draftMaxCp: 4e3,
28
+ framesPerWindow: 200,
29
+ // frames per 10s per session -> disconnect
30
+ invokesPerProjectMin: 20,
31
+ triggersPerUserMin: 6,
32
+ joinGuessesPerMin: 5,
33
+ revealsPerMin: 10,
34
+ secretsPerProject: 50,
35
+ secretValueMax: 8192,
36
+ agentQueueCap: 5,
37
+ agentMaxDepth: 3,
38
+ agentBudgetPerTrigger: 5,
39
+ agentRepeatPerChain: 2,
40
+ voiceFramesPerSec: 50,
41
+ // ~25/s real, 2x headroom; exempt from framesPerWindow
42
+ voiceFrameMaxB64: 4096
43
+ // a 40ms s16le mono chunk is ~1.7KB base64; cap slack
44
+ };
45
+ var DEFAULT_ACCESS = { mode: "owner", users: [] };
46
+ function encode(msg) {
47
+ return JSON.stringify(msg);
48
+ }
49
+ function decode(data) {
50
+ return JSON.parse(data);
51
+ }
52
+
53
+ export {
54
+ VERSION,
55
+ PROTO,
56
+ PORT,
57
+ DEFAULT_SERVER,
58
+ CANVAS_W,
59
+ CANVAS_H,
60
+ LIMITS,
61
+ DEFAULT_ACCESS,
62
+ encode,
63
+ decode
64
+ };