tempest.games 0.2.100 → 0.2.102

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.
@@ -3157,32 +3157,34 @@ var ParentSocket = class extends CustomSocket {
3157
3157
  this.id = this.proc.pid?.toString();
3158
3158
  this.on(`user-joins`, (userKey) => {
3159
3159
  this.logger.info(`\uD83D\uDC64`, userKey, `joined`);
3160
+ if (this.relays.get(userKey))
3161
+ return;
3160
3162
  const relay = new SubjectSocket(userKey);
3161
3163
  this.relays.set(userKey, relay);
3162
- this.logger.info(`\uD83D\uDD17`, `attaching services for user`, userKey);
3164
+ this.logger.info(`\uD83D\uDD17`, `attaching relay services for`, userKey);
3163
3165
  const cleanupRelay = this.initRelay(relay, userKey);
3164
3166
  if (cleanupRelay)
3165
3167
  relay.disposalFunctions.push(cleanupRelay);
3166
3168
  this.on(userKey, (...data) => {
3167
3169
  relay.in.next(data);
3168
3170
  });
3169
- relay.out.subscribe(`socket`, (data) => {
3170
- this.emit(...data);
3171
- });
3171
+ relay.disposalFunctions.push(relay.out.subscribe(`socket`, (data) => {
3172
+ this.emit(userKey, ...data);
3173
+ }));
3172
3174
  });
3173
- this.on(`user-leaves`, (username) => {
3174
- const relay = this.relays.get(username);
3175
- this.off(`relay:${username}`);
3175
+ this.on(`user-leaves`, (userKey) => {
3176
+ const relay = this.relays.get(userKey);
3177
+ this.off(userKey);
3176
3178
  if (relay) {
3177
3179
  relay.dispose();
3178
- this.relays.delete(username);
3180
+ this.relays.delete(userKey);
3179
3181
  }
3180
3182
  });
3181
3183
  this.proc.stdout.write(PROOF_OF_LIFE_SIGNAL);
3182
3184
  }
3183
3185
  receiveRelay(attachServices) {
3184
- this.logger.info(`\uD83D\uDD17`, `running relay method`);
3185
3186
  this.initRelay = attachServices;
3187
+ this.logger.info(`\uD83D\uDD17`, `ready to relay`);
3186
3188
  }
3187
3189
  };
3188
3190
  var ChildSocket = class extends CustomSocket {
@@ -3246,6 +3248,7 @@ var ChildSocket = class extends CustomSocket {
3246
3248
  continue;
3247
3249
  try {
3248
3250
  const jsonPiece = parseJson(piece);
3251
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, jsonPiece);
3249
3252
  this.handleEvent(...jsonPiece);
3250
3253
  this.incompleteData = ``;
3251
3254
  } catch (thrown0) {
@@ -3264,6 +3267,7 @@ var ChildSocket = class extends CustomSocket {
3264
3267
  if (idx === 0) {
3265
3268
  this.incompleteData = piece;
3266
3269
  const maybeActualJsonPiece = parseJson(initialMaybeWellFormed);
3270
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, maybeActualJsonPiece);
3267
3271
  this.handleEvent(...maybeActualJsonPiece);
3268
3272
  this.incompleteData = ``;
3269
3273
  } else
@@ -3275,32 +3275,34 @@ var ParentSocket = class extends CustomSocket {
3275
3275
  this.id = this.proc.pid?.toString();
3276
3276
  this.on(`user-joins`, (userKey) => {
3277
3277
  this.logger.info(`\uD83D\uDC64`, userKey, `joined`);
3278
+ if (this.relays.get(userKey))
3279
+ return;
3278
3280
  const relay = new SubjectSocket(userKey);
3279
3281
  this.relays.set(userKey, relay);
3280
- this.logger.info(`\uD83D\uDD17`, `attaching services for user`, userKey);
3282
+ this.logger.info(`\uD83D\uDD17`, `attaching relay services for`, userKey);
3281
3283
  const cleanupRelay = this.initRelay(relay, userKey);
3282
3284
  if (cleanupRelay)
3283
3285
  relay.disposalFunctions.push(cleanupRelay);
3284
3286
  this.on(userKey, (...data) => {
3285
3287
  relay.in.next(data);
3286
3288
  });
3287
- relay.out.subscribe(`socket`, (data) => {
3288
- this.emit(...data);
3289
- });
3289
+ relay.disposalFunctions.push(relay.out.subscribe(`socket`, (data) => {
3290
+ this.emit(userKey, ...data);
3291
+ }));
3290
3292
  });
3291
- this.on(`user-leaves`, (username) => {
3292
- const relay = this.relays.get(username);
3293
- this.off(`relay:${username}`);
3293
+ this.on(`user-leaves`, (userKey) => {
3294
+ const relay = this.relays.get(userKey);
3295
+ this.off(userKey);
3294
3296
  if (relay) {
3295
3297
  relay.dispose();
3296
- this.relays.delete(username);
3298
+ this.relays.delete(userKey);
3297
3299
  }
3298
3300
  });
3299
3301
  this.proc.stdout.write(PROOF_OF_LIFE_SIGNAL);
3300
3302
  }
3301
3303
  receiveRelay(attachServices) {
3302
- this.logger.info(`\uD83D\uDD17`, `running relay method`);
3303
3304
  this.initRelay = attachServices;
3305
+ this.logger.info(`\uD83D\uDD17`, `ready to relay`);
3304
3306
  }
3305
3307
  };
3306
3308
  var ChildSocket = class extends CustomSocket {
@@ -3364,6 +3366,7 @@ var ChildSocket = class extends CustomSocket {
3364
3366
  continue;
3365
3367
  try {
3366
3368
  const jsonPiece = parseJson(piece);
3369
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, jsonPiece);
3367
3370
  this.handleEvent(...jsonPiece);
3368
3371
  this.incompleteData = ``;
3369
3372
  } catch (thrown0) {
@@ -3382,6 +3385,7 @@ var ChildSocket = class extends CustomSocket {
3382
3385
  if (idx === 0) {
3383
3386
  this.incompleteData = piece;
3384
3387
  const maybeActualJsonPiece = parseJson(initialMaybeWellFormed);
3388
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, maybeActualJsonPiece);
3385
3389
  this.handleEvent(...maybeActualJsonPiece);
3386
3390
  this.incompleteData = ``;
3387
3391
  } else
@@ -16897,7 +16901,7 @@ function date4(params) {
16897
16901
 
16898
16902
  // ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/external.js
16899
16903
  config(en_default());
16900
- // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__73d64c8a7d5609e68956a108f5015724/node_modules/safegen/dist/safegen-DHhNOdib.js
16904
+ // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__e4a61318744067d8702021155ca480a3/node_modules/safegen/dist/safegen-DHhNOdib.js
16901
16905
  function createSafeDataGenerator(gen, logger) {
16902
16906
  return function generateFromSchema({ schema, fallback, toJsonSchema = exports_external.toJSONSchema }) {
16903
16907
  const jsonSchema = toJsonSchema(schema);
@@ -16929,7 +16933,7 @@ function jsonSchemaToInstruction(jsonSchema) {
16929
16933
  `);
16930
16934
  }
16931
16935
 
16932
- // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__73d64c8a7d5609e68956a108f5015724/node_modules/safegen/dist/primitives-DeHVhToL.js
16936
+ // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__e4a61318744067d8702021155ca480a3/node_modules/safegen/dist/primitives-DeHVhToL.js
16933
16937
  function formatIssue(prompt, actual, issue2, consequence) {
16934
16938
  const lines = [
16935
16939
  `SafeGen saw that invalid data was produced for the prompt:`,
@@ -24075,7 +24079,7 @@ var _deployments_endpoints = new Set([
24075
24079
  "/batches",
24076
24080
  "/images/edits"
24077
24081
  ]);
24078
- // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__73d64c8a7d5609e68956a108f5015724/node_modules/safegen/dist/openai/index.js
24082
+ // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__e4a61318744067d8702021155ca480a3/node_modules/safegen/dist/openai/index.js
24079
24083
  function buildOpenAiRequestParams(model, ...params) {
24080
24084
  const [instruction, jsonSchema, _, previouslyFailedResponses] = params;
24081
24085
  const messages = [{
@@ -46114,7 +46118,7 @@ async function getLogs(logger, logFilePath = `/var/log/nginx/access.log`, now =
46114
46118
  });
46115
46119
  }
46116
46120
 
46117
- // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__73d64c8a7d5609e68956a108f5015724/node_modules/safegen/dist/arktype/index.js
46121
+ // ../../node_modules/.pnpm/safegen@0.8.3_@floating-ui+react-dom@2.1.6_react-dom@19.2.3_react@19.2.3__react@19.2.3__e4a61318744067d8702021155ca480a3/node_modules/safegen/dist/arktype/index.js
46118
46122
  function arktypeToJsonSchema(type2) {
46119
46123
  return type2.toJsonSchema();
46120
46124
  }
@@ -11726,32 +11726,34 @@ var ParentSocket = class extends CustomSocket {
11726
11726
  this.id = this.proc.pid?.toString();
11727
11727
  this.on(`user-joins`, (userKey) => {
11728
11728
  this.logger.info(`\uD83D\uDC64`, userKey, `joined`);
11729
+ if (this.relays.get(userKey))
11730
+ return;
11729
11731
  const relay = new SubjectSocket(userKey);
11730
11732
  this.relays.set(userKey, relay);
11731
- this.logger.info(`\uD83D\uDD17`, `attaching services for user`, userKey);
11733
+ this.logger.info(`\uD83D\uDD17`, `attaching relay services for`, userKey);
11732
11734
  const cleanupRelay = this.initRelay(relay, userKey);
11733
11735
  if (cleanupRelay)
11734
11736
  relay.disposalFunctions.push(cleanupRelay);
11735
11737
  this.on(userKey, (...data) => {
11736
11738
  relay.in.next(data);
11737
11739
  });
11738
- relay.out.subscribe(`socket`, (data) => {
11739
- this.emit(...data);
11740
- });
11740
+ relay.disposalFunctions.push(relay.out.subscribe(`socket`, (data) => {
11741
+ this.emit(userKey, ...data);
11742
+ }));
11741
11743
  });
11742
- this.on(`user-leaves`, (username) => {
11743
- const relay = this.relays.get(username);
11744
- this.off(`relay:${username}`);
11744
+ this.on(`user-leaves`, (userKey) => {
11745
+ const relay = this.relays.get(userKey);
11746
+ this.off(userKey);
11745
11747
  if (relay) {
11746
11748
  relay.dispose();
11747
- this.relays.delete(username);
11749
+ this.relays.delete(userKey);
11748
11750
  }
11749
11751
  });
11750
11752
  this.proc.stdout.write(PROOF_OF_LIFE_SIGNAL);
11751
11753
  }
11752
11754
  receiveRelay(attachServices) {
11753
- this.logger.info(`\uD83D\uDD17`, `running relay method`);
11754
11755
  this.initRelay = attachServices;
11756
+ this.logger.info(`\uD83D\uDD17`, `ready to relay`);
11755
11757
  }
11756
11758
  };
11757
11759
  var ChildSocket = class extends CustomSocket {
@@ -11815,6 +11817,7 @@ var ChildSocket = class extends CustomSocket {
11815
11817
  continue;
11816
11818
  try {
11817
11819
  const jsonPiece = parseJson2(piece);
11820
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, jsonPiece);
11818
11821
  this.handleEvent(...jsonPiece);
11819
11822
  this.incompleteData = ``;
11820
11823
  } catch (thrown0) {
@@ -11833,6 +11836,7 @@ var ChildSocket = class extends CustomSocket {
11833
11836
  if (idx === 0) {
11834
11837
  this.incompleteData = piece;
11835
11838
  const maybeActualJsonPiece = parseJson2(initialMaybeWellFormed);
11839
+ this.logger.info(`\uD83D\uDCB8`, `emitted`, maybeActualJsonPiece);
11836
11840
  this.handleEvent(...maybeActualJsonPiece);
11837
11841
  this.incompleteData = ``;
11838
11842
  } else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tempest.games",
3
- "version": "0.2.100",
3
+ "version": "0.2.102",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,8 +29,8 @@
29
29
  "@js-temporal/polyfill": "0.5.1",
30
30
  "@react-email/components": "1.0.2",
31
31
  "@t3-oss/env-core": "0.13.10",
32
- "@trpc/client": "11.8.0",
33
- "@trpc/server": "11.8.0",
32
+ "@trpc/client": "11.8.1",
33
+ "@trpc/server": "11.8.1",
34
34
  "arktype": "2.1.29",
35
35
  "cron": "4.4.0",
36
36
  "drizzle-orm": "0.45.1",
@@ -43,9 +43,9 @@
43
43
  "react-email": "5.1.0",
44
44
  "resend": "6.6.0",
45
45
  "safegen": "0.8.3",
46
- "socket.io": "4.8.1",
47
- "socket.io-client": "4.8.1",
48
- "atom.io": "0.46.8",
46
+ "socket.io": "4.8.3",
47
+ "socket.io-client": "4.8.3",
48
+ "atom.io": "0.46.10",
49
49
  "safedeposit": "0.1.2",
50
50
  "treetrunks": "0.1.5"
51
51
  },
@@ -69,7 +69,7 @@
69
69
  "sass-embedded": "1.97.1",
70
70
  "vite": "7.3.0",
71
71
  "vitest": "4.0.16",
72
- "flightdeck": "0.3.28",
72
+ "flightdeck": "0.3.30",
73
73
  "varmint": "0.5.11"
74
74
  },
75
75
  "scripts": {