@rei-standard/amsg-server 2.6.0-next.2 → 2.6.0-next.21

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 (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +599 -24
  3. package/dist/adapters/d1.d.ts +416 -0
  4. package/dist/adapters/factory.d.ts +39 -0
  5. package/dist/adapters/interface.d.ts +306 -0
  6. package/dist/adapters/neon.d.ts +88 -0
  7. package/dist/adapters/pg-shared.d.ts +161 -0
  8. package/dist/adapters/pg.d.ts +84 -0
  9. package/dist/adapters/schema.d.ts +57 -0
  10. package/dist/adapters/schema.sqlite.d.ts +49 -0
  11. package/dist/chunk-7NMQFTDJ.cjs +148 -0
  12. package/dist/chunk-E7OWP3VL.cjs +135 -0
  13. package/dist/chunk-GN44PST5.mjs +148 -0
  14. package/dist/chunk-KOJQVOYS.mjs +5847 -0
  15. package/dist/chunk-QHVID3V2.cjs +5847 -0
  16. package/dist/chunk-ZGGF4GMA.mjs +135 -0
  17. package/dist/cloudflare/single-user-worker.d.ts +37 -0
  18. package/dist/cloudflare.cjs +39 -2
  19. package/dist/cloudflare.d.ts +10 -2
  20. package/dist/cloudflare.mjs +40 -3
  21. package/dist/handlers/cancel-message.d.ts +3 -0
  22. package/dist/handlers/capabilities.d.ts +4 -0
  23. package/dist/handlers/client-state.d.ts +7 -0
  24. package/dist/handlers/get-message.d.ts +3 -0
  25. package/dist/handlers/get-user-key.d.ts +3 -0
  26. package/dist/handlers/init-tenant.d.ts +23 -0
  27. package/dist/handlers/llm-credentials.d.ts +5 -0
  28. package/dist/handlers/messages.d.ts +3 -0
  29. package/dist/handlers/outbox.d.ts +7 -0
  30. package/dist/handlers/push-subscription.d.ts +5 -0
  31. package/dist/handlers/schedule-message.d.ts +3 -0
  32. package/dist/handlers/send-notifications.d.ts +3 -0
  33. package/dist/handlers/single-user-init.d.ts +13 -0
  34. package/dist/handlers/update-message.d.ts +3 -0
  35. package/dist/handlers/vapid-public-key.d.ts +19 -0
  36. package/dist/index.cjs +133 -44
  37. package/dist/index.d.cts +131 -766
  38. package/dist/index.d.ts +131 -766
  39. package/dist/index.mjs +125 -36
  40. package/dist/lib/agentic-fire.d.ts +108 -0
  41. package/dist/lib/client-state-store.d.ts +80 -0
  42. package/dist/lib/constant-time.d.ts +14 -0
  43. package/dist/lib/db-errors.d.ts +10 -0
  44. package/dist/lib/encryption.d.ts +48 -0
  45. package/dist/lib/errors.d.ts +215 -0
  46. package/dist/lib/llm-credentials-store.d.ts +147 -0
  47. package/dist/lib/llm.d.ts +1 -0
  48. package/dist/lib/message-processor.d.ts +73 -0
  49. package/dist/lib/outbox-store.d.ts +95 -0
  50. package/dist/lib/push-subscription-store.d.ts +94 -0
  51. package/dist/lib/recurrence.d.ts +51 -0
  52. package/dist/lib/request.d.ts +182 -0
  53. package/dist/lib/result-emitter.d.ts +54 -0
  54. package/dist/lib/run-tick.d.ts +115 -0
  55. package/dist/lib/schema-version.d.ts +50 -0
  56. package/dist/lib/state-accessors.d.ts +70 -0
  57. package/dist/lib/state-chunks.d.ts +55 -0
  58. package/dist/lib/task-projection.d.ts +92 -0
  59. package/dist/lib/validation.d.ts +97 -0
  60. package/dist/lib/version.d.ts +7 -0
  61. package/dist/lib/webcrypto-utils.d.ts +1 -0
  62. package/dist/lib/webpush-webcrypto.d.ts +78 -0
  63. package/dist/{neon-BFUS25UX.cjs → neon-KP2CPA57.cjs} +110 -10
  64. package/dist/{neon-CU5N3CSW.mjs → neon-ZIMHALYI.mjs} +106 -6
  65. package/dist/{pg-QO6NKTGL.mjs → pg-QGC2XHUT.mjs} +94 -5
  66. package/dist/{pg-IIH3M4OM.cjs → pg-RZPQGXR3.cjs} +98 -9
  67. package/dist/single-user.d.ts +95 -0
  68. package/dist/tenant/blob-store.d.ts +30 -0
  69. package/dist/tenant/context.d.ts +47 -0
  70. package/dist/tenant/single-user-context.d.ts +29 -0
  71. package/dist/tenant/token.d.ts +26 -0
  72. package/package.json +3 -3
  73. package/dist/chunk-5ENJGVZX.mjs +0 -72
  74. package/dist/chunk-GN5QTMCL.cjs +0 -1870
  75. package/dist/chunk-PVNLB6TF.mjs +0 -1870
  76. package/dist/chunk-RGECD4OH.cjs +0 -72
  77. package/dist/cloudflare-B-E51VjP.d.cts +0 -2848
  78. package/dist/cloudflare-B-E51VjP.d.ts +0 -2848
  79. package/dist/cloudflare.d.cts +0 -2
  80. package/dist/neon-CJl66EGy.d.cts +0 -251
  81. package/dist/neon-DYvGnCzx.d.ts +0 -251
  82. package/dist/pg-07S-u_H4.d.cts +0 -246
  83. package/dist/pg-Du-pN_UT.d.ts +0 -246
  84. package/dist/schema-C8OnYk6j.d.cts +0 -74
  85. package/dist/schema-C8OnYk6j.d.ts +0 -74
package/dist/index.cjs CHANGED
@@ -23,7 +23,56 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkGN5QTMCLcjs = require('./chunk-GN5QTMCL.cjs');
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ var _chunkQHVID3V2cjs = require('./chunk-QHVID3V2.cjs');
75
+ require('./chunk-7NMQFTDJ.cjs');
27
76
 
28
77
  // src/server/adapters/factory.js
29
78
  async function createAdapter(config) {
@@ -39,11 +88,11 @@ async function createAdapter(config) {
39
88
  }
40
89
  switch (config.driver) {
41
90
  case "neon": {
42
- const { NeonAdapter } = await Promise.resolve().then(() => _interopRequireWildcard(require("./neon-BFUS25UX.cjs")));
91
+ const { NeonAdapter } = await Promise.resolve().then(() => _interopRequireWildcard(require("./neon-KP2CPA57.cjs")));
43
92
  return new NeonAdapter(config.connectionString);
44
93
  }
45
94
  case "pg": {
46
- const { PgAdapter } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pg-IIH3M4OM.cjs")));
95
+ const { PgAdapter } = await Promise.resolve().then(() => _interopRequireWildcard(require("./pg-RZPQGXR3.cjs")));
47
96
  return new PgAdapter(config.connectionString);
48
97
  }
49
98
  default:
@@ -56,7 +105,7 @@ async function createAdapter(config) {
56
105
  // src/server/handlers/init-tenant.js
57
106
  function createInitTenantHandler(ctx) {
58
107
  async function POST(headers, body) {
59
- const initSecret = _chunkGN5QTMCLcjs.getHeader.call(void 0, headers, "x-init-secret");
108
+ const initSecret = _chunkQHVID3V2cjs.getHeader.call(void 0, headers, "x-init-secret");
60
109
  if (ctx.tenant.initSecret && initSecret !== ctx.tenant.initSecret) {
61
110
  return {
62
111
  status: 401,
@@ -69,7 +118,7 @@ function createInitTenantHandler(ctx) {
69
118
  }
70
119
  };
71
120
  }
72
- const parsed = _chunkGN5QTMCLcjs.parseJsonBody.call(void 0, body);
121
+ const parsed = _chunkQHVID3V2cjs.parseJsonBody.call(void 0, body);
73
122
  if (!parsed.ok) {
74
123
  return {
75
124
  status: 400,
@@ -83,7 +132,7 @@ function createInitTenantHandler(ctx) {
83
132
  const tenantId = payload.tenantId || void 0;
84
133
  const driver = payload.driver;
85
134
  const databaseUrl = payload.databaseUrl || payload.connectionString;
86
- if (tenantId && !_chunkGN5QTMCLcjs.isValidUUIDv4.call(void 0, tenantId)) {
135
+ if (tenantId && !_chunkQHVID3V2cjs.isValidUUIDv4.call(void 0, tenantId)) {
87
136
  return {
88
137
  status: 400,
89
138
  body: {
@@ -203,7 +252,7 @@ function createSendNotificationsHandler(ctx) {
203
252
  }
204
253
  };
205
254
  }
206
- const data = await _chunkGN5QTMCLcjs.runScheduledTick.call(void 0, { ...ctx, db, masterKey });
255
+ const data = await _chunkQHVID3V2cjs.runScheduledTick.call(void 0, { ...ctx, db, masterKey });
207
256
  return { status: 200, body: { success: true, data } };
208
257
  }
209
258
  return { POST };
@@ -212,14 +261,6 @@ function createSendNotificationsHandler(ctx) {
212
261
  // src/server/tenant/blob-store.js
213
262
  var _crypto = require('crypto');
214
263
  var inMemoryNamespaces = /* @__PURE__ */ new Map();
215
- function base64UrlEncode(input) {
216
- return Buffer.from(input).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
217
- }
218
- function base64UrlDecode(input) {
219
- const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
220
- const padLength = (4 - normalized.length % 4) % 4;
221
- return Buffer.from(normalized + "=".repeat(padLength), "base64");
222
- }
223
264
  function getKekBuffer(kek) {
224
265
  const value = String(kek || "").trim();
225
266
  if (!value) {
@@ -233,16 +274,16 @@ function encryptConfig(config, kekBuffer) {
233
274
  const plaintext = Buffer.from(JSON.stringify(config), "utf8");
234
275
  const ciphertext = Buffer.concat([cipher.update(plaintext), cipher.final()]);
235
276
  const authTag = cipher.getAuthTag();
236
- return `v1.${base64UrlEncode(iv)}.${base64UrlEncode(authTag)}.${base64UrlEncode(ciphertext)}`;
277
+ return `v1.${_chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, iv)}.${_chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, authTag)}.${_chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, ciphertext)}`;
237
278
  }
238
279
  function decryptConfig(encrypted, kekBuffer) {
239
280
  const parts = String(encrypted || "").split(".");
240
281
  if (parts.length !== 4 || parts[0] !== "v1") {
241
282
  throw new Error("INVALID_TENANT_CONFIG");
242
283
  }
243
- const iv = base64UrlDecode(parts[1]);
244
- const authTag = base64UrlDecode(parts[2]);
245
- const ciphertext = base64UrlDecode(parts[3]);
284
+ const iv = _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, parts[1]);
285
+ const authTag = _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, parts[2]);
286
+ const ciphertext = _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, parts[3]);
246
287
  const decipher = _crypto.createDecipheriv.call(void 0, "aes-256-gcm", kekBuffer, iv);
247
288
  decipher.setAuthTag(authTag);
248
289
  const plaintext = Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8");
@@ -309,16 +350,8 @@ function createTenantBlobStore(options) {
309
350
 
310
351
  // src/server/tenant/token.js
311
352
 
312
- function base64UrlEncode2(input) {
313
- return Buffer.from(input).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
314
- }
315
- function base64UrlDecode2(input) {
316
- const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
317
- const padLength = (4 - normalized.length % 4) % 4;
318
- return Buffer.from(normalized + "=".repeat(padLength), "base64");
319
- }
320
353
  function sign(input, secret) {
321
- return base64UrlEncode2(_crypto.createHmac.call(void 0, "sha256", secret).update(input).digest());
354
+ return _chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, _crypto.createHmac.call(void 0, "sha256", secret).update(input).digest());
322
355
  }
323
356
  function nowEpochSeconds() {
324
357
  return Math.floor(Date.now() / 1e3);
@@ -334,8 +367,8 @@ function createTenantToken(params, secret) {
334
367
  v: 1
335
368
  };
336
369
  const header = { alg: "HS256", typ: "JWT" };
337
- const encodedHeader = base64UrlEncode2(JSON.stringify(header));
338
- const encodedPayload = base64UrlEncode2(JSON.stringify(payload));
370
+ const encodedHeader = _chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, _chunkQHVID3V2cjs.utf8.call(void 0, JSON.stringify(header)));
371
+ const encodedPayload = _chunkQHVID3V2cjs.bytesToBase64Url.call(void 0, _chunkQHVID3V2cjs.utf8.call(void 0, JSON.stringify(payload)));
339
372
  const signingInput = `${encodedHeader}.${encodedPayload}`;
340
373
  const signature = sign(signingInput, secret);
341
374
  return `${signingInput}.${signature}`;
@@ -351,20 +384,20 @@ function verifyTenantToken(token, secret, options = {}) {
351
384
  const [encodedHeader, encodedPayload, receivedSignature] = parts;
352
385
  const signingInput = `${encodedHeader}.${encodedPayload}`;
353
386
  const expectedSignature = sign(signingInput, secret);
354
- let receivedBuffer;
355
- let expectedBuffer;
387
+ let receivedBytes;
388
+ let expectedBytes;
356
389
  try {
357
- receivedBuffer = base64UrlDecode2(receivedSignature);
358
- expectedBuffer = base64UrlDecode2(expectedSignature);
390
+ receivedBytes = _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, receivedSignature);
391
+ expectedBytes = _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, expectedSignature);
359
392
  } catch (e) {
360
393
  throw new Error("INVALID_TENANT_AUTH");
361
394
  }
362
- if (receivedBuffer.length !== expectedBuffer.length || !_crypto.timingSafeEqual.call(void 0, receivedBuffer, expectedBuffer)) {
395
+ if (!_chunkQHVID3V2cjs.timingSafeEqualBytes.call(void 0, receivedBytes, expectedBytes)) {
363
396
  throw new Error("INVALID_TENANT_AUTH");
364
397
  }
365
398
  let payload;
366
399
  try {
367
- payload = JSON.parse(base64UrlDecode2(encodedPayload).toString("utf8"));
400
+ payload = JSON.parse(_chunkQHVID3V2cjs.utf8Decode.call(void 0, _chunkQHVID3V2cjs.base64UrlToBytes.call(void 0, encodedPayload)));
368
401
  } catch (e2) {
369
402
  throw new Error("INVALID_TENANT_AUTH");
370
403
  }
@@ -438,8 +471,17 @@ function createTenantContextManager(options) {
438
471
  async function getOrCreateAdapter(dbConfig) {
439
472
  const cacheKey = `${dbConfig.driver}:${dbConfig.connectionString}`;
440
473
  if (!adapterCache.has(cacheKey)) {
441
- const adapter = await adapterFactory(dbConfig);
442
- adapterCache.set(cacheKey, adapter);
474
+ const created = (async () => {
475
+ const adapter = await adapterFactory(dbConfig);
476
+ if (typeof adapter.initSchema === "function") {
477
+ await adapter.initSchema();
478
+ }
479
+ return adapter;
480
+ })().catch((error) => {
481
+ adapterCache.delete(cacheKey);
482
+ throw error;
483
+ });
484
+ adapterCache.set(cacheKey, created);
443
485
  }
444
486
  return adapterCache.get(cacheKey);
445
487
  }
@@ -567,6 +609,10 @@ async function createReiServer(config) {
567
609
  privateKey: vapid.privateKey || ""
568
610
  },
569
611
  webpush: webpushModule,
612
+ // 分片传输的限额(与 installReiSW 的 multipart 同一份)。instant 消息在
613
+ // schedule-message 里就地投递、定时消息走 send-notifications 的 tick,两条路
614
+ // 都从这个 ctx 展开,所以配一次两边都认。
615
+ multipart: config.multipart || null,
570
616
  tenant: {
571
617
  initSecret
572
618
  },
@@ -575,12 +621,15 @@ async function createReiServer(config) {
575
621
  return {
576
622
  handlers: {
577
623
  initTenant: createInitTenantHandler(ctx),
578
- getUserKey: _chunkGN5QTMCLcjs.createGetUserKeyHandler.call(void 0, ctx),
579
- scheduleMessage: _chunkGN5QTMCLcjs.createScheduleMessageHandler.call(void 0, ctx),
624
+ getUserKey: _chunkQHVID3V2cjs.createGetUserKeyHandler.call(void 0, ctx),
625
+ scheduleMessage: _chunkQHVID3V2cjs.createScheduleMessageHandler.call(void 0, ctx),
580
626
  sendNotifications: createSendNotificationsHandler(ctx),
581
- updateMessage: _chunkGN5QTMCLcjs.createUpdateMessageHandler.call(void 0, ctx),
582
- cancelMessage: _chunkGN5QTMCLcjs.createCancelMessageHandler.call(void 0, ctx),
583
- messages: _chunkGN5QTMCLcjs.createMessagesHandler.call(void 0, ctx)
627
+ updateMessage: _chunkQHVID3V2cjs.createUpdateMessageHandler.call(void 0, ctx),
628
+ cancelMessage: _chunkQHVID3V2cjs.createCancelMessageHandler.call(void 0, ctx),
629
+ messages: _chunkQHVID3V2cjs.createMessagesHandler.call(void 0, ctx),
630
+ getMessage: _chunkQHVID3V2cjs.createGetMessageHandler.call(void 0, ctx),
631
+ pushSubscription: _chunkQHVID3V2cjs.createPushSubscriptionHandler.call(void 0, ctx),
632
+ llmCredentials: _chunkQHVID3V2cjs.createLlmCredentialsHandler.call(void 0, ctx)
584
633
  }
585
634
  };
586
635
  }
@@ -606,4 +655,44 @@ async function createReiServer(config) {
606
655
 
607
656
 
608
657
 
609
- exports.createAdapter = createAdapter; exports.createD1Adapter = _chunkGN5QTMCLcjs.createD1Adapter; exports.createReiServer = createReiServer; exports.createSingleUserCloudflareWorker = _chunkGN5QTMCLcjs.createSingleUserCloudflareWorker; exports.createSingleUserServer = _chunkGN5QTMCLcjs.createSingleUserServer; exports.createTenantToken = createTenantToken; exports.createWebCryptoWebPush = _chunkGN5QTMCLcjs.createWebCryptoWebPush; exports.decryptFromStorage = _chunkGN5QTMCLcjs.decryptFromStorage; exports.decryptPayload = _chunkGN5QTMCLcjs.decryptPayload; exports.deriveUserEncryptionKey = _chunkGN5QTMCLcjs.deriveUserEncryptionKey; exports.encryptForStorage = _chunkGN5QTMCLcjs.encryptForStorage; exports.isValidISO8601 = _chunkGN5QTMCLcjs.isValidISO8601; exports.isValidUUID = _chunkGN5QTMCLcjs.isValidUUID; exports.isValidUUIDv4 = _chunkGN5QTMCLcjs.isValidUUIDv4; exports.isValidUrl = _chunkGN5QTMCLcjs.isValidUrl; exports.runScheduledTick = _chunkGN5QTMCLcjs.runScheduledTick; exports.validateAvatarUrl = _chunkGN5QTMCLcjs.validateAvatarUrl; exports.validateLlmMessagesArray = _chunkGN5QTMCLcjs.validateLlmMessagesArray; exports.validateScheduleMessagePayload = _chunkGN5QTMCLcjs.validateScheduleMessagePayload; exports.validateSplitPattern = _chunkGN5QTMCLcjs.validateSplitPattern; exports.verifyTenantToken = verifyTenantToken;
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+ exports.CORS_ALLOW_HEADERS = _chunkQHVID3V2cjs.CORS_ALLOW_HEADERS; exports.CORS_ALLOW_METHODS = _chunkQHVID3V2cjs.CORS_ALLOW_METHODS; exports.CRED_ID_MAX_LENGTH = _chunkQHVID3V2cjs.CRED_ID_MAX_LENGTH; exports.CRED_PUT_BATCH_MAX = _chunkQHVID3V2cjs.CRED_PUT_BATCH_MAX; exports.CRED_REFS_MAX_ENTRIES = _chunkQHVID3V2cjs.CRED_REFS_MAX_ENTRIES; exports.CRED_ROWS_PER_USER_MAX = _chunkQHVID3V2cjs.CRED_ROWS_PER_USER_MAX; exports.DEFAULT_CLAIM_LEASE_MS = _chunkQHVID3V2cjs.DEFAULT_CLAIM_LEASE_MS; exports.DEFAULT_HEARTBEAT_LEASE_TTL_MS = _chunkQHVID3V2cjs.DEFAULT_HEARTBEAT_LEASE_TTL_MS; exports.DEFAULT_LEASE_HEARTBEAT_MS = _chunkQHVID3V2cjs.DEFAULT_LEASE_HEARTBEAT_MS; exports.DEFAULT_MAX_REQUEST_BODY_BYTES = _chunkQHVID3V2cjs.DEFAULT_MAX_REQUEST_BODY_BYTES; exports.DEFAULT_MAX_SCHEDULED_TASKS_PER_FIRE = _chunkQHVID3V2cjs.DEFAULT_MAX_SCHEDULED_TASKS_PER_FIRE; exports.DEFAULT_MAX_TOOL_ITERATIONS = _chunkQHVID3V2cjs.DEFAULT_MAX_TOOL_ITERATIONS; exports.DEFAULT_TOTAL_TIMEOUT_MS = _chunkQHVID3V2cjs.DEFAULT_TOTAL_TIMEOUT_MS; exports.DeploymentConfigError = _chunkQHVID3V2cjs.DeploymentConfigError; exports.MAX_PUSH_PAYLOAD_BYTES = _chunkQHVID3V2cjs.MAX_PUSH_PAYLOAD_BYTES; exports.MAX_TASK_PAYLOAD_BYTES = _chunkQHVID3V2cjs.MAX_TASK_PAYLOAD_BYTES; exports.MIN_SCHEDULE_LEAD_MS = _chunkQHVID3V2cjs.MIN_SCHEDULE_LEAD_MS; exports.NonRetryableError = _chunkQHVID3V2cjs.NonRetryableError; exports.PUSH_ENVELOPE_RESERVED_BYTES = _chunkQHVID3V2cjs.PUSH_ENVELOPE_RESERVED_BYTES; exports.SCHEMA_VERSION = _chunkQHVID3V2cjs.SCHEMA_VERSION; exports.WEB_PUSH_ENCRYPTION_OVERHEAD_BYTES = _chunkQHVID3V2cjs.WEB_PUSH_ENCRYPTION_OVERHEAD_BYTES; exports.WEB_PUSH_MAX_BODY_BYTES = _chunkQHVID3V2cjs.WEB_PUSH_MAX_BODY_BYTES; exports.advanceOccurrence = _chunkQHVID3V2cjs.advanceOccurrence; exports.createAdapter = createAdapter; exports.createD1Adapter = _chunkQHVID3V2cjs.createD1Adapter; exports.createReiServer = createReiServer; exports.createSingleUserCloudflareWorker = _chunkQHVID3V2cjs.createSingleUserCloudflareWorker; exports.createSingleUserServer = _chunkQHVID3V2cjs.createSingleUserServer; exports.createTenantToken = createTenantToken; exports.createWebCryptoWebPush = _chunkQHVID3V2cjs.createWebCryptoWebPush; exports.decryptFromStorage = _chunkQHVID3V2cjs.decryptFromStorage; exports.decryptPayload = _chunkQHVID3V2cjs.decryptPayload; exports.deriveUserEncryptionKey = _chunkQHVID3V2cjs.deriveUserEncryptionKey; exports.encryptForStorage = _chunkQHVID3V2cjs.encryptForStorage; exports.ensureSchema = _chunkQHVID3V2cjs.ensureSchema; exports.getSchemaVersion = _chunkQHVID3V2cjs.getSchemaVersion; exports.hasChatCredRef = _chunkQHVID3V2cjs.hasChatCredRef; exports.isNonRetryableError = _chunkQHVID3V2cjs.isNonRetryableError; exports.isValidCredId = _chunkQHVID3V2cjs.isValidCredId; exports.isValidISO8601 = _chunkQHVID3V2cjs.isValidISO8601; exports.isValidTimeZoneId = _chunkQHVID3V2cjs.isValidTimeZoneId; exports.isValidUUID = _chunkQHVID3V2cjs.isValidUUID; exports.isValidUUIDv4 = _chunkQHVID3V2cjs.isValidUUIDv4; exports.isValidUrl = _chunkQHVID3V2cjs.isValidUrl; exports.measurePushPayload = _chunkQHVID3V2cjs.measurePushPayload; exports.nextFutureOccurrence = _chunkQHVID3V2cjs.nextFutureOccurrence; exports.planNextOccurrence = _chunkQHVID3V2cjs.planNextOccurrence; exports.readRequestBody = _chunkQHVID3V2cjs.readRequestBody; exports.resolveLlmCredential = _chunkQHVID3V2cjs.resolveLlmCredential; exports.runScheduledTick = _chunkQHVID3V2cjs.runScheduledTick; exports.runTask = _chunkQHVID3V2cjs.runTask; exports.sanitizeErrorSummary = _chunkQHVID3V2cjs.sanitizeErrorSummary; exports.summarizeErrorCause = _chunkQHVID3V2cjs.summarizeErrorCause; exports.supportsLlmCredentialsStore = _chunkQHVID3V2cjs.supportsLlmCredentialsStore; exports.validateAvatarUrl = _chunkQHVID3V2cjs.validateAvatarUrl; exports.validateCredRefs = _chunkQHVID3V2cjs.validateCredRefs; exports.validateCredValue = _chunkQHVID3V2cjs.validateCredValue; exports.validateLlmMessagesArray = _chunkQHVID3V2cjs.validateLlmMessagesArray; exports.validateScheduleMessagePayload = _chunkQHVID3V2cjs.validateScheduleMessagePayload; exports.validateSplitPattern = _chunkQHVID3V2cjs.validateSplitPattern; exports.verifyTenantToken = verifyTenantToken;