@domino-sdk/relay 1.62.0 → 1.63.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 (74) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/{accounts-CCqCKCVx.d.ts → accounts-nz3mzfRQ.d.ts} +21 -3
  3. package/dist/{attempt-captures-Cm-5G0PC.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
  4. package/dist/authoring.d.ts +54 -20
  5. package/dist/authoring.js +58 -24
  6. package/dist/{automatic-outcomes-pAsOyIVp.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +11 -1
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +9 -9
  9. package/dist/browser.js +15 -13
  10. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  11. package/dist/{catalog--ZIlskAo.d.ts → catalog-BaTOKpNw.d.ts} +21 -10
  12. package/dist/{chunk-3PYYGFSB.js → chunk-3RFP6GT5.js} +3 -3
  13. package/dist/{chunk-HTZHBTIL.js → chunk-4GQW43UU.js} +193 -357
  14. package/dist/{chunk-D26YNACF.js → chunk-4NOFSGAL.js} +56 -56
  15. package/dist/{chunk-UW5232GG.js → chunk-5XLZ34PV.js} +5 -5
  16. package/dist/{chunk-QYPMPWVX.js → chunk-7X67QLPB.js} +43 -43
  17. package/dist/{chunk-5TEYFX6X.js → chunk-7Z4SZ6YM.js} +2 -2
  18. package/dist/{chunk-Y322OTCH.js → chunk-AQOL3SK5.js} +1 -1
  19. package/dist/{chunk-CICDIBOF.js → chunk-EHUSD3O2.js} +76 -72
  20. package/dist/chunk-FO2LCZTL.js +19 -0
  21. package/dist/{chunk-3KLC4AMA.js → chunk-FU5CGNTR.js} +135 -173
  22. package/dist/{chunk-K2KS3JLY.js → chunk-GLH6MEI2.js} +7 -2
  23. package/dist/chunk-ICXZZNPS.js +199 -0
  24. package/dist/{chunk-MK425RXJ.js → chunk-ID3BZXFZ.js} +709 -640
  25. package/dist/{chunk-UAKYDVT3.js → chunk-KP2MCX3R.js} +111 -89
  26. package/dist/{chunk-GKIFABGN.js → chunk-LZWXCBUB.js} +74 -247
  27. package/dist/{chunk-6WCIWXUV.js → chunk-MTKRIQEU.js} +2 -2
  28. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  29. package/dist/{chunk-XJFYAXET.js → chunk-N4BDKS6Y.js} +19 -19
  30. package/dist/{chunk-E6IKQHTX.js → chunk-N4LNEGQX.js} +2 -2
  31. package/dist/chunk-NQDEWJWE.js +554 -0
  32. package/dist/{chunk-GTDW453U.js → chunk-QR6HH4DI.js} +100 -114
  33. package/dist/chunk-TLSQETTY.js +41 -0
  34. package/dist/{chunk-CZFXGGEK.js → chunk-U66GUVSG.js} +2 -2
  35. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  36. package/dist/chunk-UZ765UGH.js +18 -0
  37. package/dist/{chunk-XNKSSE32.js → chunk-VWQGWGCH.js} +7 -7
  38. package/dist/{chunk-WSBYWVTZ.js → chunk-W7YSMSGC.js} +166 -158
  39. package/dist/{client-B-hbHX30.d.ts → client-DHmG7rn6.d.ts} +25 -61
  40. package/dist/{capability-error-DFMwSuSf.d.ts → dashboards-CLemT6kj.d.ts} +14 -294
  41. package/dist/{deployments-M4OHn7G3.d.ts → deployments-DTULi7dF.d.ts} +46 -3
  42. package/dist/{identity-integration-3mX6b5iH.d.ts → identity-integration-DOeNZaxF.d.ts} +32 -2
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +13 -11
  45. package/dist/internal.d.ts +27 -13
  46. package/dist/internal.js +41 -13
  47. package/dist/{analytics-BwAKLi7O.d.ts → limits-kNzYdZ00.d.ts} +124 -3
  48. package/dist/{offers-DhAtss4_.d.ts → offers-CYeN_I0Y.d.ts} +3 -2
  49. package/dist/portal-proxy.d.ts +19 -3
  50. package/dist/portal-proxy.js +64 -22
  51. package/dist/react/index.d.ts +21 -14
  52. package/dist/react/index.js +55 -29
  53. package/dist/{pages-B8q8Y_dQ.d.ts → reward-deliveries-drp-x1G-.d.ts} +300 -233
  54. package/dist/runtime/authoring.js +1 -1
  55. package/dist/runtime/chunks/UGDV5W4N.js +1 -0
  56. package/dist/runtime/manifest.json +3 -3
  57. package/dist/runtime/schema.js +1 -1
  58. package/dist/schema.d.ts +193 -18
  59. package/dist/schema.js +31 -26
  60. package/dist/server/index.d.ts +13 -13
  61. package/dist/server/index.js +5885 -6224
  62. package/dist/{sign-in-providers-BkjcDsFF.d.ts → sign-in-providers-B1Q9eDRm.d.ts} +7 -2
  63. package/dist/{submission-input-DHGKhXfp.d.ts → submission-input-DZCbjQUH.d.ts} +3 -2
  64. package/dist/{telegram-browser-BCE7zdOb.d.ts → telegram-browser-NL0Asmsi.d.ts} +4 -4
  65. package/dist/telegram.d.ts +8 -8
  66. package/dist/telegram.js +2 -2
  67. package/dist/testing.d.ts +228 -26
  68. package/dist/testing.js +137 -92
  69. package/dist/{tracker-data-Hb1uQnk5.d.ts → tracker-data-esm3WG8R.d.ts} +34 -8
  70. package/dist/{transport-DkhX2Cbs.d.ts → transport-Czht_irp.d.ts} +41259 -39835
  71. package/dist/{wallet-DTO7SXj7.d.ts → wallet-B7e06v4m.d.ts} +14 -4
  72. package/package.json +1 -1
  73. package/dist/chunk-UPQPUJOU.js +0 -457
  74. package/dist/runtime/chunks/Y4OAVXFR.js +0 -1
@@ -1,42 +1,45 @@
1
1
  import {
2
2
  RelayErrorCode,
3
3
  clientError
4
- } from "./chunk-K2KS3JLY.js";
4
+ } from "./chunk-GLH6MEI2.js";
5
5
 
6
6
  // src/identifier.ts
7
7
  import * as z from "zod";
8
- var identifier = z.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/);
8
+ var identifier = /* @__PURE__ */ (() => z.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/))();
9
9
 
10
10
  // src/response.ts
11
11
  import * as z2 from "zod";
12
- var responseFormat = /* @__PURE__ */ Symbol("domino.response.tolerant-v1");
12
+ var responseFormat = /* @__PURE__ */ (() => /* @__PURE__ */ Symbol("domino.response.tolerant-v1"))();
13
13
  function markResponseSchema(schema) {
14
14
  return Object.assign(schema, { [responseFormat]: true });
15
15
  }
16
- var shapes = /* @__PURE__ */ new WeakMap();
17
- function lazyResponseReaders(readers) {
18
- for (const key of Object.keys(readers)) {
19
- const get = Object.getOwnPropertyDescriptor(readers, key)?.get;
20
- if (!get) {
21
- continue;
22
- }
23
- const store = (value) => {
24
- Object.defineProperty(readers, key, {
25
- value,
26
- writable: true,
16
+ var shapes = /* @__PURE__ */ (() => /* @__PURE__ */ new WeakMap())();
17
+ function responseTables(schemas) {
18
+ const table = (read) => {
19
+ const entries = {};
20
+ for (const [key, schema] of Object.entries(schemas)) {
21
+ const store = (value) => {
22
+ Object.defineProperty(entries, key, {
23
+ value,
24
+ writable: true,
25
+ enumerable: true,
26
+ configurable: true
27
+ });
28
+ return value;
29
+ };
30
+ Object.defineProperty(entries, key, {
31
+ get: () => store(read(schema())),
32
+ set: store,
27
33
  enumerable: true,
28
34
  configurable: true
29
35
  });
30
- return value;
31
- };
32
- Object.defineProperty(readers, key, {
33
- get: () => store(get.call(readers)),
34
- set: store,
35
- enumerable: true,
36
- configurable: true
37
- });
38
- }
39
- return readers;
36
+ }
37
+ return entries;
38
+ };
39
+ return {
40
+ known: table(knownResponse),
41
+ tolerant: table(responseSchema)
42
+ };
40
43
  }
41
44
  function responseShape(schema) {
42
45
  const existing = shapes.get(schema);
@@ -240,10 +243,11 @@ function responseListSchema(schema) {
240
243
 
241
244
  // src/pages.ts
242
245
  import * as z3 from "zod";
243
- var pageCursorSchema = z3.string().min(1).max(4096);
244
- var pageQuerySchema = z3.strictObject({
246
+ var pageCursorSchema = /* @__PURE__ */ (() => z3.string().min(1).max(4096))();
247
+ var pageLimit = /* @__PURE__ */ (() => z3.coerce.number().int().min(1).max(100).optional())();
248
+ var pageQuerySchema = /* @__PURE__ */ (() => z3.strictObject({
245
249
  cursor: pageCursorSchema.optional()
246
- });
250
+ }))();
247
251
  async function* paginate(read) {
248
252
  let cursor;
249
253
  do {
@@ -252,21 +256,21 @@ async function* paginate(read) {
252
256
  cursor = page.nextCursor ?? void 0;
253
257
  } while (cursor !== void 0);
254
258
  }
255
- var managementStateQuerySchema = z3.strictObject({
259
+ var managementStateQuerySchema = /* @__PURE__ */ (() => z3.strictObject({
256
260
  cursor: pageCursorSchema.optional(),
257
261
  limit: z3.coerce.number().int().min(1).max(100).default(50)
258
- });
262
+ }))();
259
263
 
260
264
  // src/accounts.ts
261
265
  import * as z4 from "zod";
262
- var authProviderSchema = z4.enum(["google", "apple", "x", "discord"]);
263
- var accountConnectionSchema = z4.object({
266
+ var authProviderSchema = /* @__PURE__ */ (() => z4.enum(["google", "apple", "x", "discord"]))();
267
+ var accountConnectionSchema = /* @__PURE__ */ (() => z4.object({
264
268
  provider: authProviderSchema,
265
269
  configured: z4.boolean(),
266
270
  status: z4.enum(["disconnected", "connected", "reconnect"]),
267
271
  subject: z4.string().nullable(),
268
272
  revision: z4.number().int().nonnegative()
269
- });
273
+ }))();
270
274
  var SignInProvider = {
271
275
  Google: "google",
272
276
  Apple: "apple",
@@ -274,31 +278,31 @@ var SignInProvider = {
274
278
  Discord: "discord",
275
279
  Telegram: "telegram"
276
280
  };
277
- var signInProviderSchema = z4.string();
278
- var signInProviderInputSchema = z4.string().regex(/^[a-z][a-z0-9-]{0,63}$/, "Name a sign-in provider, such as google");
281
+ var signInProviderSchema = /* @__PURE__ */ (() => z4.string())();
282
+ var signInProviderInputSchema = /* @__PURE__ */ (() => z4.string().regex(/^[a-z][a-z0-9-]{0,63}$/, "Name a sign-in provider, such as google"))();
279
283
  var SignInAccountStatus = {
280
284
  Disconnected: "disconnected",
281
285
  Connected: "connected",
282
286
  Reconnect: "reconnect"
283
287
  };
284
- var signInAccountStatusSchema = z4.string();
285
- var signInProviderOptionSchema = z4.object({
288
+ var signInAccountStatusSchema = /* @__PURE__ */ (() => z4.string())();
289
+ var signInProviderOptionSchema = /* @__PURE__ */ (() => z4.object({
286
290
  provider: signInProviderSchema,
287
291
  configured: z4.boolean()
288
- });
289
- var signInAccountSchema = z4.object({
292
+ }))();
293
+ var signInAccountSchema = /* @__PURE__ */ (() => z4.object({
290
294
  provider: signInProviderSchema,
291
295
  configured: z4.boolean(),
292
296
  status: signInAccountStatusSchema,
293
297
  subject: z4.string().nullable(),
294
298
  revision: z4.number().int().nonnegative()
295
- });
296
- var discordMemberInputSchema = z4.object({}).strict();
297
- var discordMessageInputSchema = z4.object({
299
+ }))();
300
+ var discordMemberInputSchema = /* @__PURE__ */ (() => z4.object({}).strict())();
301
+ var discordMessageInputSchema = /* @__PURE__ */ (() => z4.object({
298
302
  channelId: z4.string().regex(/^[0-9]{1,20}$/),
299
303
  messageId: z4.string().regex(/^[0-9]{1,20}$/)
300
- }).strict();
301
- var discordMemberSchema = z4.object({
304
+ }).strict())();
305
+ var discordMemberSchema = /* @__PURE__ */ (() => z4.object({
302
306
  userId: z4.string().regex(/^[0-9]{1,20}$/).nullable().default(null),
303
307
  nickname: z4.string().nullable().default(null),
304
308
  displayName: z4.string().nullable().default(null),
@@ -306,7 +310,7 @@ var discordMemberSchema = z4.object({
306
310
  roles: z4.array(z4.string().regex(/^[0-9]{1,20}$/)),
307
311
  joinedAt: z4.string().datetime({ offset: true }).nullable(),
308
312
  pending: z4.boolean()
309
- });
313
+ }))();
310
314
 
311
315
  // src/tracker-namespaces.ts
312
316
  var telegramReactionsNamespace = "telegram-reactions";
@@ -317,23 +321,23 @@ var walletBalancesNamespace = "wallet-balances";
317
321
 
318
322
  // src/telegram.ts
319
323
  import * as z5 from "zod";
320
- var telegramSignInMethodsSchema = z5.object({
324
+ var telegramSignInMethodsSchema = /* @__PURE__ */ (() => z5.object({
321
325
  login: z5.boolean(),
322
326
  miniApp: z5.boolean()
323
- });
324
- var telegramAccountConnectionSchema = accountConnectionSchema.extend({
327
+ }))();
328
+ var telegramAccountConnectionSchema = /* @__PURE__ */ (() => accountConnectionSchema.extend({
325
329
  provider: z5.literal("telegram")
326
- });
327
- var telegramInitDataSchema = z5.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192);
328
- var telegramMiniAppSignInSchema = z5.object({
330
+ }))();
331
+ var telegramInitDataSchema = /* @__PURE__ */ (() => z5.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192))();
332
+ var telegramMiniAppSignInSchema = /* @__PURE__ */ (() => z5.object({
329
333
  initData: telegramInitDataSchema,
330
334
  mode: z5.enum(["sign-in", "connect"])
331
- }).strict();
332
- var telegramChatIdSchema = z5.string().regex(
335
+ }).strict())();
336
+ var telegramChatIdSchema = /* @__PURE__ */ (() => z5.string().regex(
333
337
  /^-?[1-9][0-9]{0,19}$/,
334
338
  "Use the chat's numeric ID, such as -1001234567890"
335
- );
336
- var telegramChatSchema = z5.object({
339
+ ))();
340
+ var telegramChatSchema = /* @__PURE__ */ (() => z5.object({
337
341
  /** The numeric chat ID, as a string. */
338
342
  id: telegramChatIdSchema,
339
343
  /** `group`, `supergroup` or `channel`; a later Telegram may add others. */
@@ -349,29 +353,29 @@ var telegramChatSchema = z5.object({
349
353
  */
350
354
  canPost: z5.boolean().optional(),
351
355
  connectedAt: z5.number()
352
- });
353
- var telegramChatsSchema = z5.object({
356
+ }))();
357
+ var telegramChatsSchema = /* @__PURE__ */ (() => z5.object({
354
358
  configured: z5.boolean(),
355
359
  /** Domino's bot, the one operators add to their chats. */
356
360
  bot: z5.object({ username: z5.string() }).nullable(),
357
361
  chats: z5.array(telegramChatSchema)
358
- });
359
- var telegramChatConnectionSchema = z5.object({
362
+ }))();
363
+ var telegramChatConnectionSchema = /* @__PURE__ */ (() => z5.object({
360
364
  url: z5.string(),
361
365
  expiresAt: z5.number()
362
- });
363
- var telegramMemberInputSchema = z5.object({
366
+ }))();
367
+ var telegramMemberInputSchema = /* @__PURE__ */ (() => z5.object({
364
368
  chat: z5.string().regex(
365
369
  /^(-?[1-9][0-9]{0,19}|@[A-Za-z][A-Za-z0-9_]{3,31})$/,
366
370
  "Name a chat the project connected, by its numeric ID or @username"
367
371
  )
368
- }).strict();
369
- var telegramConnectionInputSchema = z5.object({ operation: z5.literal("connection") }).strict();
370
- var telegramConnectionSchema = z5.object({
372
+ }).strict())();
373
+ var telegramConnectionInputSchema = /* @__PURE__ */ (() => z5.object({ operation: z5.literal("connection") }).strict())();
374
+ var telegramConnectionSchema = /* @__PURE__ */ (() => z5.object({
371
375
  /** The numeric Telegram user ID. */
372
376
  userId: z5.string()
373
- });
374
- var telegramChatMemberSchema = z5.object({
377
+ }))();
378
+ var telegramChatMemberSchema = /* @__PURE__ */ (() => z5.object({
375
379
  /** The numeric Telegram user ID. */
376
380
  userId: z5.string(),
377
381
  username: z5.string().nullable(),
@@ -384,8 +388,8 @@ var telegramChatMemberSchema = z5.object({
384
388
  isAdmin: z5.boolean(),
385
389
  /** When a paid subscription or a restriction ends, epoch milliseconds; null when it does not. */
386
390
  untilDate: z5.number().nullable()
387
- });
388
- var telegramReactionDataSchema = z5.object({
391
+ }))();
392
+ var telegramReactionDataSchema = /* @__PURE__ */ (() => z5.object({
389
393
  /** The chat's numeric ID, as a string. */
390
394
  chatId: z5.string(),
391
395
  /** `group` or `supergroup`: channel reactions are anonymous and never recorded. */
@@ -404,8 +408,8 @@ var telegramReactionDataSchema = z5.object({
404
408
  reactorStatus: z5.string(),
405
409
  /** Whether the reactor was the chat's creator or an administrator then. */
406
410
  reactorIsAdmin: z5.boolean()
407
- });
408
- var telegramMessageDataSchema = z5.object({
411
+ }))();
412
+ var telegramMessageDataSchema = /* @__PURE__ */ (() => z5.object({
409
413
  /** The chat's numeric ID, as a string. */
410
414
  chatId: z5.string(),
411
415
  /** `group` or `supergroup`: channel posts are authored by the channel and never recorded. */
@@ -418,21 +422,66 @@ var telegramMessageDataSchema = z5.object({
418
422
  * thread otherwise. Null when Telegram names none.
419
423
  */
420
424
  threadId: z5.number().nullable()
421
- });
425
+ }))();
426
+
427
+ // src/limits.ts
428
+ var limits = /* @__PURE__ */ (() => Object.freeze({
429
+ quests: 1e3,
430
+ questTypes: 200,
431
+ collections: 1e3,
432
+ sdkRuntime: Object.freeze({ modules: 200, size: 2e6 }),
433
+ memberCompletions: 100,
434
+ dashboardPanels: 24,
435
+ dashboards: 20,
436
+ defer: Object.freeze({
437
+ minRetryAfterMs: 1e3,
438
+ maxRetryAfterMs: 36e5,
439
+ retryAfterMs: 6e4,
440
+ horizonMs: 864e5,
441
+ maxDefers: 100
442
+ }),
443
+ retryCooldown: Object.freeze({ minMs: 1e3, maxMs: 6048e5 }),
444
+ analyticsQueryRows: 100,
445
+ apps: Object.freeze({
446
+ secrets: 50,
447
+ kvStores: 5,
448
+ sqlStores: 5,
449
+ migrations: 100,
450
+ migrationFileBytes: 9e4,
451
+ migrationTotalBytes: 1e6,
452
+ storageRows: 50,
453
+ storagePreviewCharacters: 2e3,
454
+ storageCellCharacters: 1e5,
455
+ schedules: 10,
456
+ scheduleMinIntervalMs: 3e5,
457
+ scheduleTimeoutMs: 3e4,
458
+ scheduleResultBytes: 16384
459
+ }),
460
+ stagedDeployment: Object.freeze({
461
+ size: 64e6,
462
+ compressedSize: 1e7
463
+ }),
464
+ capabilityCalls: 8,
465
+ trackerData: Object.freeze({ branches: 16, entries: 256 }),
466
+ trackerPreview: Object.freeze({ pages: 3, posts: 100, days: 30 }),
467
+ walletsPerChain: 5,
468
+ walletEventLogs: 1e3,
469
+ walletTransactions: 1e3
470
+ }))();
422
471
 
423
472
  // src/wallet.ts
424
473
  import * as z6 from "zod";
425
- var solanaAddressSchema = z6.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
426
- var walletChainSchema = z6.enum(["solana", "eip155", "cosmos"]);
474
+ var solanaAddressSchema = /* @__PURE__ */ (() => z6.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/))();
475
+ var walletChainSchema = /* @__PURE__ */ (() => z6.enum(["solana", "eip155", "cosmos"]))();
427
476
  var cosmosNetworkPattern = /^cosmos:[-_a-zA-Z0-9]{1,32}$/;
428
- var cosmosNetworkSchema = z6.custom(
477
+ var cosmosNetworkSchema = /* @__PURE__ */ (() => z6.custom(
429
478
  (value) => typeof value === "string" && cosmosNetworkPattern.test(value),
430
479
  "Use a Cosmos network: cosmos:<chain ID>"
431
- );
432
- var cosmosDenomSchema = z6.string().regex(
480
+ ))();
481
+ var cosmosDenomSchema = /* @__PURE__ */ (() => z6.string().regex(
433
482
  /^[a-zA-Z][a-zA-Z0-9/:._-]{2,127}$/,
434
483
  "Use a Cosmos bank denomination such as uatom or uosmo"
435
- );
484
+ ))();
436
485
  function cosmosChain(chain) {
437
486
  if (typeof chain === "string" && !chain.startsWith("cosmos:")) {
438
487
  throw new Error('Use a Cosmos network such as "cosmos:cosmoshub-4"');
@@ -455,11 +504,11 @@ function cosmosChain(chain) {
455
504
  return { ...value, network };
456
505
  }
457
506
  var solanaMainnet = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
458
- var evmAddressSchema = z6.string().regex(/^0x[0-9a-fA-F]{40}$/);
459
- var cosmosAddressSchema = z6.string().min(8).max(90).regex(
507
+ var evmAddressSchema = /* @__PURE__ */ (() => z6.string().regex(/^0x[0-9a-fA-F]{40}$/))();
508
+ var cosmosAddressSchema = /* @__PURE__ */ (() => z6.string().min(8).max(90).regex(
460
509
  /^(?:[a-z][a-z0-9]{0,82}1[02-9ac-hj-np-z]{38,}|[A-Z][A-Z0-9]{0,82}1[02-9AC-HJ-NP-Z]{38,})$/
461
- );
462
- var walletAddressInputSchema = z6.discriminatedUnion("chain", [
510
+ ))();
511
+ var walletAddressInputSchema = /* @__PURE__ */ (() => z6.discriminatedUnion("chain", [
463
512
  z6.object({ chain: z6.literal("solana"), address: solanaAddressSchema }).strict(),
464
513
  z6.object({
465
514
  chain: z6.literal("eip155"),
@@ -472,8 +521,8 @@ var walletAddressInputSchema = z6.discriminatedUnion("chain", [
472
521
  network: cosmosNetworkSchema,
473
522
  address: cosmosAddressSchema
474
523
  }).strict()
475
- ]);
476
- var walletMessageChallengeSchema = z6.object({
524
+ ]))();
525
+ var walletMessageChallengeSchema = /* @__PURE__ */ (() => z6.object({
477
526
  id: z6.string().min(1).max(200),
478
527
  purpose: z6.enum(["link", "sign-in"]),
479
528
  chain: walletChainSchema,
@@ -482,15 +531,15 @@ var walletMessageChallengeSchema = z6.object({
482
531
  address: z6.string(),
483
532
  message: z6.string().max(4096),
484
533
  expiresAt: z6.number().int()
485
- });
486
- var walletSignatureSchema = z6.object({
534
+ }))();
535
+ var walletSignatureSchema = /* @__PURE__ */ (() => z6.object({
487
536
  challenge: z6.string().min(1).max(200),
488
537
  /** solana: base58, 64 bytes · eip155: 0x and 130 hex digits (65 bytes) · cosmos: base64, 64 bytes (r‖s) */
489
538
  signature: z6.string().min(1).max(256),
490
539
  /** cosmos only: the base64 33-byte compressed secp256k1 key from signArbitrary's pub_key.value */
491
540
  publicKey: z6.string().max(128).optional()
492
- }).strict();
493
- var linkedWalletSchema = z6.object({
541
+ }).strict())();
542
+ var linkedWalletSchema = /* @__PURE__ */ (() => z6.object({
494
543
  chain: walletChainSchema,
495
544
  network: cosmosNetworkSchema.nullable(),
496
545
  address: z6.string(),
@@ -498,8 +547,8 @@ var linkedWalletSchema = z6.object({
498
547
  revision: z6.number().int().positive(),
499
548
  /** True when this wallet can sign in: it was first used through wallet sign-in. Linking never enables sign-in. */
500
549
  signIn: z6.boolean()
501
- });
502
- var walletUnlinkInputSchema = z6.object({ chain: walletChainSchema, address: z6.string().min(1).max(100) }).strict();
550
+ }))();
551
+ var walletUnlinkInputSchema = /* @__PURE__ */ (() => z6.object({ chain: walletChainSchema, address: z6.string().min(1).max(100) }).strict())();
503
552
  async function walletAddressInput(signer) {
504
553
  const address = await signer.address();
505
554
  switch (signer.chain) {
@@ -523,12 +572,12 @@ async function walletAddressInput(signer) {
523
572
  }
524
573
  var WALLETS_PER_CHAIN = 5;
525
574
  var walletSignInFamilies = ["solana", "eip155", "cosmos"];
526
- var walletSignInNetworkSchema = z6.enum(walletSignInFamilies);
527
- var walletSignInNetworksSchema = z6.array(walletSignInNetworkSchema).max(walletSignInFamilies.length).refine((values2) => new Set(values2).size === values2.length, {
575
+ var walletSignInNetworkSchema = /* @__PURE__ */ (() => z6.enum(walletSignInFamilies))();
576
+ var walletSignInNetworksSchema = /* @__PURE__ */ (() => z6.array(walletSignInNetworkSchema).max(walletSignInFamilies.length).refine((values2) => new Set(values2).size === values2.length, {
528
577
  message: "Duplicate wallet family"
529
578
  }).transform(
530
579
  (values2) => walletSignInFamilies.filter((family) => values2.includes(family))
531
- );
580
+ ))();
532
581
  function walletSignInNetwork(wallet) {
533
582
  return wallet.chain;
534
583
  }
@@ -549,12 +598,12 @@ function caip10(wallet, network) {
549
598
  function isEvmChainId(value) {
550
599
  return /^eip155:[1-9][0-9]{0,15}$/.test(value);
551
600
  }
552
- var evmChainIdSchema = z6.custom(
601
+ var evmChainIdSchema = /* @__PURE__ */ (() => z6.custom(
553
602
  (value) => typeof value === "string" && isEvmChainId(value),
554
603
  'Use an EVM chain ID such as "eip155:8453"'
555
- );
556
- var units = z6.string().regex(/^(0|[1-9][0-9]*)$/);
557
- var walletBalanceSchema = responseShape(
604
+ ))();
605
+ var units = /* @__PURE__ */ (() => z6.string().regex(/^(0|[1-9][0-9]*)$/))();
606
+ var walletBalanceSchema = /* @__PURE__ */ (() => responseShape(
558
607
  z6.object({
559
608
  /** Canonical CAIP-2 ID for Solana, EVM or a supported Cosmos SDK chain. */
560
609
  chain: z6.string(),
@@ -571,8 +620,8 @@ var walletBalanceSchema = responseShape(
571
620
  at: z6.object({ kind: z6.enum(["slot", "block"]), number: units }).strict(),
572
621
  observedAt: z6.number().int().nonnegative()
573
622
  }).strict()
574
- );
575
- var walletBalanceSampleSchema = z6.object({
623
+ ))();
624
+ var walletBalanceSampleSchema = /* @__PURE__ */ (() => z6.object({
576
625
  /** The balance in base units, as a decimal integer string. */
577
626
  amount: z6.string(),
578
627
  /** The token's decimals; null when token metadata does not report them. */
@@ -583,7 +632,7 @@ var walletBalanceSampleSchema = z6.object({
583
632
  * a decimal integer string.
584
633
  */
585
634
  block: z6.string()
586
- });
635
+ }))();
587
636
  var nftCollectionPattern = /^(eip155:[1-9][0-9]{0,15})\/(erc721|erc1155):(0x[0-9a-fA-F]{40})(?:\/(0|[1-9][0-9]{0,77}))?$/;
588
637
  var solanaNftCollectionPrefix = `${solanaMainnet}/nft:`;
589
638
  var maxTokenId = 2n ** 256n - 1n;
@@ -610,7 +659,7 @@ function parseNftCollection(value) {
610
659
  function isNftCollection(value) {
611
660
  return parseNftCollection(value) !== null;
612
661
  }
613
- var walletNftsSchema = responseShape(
662
+ var walletNftsSchema = /* @__PURE__ */ (() => responseShape(
614
663
  z6.object({
615
664
  /** The collection read, in canonical form: an EVM contract EIP-55 checksummed. */
616
665
  collection: z6.string(),
@@ -626,7 +675,7 @@ var walletNftsSchema = responseShape(
626
675
  at: z6.object({ kind: z6.enum(["slot", "block"]), number: units }).strict(),
627
676
  observedAt: z6.number().int().nonnegative()
628
677
  }).strict()
629
- );
678
+ ))();
630
679
  var integerType = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
631
680
  var bytesType = /^bytes([1-9]|[12][0-9]|3[0-2])?$/;
632
681
  function elementaryType(type) {
@@ -675,8 +724,8 @@ function parseContractCall(value) {
675
724
  function isContractCall(value) {
676
725
  return parseContractCall(value) !== null;
677
726
  }
678
- var signedUnits = z6.string().regex(/^(0|-?[1-9][0-9]*)$/);
679
- var walletCallSchema = responseShape(
727
+ var signedUnits = /* @__PURE__ */ (() => z6.string().regex(/^(0|-?[1-9][0-9]*)$/))();
728
+ var walletCallSchema = /* @__PURE__ */ (() => responseShape(
680
729
  z6.object({
681
730
  /** The call read, canonical: the contract EIP-55 checksummed, the signature without names. */
682
731
  call: z6.string(),
@@ -699,8 +748,8 @@ var walletCallSchema = responseShape(
699
748
  at: z6.object({ kind: z6.enum(["block"]), number: units }).strict(),
700
749
  observedAt: z6.number().int().nonnegative()
701
750
  }).strict()
702
- );
703
- var walletDelegationsSchema = responseShape(
751
+ ))();
752
+ var walletDelegationsSchema = /* @__PURE__ */ (() => responseShape(
704
753
  z6.object({
705
754
  chain: z6.string(),
706
755
  /** The chain's staking denomination, such as `uatom`: every amount is in its base units. */
@@ -720,7 +769,7 @@ var walletDelegationsSchema = responseShape(
720
769
  at: z6.object({ kind: z6.enum(["block"]), number: units }).strict(),
721
770
  observedAt: z6.number().int().nonnegative()
722
771
  }).strict()
723
- );
772
+ ))();
724
773
  var contractEventPattern = /^(eip155:[1-9][0-9]{0,15}):(0x[0-9a-fA-F]{40})\s+(?:event\s+)?([A-Za-z_$][A-Za-z0-9_$]*)\s*\(([^()]*)\)\s*;?$/;
725
774
  var eventArgumentPattern = /^([a-z0-9]+(?:\[[0-9]*\])*)(\s+indexed)?\s+([A-Za-z_$][A-Za-z0-9_$]*)$/;
726
775
  function eventArgumentType(type) {
@@ -775,12 +824,12 @@ function isContractEvent(value) {
775
824
  }
776
825
  var maxWalletEventLogs = 1e3;
777
826
  var maxWalletEventLookback = 30 * 24 * 60 * 60 * 1e3;
778
- var walletEventScalarSchema = z6.union([z6.string(), z6.boolean()]);
779
- var walletEventValueSchema = z6.union([
827
+ var walletEventScalarSchema = /* @__PURE__ */ (() => z6.union([z6.string(), z6.boolean()]))();
828
+ var walletEventValueSchema = /* @__PURE__ */ (() => z6.union([
780
829
  walletEventScalarSchema,
781
830
  z6.array(walletEventScalarSchema)
782
- ]);
783
- var walletEventsSchema = responseShape(
831
+ ]))();
832
+ var walletEventsSchema = /* @__PURE__ */ (() => responseShape(
784
833
  z6.object({
785
834
  /** The event read, in canonical form: the contract EIP-55 checksummed. */
786
835
  event: z6.string(),
@@ -814,23 +863,23 @@ var walletEventsSchema = responseShape(
814
863
  /** Every argument, by name. */
815
864
  args: z6.record(z6.string(), walletEventValueSchema)
816
865
  }).strict()
817
- ).max(maxWalletEventLogs),
866
+ ).max(limits.walletEventLogs),
818
867
  observedAt: z6.number().int().nonnegative()
819
868
  }).strict()
820
- );
869
+ ))();
821
870
  function isSolanaProgram(value) {
822
871
  return solanaAddressSchema.safeParse(value).success;
823
872
  }
824
- var anchorIdlSchema = z6.record(z6.string(), z6.json());
825
- var solanaProgramIdlSchema = z6.object({
873
+ var anchorIdlSchema = /* @__PURE__ */ (() => z6.record(z6.string(), z6.json()))();
874
+ var solanaProgramIdlSchema = /* @__PURE__ */ (() => z6.object({
826
875
  /** The program the setting held when the IDL was stored. */
827
876
  program: z6.string(),
828
877
  source: z6.string(),
829
878
  idl: anchorIdlSchema
830
- }).strict();
879
+ }).strict())();
831
880
  var maxWalletTransactions = 1e3;
832
881
  var maxWalletTransactionLookback = 30 * 24 * 60 * 60 * 1e3;
833
- var walletTransactionsSchema = responseShape(
882
+ var walletTransactionsSchema = /* @__PURE__ */ (() => responseShape(
834
883
  z6.object({
835
884
  program: z6.string(),
836
885
  /** Solana mainnet's CAIP-2 ID. */
@@ -842,7 +891,7 @@ var walletTransactionsSchema = responseShape(
842
891
  /** The newest finalized slot read. Transactions in later slots are not read yet. */
843
892
  at: z6.object({ kind: z6.enum(["slot"]), number: units }).strict(),
844
893
  /**
845
- * False when a wallet had more than {@link maxWalletTransactions} transactions to read since
894
+ * False when a wallet had more than {@link limits.walletTransactions} transactions to read since
846
895
  * `since`: its newest ones are returned and older ones are not.
847
896
  */
848
897
  complete: z6.boolean(),
@@ -897,11 +946,11 @@ var walletTransactionsSchema = responseShape(
897
946
  ),
898
947
  observedAt: z6.number().int().nonnegative()
899
948
  }).strict()
900
- );
949
+ ))();
901
950
 
902
951
  // src/discord.ts
903
952
  import * as z7 from "zod";
904
- var discordMessageSchema = z7.object({
953
+ var discordMessageSchema = /* @__PURE__ */ (() => z7.object({
905
954
  guildId: z7.string(),
906
955
  channelId: z7.string(),
907
956
  messageId: z7.string(),
@@ -909,16 +958,16 @@ var discordMessageSchema = z7.object({
909
958
  content: z7.string().nullable(),
910
959
  replyTo: z7.string().nullable(),
911
960
  publishedAt: z7.number()
912
- }).strict();
913
- var discordMessagesSourceSchema = z7.strictObject({
961
+ }).strict())();
962
+ var discordMessagesSourceSchema = /* @__PURE__ */ (() => z7.strictObject({
914
963
  kind: z7.literal("discord-messages"),
915
964
  /** Store each message's text in `data.text`. Off unless set. */
916
965
  text: z7.boolean().optional()
917
- });
918
- var discordReactionsSourceSchema = z7.strictObject({
966
+ }))();
967
+ var discordReactionsSourceSchema = /* @__PURE__ */ (() => z7.strictObject({
919
968
  kind: z7.literal("discord-reactions")
920
- });
921
- var discordMessageDataSchema = z7.object({
969
+ }))();
970
+ var discordMessageDataSchema = /* @__PURE__ */ (() => z7.object({
922
971
  guildId: z7.string(),
923
972
  /** The channel posted in: a thread's own ID when the message is in a thread. */
924
973
  channelId: z7.string(),
@@ -932,11 +981,11 @@ var discordMessageDataSchema = z7.object({
932
981
  replyTo: z7.string().nullable(),
933
982
  /** When Discord says the message was posted, in epoch milliseconds. */
934
983
  publishedAt: z7.number()
935
- });
936
- var discordMessageTextDataSchema = discordMessageDataSchema.extend({
984
+ }))();
985
+ var discordMessageTextDataSchema = /* @__PURE__ */ (() => discordMessageDataSchema.extend({
937
986
  text: z7.string().nullable()
938
- });
939
- var discordReactionDataSchema = z7.object({
987
+ }))();
988
+ var discordReactionDataSchema = /* @__PURE__ */ (() => z7.object({
940
989
  guildId: z7.string(),
941
990
  /** The reacted-to message's channel: a thread's own ID when the message is in a thread. */
942
991
  channelId: z7.string(),
@@ -953,14 +1002,14 @@ var discordReactionDataSchema = z7.object({
953
1002
  reactorRoles: z7.array(z7.string()),
954
1003
  /** When the reacted-to message was posted, in epoch milliseconds. */
955
1004
  messagePublishedAt: z7.number()
956
- });
957
- var discordRewardSchema = z7.strictObject({
1005
+ }))();
1006
+ var discordRewardSchema = /* @__PURE__ */ (() => z7.strictObject({
958
1007
  kind: z7.literal("integration"),
959
1008
  provider: z7.literal("discord"),
960
1009
  action: z7.literal("grant-role"),
961
1010
  roleId: z7.string().regex(/^[0-9]{1,20}$/)
962
- });
963
- var discordResourceSourceSchema = z7.union([
1011
+ }))();
1012
+ var discordResourceSourceSchema = /* @__PURE__ */ (() => z7.union([
964
1013
  z7.strictObject({
965
1014
  provider: z7.literal("discord"),
966
1015
  resource: z7.literal("channel"),
@@ -973,7 +1022,7 @@ var discordResourceSourceSchema = z7.union([
973
1022
  resource: z7.literal("role"),
974
1023
  assignable: z7.boolean().default(false)
975
1024
  })
976
- ]);
1025
+ ]))();
977
1026
 
978
1027
  // src/tracker-data.ts
979
1028
  import * as z8 from "zod";
@@ -981,11 +1030,11 @@ var maxDepth = 16;
981
1030
  var maxBytes = 32768;
982
1031
  var trackerDataMaxBranches = 16;
983
1032
  var trackerDataMaxEntries = 256;
984
- var scalar = z8.union([z8.string(), z8.number().finite(), z8.boolean(), z8.null()]);
985
- var size = z8.number().int().safe().nonnegative();
986
- var bound = z8.number().finite();
987
- var branches = () => z8.array(node).min(1).max(trackerDataMaxBranches);
988
- var node = z8.lazy(
1033
+ var scalar = /* @__PURE__ */ (() => z8.union([z8.string(), z8.number().finite(), z8.boolean(), z8.null()]))();
1034
+ var size = /* @__PURE__ */ (() => z8.number().int().safe().nonnegative())();
1035
+ var bound = /* @__PURE__ */ (() => z8.number().finite())();
1036
+ var branches = () => z8.array(node).min(1).max(limits.trackerData.branches);
1037
+ var node = /* @__PURE__ */ (() => z8.lazy(
989
1038
  () => z8.strictObject({
990
1039
  type: z8.enum([
991
1040
  "object",
@@ -997,14 +1046,14 @@ var node = z8.lazy(
997
1046
  "null"
998
1047
  ]).optional(),
999
1048
  properties: z8.record(z8.string(), node).refine(
1000
- (properties) => Object.keys(properties).length <= trackerDataMaxEntries,
1001
- `An object schema lists at most ${trackerDataMaxEntries} properties`
1049
+ (properties) => Object.keys(properties).length <= limits.trackerData.entries,
1050
+ `An object schema lists at most ${limits.trackerData.entries} properties`
1002
1051
  ).optional(),
1003
- required: z8.array(z8.string()).max(trackerDataMaxEntries).optional(),
1052
+ required: z8.array(z8.string()).max(limits.trackerData.entries).optional(),
1004
1053
  additionalProperties: z8.union([z8.boolean(), node]).optional(),
1005
1054
  propertyNames: z8.strictObject({
1006
1055
  type: z8.literal("string"),
1007
- enum: z8.array(z8.string()).max(trackerDataMaxEntries).optional()
1056
+ enum: z8.array(z8.string()).max(limits.trackerData.entries).optional()
1008
1057
  }).optional(),
1009
1058
  items: node.optional(),
1010
1059
  minItems: size.optional(),
@@ -1015,13 +1064,13 @@ var node = z8.lazy(
1015
1064
  maximum: bound.optional(),
1016
1065
  exclusiveMinimum: bound.optional(),
1017
1066
  exclusiveMaximum: bound.optional(),
1018
- enum: z8.array(scalar).min(1).max(trackerDataMaxEntries).optional(),
1067
+ enum: z8.array(scalar).min(1).max(limits.trackerData.entries).optional(),
1019
1068
  const: scalar.optional(),
1020
1069
  anyOf: branches().optional(),
1021
1070
  oneOf: branches().optional(),
1022
1071
  allOf: branches().optional()
1023
1072
  })
1024
- );
1073
+ ))();
1025
1074
  function shapeIssue(value) {
1026
1075
  const pending = [[value, 0]];
1027
1076
  while (pending.length) {
@@ -1077,7 +1126,7 @@ function nestedUnionIssue(schema, path, insideUnion) {
1077
1126
  }
1078
1127
  return null;
1079
1128
  }
1080
- var trackerDataSchemaSchema = z8.unknown().superRefine((value, ctx) => {
1129
+ var trackerDataSchemaSchema = /* @__PURE__ */ (() => z8.unknown().superRefine((value, ctx) => {
1081
1130
  const issue = shapeIssue(value);
1082
1131
  if (issue) {
1083
1132
  ctx.addIssue({ code: "custom", message: issue, abort: true });
@@ -1093,7 +1142,7 @@ var trackerDataSchemaSchema = z8.unknown().superRefine((value, ctx) => {
1093
1142
  message: `Tracker data schemas cannot nest a union with several object, array or union branches inside another union's branch (${at}): flatten it into one union`
1094
1143
  });
1095
1144
  }
1096
- });
1145
+ }))();
1097
1146
  var unsupported = {
1098
1147
  pattern: "check string patterns in your evaluator",
1099
1148
  format: "use z.string() and check the format in your evaluator",
@@ -1119,9 +1168,9 @@ var unsupported = {
1119
1168
  unevaluatedProperties: "use a strict object instead",
1120
1169
  unevaluatedItems: "use an array instead"
1121
1170
  };
1122
- var nested = /* @__PURE__ */ new Set(["additionalProperties", "items", "propertyNames"]);
1123
- var listed = /* @__PURE__ */ new Set(["anyOf", "oneOf", "allOf"]);
1124
- var supported = /* @__PURE__ */ new Set([
1171
+ var nested = /* @__PURE__ */ (() => /* @__PURE__ */ new Set(["additionalProperties", "items", "propertyNames"]))();
1172
+ var listed = /* @__PURE__ */ (() => /* @__PURE__ */ new Set(["anyOf", "oneOf", "allOf"]))();
1173
+ var supported = /* @__PURE__ */ (() => /* @__PURE__ */ new Set([
1125
1174
  "type",
1126
1175
  "properties",
1127
1176
  "required",
@@ -1137,8 +1186,8 @@ var supported = /* @__PURE__ */ new Set([
1137
1186
  "const",
1138
1187
  ...nested,
1139
1188
  ...listed
1140
- ]);
1141
- var annotations = /* @__PURE__ */ new Set([
1189
+ ]))();
1190
+ var annotations = /* @__PURE__ */ (() => /* @__PURE__ */ new Set([
1142
1191
  "$schema",
1143
1192
  "$id",
1144
1193
  "$comment",
@@ -1149,7 +1198,7 @@ var annotations = /* @__PURE__ */ new Set([
1149
1198
  "deprecated",
1150
1199
  "readOnly",
1151
1200
  "writeOnly"
1152
- ]);
1201
+ ]))();
1153
1202
  function singleTypes(schema) {
1154
1203
  if (Array.isArray(schema)) {
1155
1204
  return schema.map(singleTypes);
@@ -1270,8 +1319,8 @@ function oneOf(values2) {
1270
1319
  const shown = values2.slice(0, shownValues).map((value) => JSON.stringify(value)).join(", ");
1271
1320
  return values2.length > shownValues ? `expected one of ${shown}, or ${values2.length - shownValues} more` : `expected one of ${shown}`;
1272
1321
  }
1273
- var enumSets = /* @__PURE__ */ new WeakMap();
1274
- var literalLists = /* @__PURE__ */ new WeakMap();
1322
+ var enumSets = /* @__PURE__ */ (() => /* @__PURE__ */ new WeakMap())();
1323
+ var literalLists = /* @__PURE__ */ (() => /* @__PURE__ */ new WeakMap())();
1275
1324
  function setOf(owner, values2) {
1276
1325
  let found = enumSets.get(owner);
1277
1326
  if (!found) {
@@ -1346,13 +1395,13 @@ function matches(schema, value, at, budget) {
1346
1395
  }
1347
1396
  }
1348
1397
  if (typeof value === "number") {
1349
- const limits = [
1398
+ const limits2 = [
1350
1399
  [schema.minimum, (limit) => value >= limit, "at least"],
1351
1400
  [schema.exclusiveMinimum, (limit) => value > limit, "more than"],
1352
1401
  [schema.maximum, (limit) => value <= limit, "at most"],
1353
1402
  [schema.exclusiveMaximum, (limit) => value < limit, "less than"]
1354
1403
  ];
1355
- for (const [limit, holds, label] of limits) {
1404
+ for (const [limit, holds, label] of limits2) {
1356
1405
  if (limit !== void 0 && !holds(limit)) {
1357
1406
  return issue(() => `expected ${label} ${limit}`);
1358
1407
  }
@@ -1579,7 +1628,7 @@ import * as z11 from "zod";
1579
1628
 
1580
1629
  // src/lifecycle-reason.ts
1581
1630
  import * as z9 from "zod";
1582
- var lifecycleReasonSchema = z9.string().trim().min(1).max(500);
1631
+ var lifecycleReasonSchema = /* @__PURE__ */ (() => z9.string().trim().min(1).max(500))();
1583
1632
 
1584
1633
  // src/offset-date-time.ts
1585
1634
  import * as z10 from "zod";
@@ -1589,11 +1638,11 @@ function offsetDateTimeSchema() {
1589
1638
  }
1590
1639
 
1591
1640
  // src/trackers.ts
1592
- var timestamp = z11.number().int().safe().nonnegative().max(864e13);
1593
- var count = z11.number().int().safe().nonnegative();
1594
- var externalId = z11.string().min(1).max(256);
1595
- var metric = count.nullable().default(null);
1596
- var xTweetSchema = z11.looseObject({
1641
+ var timestamp = /* @__PURE__ */ (() => z11.number().int().safe().nonnegative().max(864e13))();
1642
+ var count = /* @__PURE__ */ (() => z11.number().int().safe().nonnegative())();
1643
+ var externalId = /* @__PURE__ */ (() => z11.string().min(1).max(256))();
1644
+ var metric = /* @__PURE__ */ (() => count.nullable().default(null))();
1645
+ var xTweetSchema = /* @__PURE__ */ (() => z11.looseObject({
1597
1646
  id: externalId,
1598
1647
  userId: externalId,
1599
1648
  content: z11.string(),
@@ -1613,8 +1662,8 @@ var xTweetSchema = z11.looseObject({
1613
1662
  isReply: z11.boolean(),
1614
1663
  isRetweet: z11.boolean(),
1615
1664
  isQuoteTweet: z11.boolean()
1616
- });
1617
- var xContentBodySchema = z11.strictObject({
1665
+ }))();
1666
+ var xContentBodySchema = /* @__PURE__ */ (() => z11.strictObject({
1618
1667
  version: z11.literal(1),
1619
1668
  id: z11.string().min(1),
1620
1669
  authorId: z11.string().min(1),
@@ -1634,20 +1683,20 @@ var xContentBodySchema = z11.strictObject({
1634
1683
  repostId: z11.string().nullable(),
1635
1684
  repostAuthorId: z11.string().nullable()
1636
1685
  })
1637
- });
1638
- var trackerContentQuerySchema = z11.strictObject({
1686
+ }))();
1687
+ var trackerContentQuerySchema = /* @__PURE__ */ (() => z11.strictObject({
1639
1688
  id: externalId,
1640
1689
  observation: z11.string().regex(/^observation_[a-f0-9]{64}$/)
1641
- });
1642
- var trackerContentReadSchema = trackerContentQuerySchema.extend({
1690
+ }))();
1691
+ var trackerContentReadSchema = /* @__PURE__ */ (() => trackerContentQuerySchema.extend({
1643
1692
  member: identifier
1644
- });
1693
+ }))();
1645
1694
  var attributionContext = { member: identifier, capturedAt: timestamp };
1646
- var trackerEvidenceSchema = z11.strictObject({
1695
+ var trackerEvidenceSchema = /* @__PURE__ */ (() => z11.strictObject({
1647
1696
  contentRevision: identifier,
1648
1697
  observation: identifier
1649
- });
1650
- var trackerContentSchema = z11.strictObject({
1698
+ }))();
1699
+ var trackerContentSchema = /* @__PURE__ */ (() => z11.strictObject({
1651
1700
  tracker: identifier,
1652
1701
  source: z11.literal("x"),
1653
1702
  evidence: trackerEvidenceSchema,
@@ -1672,22 +1721,22 @@ var trackerContentSchema = z11.strictObject({
1672
1721
  kind: z11.literal("different-author")
1673
1722
  })
1674
1723
  ])
1675
- });
1724
+ }))();
1676
1725
  var knownIdentityKinds = ["wallet", "x", "discord", "member"];
1677
- var appIdentityKindSchema = z11.templateLiteral([
1726
+ var appIdentityKindSchema = /* @__PURE__ */ (() => z11.templateLiteral([
1678
1727
  "app:",
1679
1728
  z11.string().regex(
1680
1729
  /^[a-z0-9][a-z0-9_-]{0,39}$/,
1681
- "Name an app identity kind like app:telegram: lowercase letters, digits, _ or -, at most 40"
1730
+ "Name an app identity kind like app:game: lowercase letters, digits, _ or -, at most 40"
1682
1731
  )
1683
- ]);
1684
- var identityKindSchema = z11.union([
1732
+ ]))();
1733
+ var identityKindSchema = /* @__PURE__ */ (() => z11.union([
1685
1734
  z11.enum(knownIdentityKinds),
1686
1735
  appIdentityKindSchema
1687
- ]);
1736
+ ]))();
1688
1737
  var isAppIdentityKind = (kind) => kind.startsWith("app:");
1689
- var openIdentityKindSchema = z11.string().min(1).max(64);
1690
- var memberIdentitySchema = z11.object({
1738
+ var openIdentityKindSchema = /* @__PURE__ */ (() => z11.string().min(1).max(64))();
1739
+ var memberIdentitySchema = /* @__PURE__ */ (() => z11.object({
1691
1740
  kind: openIdentityKindSchema,
1692
1741
  /** The stable user ID for `x` and `discord`; the subject your app signed the member in with for `app:<name>`. */
1693
1742
  subject: externalId,
@@ -1698,11 +1747,11 @@ var memberIdentitySchema = z11.object({
1698
1747
  revision: count,
1699
1748
  /** The latest link time, refreshed on app identity relink; null when the link time is unknown. */
1700
1749
  linkedAt: timestamp.nullable()
1701
- });
1702
- var accountRoleSchema = z11.string().regex(
1750
+ }))();
1751
+ var accountRoleSchema = /* @__PURE__ */ (() => z11.string().regex(
1703
1752
  /^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,
1704
1753
  "Name roles like author or recipient: a letter, then letters, digits or underscores"
1705
- );
1754
+ ))();
1706
1755
  var xAccountRoles = [
1707
1756
  "author",
1708
1757
  "inReplyTo",
@@ -1710,10 +1759,10 @@ var xAccountRoles = [
1710
1759
  "reposted"
1711
1760
  ];
1712
1761
  var distinct = (values2) => new Set(values2).size === values2.length;
1713
- var contentMetricNameSchema = z11.string().regex(
1762
+ var contentMetricNameSchema = /* @__PURE__ */ (() => z11.string().regex(
1714
1763
  /^[a-z][a-zA-Z0-9]{0,39}$/,
1715
1764
  "Name metrics like likes or watchTime: a lowercase letter, then letters or digits"
1716
- );
1765
+ ))();
1717
1766
  var xContentMetrics = [
1718
1767
  "likes",
1719
1768
  "replies",
@@ -1722,21 +1771,21 @@ var xContentMetrics = [
1722
1771
  "views",
1723
1772
  "bookmarks"
1724
1773
  ];
1725
- var customContentSchema = z11.strictObject({
1774
+ var customContentSchema = /* @__PURE__ */ (() => z11.strictObject({
1726
1775
  metrics: z11.array(contentMetricNameSchema).max(10).refine(distinct, "List each metric once")
1727
- });
1728
- var walletBalanceSourceSchema = z11.strictObject({
1776
+ }))();
1777
+ var walletBalanceSourceSchema = /* @__PURE__ */ (() => z11.strictObject({
1729
1778
  chain: z11.string().regex(
1730
1779
  /^(?:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp|eip155:[1-9][0-9]{0,15}|cosmos:[-_a-zA-Z0-9]{1,32})$/,
1731
1780
  'Use "solana", an EVM chain such as "eip155:8453" or a Cosmos network such as "cosmos:cosmoshub-4"'
1732
1781
  ),
1733
1782
  token: z11.string().min(1).max(128).nullable()
1734
- });
1735
- var xSearchSourceSchema = z11.object({
1783
+ }))();
1784
+ var xSearchSourceSchema = /* @__PURE__ */ (() => z11.object({
1736
1785
  kind: z11.literal("x-search"),
1737
1786
  query: z11.string().trim().min(1).max(2e3)
1738
- }).strict();
1739
- var customSourceSchema = z11.object({
1787
+ }).strict())();
1788
+ var customSourceSchema = /* @__PURE__ */ (() => z11.object({
1740
1789
  kind: z11.literal("custom"),
1741
1790
  namespace: identifier,
1742
1791
  /**
@@ -1776,13 +1825,13 @@ var customSourceSchema = z11.object({
1776
1825
  ).refine(
1777
1826
  (source) => !source.accounts || source.identities,
1778
1827
  "Named accounts need identities"
1779
- );
1780
- var trackerSourceSchema = z11.discriminatedUnion("kind", [
1828
+ ))();
1829
+ var trackerSourceSchema = /* @__PURE__ */ (() => z11.discriminatedUnion("kind", [
1781
1830
  xSearchSourceSchema,
1782
1831
  customSourceSchema,
1783
1832
  discordMessagesSourceSchema,
1784
1833
  discordReactionsSourceSchema
1785
- ]);
1834
+ ]))();
1786
1835
  var trackerSourceKinds = [
1787
1836
  "x-search",
1788
1837
  "custom",
@@ -1814,23 +1863,23 @@ function sourceContent(source) {
1814
1863
  return void 0;
1815
1864
  }
1816
1865
  }
1817
- var windowSchema = z11.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
1866
+ var windowSchema = /* @__PURE__ */ (() => z11.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
1818
1867
  (w) => w.end === void 0 || w.end > w.start,
1819
1868
  "End must follow start"
1820
- );
1821
- var trackerDefinitionSchema = z11.object({
1869
+ ))();
1870
+ var trackerDefinitionSchema = /* @__PURE__ */ (() => z11.object({
1822
1871
  key: identifier,
1823
1872
  title: z11.string().trim().min(1).max(120),
1824
1873
  source: trackerSourceSchema,
1825
1874
  window: windowSchema,
1826
1875
  refreshSeconds: z11.number().int().min(300).max(86400).default(21600),
1827
1876
  maxPages: z11.number().int().min(1).max(1e3).default(60)
1828
- }).strict();
1829
- var trackerArtifactSchema = z11.union([
1877
+ }).strict())();
1878
+ var trackerArtifactSchema = /* @__PURE__ */ (() => z11.union([
1830
1879
  trackerDefinitionSchema,
1831
1880
  z11.object({ code: z11.string().min(1).max(2e6) }).strict()
1832
- ]);
1833
- var knownTrackerSourceResponseSchema = z11.discriminatedUnion("kind", [
1881
+ ]))();
1882
+ var knownTrackerSourceResponseSchema = /* @__PURE__ */ (() => z11.discriminatedUnion("kind", [
1834
1883
  z11.object(xSearchSourceSchema.shape),
1835
1884
  z11.object({
1836
1885
  ...customSourceSchema.shape,
@@ -1838,8 +1887,8 @@ var knownTrackerSourceResponseSchema = z11.discriminatedUnion("kind", [
1838
1887
  }),
1839
1888
  z11.object(discordMessagesSourceSchema.shape),
1840
1889
  z11.object(discordReactionsSourceSchema.shape)
1841
- ]);
1842
- var trackerSourceResponseSchema = z11.union([
1890
+ ]))();
1891
+ var trackerSourceResponseSchema = /* @__PURE__ */ (() => z11.union([
1843
1892
  knownTrackerSourceResponseSchema,
1844
1893
  z11.object({
1845
1894
  kind: z11.string().min(1).refine(
@@ -1847,23 +1896,23 @@ var trackerSourceResponseSchema = z11.union([
1847
1896
  "Known source kinds must match their schema"
1848
1897
  )
1849
1898
  }).catchall(z11.json())
1850
- ]);
1899
+ ]))();
1851
1900
  function isKnownTrackerSource(source) {
1852
1901
  return knownTrackerSourceResponseSchema.safeParse(source).success;
1853
1902
  }
1854
- var trackerDefinitionResponseSchema = z11.object({
1903
+ var trackerDefinitionResponseSchema = /* @__PURE__ */ (() => z11.object({
1855
1904
  ...trackerDefinitionSchema.shape,
1856
1905
  source: trackerSourceResponseSchema,
1857
1906
  window: z11.object(windowSchema.shape)
1858
- });
1859
- var publishedTrackerSchema = z11.object({
1907
+ }))();
1908
+ var publishedTrackerSchema = /* @__PURE__ */ (() => z11.object({
1860
1909
  id: identifier,
1861
1910
  version: identifier,
1862
1911
  definition: trackerDefinitionResponseSchema,
1863
1912
  publishedAt: timestamp,
1864
1913
  actor: z11.string().nullable()
1865
- });
1866
- var trackerStatusSchema = z11.object({
1914
+ }))();
1915
+ var trackerStatusSchema = /* @__PURE__ */ (() => z11.object({
1867
1916
  archivedAt: z11.number().int().nonnegative().nullable().optional(),
1868
1917
  published: publishedTrackerSchema,
1869
1918
  paused: z11.boolean(),
@@ -1895,8 +1944,8 @@ var trackerStatusSchema = z11.object({
1895
1944
  * `management.trackers.update` changes. Older servers leave it out.
1896
1945
  */
1897
1946
  origin: z11.enum(["code", "data"]).optional()
1898
- });
1899
- var managedTrackerSourceSchema = z11.discriminatedUnion("kind", [
1947
+ }))();
1948
+ var managedTrackerSourceSchema = /* @__PURE__ */ (() => z11.discriminatedUnion("kind", [
1900
1949
  xSearchSourceSchema,
1901
1950
  discordMessagesSourceSchema,
1902
1951
  discordReactionsSourceSchema,
@@ -1909,7 +1958,7 @@ var managedTrackerSourceSchema = z11.discriminatedUnion("kind", [
1909
1958
  kind: z11.literal("wallet-balances"),
1910
1959
  ...walletBalanceSourceSchema.shape
1911
1960
  })
1912
- ]);
1961
+ ]))();
1913
1962
  var managedTrackerSourceKinds = [
1914
1963
  "x-search",
1915
1964
  "discord-messages",
@@ -1946,7 +1995,7 @@ function managedTrackerSource(source) {
1946
1995
  } : void 0;
1947
1996
  }
1948
1997
  }
1949
- var trackerPropertiesSchema = z11.object({
1998
+ var trackerPropertiesSchema = /* @__PURE__ */ (() => z11.object({
1950
1999
  title: trackerDefinitionSchema.shape.title,
1951
2000
  /** The X search query. A new query collects from now on; it never searches the past. */
1952
2001
  query: xSearchSourceSchema.shape.query,
@@ -1954,21 +2003,21 @@ var trackerPropertiesSchema = z11.object({
1954
2003
  // Without defaults, so an update leaves out what it does not change.
1955
2004
  refreshSeconds: trackerDefinitionSchema.shape.refreshSeconds.unwrap(),
1956
2005
  maxPages: trackerDefinitionSchema.shape.maxPages.unwrap()
1957
- }).strict();
1958
- var trackerCreateSchema = trackerPropertiesSchema.extend({
2006
+ }).strict())();
2007
+ var trackerCreateSchema = /* @__PURE__ */ (() => trackerPropertiesSchema.extend({
1959
2008
  key: identifier,
1960
2009
  refreshSeconds: trackerDefinitionSchema.shape.refreshSeconds,
1961
2010
  maxPages: trackerDefinitionSchema.shape.maxPages,
1962
2011
  actionId: identifier
1963
- }).strict();
1964
- var managedTrackerCreateSchema = trackerCreateSchema.extend({
2012
+ }).strict())();
2013
+ var managedTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.extend({
1965
2014
  query: xSearchSourceSchema.shape.query.optional(),
1966
2015
  source: managedTrackerSourceSchema.optional()
1967
2016
  }).refine(
1968
2017
  (input) => input.query === void 0 !== (input.source === void 0),
1969
2018
  "Name the source with source, or an X search with query, not both"
1970
- );
1971
- var trackerUpdateSchema = trackerPropertiesSchema.partial().extend({
2019
+ ))();
2020
+ var trackerUpdateSchema = /* @__PURE__ */ (() => trackerPropertiesSchema.partial().extend({
1972
2021
  source: managedTrackerSourceSchema.optional(),
1973
2022
  actionId: identifier
1974
2023
  }).strict().refine(
@@ -1977,17 +2026,17 @@ var trackerUpdateSchema = trackerPropertiesSchema.partial().extend({
1977
2026
  ).refine(
1978
2027
  (input) => input.query === void 0 || input.source === void 0,
1979
2028
  "Change the query with source or query, not both"
1980
- );
1981
- var trackerControlSchema = z11.object({
2029
+ ))();
2030
+ var trackerControlSchema = /* @__PURE__ */ (() => z11.object({
1982
2031
  actionId: identifier,
1983
2032
  action: z11.enum(["pause", "resume", "refresh"]),
1984
2033
  reason: lifecycleReasonSchema.optional()
1985
- }).strict();
1986
- var trackerAccountSchema = z11.strictObject({
2034
+ }).strict())();
2035
+ var trackerAccountSchema = /* @__PURE__ */ (() => z11.strictObject({
1987
2036
  kind: identityKindSchema.optional(),
1988
2037
  id: externalId
1989
- });
1990
- var trackerRecordInputSchema = z11.object({
2038
+ }))();
2039
+ var trackerRecordInputSchema = /* @__PURE__ */ (() => z11.object({
1991
2040
  id: externalId,
1992
2041
  occurredAt: timestamp,
1993
2042
  observedAt: timestamp,
@@ -2007,12 +2056,12 @@ var trackerRecordInputSchema = z11.object({
2007
2056
  }).strict().refine(
2008
2057
  (v) => new TextEncoder().encode(JSON.stringify(v.data)).byteLength <= 131072,
2009
2058
  "Record exceeds 128 KB"
2010
- );
2011
- var trackerRecordAccountSchema = z11.object({
2059
+ ))();
2060
+ var trackerRecordAccountSchema = /* @__PURE__ */ (() => z11.object({
2012
2061
  kind: openIdentityKindSchema.optional(),
2013
2062
  id: z11.string()
2014
- });
2015
- var trackerRecordSchema = z11.object({
2063
+ }))();
2064
+ var trackerRecordSchema = /* @__PURE__ */ (() => z11.object({
2016
2065
  id: z11.string(),
2017
2066
  occurredAt: timestamp,
2018
2067
  observedAt: timestamp,
@@ -2033,12 +2082,12 @@ var trackerRecordSchema = z11.object({
2033
2082
  synthetic: z11.literal(true).optional(),
2034
2083
  /** Present only when includeEvidence is true; custom sources have no X evidence. */
2035
2084
  evidence: trackerEvidenceSchema.nullable().optional()
2036
- });
2037
- var trackerIngestSchema = z11.object({
2085
+ }))();
2086
+ var trackerIngestSchema = /* @__PURE__ */ (() => z11.object({
2038
2087
  actionId: identifier,
2039
2088
  records: z11.array(trackerRecordInputSchema).min(1).max(100)
2040
- }).strict();
2041
- var trackerIngestResultSchema = z11.object({
2089
+ }).strict())();
2090
+ var trackerIngestResultSchema = /* @__PURE__ */ (() => z11.object({
2042
2091
  stored: count,
2043
2092
  /** Tracker-trigger decisions this ingest caused. Absent from servers without tracker triggers. */
2044
2093
  admissions: z11.object({
@@ -2051,8 +2100,8 @@ var trackerIngestResultSchema = z11.object({
2051
2100
  */
2052
2101
  filtered: count.optional()
2053
2102
  }).optional()
2054
- });
2055
- var trackerOutcomeFields = {
2103
+ }))();
2104
+ var trackerOutcomeFields = /* @__PURE__ */ (() => ({
2056
2105
  /** Stable quest ID. */
2057
2106
  quest: identifier,
2058
2107
  /** Stable tracker ID. */
@@ -2067,7 +2116,7 @@ var trackerOutcomeFields = {
2067
2116
  updatedAt: timestamp,
2068
2117
  /** Null for automatic decisions; the staff actor after a retry. */
2069
2118
  actor: z11.string().nullable()
2070
- };
2119
+ }))();
2071
2120
  var trackerSkipCodes = [
2072
2121
  /** The quest is paused or no longer active. Catch-up after a pause is an operator decision. */
2073
2122
  "quest-paused",
@@ -2121,7 +2170,8 @@ var trackerSkipCodes = [
2121
2170
  /** A prerequisite quest was not complete when the record occurred. */
2122
2171
  "prerequisites-incomplete"
2123
2172
  ];
2124
- var trackerOutcomeSchema = z11.discriminatedUnion("state", [
2173
+ var skipEnrollmentSchema = /* @__PURE__ */ (() => z11.string().optional())();
2174
+ var trackerOutcomeSchema = /* @__PURE__ */ (() => z11.discriminatedUnion("state", [
2125
2175
  z11.object({
2126
2176
  ...trackerOutcomeFields,
2127
2177
  state: z11.literal("admitted"),
@@ -2141,12 +2191,14 @@ var trackerOutcomeSchema = z11.discriminatedUnion("state", [
2141
2191
  reason: z11.string(),
2142
2192
  /** Which window refused admission when `code` is `outside-window`. */
2143
2193
  window: z11.enum(["tracker", "quest"]).optional(),
2194
+ /** Which enrollment the member lacks when `code` is `not-enrolled`. */
2195
+ enrollment: skipEnrollmentSchema,
2144
2196
  /** The attributed member, when attribution got that far. */
2145
2197
  member: identifier.nullable(),
2146
2198
  attempt: identifier.nullable()
2147
2199
  })
2148
- ]);
2149
- var trackerOutcomeFilters = {
2200
+ ]))();
2201
+ var trackerOutcomeFilters = /* @__PURE__ */ (() => ({
2150
2202
  /** Quest key or ID. */
2151
2203
  quest: identifier.optional(),
2152
2204
  record: externalId.optional(),
@@ -2155,37 +2207,37 @@ var trackerOutcomeFilters = {
2155
2207
  /** Only skips with this code, such as `unlinked-account`. */
2156
2208
  code: z11.string().min(1).max(100).optional(),
2157
2209
  limit: z11.coerce.number().int().min(1).max(100).default(25)
2158
- };
2159
- var trackerTriggerOutcomeQuerySchema = z11.strictObject({
2210
+ }))();
2211
+ var trackerTriggerOutcomeQuerySchema = /* @__PURE__ */ (() => z11.strictObject({
2160
2212
  ...trackerOutcomeFilters,
2161
2213
  cursor: pageCursorSchema.optional()
2162
- });
2163
- var trackerTriggerOutcomePageSchema = z11.object({
2214
+ }))();
2215
+ var trackerTriggerOutcomePageSchema = /* @__PURE__ */ (() => z11.object({
2164
2216
  items: z11.array(trackerOutcomeSchema).max(100),
2165
2217
  nextCursor: pageCursorSchema.nullable()
2166
- });
2167
- var trackerOutcomeQuerySchema = z11.strictObject({
2218
+ }))();
2219
+ var trackerOutcomeQuerySchema = /* @__PURE__ */ (() => z11.strictObject({
2168
2220
  ...trackerOutcomeFilters,
2169
2221
  /** Opaque cursor from `next`: older outcomes. */
2170
2222
  before: z11.string().max(512).optional()
2171
- });
2172
- var trackerOutcomePageSchema = z11.strictObject({
2223
+ }))();
2224
+ var trackerOutcomePageSchema = /* @__PURE__ */ (() => z11.strictObject({
2173
2225
  /** Newest first. */
2174
2226
  items: z11.array(trackerOutcomeSchema).max(100),
2175
2227
  next: z11.string().nullable()
2176
- });
2177
- var trackerOutcomeRetrySchema = z11.strictObject({
2228
+ }))();
2229
+ var trackerOutcomeRetrySchema = /* @__PURE__ */ (() => z11.strictObject({
2178
2230
  actionId: identifier,
2179
2231
  /** Quest key or ID. */
2180
2232
  quest: identifier,
2181
2233
  record: externalId,
2182
2234
  observedAt: timestamp
2183
- });
2184
- var booleanQuery = z11.union([
2235
+ }))();
2236
+ var booleanQuery = /* @__PURE__ */ (() => z11.union([
2185
2237
  z11.boolean(),
2186
2238
  z11.enum(["true", "false"]).transform((v) => v === "true")
2187
- ]);
2188
- var trackerQuerySchema = z11.object({
2239
+ ]))();
2240
+ var trackerQuerySchema = /* @__PURE__ */ (() => z11.object({
2189
2241
  author: externalId.optional(),
2190
2242
  member: identifier.optional(),
2191
2243
  verified: booleanQuery.optional(),
@@ -2200,15 +2252,15 @@ var trackerQuerySchema = z11.object({
2200
2252
  }).strict().refine(
2201
2253
  (q) => q.since === void 0 || q.until === void 0 || q.until > q.since,
2202
2254
  "Until must follow since"
2203
- );
2204
- var trackerPageSchema = z11.object({
2255
+ ))();
2256
+ var trackerPageSchema = /* @__PURE__ */ (() => z11.object({
2205
2257
  tracker: identifier,
2206
2258
  items: z11.array(trackerRecordSchema),
2207
2259
  nextCursor: z11.string().nullable(),
2208
2260
  total: count,
2209
2261
  status: trackerStatusSchema
2210
- });
2211
- var trackerSummarySchema = z11.object({
2262
+ }))();
2263
+ var trackerSummarySchema = /* @__PURE__ */ (() => z11.object({
2212
2264
  records: count,
2213
2265
  authors: count,
2214
2266
  metrics: z11.object({
@@ -2221,31 +2273,31 @@ var trackerSummarySchema = z11.object({
2221
2273
  }),
2222
2274
  missingMetrics: count,
2223
2275
  status: trackerStatusSchema
2224
- });
2276
+ }))();
2225
2277
  var trackerPreviewLimits = {
2226
2278
  pages: 3,
2227
2279
  posts: 100,
2228
2280
  days: 30
2229
2281
  };
2230
- var trackerPreviewInputSchema = z11.object({
2282
+ var trackerPreviewInputSchema = /* @__PURE__ */ (() => z11.object({
2231
2283
  query: xSearchSourceSchema.shape.query,
2232
2284
  /** Start of the searched window. The window ends when the sample is fetched. */
2233
2285
  since: timestamp
2234
- }).strict();
2235
- var trackerPreviewSchema = z11.object({
2286
+ }).strict())();
2287
+ var trackerPreviewSchema = /* @__PURE__ */ (() => z11.object({
2236
2288
  query: z11.string(),
2237
2289
  since: timestamp,
2238
2290
  fetchedAt: timestamp,
2239
2291
  pages: count,
2240
2292
  /** Every match in the sample, newest first, verified or not. */
2241
- posts: z11.array(xTweetSchema).max(trackerPreviewLimits.posts),
2293
+ posts: z11.array(xTweetSchema).max(limits.trackerPreview.posts),
2242
2294
  /** X had more matches than the sample holds. */
2243
2295
  more: z11.boolean()
2244
- });
2296
+ }))();
2245
2297
 
2246
2298
  // src/content.ts
2247
2299
  import * as z12 from "zod";
2248
- var contentQualificationDecisionSchema = z12.strictObject({
2300
+ var contentQualificationDecisionSchema = /* @__PURE__ */ (() => z12.strictObject({
2249
2301
  kind: z12.enum([
2250
2302
  "accept",
2251
2303
  "reject",
@@ -2255,15 +2307,15 @@ var contentQualificationDecisionSchema = z12.strictObject({
2255
2307
  "superseded"
2256
2308
  ]),
2257
2309
  reason: z12.string().nullable()
2258
- });
2259
- var contentQualificationQuerySchema = z12.strictObject({
2310
+ }))();
2311
+ var contentQualificationQuerySchema = /* @__PURE__ */ (() => z12.strictObject({
2260
2312
  quest: identifier,
2261
2313
  member: identifier.optional(),
2262
2314
  /** A content item's record ID in the quest's tracker. */
2263
2315
  content: z12.string().min(1).max(256).optional(),
2264
2316
  cursor: pageCursorSchema.optional()
2265
- });
2266
- var contentQualificationSchema = z12.strictObject({
2317
+ }))();
2318
+ var contentQualificationSchema = /* @__PURE__ */ (() => z12.strictObject({
2267
2319
  quest: identifier,
2268
2320
  /** The content item's record ID in the quest's tracker. */
2269
2321
  content: z12.string(),
@@ -2290,32 +2342,32 @@ var contentQualificationSchema = z12.strictObject({
2290
2342
  completion: identifier.nullable(),
2291
2343
  state: z12.enum(["unresolved", "awarded", "excluded"])
2292
2344
  })
2293
- });
2294
- var contentQualificationPageSchema = z12.strictObject({
2345
+ }))();
2346
+ var contentQualificationPageSchema = /* @__PURE__ */ (() => z12.strictObject({
2295
2347
  items: z12.array(contentQualificationSchema),
2296
2348
  nextCursor: pageCursorSchema.nullable()
2297
- });
2349
+ }))();
2298
2350
  var contentMetricSchema = contentMetricNameSchema;
2299
- var contentMetricsSchema = z12.record(
2351
+ var contentMetricsSchema = /* @__PURE__ */ (() => z12.record(
2300
2352
  contentMetricSchema,
2301
2353
  z12.number().int().safe().nonnegative()
2302
- );
2303
- var contentPerformancePolicySchema = z12.strictObject({
2354
+ ))();
2355
+ var contentPerformancePolicySchema = /* @__PURE__ */ (() => z12.strictObject({
2304
2356
  metrics: z12.array(contentMetricSchema).min(1).max(10).refine(
2305
2357
  (values2) => new Set(values2).size === values2.length,
2306
2358
  "Metrics must be unique"
2307
2359
  ),
2308
2360
  maxAgeMs: z12.number().int().positive().max(864e5).default(36e5)
2309
- });
2361
+ }))();
2310
2362
 
2311
2363
  // src/counters.ts
2312
2364
  import * as z13 from "zod";
2313
2365
  var day = 864e5;
2314
- var counterGoalSchema = z13.object({
2366
+ var counterGoalSchema = /* @__PURE__ */ (() => z13.object({
2315
2367
  kind: z13.literal("count"),
2316
2368
  count: z13.number().int().min(1).max(1e4)
2317
- }).strict();
2318
- var counterWindowSchema = z13.discriminatedUnion("kind", [
2369
+ }).strict())();
2370
+ var counterWindowSchema = /* @__PURE__ */ (() => z13.discriminatedUnion("kind", [
2319
2371
  z13.object({ kind: z13.literal("lifetime") }).strict(),
2320
2372
  z13.object({
2321
2373
  kind: z13.literal("calendar"),
@@ -2326,20 +2378,20 @@ var counterWindowSchema = z13.discriminatedUnion("kind", [
2326
2378
  kind: z13.literal("rolling"),
2327
2379
  durationMs: z13.number().int().min(1).max(365 * day)
2328
2380
  }).strict()
2329
- ]);
2330
- var counterPolicySchema = z13.object({
2381
+ ]))();
2382
+ var counterPolicySchema = /* @__PURE__ */ (() => z13.object({
2331
2383
  kind: z13.literal("progress"),
2332
2384
  goal: counterGoalSchema,
2333
2385
  window: counterWindowSchema,
2334
2386
  repeat: z13.enum(["once", "repeat"]).default("once")
2335
- }).strict();
2336
- var achievementBase = z13.object({
2387
+ }).strict())();
2388
+ var achievementBase = /* @__PURE__ */ (() => z13.object({
2337
2389
  id: identifier,
2338
2390
  ordinal: z13.number().int().positive(),
2339
2391
  achievedAt: z13.number().int(),
2340
2392
  window: z13.string()
2341
- });
2342
- var counterAchievementSchema = z13.discriminatedUnion("status", [
2393
+ }))();
2394
+ var counterAchievementSchema = /* @__PURE__ */ (() => z13.discriminatedUnion("status", [
2343
2395
  achievementBase.extend({
2344
2396
  status: z13.literal("revoked"),
2345
2397
  completion: identifier,
@@ -2353,8 +2405,8 @@ var counterAchievementSchema = z13.discriminatedUnion("status", [
2353
2405
  status: z13.literal("budget-exhausted"),
2354
2406
  budget: identifier
2355
2407
  })
2356
- ]);
2357
- var counterProgressSchema = z13.object({
2408
+ ]))();
2409
+ var counterProgressSchema = /* @__PURE__ */ (() => z13.object({
2358
2410
  goal: z13.number().int().positive(),
2359
2411
  current: z13.number().int().nonnegative(),
2360
2412
  window: z13.object({
@@ -2365,8 +2417,8 @@ var counterProgressSchema = z13.object({
2365
2417
  repeat: z13.enum(["once", "repeat"]),
2366
2418
  settled: z13.number().int().nonnegative(),
2367
2419
  latest: counterAchievementSchema.nullable()
2368
- });
2369
- var counterContributionSchema = z13.object({
2420
+ }))();
2421
+ var counterContributionSchema = /* @__PURE__ */ (() => z13.object({
2370
2422
  id: identifier,
2371
2423
  distinct: z13.string(),
2372
2424
  attempt: identifier,
@@ -2376,25 +2428,25 @@ var counterContributionSchema = z13.object({
2376
2428
  status: z13.enum(["counted", "late", "future", "excluded"]),
2377
2429
  achievement: counterAchievementSchema.nullable(),
2378
2430
  reason: z13.string().nullable()
2379
- });
2380
- var counterHistorySchema = z13.object({
2431
+ }))();
2432
+ var counterHistorySchema = /* @__PURE__ */ (() => z13.object({
2381
2433
  items: z13.array(counterContributionSchema),
2382
2434
  nextCursor: z13.string().nullable()
2383
- });
2384
- var counterModerationSchema = z13.object({
2435
+ }))();
2436
+ var counterModerationSchema = /* @__PURE__ */ (() => z13.object({
2385
2437
  actionId: z13.uuid(),
2386
2438
  excluded: z13.boolean(),
2387
2439
  reason: z13.string().trim().min(1).max(2e3)
2388
- }).strict();
2389
- var counterHistoryQuerySchema = z13.object({
2440
+ }).strict())();
2441
+ var counterHistoryQuerySchema = /* @__PURE__ */ (() => z13.object({
2390
2442
  cursor: z13.string().max(2e3).optional(),
2391
2443
  limit: z13.coerce.number().int().min(1).max(100).optional()
2392
- }).strict();
2393
- var counterModerationResultSchema = z13.object({ excluded: z13.boolean() });
2444
+ }).strict())();
2445
+ var counterModerationResultSchema = /* @__PURE__ */ (() => z13.object({ excluded: z13.boolean() }))();
2394
2446
 
2395
2447
  // src/calendar.ts
2396
2448
  import * as z14 from "zod";
2397
- var timestamp2 = z14.number().int().safe();
2449
+ var timestamp2 = /* @__PURE__ */ (() => z14.number().int().safe())();
2398
2450
  var fixedOffset = /^(?:[+-]|(?:Etc\/)?GMT[+-]\d|(?:EST|MST|HST)$)/i;
2399
2451
  function canonicalTimeZone(zone) {
2400
2452
  let resolved;
@@ -2410,7 +2462,7 @@ function canonicalTimeZone(zone) {
2410
2462
  }
2411
2463
  return fixedOffset.test(zone) || fixedOffset.test(resolved) ? null : resolved;
2412
2464
  }
2413
- var timeZoneSchema = z14.string().min(1).max(100).transform((zone, ctx) => {
2465
+ var timeZoneSchema = /* @__PURE__ */ (() => z14.string().min(1).max(100).transform((zone, ctx) => {
2414
2466
  const canonical = canonicalTimeZone(zone);
2415
2467
  if (canonical === null) {
2416
2468
  ctx.addIssue({
@@ -2420,8 +2472,8 @@ var timeZoneSchema = z14.string().min(1).max(100).transform((zone, ctx) => {
2420
2472
  return z14.NEVER;
2421
2473
  }
2422
2474
  return canonical;
2423
- });
2424
- var timeZoneNameSchema = z14.string().min(1).max(100);
2475
+ }))();
2476
+ var timeZoneNameSchema = /* @__PURE__ */ (() => z14.string().min(1).max(100))();
2425
2477
  var movedTimeZone = (what) => `${what} no longer take a timeZone: they follow the project calendar. Set calendar.timeZone in relay.json or in Console settings.`;
2426
2478
  var record6 = (value) => typeof value === "object" && value !== null;
2427
2479
  function refuseStreakTimeZone(value, ctx) {
@@ -2445,8 +2497,8 @@ function refuseWindowTimeZone(value, ctx) {
2445
2497
  }
2446
2498
  return value;
2447
2499
  }
2448
- var calendarPeriodSchema = z14.enum(["lifetime", "day", "week", "month"]);
2449
- var projectCalendarSchema = z14.object({
2500
+ var calendarPeriodSchema = /* @__PURE__ */ (() => z14.enum(["lifetime", "day", "week", "month"]))();
2501
+ var projectCalendarSchema = /* @__PURE__ */ (() => z14.object({
2450
2502
  /** The timezone of the current calendar day. */
2451
2503
  timeZone: timeZoneNameSchema,
2452
2504
  /** The current calendar date, such as `2026-10-01`. */
@@ -2462,21 +2514,21 @@ var projectCalendarSchema = z14.object({
2462
2514
  * v1. The calendar reads it as UTC until an operator chooses a timezone. Null otherwise.
2463
2515
  */
2464
2516
  unsupported: z14.string().nullable().default(null)
2465
- });
2466
- var projectCalendarInputSchema = z14.object({
2517
+ }))();
2518
+ var projectCalendarInputSchema = /* @__PURE__ */ (() => z14.object({
2467
2519
  actionId: identifier,
2468
2520
  timeZone: timeZoneSchema,
2469
2521
  reason: z14.string().trim().min(1).max(500)
2470
- }).strict();
2471
- var projectCalendarDeclarationSchema = z14.object({ timeZone: timeZoneSchema }).strict();
2522
+ }).strict())();
2523
+ var projectCalendarDeclarationSchema = /* @__PURE__ */ (() => z14.object({ timeZone: timeZoneSchema }).strict())();
2472
2524
 
2473
2525
  // src/streaks.ts
2474
2526
  import * as z15 from "zod";
2475
- var streakPolicySchema = z15.object({
2527
+ var streakPolicySchema = /* @__PURE__ */ (() => z15.object({
2476
2528
  kind: z15.literal("streak"),
2477
2529
  days: z15.number().int().min(1).max(3650)
2478
- });
2479
- var streakProgressSchema = z15.object({
2530
+ }))();
2531
+ var streakProgressSchema = /* @__PURE__ */ (() => z15.object({
2480
2532
  goal: z15.number().int().positive(),
2481
2533
  current: z15.number().int().nonnegative(),
2482
2534
  best: z15.number().int().nonnegative(),
@@ -2510,29 +2562,29 @@ var streakProgressSchema = z15.object({
2510
2562
  achievedAt: z15.number().int()
2511
2563
  })
2512
2564
  ])
2513
- });
2565
+ }))();
2514
2566
 
2515
2567
  // src/tracker-triggers.ts
2516
2568
  import * as z16 from "zod";
2517
- var timestamp3 = z16.number().int().safe().nonnegative().max(864e13);
2518
- var count2 = z16.number().int().safe().nonnegative();
2519
- var trackerTriggerModeSchema = z16.enum([
2569
+ var timestamp3 = /* @__PURE__ */ (() => z16.number().int().safe().nonnegative().max(864e13))();
2570
+ var count2 = /* @__PURE__ */ (() => z16.number().int().safe().nonnegative())();
2571
+ var trackerTriggerModeSchema = /* @__PURE__ */ (() => z16.enum([
2520
2572
  "new-record",
2521
2573
  "new-observation",
2522
2574
  "data-changed"
2523
- ]);
2524
- function defaultTriggerMode(source) {
2525
- return source === "custom" ? "new-observation" : "new-record";
2575
+ ]))();
2576
+ function defaultTriggerMode(source, namespace) {
2577
+ return source === "custom" && namespace !== telegramMessagesNamespace && namespace !== telegramReactionsNamespace ? "new-observation" : "new-record";
2526
2578
  }
2527
- var trackerBoundSchema = z16.union([
2579
+ var trackerBoundSchema = /* @__PURE__ */ (() => z16.union([
2528
2580
  z16.number().finite(),
2529
2581
  z16.strictObject({ setting: z16.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) })
2530
- ]);
2531
- var dataPath = z16.string().max(200).regex(
2582
+ ]))();
2583
+ var dataPath = /* @__PURE__ */ (() => z16.string().max(200).regex(
2532
2584
  /^[^.\s]+(\.[^.\s]+)*$/,
2533
2585
  "Use dot-separated keys, such as metrics.likes"
2534
- );
2535
- var trackerConditionSchema = z16.union([
2586
+ ))();
2587
+ var trackerConditionSchema = /* @__PURE__ */ (() => z16.union([
2536
2588
  z16.strictObject({
2537
2589
  path: dataPath,
2538
2590
  equals: z16.union([z16.string().max(1e3), z16.number().finite(), z16.boolean()])
@@ -2549,11 +2601,11 @@ var trackerConditionSchema = z16.union([
2549
2601
  ),
2550
2602
  "Compare with equals, gt, gte, lt or lte"
2551
2603
  )
2552
- ]);
2553
- var trackerWhereSchema = z16.union([
2604
+ ]))();
2605
+ var trackerWhereSchema = /* @__PURE__ */ (() => z16.union([
2554
2606
  trackerConditionSchema,
2555
2607
  z16.array(trackerConditionSchema).min(1).max(10)
2556
- ]);
2608
+ ]))();
2557
2609
  function whereConditions(where) {
2558
2610
  return where === void 0 ? [] : Array.isArray(where) ? where : [where];
2559
2611
  }
@@ -2564,10 +2616,10 @@ function whereSettings(where) {
2564
2616
  )
2565
2617
  );
2566
2618
  }
2567
- var triggerEnrollmentSchema = z16.enum(["none", "required"]);
2568
- var triggerSinceSchema = z16.enum(["activation", "window", "enrollment"]);
2569
- var triggerHistoricalSchema = z16.enum(["staff", "claim", "automatic"]);
2570
- var trackerTriggerPolicySchema = z16.strictObject({
2619
+ var triggerEnrollmentSchema = /* @__PURE__ */ (() => z16.enum(["none", "required"]))();
2620
+ var triggerSinceSchema = /* @__PURE__ */ (() => z16.enum(["activation", "window", "enrollment"]))();
2621
+ var triggerHistoricalSchema = /* @__PURE__ */ (() => z16.enum(["staff", "claim", "automatic"]))();
2622
+ var trackerTriggerPolicySchema = /* @__PURE__ */ (() => z16.strictObject({
2571
2623
  /** The tracker's authoring key; publication binds it to the tracker's stable ID. */
2572
2624
  tracker: identifier,
2573
2625
  /**
@@ -2599,7 +2651,7 @@ var trackerTriggerPolicySchema = z16.strictObject({
2599
2651
  }).refine(
2600
2652
  (policy) => policy.since !== "enrollment" || policy.enrollment === "required",
2601
2653
  'since: "enrollment" needs enrollment: "required"'
2602
- );
2654
+ ))();
2603
2655
  function triggerMode(policy) {
2604
2656
  return policy.on;
2605
2657
  }
@@ -2613,7 +2665,7 @@ function triggerAdmission(policy) {
2613
2665
  function beneficiaryRole(policy) {
2614
2666
  return policy.beneficiary;
2615
2667
  }
2616
- var xLink = {
2668
+ var xLink = /* @__PURE__ */ (() => ({
2617
2669
  issuer: z16.string().min(1),
2618
2670
  /** The account's stable user ID. */
2619
2671
  subject: z16.string().min(1).max(256),
@@ -2621,8 +2673,8 @@ var xLink = {
2621
2673
  revision: count2,
2622
2674
  /** When the member linked the account; null when unknown. */
2623
2675
  linkedAt: timestamp3.nullable()
2624
- };
2625
- var trackerAttributionSchema = z16.object({
2676
+ }))();
2677
+ var trackerAttributionSchema = /* @__PURE__ */ (() => z16.object({
2626
2678
  member: identifier,
2627
2679
  capturedAt: timestamp3,
2628
2680
  account: z16.union([
@@ -2643,7 +2695,7 @@ var trackerAttributionSchema = z16.object({
2643
2695
  id: identifier
2644
2696
  }),
2645
2697
  z16.object({
2646
- /** Your app's identity kind, such as `app:telegram`. */
2698
+ /** Your app's identity kind, such as `app:game`. */
2647
2699
  provider: appIdentityKindSchema,
2648
2700
  /** The subject your app signed the member in with, as the record names it. */
2649
2701
  subject: z16.string().min(1).max(256),
@@ -2655,8 +2707,8 @@ var trackerAttributionSchema = z16.object({
2655
2707
  /** A kind a later Relay adds. */
2656
2708
  z16.object({ provider: z16.string().min(1) })
2657
2709
  ])
2658
- });
2659
- var trackerTriggerRecordSchema = z16.object({
2710
+ }))();
2711
+ var trackerTriggerRecordSchema = /* @__PURE__ */ (() => z16.object({
2660
2712
  id: z16.string().min(1).max(256),
2661
2713
  source: z16.string(),
2662
2714
  occurredAt: timestamp3,
@@ -2670,16 +2722,16 @@ var trackerTriggerRecordSchema = z16.object({
2670
2722
  accounts: z16.record(accountRoleSchema, trackerRecordAccountSchema).optional(),
2671
2723
  data: z16.record(z16.string(), z16.json()),
2672
2724
  removed: z16.boolean()
2673
- });
2674
- var trackerContentStageSchema = z16.object({
2725
+ }))();
2726
+ var trackerContentStageSchema = /* @__PURE__ */ (() => z16.object({
2675
2727
  /** The body's revision: the hash of its canonical JSON. Edits make a new one. */
2676
2728
  revision: identifier,
2677
2729
  /** The captured observation that carried this body. */
2678
2730
  observation: identifier,
2679
2731
  /** The body: an X post's normalized body, or a custom record's `data.body`. */
2680
2732
  body: z16.record(z16.string(), z16.json())
2681
- });
2682
- var trackerTriggerContextSchema = z16.object({
2733
+ }))();
2734
+ var trackerTriggerContextSchema = /* @__PURE__ */ (() => z16.object({
2683
2735
  /** The tracker's stable ID. */
2684
2736
  tracker: identifier,
2685
2737
  /** The tracker's authoring key. */
@@ -2698,11 +2750,11 @@ var trackerTriggerContextSchema = z16.object({
2698
2750
  * When the member enrolled in the quest. Present only on quests that require enrollment.
2699
2751
  */
2700
2752
  enrolledAt: timestamp3.optional()
2701
- });
2753
+ }))();
2702
2754
 
2703
2755
  // src/reject-codes.ts
2704
2756
  import * as z17 from "zod";
2705
- var reservedAttemptCodes = Object.freeze([
2757
+ var reservedAttemptCodes = /* @__PURE__ */ (() => Object.freeze([
2706
2758
  "budget-exhausted",
2707
2759
  "defer-expired",
2708
2760
  "defer-limit-exceeded",
@@ -2715,7 +2767,7 @@ var reservedAttemptCodes = Object.freeze([
2715
2767
  "author-error",
2716
2768
  "evaluator-error",
2717
2769
  "capability-limit"
2718
- ]);
2770
+ ]))();
2719
2771
  var rejectCodeMaxLength = 64;
2720
2772
  var rejectCodePattern = /^[a-z0-9-]+$/;
2721
2773
  function rejectCodeIssue(code) {
@@ -2727,12 +2779,12 @@ function rejectCodeIssue(code) {
2727
2779
  }
2728
2780
  return null;
2729
2781
  }
2730
- var rejectCodeSchema = z17.string().superRefine((code, context) => {
2782
+ var rejectCodeSchema = /* @__PURE__ */ (() => z17.string().superRefine((code, context) => {
2731
2783
  const issue = rejectCodeIssue(code);
2732
2784
  if (issue) {
2733
2785
  context.addIssue({ code: "custom", message: issue });
2734
2786
  }
2735
- });
2787
+ }))();
2736
2788
 
2737
2789
  // src/sdk-runtime.ts
2738
2790
  import * as z18 from "zod";
@@ -2746,24 +2798,24 @@ var sdkRuntimeLimits = {
2746
2798
  /** Characters of module source, summed over all modules. */
2747
2799
  size: 2e6
2748
2800
  };
2749
- var sha256 = z18.string().regex(/^[0-9a-f]{64}$/);
2750
- var sdkRuntimeModulePathSchema = z18.string().max(200).regex(/^[a-z0-9_][a-z0-9_.-]*(\/[a-z0-9_][a-z0-9_.-]*)*\.js$/i).refine(
2801
+ var sha256 = /* @__PURE__ */ (() => z18.string().regex(/^[0-9a-f]{64}$/))();
2802
+ var sdkRuntimeModulePathSchema = /* @__PURE__ */ (() => z18.string().max(200).regex(/^[a-z0-9_][a-z0-9_.-]*(\/[a-z0-9_][a-z0-9_.-]*)*\.js$/i).refine(
2751
2803
  (path) => !path.split("/").some((part) => part === "." || part === ".."),
2752
2804
  "Runtime module paths cannot contain . or .. segments"
2753
- );
2754
- var sdkRuntimeReferenceSchema = z18.object({
2805
+ ))();
2806
+ var sdkRuntimeReferenceSchema = /* @__PURE__ */ (() => z18.object({
2755
2807
  digest: sha256,
2756
2808
  /** The SDK version that built the runtime, for display. The digest is what pins it. */
2757
2809
  sdkVersion: z18.string().min(1).max(64)
2758
- }).strict();
2759
- var sdkRuntimeModulesSchema = z18.record(sdkRuntimeModulePathSchema, z18.string().min(1)).refine((modules) => {
2810
+ }).strict())();
2811
+ var sdkRuntimeModulesSchema = /* @__PURE__ */ (() => z18.record(sdkRuntimeModulePathSchema, z18.string().min(1)).refine((modules) => {
2760
2812
  const entries = Object.values(modules);
2761
- return entries.length > 0 && entries.length <= sdkRuntimeLimits.modules && entries.reduce((sum, source) => sum + source.length, 0) <= sdkRuntimeLimits.size;
2762
- }, `A runtime has 1 to ${sdkRuntimeLimits.modules} modules and at most ${sdkRuntimeLimits.size} characters of source`);
2763
- var sdkRuntimeSchema = sdkRuntimeReferenceSchema.extend({
2813
+ return entries.length > 0 && entries.length <= limits.sdkRuntime.modules && entries.reduce((sum, source) => sum + source.length, 0) <= limits.sdkRuntime.size;
2814
+ }, `A runtime has 1 to ${limits.sdkRuntime.modules} modules and at most ${limits.sdkRuntime.size} characters of source`))();
2815
+ var sdkRuntimeSchema = /* @__PURE__ */ (() => sdkRuntimeReferenceSchema.extend({
2764
2816
  zodVersion: z18.string().min(1).max(64),
2765
2817
  modules: sdkRuntimeModulesSchema
2766
- }).strict();
2818
+ }).strict())();
2767
2819
  async function sdkRuntimeDigest(modules) {
2768
2820
  const canonical = JSON.stringify(
2769
2821
  Object.entries(modules).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
@@ -2777,8 +2829,8 @@ async function sdkRuntimeDigest(modules) {
2777
2829
 
2778
2830
  // src/completion.ts
2779
2831
  import * as z19 from "zod";
2780
- var name = z19.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/);
2781
- var completionPolicySchema = z19.discriminatedUnion("kind", [
2832
+ var name = /* @__PURE__ */ (() => z19.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/))();
2833
+ var completionPolicySchema = /* @__PURE__ */ (() => z19.discriminatedUnion("kind", [
2782
2834
  streakPolicySchema,
2783
2835
  counterPolicySchema,
2784
2836
  z19.object({ kind: z19.literal("once") }).strict(),
@@ -2790,9 +2842,9 @@ var completionPolicySchema = z19.discriminatedUnion("kind", [
2790
2842
  */
2791
2843
  across: z19.literal("members").optional()
2792
2844
  }).strict()
2793
- ]);
2794
- var completionKeySchema = z19.string().min(1).max(500);
2795
- var budgetSchema = z19.object({
2845
+ ]))();
2846
+ var completionKeySchema = /* @__PURE__ */ (() => z19.string().min(1).max(500))();
2847
+ var budgetSchema = /* @__PURE__ */ (() => z19.object({
2796
2848
  id: name,
2797
2849
  scope: z19.enum(["member", "project"]),
2798
2850
  /**
@@ -2806,29 +2858,29 @@ var budgetSchema = z19.object({
2806
2858
  z19.number().int().positive().max(Number.MAX_SAFE_INTEGER),
2807
2859
  z19.object({ balance: name }).strict()
2808
2860
  ])
2809
- }).strict();
2810
- var authorBudgetSchema = budgetSchema.extend({ scope: z19.literal("author") }).strict();
2811
- var memberCompletionSchema = z19.object({
2861
+ }).strict())();
2862
+ var authorBudgetSchema = /* @__PURE__ */ (() => budgetSchema.extend({ scope: z19.literal("author") }).strict())();
2863
+ var memberCompletionSchema = /* @__PURE__ */ (() => z19.object({
2812
2864
  quest: z19.string().min(1).max(200),
2813
2865
  key: completionKeySchema,
2814
2866
  completedAt: z19.number().int().nonnegative().safe().nullable()
2815
- });
2867
+ }))();
2816
2868
  var maxMemberCompletions = 100;
2817
2869
 
2818
2870
  // src/integrations.ts
2819
2871
  import * as z20 from "zod";
2820
- var evaluatorIntegrationProviderSchema = z20.enum(["discord", "x"]);
2821
- var integrationModuleProviderSchema = z20.string().regex(
2872
+ var evaluatorIntegrationProviderSchema = /* @__PURE__ */ (() => z20.enum(["discord", "x"]))();
2873
+ var integrationModuleProviderSchema = /* @__PURE__ */ (() => z20.string().regex(
2822
2874
  /^[a-z][a-z0-9-]{0,63}$/,
2823
2875
  "Name an integration module provider, such as discord"
2824
- );
2825
- var integrationProviderSchema = z20.enum(["discord"]);
2826
- var discordServerSchema = z20.object({
2876
+ ))();
2877
+ var integrationProviderSchema = /* @__PURE__ */ (() => z20.enum(["discord"]))();
2878
+ var discordServerSchema = /* @__PURE__ */ (() => z20.object({
2827
2879
  id: z20.string().regex(/^[0-9]{1,20}$/),
2828
2880
  name: z20.string().min(1),
2829
2881
  icon: z20.string().nullable()
2830
- });
2831
- var projectIntegrationSchema = z20.object({
2882
+ }))();
2883
+ var projectIntegrationSchema = /* @__PURE__ */ (() => z20.object({
2832
2884
  provider: integrationProviderSchema,
2833
2885
  configured: z20.boolean(),
2834
2886
  status: z20.enum(["disconnected", "ready", "attention"]),
@@ -2836,10 +2888,10 @@ var projectIntegrationSchema = z20.object({
2836
2888
  server: discordServerSchema.nullable(),
2837
2889
  issue: z20.string().nullable(),
2838
2890
  connectedAt: z20.number().default(0)
2839
- });
2840
- var organizationDiscordServersSchema = z20.object({
2891
+ }))();
2892
+ var organizationDiscordServersSchema = /* @__PURE__ */ (() => z20.object({
2841
2893
  servers: z20.array(discordServerSchema)
2842
- });
2894
+ }))();
2843
2895
 
2844
2896
  // src/announcement-template.ts
2845
2897
  var announcementPlaceholders = [
@@ -2849,7 +2901,7 @@ var announcementPlaceholders = [
2849
2901
  "points",
2850
2902
  "rewards"
2851
2903
  ];
2852
- var placeholderNames = new Set(announcementPlaceholders);
2904
+ var placeholderNames = /* @__PURE__ */ (() => new Set(announcementPlaceholders))();
2853
2905
  function parseAnnouncementTemplate(text) {
2854
2906
  const segments = [];
2855
2907
  let literal18 = "";
@@ -2899,13 +2951,13 @@ function parseAnnouncementTemplate(text) {
2899
2951
 
2900
2952
  // src/announcements.ts
2901
2953
  import * as z21 from "zod";
2902
- var announcementTextSchema = z21.string().trim().min(1).max(1e3).superRefine((text, context) => {
2954
+ var announcementTextSchema = /* @__PURE__ */ (() => z21.string().trim().min(1).max(1e3).superRefine((text, context) => {
2903
2955
  const parsed = parseAnnouncementTemplate(text);
2904
2956
  if ("error" in parsed) {
2905
2957
  context.addIssue({ code: "custom", message: parsed.error });
2906
2958
  }
2907
- });
2908
- var announcementFields = {
2959
+ }))();
2960
+ var announcementFields = /* @__PURE__ */ (() => ({
2909
2961
  action: z21.literal("post-message"),
2910
2962
  text: announcementTextSchema,
2911
2963
  /**
@@ -2914,35 +2966,35 @@ var announcementFields = {
2914
2966
  * post is a plain message otherwise.
2915
2967
  */
2916
2968
  replyToTriggeringMessage: z21.boolean().optional()
2917
- };
2918
- var telegramAnnouncementSchema = z21.strictObject({
2969
+ }))();
2970
+ var telegramAnnouncementSchema = /* @__PURE__ */ (() => z21.strictObject({
2919
2971
  provider: z21.literal("telegram"),
2920
2972
  /** The chat's numeric ID, as `settings.telegramChat()` holds it. */
2921
2973
  chat: telegramChatIdSchema,
2922
2974
  ...announcementFields
2923
- });
2924
- var discordAnnouncementSchema = z21.strictObject({
2975
+ }))();
2976
+ var discordAnnouncementSchema = /* @__PURE__ */ (() => z21.strictObject({
2925
2977
  provider: z21.literal("discord"),
2926
2978
  /** The channel's ID, as a `discord.channels()` resource setting holds it. */
2927
2979
  channel: z21.string().regex(/^[0-9]{1,20}$/),
2928
2980
  ...announcementFields
2929
- });
2930
- var announcementSchema = z21.discriminatedUnion("provider", [
2981
+ }))();
2982
+ var announcementSchema = /* @__PURE__ */ (() => z21.discriminatedUnion("provider", [
2931
2983
  telegramAnnouncementSchema,
2932
2984
  discordAnnouncementSchema
2933
- ]);
2985
+ ]))();
2934
2986
 
2935
2987
  // src/submission-input.ts
2936
2988
  import * as z22 from "zod";
2937
- var textOptionsSchema = z22.object({
2989
+ var textOptionsSchema = /* @__PURE__ */ (() => z22.object({
2938
2990
  required: z22.boolean().default(true),
2939
2991
  minLength: z22.number().int().min(0).max(1e4).default(1),
2940
2992
  maxLength: z22.number().int().min(1).max(1e4).default(1e4)
2941
2993
  }).strict().refine(
2942
2994
  (v) => v.minLength <= v.maxLength,
2943
2995
  "minLength must not exceed maxLength"
2944
- );
2945
- var hostSchema = z22.string().min(1).max(253).refine((host) => {
2996
+ ))();
2997
+ var hostSchema = /* @__PURE__ */ (() => z22.string().min(1).max(253).refine((host) => {
2946
2998
  if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/i.test(host) || host.includes("..")) {
2947
2999
  return false;
2948
3000
  }
@@ -2952,17 +3004,17 @@ var hostSchema = z22.string().min(1).max(253).refine((host) => {
2952
3004
  } catch {
2953
3005
  return false;
2954
3006
  }
2955
- }, "Use a hostname without a scheme, path, port, or wildcard");
2956
- var urlOptionsSchema = z22.object({
3007
+ }, "Use a hostname without a scheme, path, port, or wildcard"))();
3008
+ var urlOptionsSchema = /* @__PURE__ */ (() => z22.object({
2957
3009
  required: z22.boolean().default(true),
2958
3010
  allowedHosts: z22.array(hostSchema).min(1).max(100).optional()
2959
- }).strict();
2960
- var textEvidenceSchema = z22.object({ kind: z22.literal("text"), value: z22.string().max(1e4) }).strict();
2961
- var urlEvidenceSchema = z22.object({ kind: z22.literal("url"), value: z22.string().max(2048) }).strict();
2962
- var valueEvidenceSchema = z22.discriminatedUnion("kind", [
3011
+ }).strict())();
3012
+ var textEvidenceSchema = /* @__PURE__ */ (() => z22.object({ kind: z22.literal("text"), value: z22.string().max(1e4) }).strict())();
3013
+ var urlEvidenceSchema = /* @__PURE__ */ (() => z22.object({ kind: z22.literal("url"), value: z22.string().max(2048) }).strict())();
3014
+ var valueEvidenceSchema = /* @__PURE__ */ (() => z22.discriminatedUnion("kind", [
2963
3015
  textEvidenceSchema,
2964
3016
  urlEvidenceSchema
2965
- ]);
3017
+ ]))();
2966
3018
  function validateSubmissionValue(input, contract) {
2967
3019
  const maximum = input.kind === "text" ? 1e4 : 2048;
2968
3020
  if (input.value.length > maximum) {
@@ -3023,21 +3075,21 @@ function xPostId(value) {
3023
3075
 
3024
3076
  // src/quiz.ts
3025
3077
  import * as z23 from "zod";
3026
- var quizId = z23.string().regex(/^[a-zA-Z0-9_-]+$/).max(100);
3027
- var quizChoiceSchema = z23.object({ id: quizId, label: z23.string().trim().min(1).max(500) }).strict();
3028
- var quizQuestionSchema = z23.object({
3078
+ var quizId = /* @__PURE__ */ (() => z23.string().regex(/^[a-zA-Z0-9_-]+$/).max(100))();
3079
+ var quizChoiceSchema = /* @__PURE__ */ (() => z23.object({ id: quizId, label: z23.string().trim().min(1).max(500) }).strict())();
3080
+ var quizQuestionSchema = /* @__PURE__ */ (() => z23.object({
3029
3081
  id: quizId,
3030
3082
  prompt: z23.string().trim().min(1).max(1e3),
3031
3083
  choices: z23.array(quizChoiceSchema).min(2).max(8).refine(
3032
3084
  (choices) => new Set(choices.map((choice) => choice.id)).size === choices.length,
3033
3085
  "Choice IDs must be unique"
3034
3086
  )
3035
- }).strict();
3036
- var quizQuestionsSchema = z23.array(quizQuestionSchema).min(1).max(20).refine(
3087
+ }).strict())();
3088
+ var quizQuestionsSchema = /* @__PURE__ */ (() => z23.array(quizQuestionSchema).min(1).max(20).refine(
3037
3089
  (questions) => new Set(questions.map((question) => question.id)).size === questions.length,
3038
3090
  "Question IDs must be unique"
3039
- );
3040
- var quizContentSchema = z23.array(
3091
+ ))();
3092
+ var quizContentSchema = /* @__PURE__ */ (() => z23.array(
3041
3093
  quizQuestionSchema.extend({ correct: quizId }).refine(
3042
3094
  (question) => question.choices.some((choice) => choice.id === question.correct),
3043
3095
  "Choose a correct answer from the available choices"
@@ -3045,24 +3097,24 @@ var quizContentSchema = z23.array(
3045
3097
  ).min(1).max(20).refine(
3046
3098
  (questions) => new Set(questions.map((question) => question.id)).size === questions.length,
3047
3099
  "Question IDs must be unique"
3048
- );
3100
+ ))();
3049
3101
 
3050
3102
  // src/resources.ts
3051
3103
  import * as z24 from "zod";
3052
- var resourceSourceSchema = z24.union([
3104
+ var resourceSourceSchema = /* @__PURE__ */ (() => z24.union([
3053
3105
  z24.strictObject({
3054
3106
  provider: z24.literal("domino"),
3055
3107
  resource: z24.literal("point-ledger")
3056
3108
  }),
3057
3109
  discordResourceSourceSchema
3058
- ]);
3059
- var resourceRequestSchema = z24.object({
3110
+ ]))();
3111
+ var resourceRequestSchema = /* @__PURE__ */ (() => z24.object({
3060
3112
  source: resourceSourceSchema,
3061
3113
  query: z24.string().max(100).optional(),
3062
3114
  cursor: z24.string().regex(/^\d{1,6}$/).optional(),
3063
3115
  ids: z24.array(z24.string().min(1).max(100)).max(50).optional()
3064
- }).strict();
3065
- var resourceOptionsSchema = z24.object({
3116
+ }).strict())();
3117
+ var resourceOptionsSchema = /* @__PURE__ */ (() => z24.object({
3066
3118
  revision: z24.number().int(),
3067
3119
  options: z24.array(
3068
3120
  z24.object({
@@ -3077,24 +3129,24 @@ var resourceOptionsSchema = z24.object({
3077
3129
  nextCursor: z24.string().nullable().default(null),
3078
3130
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
3079
3131
  cursor: z24.string().nullable()
3080
- });
3132
+ }))();
3081
3133
 
3082
3134
  // src/settings.ts
3083
3135
  import * as z26 from "zod";
3084
3136
 
3085
3137
  // src/setting-values.ts
3086
3138
  import * as z25 from "zod";
3087
- var settingInstant = offsetDateTimeSchema().transform(
3139
+ var settingInstant = /* @__PURE__ */ (() => offsetDateTimeSchema().transform(
3088
3140
  (value) => new Date(value).toISOString()
3089
- );
3090
- var settingResourceId = z25.union([
3141
+ ))();
3142
+ var settingResourceId = /* @__PURE__ */ (() => z25.union([
3091
3143
  z25.literal(""),
3092
3144
  z25.string().regex(/^\S{1,200}$/)
3093
- ]);
3145
+ ]))();
3094
3146
 
3095
3147
  // src/settings.ts
3096
- var base = { label: z26.string().min(1), description: z26.string().optional() };
3097
- var settingFieldSchema = z26.discriminatedUnion("kind", [
3148
+ var base = /* @__PURE__ */ (() => ({ label: z26.string().min(1), description: z26.string().optional() }))();
3149
+ var settingFieldSchema = /* @__PURE__ */ (() => z26.discriminatedUnion("kind", [
3098
3150
  z26.object({
3099
3151
  ...base,
3100
3152
  kind: z26.literal("point-ledger"),
@@ -3134,7 +3186,12 @@ var settingFieldSchema = z26.discriminatedUnion("kind", [
3134
3186
  * On an `amount` setting, the token's decimals: Console shows and edits the value in whole
3135
3187
  * tokens.
3136
3188
  */
3137
- decimals: z26.number().int().min(0).max(255).optional()
3189
+ decimals: z26.number().int().min(0).max(255).optional(),
3190
+ /**
3191
+ * A value operators set in Console that never leaves Relay: management responses, the CLI
3192
+ * and Console withhold it, and the quest's code reads it as usual. Its `default` is `""`.
3193
+ */
3194
+ secret: z26.literal(true).optional()
3138
3195
  }).strict(),
3139
3196
  z26.object({
3140
3197
  ...base,
@@ -3150,15 +3207,15 @@ var settingFieldSchema = z26.discriminatedUnion("kind", [
3150
3207
  default: z26.string(),
3151
3208
  options: z26.array(z26.string().min(1)).min(1)
3152
3209
  }).strict()
3153
- ]);
3154
- var settingsFieldsSchema = z26.record(
3210
+ ]))();
3211
+ var settingsFieldsSchema = /* @__PURE__ */ (() => z26.record(
3155
3212
  z26.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
3156
3213
  settingFieldSchema
3157
- );
3158
- var settingsValuesSchema = z26.record(
3214
+ ))();
3215
+ var settingsValuesSchema = /* @__PURE__ */ (() => z26.record(
3159
3216
  z26.string(),
3160
3217
  z26.union([z26.string(), z26.number().finite(), z26.boolean(), quizContentSchema])
3161
- );
3218
+ ))();
3162
3219
  function isAmount(value) {
3163
3220
  return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
3164
3221
  }
@@ -3169,7 +3226,10 @@ function isBoundSetting(field) {
3169
3226
  return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
3170
3227
  }
3171
3228
  function textSettingSchema(field) {
3172
- const text = z26.string().min(field.minLength).max(field.maxLength);
3229
+ const text = field.secret ? z26.string().max(field.maxLength).refine(
3230
+ (value) => value === "" || value.length >= field.minLength,
3231
+ `Use at least ${field.minLength} characters`
3232
+ ) : z26.string().min(field.minLength).max(field.maxLength);
3173
3233
  switch (field.picker) {
3174
3234
  case "amount":
3175
3235
  return text.refine(
@@ -3257,18 +3317,18 @@ function authoringKey(input) {
3257
3317
 
3258
3318
  // src/campaigns.ts
3259
3319
  import * as z27 from "zod";
3260
- var timestamp4 = z27.number().int().safe().nonnegative();
3261
- var availabilityWindowSchema = z27.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
3320
+ var timestamp4 = /* @__PURE__ */ (() => z27.number().int().safe().nonnegative())();
3321
+ var availabilityWindowSchema = /* @__PURE__ */ (() => z27.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
3262
3322
  message: "Window end must follow its start",
3263
3323
  path: ["until"]
3264
- });
3265
- var campaignDefinitionSchema = z27.object({
3324
+ }))();
3325
+ var campaignDefinitionSchema = /* @__PURE__ */ (() => z27.object({
3266
3326
  key: identifier,
3267
3327
  title: z27.string().trim().min(1).max(120),
3268
3328
  window: availabilityWindowSchema.optional(),
3269
3329
  enrollment: z27.enum(["none", "required"]).default("none")
3270
- }).strict();
3271
- var campaignAuthoringSchema = campaignDefinitionSchema.omit({ key: true, title: true }).extend({
3330
+ }).strict())();
3331
+ var campaignAuthoringSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.omit({ key: true, title: true }).extend({
3272
3332
  ...authoringIdentityShape,
3273
3333
  title: z27.string().trim().min(1).max(120).optional()
3274
3334
  }).strict().transform((value) => {
@@ -3277,47 +3337,47 @@ var campaignAuthoringSchema = campaignDefinitionSchema.omit({ key: true, title:
3277
3337
  ...normalized,
3278
3338
  title: value.title ?? normalized.key
3279
3339
  });
3280
- });
3340
+ }))();
3281
3341
  function defineCampaign(input) {
3282
3342
  return campaignAuthoringSchema.parse(input);
3283
3343
  }
3284
- var campaignViewSchema = campaignDefinitionSchema.extend({
3344
+ var campaignViewSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.extend({
3285
3345
  enrolledAt: timestamp4.nullable(),
3286
3346
  withdrawnAt: timestamp4.nullable().default(null),
3287
3347
  withdrawalReason: z27.string().nullable().default(null)
3288
- });
3289
- var campaignEnrollmentInputSchema = z27.object({ actionId: identifier, campaign: identifier }).strict();
3290
- var memberCampaignEnrollmentInputSchema = campaignEnrollmentInputSchema.extend({ member: identifier });
3348
+ }))();
3349
+ var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z27.object({ actionId: identifier, campaign: identifier }).strict())();
3350
+ var memberCampaignEnrollmentInputSchema = /* @__PURE__ */ (() => campaignEnrollmentInputSchema.extend({ member: identifier }))();
3291
3351
  var campaignWithdrawalInputSchema = campaignEnrollmentInputSchema;
3292
- var memberCampaignWithdrawalInputSchema = campaignWithdrawalInputSchema.extend({
3352
+ var memberCampaignWithdrawalInputSchema = /* @__PURE__ */ (() => campaignWithdrawalInputSchema.extend({
3293
3353
  member: identifier,
3294
3354
  reason: z27.string().trim().min(1).max(500)
3295
- });
3296
- var campaignEnrollmentSchema = z27.object({
3355
+ }))();
3356
+ var campaignEnrollmentSchema = /* @__PURE__ */ (() => z27.object({
3297
3357
  campaign: identifier,
3298
3358
  member: identifier,
3299
3359
  enrolledAt: timestamp4,
3300
3360
  withdrawnAt: timestamp4.nullable().default(null),
3301
3361
  withdrawalReason: z27.string().nullable().default(null)
3302
- });
3362
+ }))();
3303
3363
 
3304
3364
  // src/resource-handle.ts
3305
3365
  import * as z28 from "zod";
3306
3366
  function resourceHandle(_kind, definition) {
3307
3367
  return definition;
3308
3368
  }
3309
- var ledgerSettingSchema = identifier.or(z28.literal("")).brand();
3369
+ var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z28.literal("")).brand())();
3310
3370
  function ledgerKey(ledger) {
3311
3371
  return typeof ledger === "string" ? ledger : ledger.key;
3312
3372
  }
3313
3373
 
3314
3374
  // src/groups.ts
3315
3375
  import * as z29 from "zod";
3316
- var projectGroupSchema = z29.object({
3376
+ var projectGroupSchema = /* @__PURE__ */ (() => z29.object({
3317
3377
  key: identifier,
3318
3378
  title: z29.string().trim().min(1).max(120)
3319
- }).strict();
3320
- var projectGroupAuthoringSchema = projectGroupSchema.omit({ key: true, title: true }).extend({
3379
+ }).strict())();
3380
+ var projectGroupAuthoringSchema = /* @__PURE__ */ (() => projectGroupSchema.omit({ key: true, title: true }).extend({
3321
3381
  ...authoringIdentityShape,
3322
3382
  title: z29.string().trim().min(1).max(120).optional()
3323
3383
  }).strict().transform((value) => {
@@ -3325,51 +3385,51 @@ var projectGroupAuthoringSchema = projectGroupSchema.omit({ key: true, title: tr
3325
3385
  ...value,
3326
3386
  title: value.title ?? value.key
3327
3387
  });
3328
- });
3388
+ }))();
3329
3389
  function defineGroup(input) {
3330
3390
  return resourceHandle("group", projectGroupAuthoringSchema.parse(input));
3331
3391
  }
3332
3392
  function projectGroupKey(group) {
3333
3393
  return identifier.parse(group.key);
3334
3394
  }
3335
- var groupTitle = z29.string().trim().min(1).max(120);
3336
- var reason = z29.string().trim().min(1).max(1e3);
3337
- var timestamp5 = z29.number().int().nonnegative().max(864e13);
3338
- var createGroupSchema = z29.object({ actionId: identifier, key: identifier, title: groupTitle }).strict();
3339
- var updateGroupSchema = z29.object({ title: groupTitle }).strict();
3340
- var addGroupMemberSchema = z29.object({ actionId: identifier, member: identifier, reason }).strict();
3341
- var removeGroupMemberSchema = z29.object({ actionId: identifier, reason }).strict();
3342
- var groupArchiveInputSchema = z29.object({ reason: lifecycleReasonSchema.optional() }).strict();
3343
- var groupPageQuerySchema = z29.strictObject({
3395
+ var groupTitle = /* @__PURE__ */ (() => z29.string().trim().min(1).max(120))();
3396
+ var reason = /* @__PURE__ */ (() => z29.string().trim().min(1).max(1e3))();
3397
+ var timestamp5 = /* @__PURE__ */ (() => z29.number().int().nonnegative().max(864e13))();
3398
+ var createGroupSchema = /* @__PURE__ */ (() => z29.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
3399
+ var updateGroupSchema = /* @__PURE__ */ (() => z29.object({ title: groupTitle }).strict())();
3400
+ var addGroupMemberSchema = /* @__PURE__ */ (() => z29.object({ actionId: identifier, member: identifier, reason }).strict())();
3401
+ var removeGroupMemberSchema = /* @__PURE__ */ (() => z29.object({ actionId: identifier, reason }).strict())();
3402
+ var groupArchiveInputSchema = /* @__PURE__ */ (() => z29.object({ reason: lifecycleReasonSchema.optional() }).strict())();
3403
+ var groupPageQuerySchema = /* @__PURE__ */ (() => z29.strictObject({
3344
3404
  cursor: pageCursorSchema.optional(),
3345
3405
  /** Items per page, 1–100; the default is 50. */
3346
3406
  limit: z29.number().int().min(1).max(100).optional()
3347
- });
3348
- var managedGroupSchema = z29.object({
3407
+ }))();
3408
+ var managedGroupSchema = /* @__PURE__ */ (() => z29.object({
3349
3409
  key: identifier,
3350
3410
  title: z29.string(),
3351
3411
  members: z29.number().int().nonnegative(),
3352
3412
  createdAt: timestamp5,
3353
3413
  archivedAt: timestamp5.nullable()
3354
- });
3355
- var groupPageSchema = z29.object({
3414
+ }))();
3415
+ var groupPageSchema = /* @__PURE__ */ (() => z29.object({
3356
3416
  items: z29.array(managedGroupSchema),
3357
3417
  nextCursor: pageCursorSchema.nullable()
3358
- });
3359
- var groupMemberSchema = z29.object({
3418
+ }))();
3419
+ var groupMemberSchema = /* @__PURE__ */ (() => z29.object({
3360
3420
  member: identifier,
3361
3421
  addedAt: timestamp5.nullable()
3362
- });
3363
- var groupMemberPageSchema = z29.object({
3422
+ }))();
3423
+ var groupMemberPageSchema = /* @__PURE__ */ (() => z29.object({
3364
3424
  items: z29.array(groupMemberSchema),
3365
3425
  nextCursor: pageCursorSchema.nullable()
3366
- });
3426
+ }))();
3367
3427
 
3368
3428
  // src/prerequisites.ts
3369
3429
  import * as z30 from "zod";
3370
- var amount = z30.number().int().safe().nonnegative();
3371
- var threshold = amount.positive();
3372
- var completionPrerequisiteSchema = z30.discriminatedUnion("scope", [
3430
+ var amount = /* @__PURE__ */ (() => z30.number().int().safe().nonnegative())();
3431
+ var threshold = /* @__PURE__ */ (() => amount.positive())();
3432
+ var completionPrerequisiteSchema = /* @__PURE__ */ (() => z30.discriminatedUnion("scope", [
3373
3433
  z30.object({
3374
3434
  kind: z30.literal("completion"),
3375
3435
  quest: identifier,
@@ -3381,19 +3441,19 @@ var completionPrerequisiteSchema = z30.discriminatedUnion("scope", [
3381
3441
  scope: z30.literal("period"),
3382
3442
  period: calendarPeriodSchema.exclude(["lifetime"])
3383
3443
  }).strict()
3384
- ]);
3385
- var balancePrerequisiteSchema = z30.object({
3444
+ ]))();
3445
+ var balancePrerequisiteSchema = /* @__PURE__ */ (() => z30.object({
3386
3446
  kind: z30.literal("balance"),
3387
3447
  balance: identifier,
3388
3448
  minimum: threshold
3389
- }).strict();
3390
- var groupPrerequisiteSchema = z30.object({ kind: z30.literal("group"), group: identifier, title: z30.string() }).strict();
3391
- var prerequisiteSchema = z30.discriminatedUnion("kind", [
3449
+ }).strict())();
3450
+ var groupPrerequisiteSchema = /* @__PURE__ */ (() => z30.object({ kind: z30.literal("group"), group: identifier, title: z30.string() }).strict())();
3451
+ var prerequisiteSchema = /* @__PURE__ */ (() => z30.discriminatedUnion("kind", [
3392
3452
  completionPrerequisiteSchema,
3393
3453
  balancePrerequisiteSchema,
3394
3454
  groupPrerequisiteSchema
3395
- ]);
3396
- var missingPrerequisiteSchema = z30.union([
3455
+ ]))();
3456
+ var missingPrerequisiteSchema = /* @__PURE__ */ (() => z30.union([
3397
3457
  z30.object({
3398
3458
  kind: z30.literal("completion"),
3399
3459
  quest: identifier,
@@ -3420,7 +3480,7 @@ var missingPrerequisiteSchema = z30.union([
3420
3480
  group: identifier,
3421
3481
  title: z30.string()
3422
3482
  })
3423
- ]);
3483
+ ]))();
3424
3484
  function completed(quest, options = {}) {
3425
3485
  const reference = quest.key;
3426
3486
  return completionPrerequisiteSchema.parse({
@@ -3450,12 +3510,12 @@ var maxPointsAmount = 2147483647;
3450
3510
 
3451
3511
  // src/schema.ts
3452
3512
  import * as z31 from "zod";
3453
- var pointsRewardSchema = z31.object({
3513
+ var pointsRewardSchema = /* @__PURE__ */ (() => z31.object({
3454
3514
  kind: z31.literal("points").default("points"),
3455
3515
  balance: identifier,
3456
3516
  amount: z31.number().int().min(0).max(maxPointsAmount)
3457
- }).strict();
3458
- var tieredRewardDefinitionSchema = z31.object({
3517
+ }).strict())();
3518
+ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z31.object({
3459
3519
  /** An automatic achievement backed by the project badge catalog. */
3460
3520
  badge: identifier.optional(),
3461
3521
  /** Membership in the project group with this key, added when the reward is delivered. */
@@ -3479,20 +3539,20 @@ var tieredRewardDefinitionSchema = z31.object({
3479
3539
  ).refine(
3480
3540
  (value) => value.badge === void 0 || value.group === void 0,
3481
3541
  "A reward is either a badge or a group membership"
3482
- );
3483
- var tieredRewardReferenceSchema = z31.object({
3542
+ ))();
3543
+ var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z31.object({
3484
3544
  id: identifier,
3485
3545
  key: identifier.nullable()
3486
- });
3487
- var tierRewardSchema = z31.object({
3546
+ }))();
3547
+ var tierRewardSchema = /* @__PURE__ */ (() => z31.object({
3488
3548
  kind: z31.literal("tier"),
3489
3549
  reward: tieredRewardDefinitionSchema,
3490
3550
  tier: identifier
3491
3551
  }).strict().refine(
3492
3552
  (value) => value.reward.tiers.some((t) => t.id === value.tier),
3493
3553
  "Unknown reward tier"
3494
- );
3495
- var badgeRewardSchema = tierRewardSchema.transform(
3554
+ ))();
3555
+ var badgeRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
3496
3556
  (value, context) => {
3497
3557
  const badge = value.reward.badge;
3498
3558
  if (!badge || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
@@ -3501,7 +3561,7 @@ var badgeRewardSchema = tierRewardSchema.transform(
3501
3561
  }
3502
3562
  return { ...value, reward: { ...value.reward, badge } };
3503
3563
  }
3504
- );
3564
+ ))();
3505
3565
  function badgeReward(reference, title) {
3506
3566
  return badgeRewardSchema.parse({
3507
3567
  kind: "tier",
@@ -3516,7 +3576,7 @@ function badgeReward(reference, title) {
3516
3576
  }
3517
3577
  });
3518
3578
  }
3519
- var groupRewardSchema = tierRewardSchema.transform(
3579
+ var groupRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
3520
3580
  (value, context) => {
3521
3581
  const group = value.reward.group;
3522
3582
  if (!group || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
@@ -3525,7 +3585,7 @@ var groupRewardSchema = tierRewardSchema.transform(
3525
3585
  }
3526
3586
  return { ...value, reward: { ...value.reward, group } };
3527
3587
  }
3528
- );
3588
+ ))();
3529
3589
  function groupReward(key, title) {
3530
3590
  return groupRewardSchema.parse({
3531
3591
  kind: "tier",
@@ -3541,16 +3601,16 @@ function groupReward(key, title) {
3541
3601
  });
3542
3602
  }
3543
3603
  var integrationRewardSchema = discordRewardSchema;
3544
- var rewardSchema = z31.union([
3604
+ var rewardSchema = /* @__PURE__ */ (() => z31.union([
3545
3605
  pointsRewardSchema,
3546
3606
  tierRewardSchema,
3547
3607
  integrationRewardSchema
3548
- ]);
3549
- var rewardTypeSchema = z31.string();
3550
- var rewardEntrySchema = z31.object({
3608
+ ]))();
3609
+ var rewardTypeSchema = /* @__PURE__ */ (() => z31.string())();
3610
+ var rewardEntrySchema = /* @__PURE__ */ (() => z31.object({
3551
3611
  type: rewardTypeSchema,
3552
3612
  data: z31.record(z31.string(), z31.json())
3553
- });
3613
+ }))();
3554
3614
  function rewardKey(reward) {
3555
3615
  if (reward.kind === "tier" && reward.reward.badge) {
3556
3616
  return "badge:" + reward.reward.badge;
@@ -3563,7 +3623,7 @@ function rewardKey(reward) {
3563
3623
  }
3564
3624
  return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
3565
3625
  }
3566
- var triggerSchema = z31.union([
3626
+ var triggerSchema = /* @__PURE__ */ (() => z31.union([
3567
3627
  z31.object({
3568
3628
  kind: z31.literal("manual"),
3569
3629
  input: z31.literal("text"),
@@ -3585,18 +3645,18 @@ var triggerSchema = z31.union([
3585
3645
  kind: z31.literal("automatic"),
3586
3646
  tracker: trackerTriggerPolicySchema.optional()
3587
3647
  }).strict()
3588
- ]);
3589
- var triggerResponseSchema = z31.union(
3648
+ ]))();
3649
+ var triggerResponseSchema = /* @__PURE__ */ (() => z31.union(
3590
3650
  triggerSchema.options.map((option) => option.strip())
3591
- );
3592
- var photoResultSchema = z31.object({
3651
+ ))();
3652
+ var photoResultSchema = /* @__PURE__ */ (() => z31.object({
3593
3653
  kind: z31.enum(["pass", "fail", "unclear"]),
3594
3654
  reason: z31.string().min(1).max(2e3)
3595
- }).strict();
3596
- var textReviewInputSchema = z31.object({
3655
+ }).strict())();
3656
+ var textReviewInputSchema = /* @__PURE__ */ (() => z31.object({
3597
3657
  text: z31.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
3598
3658
  criteria: z31.string().trim().min(1).max(2e3)
3599
- }).strict();
3659
+ }).strict())();
3600
3660
  var textResultSchema = photoResultSchema;
3601
3661
  var deferPolicy = {
3602
3662
  minRetryAfterMs: 1e3,
@@ -3609,19 +3669,19 @@ var retryCooldownPolicy = {
3609
3669
  minMs: 1e3,
3610
3670
  maxMs: 6048e5
3611
3671
  };
3612
- var retryCooldownMsSchema = z31.number().int().min(retryCooldownPolicy.minMs).max(retryCooldownPolicy.maxMs);
3613
- var evaluatorProgressSchema = z31.object({
3672
+ var retryCooldownMsSchema = /* @__PURE__ */ (() => z31.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
3673
+ var evaluatorProgressSchema = /* @__PURE__ */ (() => z31.object({
3614
3674
  current: z31.number().finite().nonnegative(),
3615
3675
  target: z31.number().finite().positive(),
3616
3676
  reason: z31.string().min(1).max(2e3)
3617
3677
  }).refine((value) => value.current <= value.target, {
3618
3678
  message: "Progress current must not exceed target"
3619
- });
3620
- var decisionSchema = z31.discriminatedUnion("kind", [
3679
+ }))();
3680
+ var decisionSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3621
3681
  z31.strictObject({
3622
3682
  kind: z31.literal("defer"),
3623
3683
  reason: z31.string().min(1).max(2e3),
3624
- retryAfterMs: z31.number().int().min(deferPolicy.minRetryAfterMs).max(deferPolicy.maxRetryAfterMs).optional(),
3684
+ retryAfterMs: z31.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
3625
3685
  /** Absolute Unix milliseconds; the platform can only shorten its existing deadline. */
3626
3686
  until: z31.number().int().safe().nonnegative().optional()
3627
3687
  }),
@@ -3649,20 +3709,20 @@ var decisionSchema = z31.discriminatedUnion("kind", [
3649
3709
  rewards: z31.array(rewardSchema).max(10).optional(),
3650
3710
  completionKey: completionKeySchema.optional()
3651
3711
  }).strict()
3652
- ]);
3653
- var reviewModeSchema = z31.enum(["workers-ai"]);
3654
- var storedReviewModeSchema = z31.enum([
3712
+ ]))();
3713
+ var reviewModeSchema = /* @__PURE__ */ (() => z31.enum(["workers-ai"]))();
3714
+ var storedReviewModeSchema = /* @__PURE__ */ (() => z31.enum([
3655
3715
  "fixture-pass",
3656
3716
  "fixture-fail",
3657
3717
  "fixture-unclear",
3658
3718
  "fixture-error",
3659
3719
  "workers-ai"
3660
- ]);
3661
- var rewardBundleSchema = z31.array(rewardSchema).max(10).refine(
3720
+ ]))();
3721
+ var rewardBundleSchema = /* @__PURE__ */ (() => z31.array(rewardSchema).max(10).refine(
3662
3722
  (rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
3663
3723
  "Use one entry per balance or shared reward"
3664
- );
3665
- var mediaUrlSchema = z31.string().max(2e3).refine((value) => {
3724
+ ))();
3725
+ var mediaUrlSchema = /* @__PURE__ */ (() => z31.string().max(2e3).refine((value) => {
3666
3726
  if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
3667
3727
  return true;
3668
3728
  }
@@ -3671,8 +3731,8 @@ var mediaUrlSchema = z31.string().max(2e3).refine((value) => {
3671
3731
  } catch {
3672
3732
  return false;
3673
3733
  }
3674
- }, "Use an HTTPS URL or a same-site path beginning with /");
3675
- var questStepActionSchema = z31.discriminatedUnion("kind", [
3734
+ }, "Use an HTTPS URL or a same-site path beginning with /"))();
3735
+ var questStepActionSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3676
3736
  z31.object({
3677
3737
  kind: z31.literal("link"),
3678
3738
  url: mediaUrlSchema.refine(
@@ -3681,23 +3741,23 @@ var questStepActionSchema = z31.discriminatedUnion("kind", [
3681
3741
  ),
3682
3742
  label: z31.string().trim().min(1).max(120)
3683
3743
  }).strict()
3684
- ]);
3685
- var questStepSchema = z31.object({
3744
+ ]))();
3745
+ var questStepSchema = /* @__PURE__ */ (() => z31.object({
3686
3746
  title: z31.string().trim().min(1).max(120),
3687
3747
  description: z31.string().max(4e3).optional(),
3688
3748
  action: questStepActionSchema.optional()
3689
- }).strict();
3690
- var questPresentationRequirementSchema = z31.discriminatedUnion("kind", [
3749
+ }).strict())();
3750
+ var questPresentationRequirementSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3691
3751
  z31.object({ kind: z31.literal("account"), provider: authProviderSchema }).strict(),
3692
3752
  z31.object({ kind: z31.literal("wallet"), chain: walletChainSchema.optional() }).strict()
3693
- ]);
3694
- var questPresentationContentSchema = z31.object({
3753
+ ]))();
3754
+ var questPresentationContentSchema = /* @__PURE__ */ (() => z31.object({
3695
3755
  steps: z31.array(questStepSchema).max(30).optional(),
3696
3756
  image: mediaUrlSchema.optional(),
3697
3757
  imageAlt: z31.string().max(500).optional(),
3698
3758
  requirements: z31.array(questPresentationRequirementSchema).max(10).optional()
3699
- }).strict();
3700
- var questPresentationSchema = questPresentationContentSchema.extend({
3759
+ }).strict())();
3760
+ var questPresentationSchema = /* @__PURE__ */ (() => questPresentationContentSchema.extend({
3701
3761
  quiz: quizQuestionsSchema.optional(),
3702
3762
  instructions: z31.string().max(4e3).optional(),
3703
3763
  video: z31.object({
@@ -3709,11 +3769,11 @@ var questPresentationSchema = questPresentationContentSchema.extend({
3709
3769
  label: z31.string().min(1).max(80)
3710
3770
  }).strict().optional()
3711
3771
  }).strict().optional()
3712
- }).strict();
3713
- var questProfileSchema = z31.object({ visible: z31.boolean() }).strict();
3772
+ }).strict())();
3773
+ var questProfileSchema = /* @__PURE__ */ (() => z31.object({ visible: z31.boolean() }).strict())();
3714
3774
  var evaluatorProtocol = 2;
3715
- var evaluatorProtocolSchema = z31.literal(evaluatorProtocol);
3716
- var questDescriptionSchema = z31.object({
3775
+ var evaluatorProtocolSchema = /* @__PURE__ */ (() => z31.literal(evaluatorProtocol))();
3776
+ var questDescriptionSchema = /* @__PURE__ */ (() => z31.object({
3717
3777
  quest: identifier,
3718
3778
  evaluatorProtocol: evaluatorProtocolSchema,
3719
3779
  title: z31.string().min(1).max(120),
@@ -3755,20 +3815,20 @@ var questDescriptionSchema = z31.object({
3755
3815
  * `retryCooldownMs`. Omitted: no cooldown.
3756
3816
  */
3757
3817
  completionCooldownMs: retryCooldownMsSchema.optional()
3758
- }).strict();
3759
- var artifactSchema = z31.object({ code: z31.string().min(1).max(1e6) }).strict();
3760
- var releaseSchema = artifactSchema.extend({
3818
+ }).strict())();
3819
+ var artifactSchema = /* @__PURE__ */ (() => z31.object({ code: z31.string().min(1).max(1e6) }).strict())();
3820
+ var releaseSchema = /* @__PURE__ */ (() => artifactSchema.extend({
3761
3821
  /** The SDK runtime the code imports. Absent, the code bundles its own SDK. */
3762
3822
  runtime: sdkRuntimeReferenceSchema.optional(),
3763
3823
  settings: settingsValuesSchema,
3764
3824
  provider: reviewModeSchema,
3765
3825
  expectedRelease: identifier.nullable().optional(),
3766
3826
  settingRenames: z31.record(z31.string(), z31.string()).optional()
3767
- }).strict();
3768
- var batchReleaseSchema = z31.object({
3769
- releases: z31.array(releaseSchema).min(1).max(questScaleLimits.quests)
3770
- }).strict();
3771
- var questSettingsInputSchema = z31.object({
3827
+ }).strict())();
3828
+ var batchReleaseSchema = /* @__PURE__ */ (() => z31.object({
3829
+ releases: z31.array(releaseSchema).min(1).max(limits.quests)
3830
+ }).strict())();
3831
+ var questSettingsInputSchema = /* @__PURE__ */ (() => z31.object({
3772
3832
  quest: identifier,
3773
3833
  expectedRelease: identifier,
3774
3834
  set: settingsValuesSchema,
@@ -3781,11 +3841,11 @@ var questSettingsInputSchema = z31.object({
3781
3841
  * precedence.
3782
3842
  */
3783
3843
  solanaIdls: z31.record(z31.string(), anchorIdlSchema.nullable()).optional()
3784
- }).strict();
3785
- var storedQuestDescriptionSchema = questDescriptionSchema.extend({
3844
+ }).strict())();
3845
+ var storedQuestDescriptionSchema = /* @__PURE__ */ (() => questDescriptionSchema.extend({
3786
3846
  completion: completionPolicySchema
3787
- });
3788
- var publishedReleaseSchema = responseShape(
3847
+ }))();
3848
+ var publishedReleaseSchema = /* @__PURE__ */ (() => responseShape(
3789
3849
  storedQuestDescriptionSchema.extend({
3790
3850
  /**
3791
3851
  * Every reward of the quest, kinds this SDK does not know included: the open sibling of
@@ -3813,32 +3873,38 @@ var publishedReleaseSchema = responseShape(
3813
3873
  * `settings.solanaProgram()` setting key. Stored when the setting is saved; a setting without
3814
3874
  * an IDL has no entry.
3815
3875
  */
3816
- solanaIdls: z31.record(z31.string(), solanaProgramIdlSchema).optional()
3876
+ solanaIdls: z31.record(z31.string(), solanaProgramIdlSchema).optional(),
3877
+ /**
3878
+ * The secret settings (`settings.text({ secret: true })`) that hold a value. Responses leave
3879
+ * every secret setting out of `values` and `configuration`; one not listed here is empty.
3880
+ * Absent when the release has no secret setting.
3881
+ */
3882
+ withheldSettings: z31.array(z31.string()).optional()
3817
3883
  })
3818
- );
3819
- var templateSchema = z31.object({
3884
+ ))();
3885
+ var templateSchema = /* @__PURE__ */ (() => z31.object({
3820
3886
  code: z31.string(),
3821
3887
  definition: questDescriptionSchema
3822
- });
3823
- var quizAnswersSchema = z31.record(identifier, identifier).refine(
3888
+ }))();
3889
+ var quizAnswersSchema = /* @__PURE__ */ (() => z31.record(identifier, identifier).refine(
3824
3890
  (answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
3825
3891
  "Provide between 1 and 50 answers"
3826
3892
  ).transform(
3827
3893
  (answers) => Object.fromEntries(
3828
3894
  Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
3829
3895
  )
3830
- );
3831
- var quizEvidenceSchema = z31.object({
3896
+ ))();
3897
+ var quizEvidenceSchema = /* @__PURE__ */ (() => z31.object({
3832
3898
  kind: z31.literal("quiz"),
3833
3899
  release: identifier.optional(),
3834
3900
  answers: quizAnswersSchema
3835
- }).strict();
3836
- var submissionEvidenceSchema = z31.union([
3901
+ }).strict())();
3902
+ var submissionEvidenceSchema = /* @__PURE__ */ (() => z31.union([
3837
3903
  quizEvidenceSchema,
3838
3904
  textEvidenceSchema,
3839
3905
  urlEvidenceSchema
3840
- ]);
3841
- var submitSchema = z31.object({
3906
+ ]))();
3907
+ var submitSchema = /* @__PURE__ */ (() => z31.object({
3842
3908
  actionId: identifier,
3843
3909
  quest: identifier,
3844
3910
  member: identifier,
@@ -3847,7 +3913,7 @@ var submitSchema = z31.object({
3847
3913
  release: identifier.optional(),
3848
3914
  /** @deprecated Relay refuses a submission that sets it to `true` and ignores `false`. Removed in 2.0.0. */
3849
3915
  faultAfterReview: z31.boolean().optional()
3850
- }).strict();
3916
+ }).strict())();
3851
3917
  var AttemptStatus = {
3852
3918
  Queued: "queued",
3853
3919
  Evaluating: "evaluating",
@@ -3858,13 +3924,13 @@ var AttemptStatus = {
3858
3924
  NeedsReview: "needs-review",
3859
3925
  Failed: "failed"
3860
3926
  };
3861
- var attemptStatusSchema = z31.string();
3927
+ var attemptStatusSchema = /* @__PURE__ */ (() => z31.string())();
3862
3928
  var AttemptCodeSource = {
3863
3929
  Relay: "relay",
3864
3930
  Evaluator: "evaluator"
3865
3931
  };
3866
- var attemptCodeSourceSchema = z31.string();
3867
- var attemptSchema = z31.object({
3932
+ var attemptCodeSourceSchema = /* @__PURE__ */ (() => z31.string())();
3933
+ var attemptSchema = /* @__PURE__ */ (() => z31.object({
3868
3934
  id: identifier,
3869
3935
  release: identifier,
3870
3936
  quest: identifier,
@@ -3902,15 +3968,15 @@ var attemptSchema = z31.object({
3902
3968
  */
3903
3969
  requestedReview: z31.boolean().default(false),
3904
3970
  createdAt: z31.number()
3905
- });
3971
+ }))();
3906
3972
  var QuestSubmissionStatus = {
3907
3973
  Open: "open",
3908
3974
  Submitted: "submitted",
3909
3975
  Discarded: "discarded",
3910
3976
  Expired: "expired"
3911
3977
  };
3912
- var questSubmissionStatusSchema = z31.string();
3913
- var questSubmissionSchema = responseShape(
3978
+ var questSubmissionStatusSchema = /* @__PURE__ */ (() => z31.string())();
3979
+ var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
3914
3980
  z31.object({
3915
3981
  id: identifier,
3916
3982
  quest: identifier,
@@ -3930,36 +3996,36 @@ var questSubmissionSchema = responseShape(
3930
3996
  /** When an open submission expires unless it changes again. */
3931
3997
  expiresAt: z31.number()
3932
3998
  })
3933
- );
3934
- var questSubmissionUpdateSchema = z31.object({
3999
+ ))();
4000
+ var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z31.object({
3935
4001
  release: identifier.nullable().optional(),
3936
4002
  input: submissionEvidenceSchema.nullable().optional(),
3937
4003
  evidence: identifier.nullable().optional()
3938
- }).strict();
3939
- var questSubmissionResultSchema = responseShape(
4004
+ }).strict())();
4005
+ var questSubmissionResultSchema = /* @__PURE__ */ (() => responseShape(
3940
4006
  z31.object({
3941
4007
  submission: questSubmissionSchema,
3942
4008
  attempt: attemptSchema,
3943
4009
  replayed: z31.boolean()
3944
4010
  })
3945
- );
3946
- var eventSchema = z31.object({
4011
+ ))();
4012
+ var eventSchema = /* @__PURE__ */ (() => z31.object({
3947
4013
  id: z31.number(),
3948
4014
  attempt: z31.string().nullable(),
3949
4015
  kind: z31.string(),
3950
4016
  detail: z31.string(),
3951
4017
  actor: z31.string().nullable().default(null),
3952
4018
  at: z31.number()
3953
- });
3954
- var pickupSelectionSchema = z31.object({
4019
+ }))();
4020
+ var pickupSelectionSchema = /* @__PURE__ */ (() => z31.object({
3955
4021
  item: identifier,
3956
4022
  revision: z31.number().int().nonnegative()
3957
- }).strict();
3958
- var pickupAllocationSchema = z31.object({
4023
+ }).strict())();
4024
+ var pickupAllocationSchema = /* @__PURE__ */ (() => z31.object({
3959
4025
  item: identifier,
3960
4026
  label: z31.string().min(1).max(80)
3961
- }).strict();
3962
- var pickupPolicySchema = z31.discriminatedUnion("kind", [
4027
+ }).strict())();
4028
+ var pickupPolicySchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3963
4029
  z31.object({ kind: z31.literal("untracked") }).strict(),
3964
4030
  z31.object({
3965
4031
  kind: z31.literal("at-pickup"),
@@ -3970,13 +4036,13 @@ var pickupPolicySchema = z31.discriminatedUnion("kind", [
3970
4036
  }).strict()
3971
4037
  ).min(1).max(100)
3972
4038
  }).strict()
3973
- ]);
3974
- var pickupCatalogSchema = z31.object({
4039
+ ]))();
4040
+ var pickupCatalogSchema = /* @__PURE__ */ (() => z31.object({
3975
4041
  reward: tieredRewardDefinitionSchema,
3976
4042
  revision: z31.number().int().nonnegative(),
3977
4043
  policy: pickupPolicySchema
3978
- });
3979
- var pickupAvailabilitySchema = z31.discriminatedUnion("kind", [
4044
+ }))();
4045
+ var pickupAvailabilitySchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3980
4046
  z31.object({ kind: z31.literal("untracked") }).strict(),
3981
4047
  z31.object({
3982
4048
  kind: z31.literal("at-pickup"),
@@ -3987,8 +4053,8 @@ var pickupAvailabilitySchema = z31.discriminatedUnion("kind", [
3987
4053
  })
3988
4054
  )
3989
4055
  }).strict()
3990
- ]);
3991
- var configurePickupSchema = z31.object({
4056
+ ]))();
4057
+ var configurePickupSchema = /* @__PURE__ */ (() => z31.object({
3992
4058
  reward: identifier,
3993
4059
  revision: z31.number().int().nonnegative(),
3994
4060
  actionId: identifier,
@@ -4008,23 +4074,23 @@ var configurePickupSchema = z31.object({
4008
4074
  ).min(1).max(100)
4009
4075
  }).strict()
4010
4076
  ])
4011
- }).strict();
4012
- var entitlementRecoverySchema = z31.object({
4077
+ }).strict())();
4078
+ var entitlementRecoverySchema = /* @__PURE__ */ (() => z31.object({
4013
4079
  completion: identifier,
4014
4080
  reason: z31.string(),
4015
4081
  flaggedAt: z31.number(),
4016
4082
  /** Null means no accepted completion currently earns this reward. */
4017
4083
  remainingTier: identifier.nullable()
4018
- });
4019
- var entitlementBase = {
4084
+ }))();
4085
+ var entitlementBase = /* @__PURE__ */ (() => ({
4020
4086
  id: identifier,
4021
4087
  member: identifier,
4022
4088
  reward: tieredRewardDefinitionSchema,
4023
4089
  earnedTier: identifier,
4024
4090
  tier: identifier,
4025
4091
  revision: z31.number().int().positive()
4026
- };
4027
- var entitlementStateSchema = z31.discriminatedUnion("status", [
4092
+ }))();
4093
+ var entitlementStateSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("status", [
4028
4094
  z31.object({ ...entitlementBase, status: z31.literal("available") }).strict(),
4029
4095
  z31.object({
4030
4096
  ...entitlementBase,
@@ -4049,24 +4115,24 @@ var entitlementStateSchema = z31.discriminatedUnion("status", [
4049
4115
  status: z31.literal("void"),
4050
4116
  voidedAt: z31.number()
4051
4117
  }).strict()
4052
- ]);
4053
- var tieredRewardReadSchema = z31.object({
4118
+ ]))();
4119
+ var tieredRewardReadSchema = /* @__PURE__ */ (() => z31.object({
4054
4120
  id: identifier,
4055
4121
  title: z31.string(),
4056
4122
  tiers: z31.array(z31.object({ id: identifier, title: z31.string() }).loose()),
4057
4123
  inventory: z31.object({ kind: z31.string() }).loose(),
4058
4124
  fulfillment: z31.object({ kind: z31.string() }).loose()
4059
- }).loose();
4060
- var entitlementReadBase = {
4125
+ }).loose())();
4126
+ var entitlementReadBase = /* @__PURE__ */ (() => ({
4061
4127
  id: identifier,
4062
4128
  member: identifier,
4063
4129
  reward: tieredRewardReadSchema,
4064
4130
  earnedTier: identifier,
4065
4131
  tier: identifier,
4066
4132
  revision: z31.number().int()
4067
- };
4068
- var allocationReadSchema = z31.object({ item: identifier, label: z31.string() }).loose();
4069
- var entitlementSchema = z31.union([
4133
+ }))();
4134
+ var allocationReadSchema = /* @__PURE__ */ (() => z31.object({ item: identifier, label: z31.string() }).loose())();
4135
+ var entitlementSchema = /* @__PURE__ */ (() => z31.union([
4070
4136
  z31.discriminatedUnion("status", [
4071
4137
  z31.object({ ...entitlementReadBase, status: z31.literal("available") }).loose(),
4072
4138
  z31.object({
@@ -4096,28 +4162,28 @@ var entitlementSchema = z31.union([
4096
4162
  status: "unsupported",
4097
4163
  reportedStatus: status
4098
4164
  }))
4099
- ]);
4100
- var beginHandoverSchema = z31.object({
4165
+ ]))();
4166
+ var beginHandoverSchema = /* @__PURE__ */ (() => z31.object({
4101
4167
  actionId: identifier,
4102
4168
  revision: z31.number().int().positive(),
4103
4169
  selection: pickupSelectionSchema.optional()
4104
- }).strict();
4105
- var confirmHandoverSchema = z31.object({ actionId: identifier, handover: identifier }).strict();
4106
- var entitlementCorrectionSchema = z31.object({
4170
+ }).strict())();
4171
+ var confirmHandoverSchema = /* @__PURE__ */ (() => z31.object({ actionId: identifier, handover: identifier }).strict())();
4172
+ var entitlementCorrectionSchema = /* @__PURE__ */ (() => z31.object({
4107
4173
  actionId: identifier,
4108
4174
  revision: z31.number().int().positive(),
4109
4175
  reason: z31.string().trim().min(1).max(500)
4110
- }).strict();
4176
+ }).strict())();
4111
4177
  var CompletionSourceKind = {
4112
4178
  Quest: "quest",
4113
4179
  Leaderboard: "leaderboard"
4114
4180
  };
4115
- var completionSourceKindSchema = z31.string().min(1).max(64);
4116
- var completionSourceSchema = z31.object({
4181
+ var completionSourceKindSchema = /* @__PURE__ */ (() => z31.string().min(1).max(64))();
4182
+ var completionSourceSchema = /* @__PURE__ */ (() => z31.object({
4117
4183
  kind: completionSourceKindSchema,
4118
4184
  id: identifier
4119
- });
4120
- var completionRecordSchema = z31.object({
4185
+ }))();
4186
+ var completionRecordSchema = /* @__PURE__ */ (() => z31.object({
4121
4187
  /** The occurrence the completion consumed. For a leaderboard prize, the settlement ID. */
4122
4188
  key: z31.string().default("once"),
4123
4189
  id: identifier,
@@ -4126,8 +4192,8 @@ var completionRecordSchema = z31.object({
4126
4192
  member: identifier,
4127
4193
  /** What paid the completion. `source.id` repeats `quest`. */
4128
4194
  source: completionSourceSchema.optional()
4129
- });
4130
- var questAvailabilitySchema = z31.discriminatedUnion("kind", [
4195
+ }))();
4196
+ var questAvailabilitySchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
4131
4197
  z31.object({
4132
4198
  kind: z31.literal("available"),
4133
4199
  input: z31.enum(["photo", "quiz", "none", "text", "url"])
@@ -4156,18 +4222,18 @@ var questAvailabilitySchema = z31.discriminatedUnion("kind", [
4156
4222
  z31.object({ kind: z31.literal("checking"), attempt: identifier }).strict(),
4157
4223
  z31.object({ kind: z31.literal("needs-review"), attempt: identifier }).strict(),
4158
4224
  z31.object({ kind: z31.literal("retryable"), attempt: identifier }).strict()
4159
- ]);
4160
- var questAvailabilityResponseSchema = z31.union(
4225
+ ]))();
4226
+ var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z31.union(
4161
4227
  questAvailabilitySchema.options.map((option) => option.strip())
4162
- );
4163
- var questBudgetViewSchema = z31.object({
4228
+ ))();
4229
+ var questBudgetViewSchema = /* @__PURE__ */ (() => z31.object({
4164
4230
  id: identifier,
4165
4231
  scope: z31.enum(["member", "project"]),
4166
4232
  period: z31.enum(["day", "week", "month", "lifetime"]),
4167
4233
  remaining: z31.number().int().safe().nonnegative(),
4168
4234
  resetsAt: z31.number().int().safe().nullable()
4169
- });
4170
- var memberProgressSchema = responseShape(
4235
+ }))();
4236
+ var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
4171
4237
  z31.object({
4172
4238
  member: identifier,
4173
4239
  quests: z31.array(
@@ -4212,8 +4278,8 @@ var memberProgressSchema = responseShape(
4212
4278
  ),
4213
4279
  entitlements: z31.array(entitlementSchema)
4214
4280
  })
4215
- );
4216
- var snapshotSchema = responseShape(
4281
+ ))();
4282
+ var snapshotSchema = /* @__PURE__ */ (() => responseShape(
4217
4283
  z31.object({
4218
4284
  releases: z31.array(publishedReleaseSchema),
4219
4285
  completions: z31.array(completionRecordSchema),
@@ -4230,14 +4296,14 @@ var snapshotSchema = responseShape(
4230
4296
  ),
4231
4297
  events: z31.array(eventSchema)
4232
4298
  })
4233
- );
4234
- var evidenceSchema = z31.object({
4299
+ ))();
4300
+ var evidenceSchema = /* @__PURE__ */ (() => z31.object({
4235
4301
  id: identifier,
4236
4302
  member: identifier,
4237
4303
  type: z31.enum(["image/jpeg", "image/png"]),
4238
4304
  size: z31.number()
4239
- });
4240
- var errorSchema = z31.object({
4305
+ }))();
4306
+ var errorSchema = /* @__PURE__ */ (() => z31.object({
4241
4307
  error: z31.string(),
4242
4308
  code: z31.string().optional(),
4243
4309
  /** Which window refused admission when `code` is `outside-window`. */
@@ -4248,76 +4314,76 @@ var errorSchema = z31.object({
4248
4314
  * `completion-cooldown`.
4249
4315
  */
4250
4316
  retryAt: z31.number().int().safe().optional()
4251
- });
4252
- var staffDecisionSchema = z31.object({
4317
+ }))();
4318
+ var staffDecisionSchema = /* @__PURE__ */ (() => z31.object({
4253
4319
  actionId: identifier,
4254
4320
  generation: z31.number().int().nonnegative(),
4255
4321
  decision: z31.enum(["accept", "reject"]),
4256
4322
  reason: z31.string().trim().min(1).max(2e3)
4257
- }).strict();
4258
- var acceptAnywaySchema = z31.object({
4323
+ }).strict())();
4324
+ var acceptAnywaySchema = /* @__PURE__ */ (() => z31.object({
4259
4325
  actionId: identifier,
4260
4326
  reason: z31.string().trim().min(1).max(2e3)
4261
- }).strict();
4262
- var evidenceRedactionInputSchema = z31.object({
4327
+ }).strict())();
4328
+ var evidenceRedactionInputSchema = /* @__PURE__ */ (() => z31.object({
4263
4329
  actionId: identifier,
4264
4330
  reason: z31.string().trim().min(1).max(2e3)
4265
- }).strict();
4266
- var evidenceRetentionInputSchema = z31.object({
4331
+ }).strict())();
4332
+ var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z31.object({
4267
4333
  actionId: identifier,
4268
4334
  quest: identifier,
4269
4335
  decidedBefore: z31.number().int().nonnegative(),
4270
4336
  reason: z31.string().trim().min(1).max(2e3)
4271
- }).strict();
4272
- var stockSchema = z31.object({ item: identifier, quantity: z31.number().int().min(0).max(1e4) }).strict();
4273
- var reservationSchema = z31.object({
4337
+ }).strict())();
4338
+ var stockSchema = /* @__PURE__ */ (() => z31.object({ item: identifier, quantity: z31.number().int().min(0).max(1e4) }).strict())();
4339
+ var reservationSchema = /* @__PURE__ */ (() => z31.object({
4274
4340
  actionId: identifier,
4275
4341
  member: identifier,
4276
4342
  item: identifier,
4277
4343
  balance: identifier,
4278
4344
  price: z31.number().int().positive().max(1e4)
4279
- }).strict();
4280
- var pageOptions = {
4345
+ }).strict())();
4346
+ var pageOptions = /* @__PURE__ */ (() => ({
4281
4347
  limit: z31.number().int().min(1).max(100).default(25),
4282
4348
  cursor: z31.string().min(1).max(4096).optional()
4283
- };
4284
- var reviewListSchema = z31.object({
4349
+ }))();
4350
+ var reviewListSchema = /* @__PURE__ */ (() => z31.object({
4285
4351
  ...pageOptions,
4286
4352
  member: identifier.optional(),
4287
4353
  quest: identifier.optional()
4288
- }).strict();
4289
- var memberListSchema = z31.object({
4354
+ }).strict())();
4355
+ var memberListSchema = /* @__PURE__ */ (() => z31.object({
4290
4356
  ...pageOptions,
4291
4357
  prefix: identifier.optional()
4292
- }).strict();
4293
- var reviewItemSchema = z31.object({
4358
+ }).strict())();
4359
+ var reviewItemSchema = /* @__PURE__ */ (() => z31.object({
4294
4360
  attempt: attemptSchema,
4295
4361
  title: z31.string(),
4296
4362
  checks: z31.array(
4297
4363
  z31.object({ criteria: z31.string(), result: photoResultSchema })
4298
4364
  )
4299
- });
4300
- var reviewPageSchema = z31.object({
4365
+ }))();
4366
+ var reviewPageSchema = /* @__PURE__ */ (() => z31.object({
4301
4367
  items: z31.array(reviewItemSchema).max(100),
4302
4368
  nextCursor: z31.string().nullable()
4303
- });
4304
- var memberPageSchema = z31.object({
4369
+ }))();
4370
+ var memberPageSchema = /* @__PURE__ */ (() => z31.object({
4305
4371
  items: z31.array(z31.object({ member: identifier })).max(100),
4306
4372
  nextCursor: z31.string().nullable()
4307
- });
4308
- var createStockItemSchema = z31.object({ actionId: identifier, name: z31.string().trim().min(1).max(80) }).strict();
4309
- var stockItemSchema = z31.object({ id: identifier, name: z31.string() });
4310
- var contentPerformanceSnapshotSchema = z31.strictObject({
4373
+ }))();
4374
+ var createStockItemSchema = /* @__PURE__ */ (() => z31.object({ actionId: identifier, name: z31.string().trim().min(1).max(80) }).strict())();
4375
+ var stockItemSchema = /* @__PURE__ */ (() => z31.object({ id: identifier, name: z31.string() }))();
4376
+ var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z31.strictObject({
4311
4377
  contentAttempt: identifier,
4312
4378
  observation: identifier,
4313
4379
  observedAt: z31.number().int().safe().nonnegative(),
4314
4380
  metrics: contentMetricsSchema,
4315
4381
  rewards: rewardBundleSchema
4316
- });
4317
- var contentPerformanceQuerySchema = contentQualificationQuerySchema.extend({
4382
+ }))();
4383
+ var contentPerformanceQuerySchema = /* @__PURE__ */ (() => contentQualificationQuerySchema.extend({
4318
4384
  content: z31.string().min(1).max(256)
4319
- });
4320
- var contentPerformancePageSchema = z31.strictObject({
4385
+ }))();
4386
+ var contentPerformancePageSchema = /* @__PURE__ */ (() => z31.strictObject({
4321
4387
  current: z31.strictObject({
4322
4388
  state: z31.enum([
4323
4389
  "content-pending",
@@ -4354,17 +4420,18 @@ var contentPerformancePageSchema = z31.strictObject({
4354
4420
  })
4355
4421
  ),
4356
4422
  nextCursor: pageCursorSchema.nullable()
4357
- });
4423
+ }))();
4358
4424
 
4359
4425
  export {
4360
4426
  identifier,
4361
4427
  markResponseSchema,
4362
- lazyResponseReaders,
4428
+ responseTables,
4363
4429
  responseShape,
4364
4430
  knownResponse,
4365
4431
  responseSchema,
4366
4432
  responseListSchema,
4367
4433
  pageCursorSchema,
4434
+ pageLimit,
4368
4435
  pageQuerySchema,
4369
4436
  paginate,
4370
4437
  managementStateQuerySchema,
@@ -4398,6 +4465,7 @@ export {
4398
4465
  telegramChatMemberSchema,
4399
4466
  telegramReactionDataSchema,
4400
4467
  telegramMessageDataSchema,
4468
+ limits,
4401
4469
  solanaAddressSchema,
4402
4470
  walletChainSchema,
4403
4471
  cosmosNetworkSchema,
@@ -4508,6 +4576,7 @@ export {
4508
4576
  trackerIngestSchema,
4509
4577
  trackerIngestResultSchema,
4510
4578
  trackerSkipCodes,
4579
+ skipEnrollmentSchema,
4511
4580
  trackerOutcomeSchema,
4512
4581
  trackerTriggerOutcomeQuerySchema,
4513
4582
  trackerTriggerOutcomePageSchema,