@replit/river 0.205.2 → 0.206.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.
Files changed (45) hide show
  1. package/dist/{chunk-TP4OJAKI.js → chunk-EMOYAUX3.js} +3 -3
  2. package/dist/{chunk-W337YQLT.js → chunk-FCQWZRES.js} +3 -3
  3. package/dist/{chunk-FTOB2HQN.js → chunk-JSU537MZ.js} +2 -2
  4. package/dist/{chunk-BYA34LH3.js → chunk-NTVJNU5K.js} +14 -18
  5. package/dist/chunk-NTVJNU5K.js.map +1 -0
  6. package/dist/{chunk-FCN2JPOE.js → chunk-VGWFMCOP.js} +2 -2
  7. package/dist/{connection-8ed39cb5.d.ts → connection-494a5b68.d.ts} +2 -2
  8. package/dist/logging/index.d.cts +1 -1
  9. package/dist/logging/index.d.ts +1 -1
  10. package/dist/{message-865bba35.d.ts → message-ffacb98a.d.ts} +1 -1
  11. package/dist/router/index.cjs +13 -17
  12. package/dist/router/index.cjs.map +1 -1
  13. package/dist/router/index.d.cts +5 -8
  14. package/dist/router/index.d.ts +5 -8
  15. package/dist/router/index.js +1 -1
  16. package/dist/{services-036dcc97.d.ts → services-15a0df95.d.ts} +731 -9
  17. package/dist/testUtil/index.cjs +1 -1
  18. package/dist/testUtil/index.cjs.map +1 -1
  19. package/dist/testUtil/index.d.cts +3 -5
  20. package/dist/testUtil/index.d.ts +3 -5
  21. package/dist/testUtil/index.js +4 -4
  22. package/dist/transport/impls/ws/client.cjs +1 -1
  23. package/dist/transport/impls/ws/client.cjs.map +1 -1
  24. package/dist/transport/impls/ws/client.d.cts +3 -4
  25. package/dist/transport/impls/ws/client.d.ts +3 -4
  26. package/dist/transport/impls/ws/client.js +4 -4
  27. package/dist/transport/impls/ws/server.cjs +1 -1
  28. package/dist/transport/impls/ws/server.cjs.map +1 -1
  29. package/dist/transport/impls/ws/server.d.cts +4 -4
  30. package/dist/transport/impls/ws/server.d.ts +4 -4
  31. package/dist/transport/impls/ws/server.js +4 -4
  32. package/dist/transport/index.cjs +1 -1
  33. package/dist/transport/index.cjs.map +1 -1
  34. package/dist/transport/index.d.cts +72 -5
  35. package/dist/transport/index.d.ts +72 -5
  36. package/dist/transport/index.js +4 -4
  37. package/package.json +1 -1
  38. package/dist/chunk-BYA34LH3.js.map +0 -1
  39. package/dist/client-8ab60722.d.ts +0 -54
  40. package/dist/context-2c4bb66b.d.ts +0 -670
  41. package/dist/server-dc261419.d.ts +0 -70
  42. /package/dist/{chunk-TP4OJAKI.js.map → chunk-EMOYAUX3.js.map} +0 -0
  43. /package/dist/{chunk-W337YQLT.js.map → chunk-FCQWZRES.js.map} +0 -0
  44. /package/dist/{chunk-FTOB2HQN.js.map → chunk-JSU537MZ.js.map} +0 -0
  45. /package/dist/{chunk-FCN2JPOE.js.map → chunk-VGWFMCOP.js.map} +0 -0
@@ -69,6 +69,10 @@ function castTypeboxValueErrors(errors) {
69
69
  }
70
70
  return result;
71
71
  }
72
+ var CancelResultSchema = import_typebox.Type.Object({
73
+ code: import_typebox.Type.Literal(CANCEL_CODE),
74
+ message: import_typebox.Type.String()
75
+ });
72
76
  var ReaderErrorSchema = import_typebox.Type.Union([
73
77
  import_typebox.Type.Object({
74
78
  code: import_typebox.Type.Literal(UNCAUGHT_ERROR_CODE),
@@ -88,10 +92,7 @@ var ReaderErrorSchema = import_typebox.Type.Union([
88
92
  })
89
93
  )
90
94
  }),
91
- import_typebox.Type.Object({
92
- code: import_typebox.Type.Literal(CANCEL_CODE),
93
- message: import_typebox.Type.String()
94
- })
95
+ CancelResultSchema
95
96
  ]);
96
97
  function isUnion(schema) {
97
98
  return schema[import_typebox.Kind] === "Union";
@@ -1184,7 +1185,6 @@ async function getSingleMessage(resReadable, log) {
1184
1185
  }
1185
1186
 
1186
1187
  // router/server.ts
1187
- var import_typebox6 = require("@sinclair/typebox");
1188
1188
  var import_value2 = require("@sinclair/typebox/value");
1189
1189
 
1190
1190
  // transport/stringifyError.ts
@@ -1196,12 +1196,6 @@ function coerceErrorString(err) {
1196
1196
  }
1197
1197
 
1198
1198
  // router/server.ts
1199
- var CancelResultSchema = ErrResultSchema(
1200
- import_typebox6.Type.Object({
1201
- code: import_typebox6.Type.Literal(CANCEL_CODE),
1202
- message: import_typebox6.Type.String()
1203
- })
1204
- );
1205
1199
  var RiverServer = class {
1206
1200
  transport;
1207
1201
  contextMap;
@@ -1343,7 +1337,7 @@ var RiverServer = class {
1343
1337
  if (isStreamCancelBackwardsCompat(msg.controlFlags, protocolVersion)) {
1344
1338
  let cancelResult;
1345
1339
  if (import_value2.Value.Check(CancelResultSchema, msg.payload)) {
1346
- cancelResult = msg.payload;
1340
+ cancelResult = Err(msg.payload);
1347
1341
  } else {
1348
1342
  cancelResult = Err({
1349
1343
  code: CANCEL_CODE,
@@ -1545,11 +1539,13 @@ var RiverServer = class {
1545
1539
  sessionId,
1546
1540
  metadata: sessionMetadata,
1547
1541
  span: span2,
1548
- cancel: () => {
1549
- onServerCancel({
1542
+ cancel: (message) => {
1543
+ const errRes = {
1550
1544
  code: CANCEL_CODE,
1551
- message: "cancelled by server procedure handler"
1552
- });
1545
+ message: message ?? "cancelled by server procedure handler"
1546
+ };
1547
+ onServerCancel(errRes);
1548
+ return Err(errRes);
1553
1549
  },
1554
1550
  signal: finishedController.signal
1555
1551
  });
@@ -1886,7 +1882,7 @@ function createServerHandshakeOptions(schema, validate) {
1886
1882
  }
1887
1883
 
1888
1884
  // package.json
1889
- var version = "0.205.2";
1885
+ var version = "0.206.0";
1890
1886
  // Annotate the CommonJS export names for ESM import in node:
1891
1887
  0 && (module.exports = {
1892
1888
  CANCEL_CODE,