@domino-sdk/relay 1.67.0 → 1.68.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 (72) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/{accounts-C2O8mpB8.d.ts → accounts-DnpKoJCo.d.ts} +210 -3
  3. package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-DMNFMYFb.d.ts} +9 -1
  4. package/dist/authoring.d.ts +349 -38
  5. package/dist/authoring.js +125 -18
  6. package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-CQ3vpiQl.d.ts} +2 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +10 -9
  9. package/dist/browser.js +12 -13
  10. package/dist/{catalog-CbiftcxQ.d.ts → catalog-BLGie8Lh.d.ts} +60 -2
  11. package/dist/chunk-4JSPMFO2.js +427 -0
  12. package/dist/{chunk-5DZNMLDM.js → chunk-55WJVFWC.js} +2 -2
  13. package/dist/{chunk-Q5QVAF7R.js → chunk-5AKD4ZF3.js} +37 -25
  14. package/dist/{chunk-DSJ46QLB.js → chunk-6UBFSMCM.js} +1 -1
  15. package/dist/{chunk-P33ZAJMS.js → chunk-6YTSRWRB.js} +1199 -677
  16. package/dist/{chunk-RDUSFUXX.js → chunk-75KF633N.js} +9 -1
  17. package/dist/{chunk-Q6KTTVOI.js → chunk-7YSVZA7A.js} +1 -1
  18. package/dist/{chunk-BMJHFWVT.js → chunk-CZ7NQ7W7.js} +10 -43
  19. package/dist/{chunk-X3FMVRMM.js → chunk-DDJN2T5A.js} +1 -1
  20. package/dist/{chunk-KUNPCDN6.js → chunk-DNPDR4Z7.js} +16 -9
  21. package/dist/{chunk-RWR2LOPA.js → chunk-EXZVWQOQ.js} +2 -2
  22. package/dist/{chunk-MVQQDPQX.js → chunk-HXTKI34N.js} +14 -2
  23. package/dist/{chunk-FGXLXENM.js → chunk-IW46TW3A.js} +21 -1
  24. package/dist/{chunk-5SBA6X5X.js → chunk-KKHENO57.js} +2 -2
  25. package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
  26. package/dist/{chunk-QYC3CZVD.js → chunk-MEUAJIVO.js} +2 -2
  27. package/dist/{chunk-BQXRCJ3N.js → chunk-P4TPW4SY.js} +1 -1
  28. package/dist/{chunk-NRMQVK2W.js → chunk-R3MNZKNJ.js} +1 -1
  29. package/dist/{chunk-Z2Z5DBNW.js → chunk-SD74HD75.js} +45 -9
  30. package/dist/{chunk-JK3XV2CR.js → chunk-TYZFVL73.js} +50 -8
  31. package/dist/chunk-VAGGGB6B.js +87 -0
  32. package/dist/{chunk-2HHZV7U3.js → chunk-VRZZB7CQ.js} +1 -1
  33. package/dist/{client-CZPewB9h.d.ts → client-BMif22WQ.d.ts} +133 -7
  34. package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DMk-vL1q.d.ts} +4 -4
  35. package/dist/{deployments-BVFd7ddA.d.ts → deployments-BCr418BX.d.ts} +582 -173
  36. package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-r76xaAax.d.ts} +1 -1
  37. package/dist/index.d.ts +10 -10
  38. package/dist/index.js +10 -10
  39. package/dist/internal.d.ts +137 -14
  40. package/dist/internal.js +240 -19
  41. package/dist/{limits-C4RzrOV4.d.ts → limits-ByVRQePO.d.ts} +6 -1
  42. package/dist/{offers-BpYenB9i.d.ts → offers-xcPbYaEv.d.ts} +2 -2
  43. package/dist/portal-proxy.d.ts +2 -2
  44. package/dist/portal-proxy.js +11 -11
  45. package/dist/react/index.d.ts +37 -15
  46. package/dist/react/index.js +12 -13
  47. package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-0VvT6LMj.d.ts} +1 -1
  48. package/dist/runtime/authoring.js +1 -1
  49. package/dist/runtime/chunks/2UDZ6TPL.js +1 -0
  50. package/dist/runtime/manifest.json +3 -3
  51. package/dist/runtime/schema.js +1 -1
  52. package/dist/schema.d.ts +398 -104
  53. package/dist/schema.js +62 -8
  54. package/dist/server/index.d.ts +12 -12
  55. package/dist/server/index.js +2046 -886
  56. package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C5_753DZ.d.ts} +2 -2
  57. package/dist/solana.d.ts +171 -0
  58. package/dist/solana.js +364 -0
  59. package/dist/{submission-input-C152xIdn.d.ts → submission-input-CaL8drIh.d.ts} +2 -2
  60. package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-DLtHPRBI.d.ts} +6 -108
  61. package/dist/telegram.d.ts +8 -8
  62. package/dist/telegram.js +2 -2
  63. package/dist/testing.d.ts +85 -13
  64. package/dist/testing.js +101 -11
  65. package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-CAK942sx.d.ts} +298 -1
  66. package/dist/{transport-CthYgZXK.d.ts → transport-CkidqTOk.d.ts} +5250 -1226
  67. package/dist/{wallet-Btng186v.d.ts → wallet-DQtJelQQ.d.ts} +367 -13
  68. package/dist/wallet-browser-dpmr22Xv.d.ts +106 -0
  69. package/package.json +16 -1
  70. package/dist/chunk-UWUS4OOV.js +0 -59
  71. package/dist/chunk-UYVJZR33.js +0 -34
  72. package/dist/runtime/chunks/C2MGLQXC.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RelayErrorCode,
3
3
  clientError
4
- } from "./chunk-FGXLXENM.js";
4
+ } from "./chunk-IW46TW3A.js";
5
5
 
6
6
  // src/identifier.ts
7
7
  import * as z from "zod";
@@ -352,6 +352,9 @@ var telegramMessagesNamespace = "telegram-messages";
352
352
  var youtubeShortsNamespace = "youtube-shorts";
353
353
  var tiktokVideosNamespace = "tiktok-videos";
354
354
  var walletBalancesNamespace = "wallet-balances";
355
+ var walletProgramActivityNamespace = "wallet-program-activity";
356
+ var walletNftsNamespace = "wallet-nfts";
357
+ var walletStakeNamespace = "wallet-stake";
355
358
 
356
359
  // src/telegram.ts
357
360
  import * as z6 from "zod";
@@ -502,9 +505,65 @@ var limits = /* @__PURE__ */ (() => Object.freeze({
502
505
  trackerPreview: Object.freeze({ pages: 3, posts: 100, days: 30 }),
503
506
  walletsPerChain: 5,
504
507
  walletEventLogs: 1e3,
505
- walletTransactions: 1e3
508
+ walletTransactions: 1e3,
509
+ transactionFixtureSignatures: 20
506
510
  }))();
507
511
 
512
+ // src/base58.ts
513
+ var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
514
+ function base58(bytes) {
515
+ let zeros = 0;
516
+ while (zeros < bytes.length && bytes[zeros] === 0) {
517
+ zeros++;
518
+ }
519
+ const digits = [];
520
+ for (let index = zeros; index < bytes.length; index++) {
521
+ let carry = bytes[index];
522
+ for (let digit = 0; digit < digits.length; digit++) {
523
+ carry += digits[digit] * 256;
524
+ digits[digit] = carry % 58;
525
+ carry = Math.floor(carry / 58);
526
+ }
527
+ while (carry > 0) {
528
+ digits.push(carry % 58);
529
+ carry = Math.floor(carry / 58);
530
+ }
531
+ }
532
+ let result = "1".repeat(zeros);
533
+ for (let digit = digits.length - 1; digit >= 0; digit--) {
534
+ result += alphabet[digits[digit]];
535
+ }
536
+ return result;
537
+ }
538
+ function base58Bytes(value, length) {
539
+ if (value.length > Math.ceil(length * Math.log(256) / Math.log(58))) {
540
+ return null;
541
+ }
542
+ let zeros = 0;
543
+ while (zeros < value.length && value[zeros] === "1") {
544
+ zeros++;
545
+ }
546
+ const bytes = [];
547
+ for (let index = zeros; index < value.length; index++) {
548
+ let carry = alphabet.indexOf(value[index]);
549
+ if (carry < 0) {
550
+ return null;
551
+ }
552
+ for (let byte = 0; byte < bytes.length; byte++) {
553
+ carry += bytes[byte] * 58;
554
+ bytes[byte] = carry & 255;
555
+ carry >>= 8;
556
+ }
557
+ while (carry > 0) {
558
+ bytes.push(carry & 255);
559
+ carry >>= 8;
560
+ }
561
+ }
562
+ const decoded = new Uint8Array(zeros + bytes.length);
563
+ decoded.set(bytes.reverse(), zeros);
564
+ return decoded.length === length && base58(decoded) === value ? decoded : null;
565
+ }
566
+
508
567
  // src/wallet.ts
509
568
  import * as z7 from "zod";
510
569
  var solanaAddressSchema = /* @__PURE__ */ (() => z7.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/))();
@@ -593,6 +652,28 @@ var evmChainIdSchema = /* @__PURE__ */ (() => z7.custom(
593
652
  (value) => typeof value === "string" && isEvmChainId(value),
594
653
  'Use an EVM chain ID such as "eip155:8453"'
595
654
  ))();
655
+ var solanaMemoProgram = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
656
+ var solanaSignatureSchema = /* @__PURE__ */ (() => z7.string().min(64).max(88).refine((value) => base58Bytes(value, 64) !== null, {
657
+ message: "Use a Solana transaction signature: base58, 64 bytes"
658
+ }))();
659
+ var walletTransactionChallengeSchema = /* @__PURE__ */ (() => z7.object({
660
+ id: z7.string().min(1).max(200),
661
+ chain: walletChainSchema,
662
+ /** Canonical base58. The memo instruction lists this account, and it signs it. */
663
+ address: z7.string(),
664
+ /** The exact memo text, which names the project, the environment and a nonce. */
665
+ memo: z7.string().max(566),
666
+ /** The program the memo instruction calls: SPL Memo v2 (`solanaMemoProgram`). */
667
+ memoProgram: z7.string(),
668
+ /** Submit the transaction's signature before this time (epoch milliseconds). */
669
+ expiresAt: z7.number().int()
670
+ }))();
671
+ var walletTransactionProofSchema = /* @__PURE__ */ (() => z7.object({
672
+ chain: z7.literal("solana"),
673
+ address: solanaAddressSchema,
674
+ /** The transaction's signature (its first one, as explorers show it). */
675
+ signature: solanaSignatureSchema
676
+ }).strict())();
596
677
  var linkedWalletSchema = /* @__PURE__ */ (() => z7.object({
597
678
  chain: walletChainSchema,
598
679
  network: cosmosNetworkSchema.nullable(),
@@ -603,6 +684,19 @@ var linkedWalletSchema = /* @__PURE__ */ (() => z7.object({
603
684
  * Absent for a key's own signature.
604
685
  */
605
686
  provedOn: evmChainIdSchema.optional(),
687
+ /**
688
+ * `"transaction"` when the wallet's latest proof was a transaction it executed (a Solana smart
689
+ * account, such as a Squads vault) rather than a signed message. Absent for a signed message.
690
+ *
691
+ * @experimental A minor release can change linking by transaction.
692
+ */
693
+ provedBy: z7.string().optional(),
694
+ /**
695
+ * With `provedBy: "transaction"`: the signature of the Solana mainnet transaction that proved it.
696
+ *
697
+ * @experimental A minor release can change linking by transaction.
698
+ */
699
+ proofTransaction: z7.string().optional(),
606
700
  verifiedAt: z7.number().int().nonnegative(),
607
701
  revision: z7.number().int().positive(),
608
702
  /** True when this wallet can sign in: it was first used through wallet sign-in. Linking never enables sign-in. */
@@ -697,6 +791,30 @@ var walletBalanceSampleSchema = /* @__PURE__ */ (() => z7.object({
697
791
  */
698
792
  block: z7.string()
699
793
  }))();
794
+ var walletProgramActivitySchema = /* @__PURE__ */ (() => z7.object({
795
+ signature: z7.string(),
796
+ /** The transaction's slot, as a decimal integer string. */
797
+ slot: z7.string(),
798
+ /** The block time, in epoch milliseconds. */
799
+ timestamp: z7.number().int().nonnegative(),
800
+ /**
801
+ * Whether the wallet signed the transaction. Always true unless the tracker counts any signer
802
+ * (`signer: "any"`).
803
+ */
804
+ signer: z7.boolean(),
805
+ /** The tracker's instruction, as the program's IDL spells it; null when the tracker names none. */
806
+ instruction: z7.string().nullable(),
807
+ /**
808
+ * How much of the tracker's mint the wallet moved, in or out, in base units as a decimal integer
809
+ * string; null when the tracker names no mint.
810
+ */
811
+ amount: z7.string().nullable(),
812
+ /**
813
+ * The wallet's change of the tracker's mint in base units, negative when it spent: a decimal
814
+ * integer string; null when the tracker names no mint.
815
+ */
816
+ delta: z7.string().nullable()
817
+ }))();
700
818
  var nftCollectionPattern = /^(eip155:[1-9][0-9]{0,15})\/(erc721|erc1155):(0x[0-9a-fA-F]{40})(?:\/(0|[1-9][0-9]{0,77}))?$/;
701
819
  var solanaNftCollectionPattern = /^(solana:[1-9A-HJ-NP-Za-km-z]{32})\/nft:(.*)$/;
702
820
  var maxTokenId = 2n ** 256n - 1n;
@@ -741,6 +859,16 @@ var walletNftsSchema = /* @__PURE__ */ (() => responseShape(
741
859
  observedAt: z7.number().int().nonnegative()
742
860
  }).strict()
743
861
  ))();
862
+ var walletNftSampleSchema = /* @__PURE__ */ (() => z7.object({
863
+ /** How many of the collection's NFTs the wallet held, as a decimal integer string. */
864
+ count: z7.string(),
865
+ /**
866
+ * Where the run read: the EVM block number every wallet of the run was read at, or on Solana the
867
+ * slot this wallet's answer reflects (at or after the run's pinned slot), as a decimal integer
868
+ * string.
869
+ */
870
+ block: z7.string()
871
+ }))();
744
872
  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)?$/;
745
873
  var bytesType = /^bytes([1-9]|[12][0-9]|3[0-2])?$/;
746
874
  function elementaryType(type) {
@@ -990,7 +1118,7 @@ var walletTransactionsSchema = /* @__PURE__ */ (() => responseShape(
990
1118
  ),
991
1119
  /**
992
1120
  * The program's instructions in the transaction, top-level and inner, in call order,
993
- * decoded with the program's Anchor IDL. Instructions the IDL does not describe are left
1121
+ * decoded with the program's IDL. Instructions the IDL does not describe are left
994
1122
  * out. Absent when the program's setting has no IDL.
995
1123
  */
996
1124
  instructions: z7.array(
@@ -1012,6 +1140,125 @@ var walletTransactionsSchema = /* @__PURE__ */ (() => responseShape(
1012
1140
  observedAt: z7.number().int().nonnegative()
1013
1141
  }).strict()
1014
1142
  ))();
1143
+ var solanaTransactionFixtureInputSchema = /* @__PURE__ */ (() => z7.object({
1144
+ /** The cluster the transactions ran on; mainnet by default. */
1145
+ chain: z7.enum([solanaMainnet, solanaDevnet]).default(solanaMainnet),
1146
+ /** The program the quest reads, as its `settings.solanaProgram()` setting holds it. */
1147
+ program: solanaAddressSchema,
1148
+ /** Each signature once, at most {@link limits.transactionFixtureSignatures}. */
1149
+ signatures: z7.array(solanaSignatureSchema).min(1).max(limits.transactionFixtureSignatures).refine((list) => new Set(list).size === list.length, {
1150
+ message: "List each signature once"
1151
+ }),
1152
+ /** The wallet whose view the answer gives; the transactions' fee payer by default. */
1153
+ wallet: solanaAddressSchema.optional(),
1154
+ /**
1155
+ * The program's IDL, as a pasted one would be stored; without it, the IDL the program
1156
+ * publishes on chain, as saving its setting stores it.
1157
+ */
1158
+ idl: anchorIdlSchema.optional()
1159
+ }).strict())();
1160
+ var seedInteger = /* @__PURE__ */ (() => z7.union([z7.number().finite(), z7.string().max(64)]))();
1161
+ var solanaSeedSchema = /* @__PURE__ */ (() => z7.union([
1162
+ z7.strictObject({ wallet: z7.literal(true) }),
1163
+ z7.string().max(200),
1164
+ z7.strictObject({ pubkey: z7.string().max(64) }),
1165
+ z7.strictObject({ u8: seedInteger }),
1166
+ z7.strictObject({ u16: seedInteger }),
1167
+ z7.strictObject({ u32: seedInteger }),
1168
+ z7.strictObject({ u64: seedInteger }),
1169
+ z7.strictObject({ u128: seedInteger }),
1170
+ z7.strictObject({ i8: seedInteger }),
1171
+ z7.strictObject({ i16: seedInteger }),
1172
+ z7.strictObject({ i32: seedInteger }),
1173
+ z7.strictObject({ i64: seedInteger }),
1174
+ z7.strictObject({ i128: seedInteger })
1175
+ ]))();
1176
+ var maxSolanaSeeds = 15;
1177
+ var walletProgramAccountSchema = /* @__PURE__ */ (() => responseShape(
1178
+ z7.object({
1179
+ program: z7.string(),
1180
+ /** The CAIP-2 ID of the cluster read: Solana mainnet or devnet. */
1181
+ chain: z7.string(),
1182
+ /** The account type read, as the IDL names it. */
1183
+ account: z7.string(),
1184
+ wallets: z7.array(
1185
+ z7.object({
1186
+ /** The member's linked wallet. */
1187
+ address: z7.string(),
1188
+ /** The program-derived address its seeds give: the account read. */
1189
+ pda: z7.string(),
1190
+ /**
1191
+ * The account's fields by name, decoded with the IDL: integers up to 32 bits and floats as
1192
+ * numbers, wider integers as decimal strings, public keys in base58, `bytes` and arrays as
1193
+ * arrays, an absent option as null, and an enum as `{ Variant: fields }`. Null when no
1194
+ * account exists at `pda`.
1195
+ */
1196
+ fields: z7.record(z7.string(), z7.json()).nullable()
1197
+ })
1198
+ ),
1199
+ /** The slot every account was read at. */
1200
+ at: z7.object({
1201
+ kind: z7.string(),
1202
+ number: units
1203
+ }),
1204
+ observedAt: z7.number().int().nonnegative()
1205
+ })
1206
+ ))();
1207
+ var stakeAmounts = {
1208
+ /** Delegated stake that is active: activated before the current epoch and not deactivating. */
1209
+ amount: units,
1210
+ /** Delegated stake that activates at the next epoch boundary. */
1211
+ activating: units,
1212
+ /** Stake deactivated this epoch, which stops earning at the next epoch boundary. */
1213
+ deactivating: units
1214
+ };
1215
+ var walletStakeSchema = /* @__PURE__ */ (() => responseShape(
1216
+ z7.object({
1217
+ /** The CAIP-2 ID of the cluster read: Solana mainnet or devnet. */
1218
+ chain: z7.string(),
1219
+ /** The vote account the read counted, or null for every validator. */
1220
+ voteAccount: z7.string().nullable(),
1221
+ /** The epoch the stake states are for. */
1222
+ epoch: z7.number().int().nonnegative(),
1223
+ /** Active stake, summed over `wallets`. */
1224
+ total: units,
1225
+ /** Activating stake, summed over `wallets`. */
1226
+ activating: units,
1227
+ /** Deactivating stake, summed over `wallets`. */
1228
+ deactivating: units,
1229
+ /**
1230
+ * Each wallet read, with the stake of the accounts it controls. An account two linked wallets
1231
+ * control counts once, for its withdrawer.
1232
+ */
1233
+ wallets: z7.array(z7.object({ address: z7.string(), ...stakeAmounts })),
1234
+ /** The stake per vote account, summed over the wallets; none without stake in any state. */
1235
+ voteAccounts: z7.array(
1236
+ z7.object({ voteAccount: z7.string(), ...stakeAmounts })
1237
+ ),
1238
+ /** The earliest slot the epoch and the stake accounts were read at. */
1239
+ at: z7.object({
1240
+ kind: z7.string(),
1241
+ number: units
1242
+ }),
1243
+ observedAt: z7.number().int().nonnegative()
1244
+ })
1245
+ ))();
1246
+ var walletStakeSampleSchema = /* @__PURE__ */ (() => z7.object({
1247
+ /**
1248
+ * Active stake: delegated, activated before the sampled epoch and not deactivating, as a
1249
+ * decimal integer string.
1250
+ */
1251
+ amount: z7.string(),
1252
+ /** Stake that activates at the next epoch boundary, as a decimal integer string. */
1253
+ activating: z7.string(),
1254
+ /** Stake deactivated this epoch, as a decimal integer string. */
1255
+ deactivating: z7.string(),
1256
+ /**
1257
+ * The slot this wallet's answer reflects, at or after the run's pinned slot, as a decimal
1258
+ * integer string.
1259
+ */
1260
+ block: z7.string()
1261
+ }))();
1015
1262
 
1016
1263
  // src/discord.ts
1017
1264
  import * as z8 from "zod";
@@ -1495,26 +1742,26 @@ function matches(schema, value, at, budget) {
1495
1742
  }
1496
1743
  }
1497
1744
  if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1498
- const object25 = value;
1745
+ const object26 = value;
1499
1746
  const properties = schema.properties ?? {};
1500
1747
  const required = schema.required ?? [];
1501
1748
  charge(budget, required.length);
1502
1749
  for (const key of required) {
1503
- if (!Object.hasOwn(object25, key)) {
1750
+ if (!Object.hasOwn(object26, key)) {
1504
1751
  return issue(() => `missing required key "${clip(key, maxKeyText)}"`);
1505
1752
  }
1506
1753
  }
1507
1754
  const literals = literalsOf(schema);
1508
1755
  charge(budget, literals.length);
1509
1756
  for (const [key, property] of literals) {
1510
- if (Object.hasOwn(object25, key) && object25[key] !== property.const) {
1757
+ if (Object.hasOwn(object26, key) && object26[key] !== property.const) {
1511
1758
  return {
1512
1759
  at: { parent: at, key },
1513
1760
  reason: () => `expected ${JSON.stringify(property.const)}`
1514
1761
  };
1515
1762
  }
1516
1763
  }
1517
- const keys = Object.keys(object25);
1764
+ const keys = Object.keys(object26);
1518
1765
  charge(budget, keys.length);
1519
1766
  const names = schema.propertyNames?.enum;
1520
1767
  const allowed = names && setOf(schema.propertyNames, names);
@@ -1535,7 +1782,7 @@ function matches(schema, value, at, budget) {
1535
1782
  if (property && property !== true) {
1536
1783
  const found = matches(
1537
1784
  property,
1538
- object25[key],
1785
+ object26[key],
1539
1786
  { parent: at, key },
1540
1787
  budget
1541
1788
  );
@@ -1846,6 +2093,37 @@ var walletBalanceSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
1846
2093
  ),
1847
2094
  token: z12.string().min(1).max(128).nullable()
1848
2095
  }))();
2096
+ var solanaClusterSchema = /* @__PURE__ */ (() => z12.string().regex(
2097
+ /^solana:(?:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp|EtWTRABZaYq6iMfeYKouRu166VU2xqa1)$/,
2098
+ 'Use "solana" or Solana devnet ("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1")'
2099
+ ))();
2100
+ var walletProgramActivitySourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2101
+ chain: solanaClusterSchema,
2102
+ program: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 program address"),
2103
+ instruction: z12.string().regex(
2104
+ /^[A-Za-z_][A-Za-z0-9_]{0,63}$/,
2105
+ "Use the instruction's name as the program's IDL spells it"
2106
+ ).nullable(),
2107
+ mint: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 SPL mint address").nullable(),
2108
+ minAmount: z12.string().regex(/^[1-9][0-9]{0,77}$/, "Use a positive whole number of base units").nullable(),
2109
+ anySigner: z12.boolean()
2110
+ }).refine(
2111
+ (activity) => activity.minAmount === null || activity.mint !== null,
2112
+ "minAmount needs a mint"
2113
+ ))();
2114
+ var walletNftSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2115
+ collection: z12.string().max(200).refine(
2116
+ (value) => isNftCollection(value),
2117
+ "Use an NFT collection"
2118
+ )
2119
+ }))();
2120
+ var walletStakeSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2121
+ chain: solanaClusterSchema,
2122
+ voteAccount: z12.string().refine(
2123
+ (value) => base58Bytes(value, 32) !== null,
2124
+ "Use a base58 vote account address"
2125
+ ).nullable()
2126
+ }))();
1849
2127
  var xSearchSourceSchema = /* @__PURE__ */ (() => z12.object({
1850
2128
  kind: z12.literal("x-search"),
1851
2129
  query: z12.string().trim().min(1).max(2e3)
@@ -1880,10 +2158,34 @@ var customSourceSchema = /* @__PURE__ */ (() => z12.object({
1880
2158
  * The chain and token Relay samples, on `wallet.balances()`'s reserved namespace only.
1881
2159
  * `wallet.balances()` sets it.
1882
2160
  */
1883
- balance: walletBalanceSourceSchema.optional()
2161
+ balance: walletBalanceSourceSchema.optional(),
2162
+ /**
2163
+ * The program activity Relay records, on `wallet.programActivity()`'s reserved namespace only.
2164
+ * `wallet.programActivity()` sets it.
2165
+ */
2166
+ activity: walletProgramActivitySourceSchema.optional(),
2167
+ /**
2168
+ * The NFT collection Relay samples, on `wallet.nfts()`'s reserved namespace only.
2169
+ * `wallet.nfts()` sets it.
2170
+ */
2171
+ nfts: walletNftSourceSchema.optional(),
2172
+ /**
2173
+ * The cluster and vote account Relay samples stake for, on `wallet.stake()`'s reserved
2174
+ * namespace only. `wallet.stake()` sets it.
2175
+ */
2176
+ stake: walletStakeSourceSchema.optional()
1884
2177
  }).strict().refine(
1885
2178
  (source) => source.balance === void 0 || source.namespace === walletBalancesNamespace,
1886
2179
  "Only wallet.balances() samples a balance"
2180
+ ).refine(
2181
+ (source) => source.activity === void 0 || source.namespace === walletProgramActivityNamespace,
2182
+ "Only wallet.programActivity() records program activity"
2183
+ ).refine(
2184
+ (source) => source.nfts === void 0 || source.namespace === walletNftsNamespace,
2185
+ "Only wallet.nfts() samples NFTs"
2186
+ ).refine(
2187
+ (source) => source.stake === void 0 || source.namespace === walletStakeNamespace,
2188
+ "Only wallet.stake() samples stake"
1887
2189
  ).refine(
1888
2190
  (source) => !source.content || source.data?.properties?.body?.type === "object" && (source.data.required ?? []).includes("body"),
1889
2191
  "A content source's data schema has a required object body"
@@ -1948,7 +2250,13 @@ var knownTrackerSourceResponseSchema = /* @__PURE__ */ (() => z12.discriminatedU
1948
2250
  z12.object(xSearchSourceSchema.shape),
1949
2251
  z12.object({
1950
2252
  ...customSourceSchema.shape,
1951
- identities: z12.array(openIdentityKindSchema).optional()
2253
+ identities: z12.array(openIdentityKindSchema).optional(),
2254
+ // A later Relay may add settings to program activity, NFT or stake samples.
2255
+ activity: z12.object(walletProgramActivitySourceSchema.shape).optional(),
2256
+ // Read as stored: a later Relay may sample collections this SDK does not parse.
2257
+ nfts: z12.object({ collection: z12.string() }).optional(),
2258
+ // Read as stored: a later Relay may sample clusters this SDK does not name.
2259
+ stake: z12.object({ chain: z12.string(), voteAccount: z12.string().nullable() }).optional()
1952
2260
  }),
1953
2261
  z12.object(discordMessagesSourceSchema.shape),
1954
2262
  z12.object(discordReactionsSourceSchema.shape)
@@ -2082,6 +2390,24 @@ var managedTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.exte
2082
2390
  (input) => input.query === void 0 !== (input.source === void 0),
2083
2391
  "Name the source with source, or an X search with query, not both"
2084
2392
  ))();
2393
+ var walletProgramActivityTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2394
+ kind: z12.literal("wallet-program-activity"),
2395
+ ...walletProgramActivitySourceSchema.shape
2396
+ }).refine(
2397
+ (activity) => activity.minAmount === null || activity.mint !== null,
2398
+ "minAmount needs a mint"
2399
+ ))();
2400
+ var programActivityTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletProgramActivityTrackerSourceSchema }))();
2401
+ var walletNftsTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2402
+ kind: z12.literal("wallet-nfts"),
2403
+ ...walletNftSourceSchema.shape
2404
+ }))();
2405
+ var nftTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletNftsTrackerSourceSchema }))();
2406
+ var walletStakeTrackerSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2407
+ kind: z12.literal("wallet-stake"),
2408
+ ...walletStakeSourceSchema.shape
2409
+ }))();
2410
+ var stakeTrackerCreateSchema = /* @__PURE__ */ (() => trackerCreateSchema.omit({ query: true }).extend({ source: walletStakeTrackerSourceSchema }))();
2085
2411
  var trackerUpdateSchema = /* @__PURE__ */ (() => trackerPropertiesSchema.partial().extend({
2086
2412
  source: managedTrackerSourceSchema.optional(),
2087
2413
  actionId: identifier
@@ -2644,7 +2970,7 @@ var trackerTriggerModeSchema = /* @__PURE__ */ (() => z17.enum([
2644
2970
  "data-changed"
2645
2971
  ]))();
2646
2972
  function defaultTriggerMode(source, namespace) {
2647
- return source === "custom" && namespace !== telegramMessagesNamespace && namespace !== telegramReactionsNamespace ? "new-observation" : "new-record";
2973
+ return source === "custom" && namespace !== telegramMessagesNamespace && namespace !== telegramReactionsNamespace && namespace !== walletProgramActivityNamespace ? "new-observation" : "new-record";
2648
2974
  }
2649
2975
  var trackerBoundSchema = /* @__PURE__ */ (() => z17.union([
2650
2976
  z17.number().finite(),
@@ -3169,122 +3495,196 @@ var quizContentSchema = /* @__PURE__ */ (() => z24.array(
3169
3495
  "Question IDs must be unique"
3170
3496
  ))();
3171
3497
 
3172
- // src/resources.ts
3498
+ // src/windows.ts
3173
3499
  import * as z25 from "zod";
3174
- var resourceSourceSchema = /* @__PURE__ */ (() => z25.union([
3175
- z25.strictObject({
3176
- provider: z25.literal("domino"),
3177
- resource: z25.literal("point-ledger")
3500
+ var timestamp4 = /* @__PURE__ */ (() => z25.number().int().safe().nonnegative())();
3501
+ var endsAfterStart = (window) => window.from === void 0 || window.until === void 0 || window.until > window.from;
3502
+ var inWindow = (window, time) => (window.from === void 0 || time >= window.from) && (window.until === void 0 || time < window.until);
3503
+
3504
+ // src/solana-actions.ts
3505
+ import * as z26 from "zod";
3506
+ var maxSolanaActionReference = 64;
3507
+ var prefix = "domino:quest:";
3508
+ var referenceSchema = /* @__PURE__ */ (() => z26.string().min(1).max(maxSolanaActionReference).regex(/^[a-zA-Z0-9_-]+$/, "use letters, digits, _ or -"))();
3509
+ function solanaActionMemo(input) {
3510
+ const quest = identifier.parse(input.quest);
3511
+ return input.reference === void 0 ? prefix + quest : `${prefix}${quest}:${referenceSchema.parse(input.reference)}`;
3512
+ }
3513
+ function parseSolanaActionMemo(text) {
3514
+ if (!text.startsWith(prefix)) {
3515
+ return null;
3516
+ }
3517
+ const [quest, reference, ...rest] = text.slice(prefix.length).split(":");
3518
+ if (rest.length || !identifier.safeParse(quest).success || reference !== void 0 && !referenceSchema.safeParse(reference).success) {
3519
+ return null;
3520
+ }
3521
+ return { quest, reference: reference ?? null };
3522
+ }
3523
+ function takesSolanaTransaction(trigger) {
3524
+ return trigger.kind === "manual" && trigger.actor !== "staff" && trigger.input === "none";
3525
+ }
3526
+ var questStationSchema = /* @__PURE__ */ (() => z26.object({
3527
+ key: referenceSchema,
3528
+ label: z26.string().trim().min(1).max(120),
3529
+ opensAt: timestamp4.optional(),
3530
+ closesAt: timestamp4.optional()
3531
+ }).strict().refine(
3532
+ (station) => endsAfterStart({ from: station.opensAt, until: station.closesAt }),
3533
+ { message: "A station must close after it opens", path: ["closesAt"] }
3534
+ ))();
3535
+ var questStationsSchema = /* @__PURE__ */ (() => z26.array(questStationSchema).min(1).max(200).refine(
3536
+ (stations) => new Set(stations.map((station) => station.key)).size === stations.length,
3537
+ "Give each station its own key"
3538
+ ))();
3539
+ function stationRefusal(stations, reference, blockTime) {
3540
+ const station = stations.find((station2) => station2.key === reference);
3541
+ if (!station) {
3542
+ return {
3543
+ code: "station-unknown",
3544
+ message: reference === null ? "This quest completes only from a transaction whose memo names one of its stations" : `The memo names station "${reference}", which this quest does not have`
3545
+ };
3546
+ }
3547
+ if (!inWindow({ from: station.opensAt, until: station.closesAt }, blockTime)) {
3548
+ return {
3549
+ code: "station-closed",
3550
+ message: `Station "${station.key}" was closed when the transaction landed`
3551
+ };
3552
+ }
3553
+ return null;
3554
+ }
3555
+ var solanaSignatureSchema2 = /* @__PURE__ */ (() => z26.string().min(64).max(88).regex(/^[1-9A-HJ-NP-Za-km-z]+$/, "use a base58 transaction signature"))();
3556
+ var solanaTransactionSubmissionSchema = /* @__PURE__ */ (() => z26.object({
3557
+ quest: identifier,
3558
+ signature: solanaSignatureSchema2,
3559
+ chain: z26.enum(["solana", solanaMainnet, solanaDevnet]).default(solanaMainnet).transform(
3560
+ (chain) => chain === "solana" ? solanaMainnet : chain
3561
+ )
3562
+ }).strict())();
3563
+ var attemptActionSchema = /* @__PURE__ */ (() => z26.object({
3564
+ kind: z26.string(),
3565
+ chain: z26.string(),
3566
+ signature: z26.string(),
3567
+ wallet: z26.string(),
3568
+ reference: z26.string().nullable()
3569
+ }))();
3570
+
3571
+ // src/resources.ts
3572
+ import * as z27 from "zod";
3573
+ var resourceSourceSchema = /* @__PURE__ */ (() => z27.union([
3574
+ z27.strictObject({
3575
+ provider: z27.literal("domino"),
3576
+ resource: z27.literal("point-ledger")
3178
3577
  }),
3179
3578
  discordResourceSourceSchema
3180
3579
  ]))();
3181
- var resourceRequestSchema = /* @__PURE__ */ (() => z25.object({
3580
+ var resourceRequestSchema = /* @__PURE__ */ (() => z27.object({
3182
3581
  source: resourceSourceSchema,
3183
- query: z25.string().max(100).optional(),
3184
- cursor: z25.string().regex(/^\d{1,6}$/).optional(),
3185
- ids: z25.array(z25.string().min(1).max(100)).max(50).optional()
3582
+ query: z27.string().max(100).optional(),
3583
+ cursor: z27.string().regex(/^\d{1,6}$/).optional(),
3584
+ ids: z27.array(z27.string().min(1).max(100)).max(50).optional()
3186
3585
  }).strict())();
3187
- var resourceOptionsSchema = /* @__PURE__ */ (() => z25.object({
3188
- revision: z25.number().int(),
3189
- options: z25.array(
3190
- z25.object({
3191
- id: z25.string(),
3192
- label: z25.string(),
3193
- description: z25.string().optional(),
3194
- group: z25.string().optional(),
3195
- disabledReason: z25.string().optional()
3586
+ var resourceOptionsSchema = /* @__PURE__ */ (() => z27.object({
3587
+ revision: z27.number().int(),
3588
+ options: z27.array(
3589
+ z27.object({
3590
+ id: z27.string(),
3591
+ label: z27.string(),
3592
+ description: z27.string().optional(),
3593
+ group: z27.string().optional(),
3594
+ disabledReason: z27.string().optional()
3196
3595
  })
3197
3596
  ),
3198
3597
  /** Pass back as `cursor` for the next page; null on the last one. */
3199
- nextCursor: z25.string().nullable().default(null),
3598
+ nextCursor: z27.string().nullable().default(null),
3200
3599
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
3201
- cursor: z25.string().nullable()
3600
+ cursor: z27.string().nullable()
3202
3601
  }))();
3203
3602
 
3204
3603
  // src/settings.ts
3205
- import * as z27 from "zod";
3604
+ import * as z29 from "zod";
3206
3605
 
3207
3606
  // src/setting-values.ts
3208
- import * as z26 from "zod";
3607
+ import * as z28 from "zod";
3209
3608
  var settingInstant = /* @__PURE__ */ (() => offsetDateTimeSchema().transform(
3210
3609
  (value) => new Date(value).toISOString()
3211
3610
  ))();
3212
- var settingResourceId = /* @__PURE__ */ (() => z26.union([
3213
- z26.literal(""),
3214
- z26.string().regex(/^\S{1,200}$/)
3611
+ var settingResourceId = /* @__PURE__ */ (() => z28.union([
3612
+ z28.literal(""),
3613
+ z28.string().regex(/^\S{1,200}$/)
3215
3614
  ]))();
3216
3615
 
3217
3616
  // src/settings.ts
3218
- var base = /* @__PURE__ */ (() => ({ label: z27.string().min(1), description: z27.string().optional() }))();
3219
- var settingFieldSchema = /* @__PURE__ */ (() => z27.discriminatedUnion("kind", [
3220
- z27.object({
3617
+ var base = /* @__PURE__ */ (() => ({ label: z29.string().min(1), description: z29.string().optional() }))();
3618
+ var settingFieldSchema = /* @__PURE__ */ (() => z29.discriminatedUnion("kind", [
3619
+ z29.object({
3221
3620
  ...base,
3222
- kind: z27.literal("point-ledger"),
3223
- default: identifier.or(z27.literal(""))
3621
+ kind: z29.literal("point-ledger"),
3622
+ default: identifier.or(z29.literal(""))
3224
3623
  }).strict(),
3225
- z27.object({ ...base, kind: z27.literal("datetime"), default: settingInstant }).strict(),
3226
- z27.object({
3624
+ z29.object({ ...base, kind: z29.literal("datetime"), default: settingInstant }).strict(),
3625
+ z29.object({
3227
3626
  ...base,
3228
- kind: z27.literal("resource"),
3627
+ kind: z29.literal("resource"),
3229
3628
  default: settingResourceId,
3230
3629
  source: resourceSourceSchema
3231
3630
  }).strict(),
3232
- z27.object({ ...base, kind: z27.literal("quiz"), default: quizContentSchema }).strict(),
3233
- z27.object({
3631
+ z29.object({ ...base, kind: z29.literal("quiz"), default: quizContentSchema }).strict(),
3632
+ z29.object({
3234
3633
  ...base,
3235
- kind: z27.literal("text"),
3236
- default: z27.string(),
3237
- minLength: z27.number().int().nonnegative(),
3238
- maxLength: z27.number().int().positive(),
3239
- multiline: z27.boolean(),
3634
+ kind: z29.literal("text"),
3635
+ default: z29.string(),
3636
+ minLength: z29.number().int().nonnegative(),
3637
+ maxLength: z29.number().int().positive(),
3638
+ multiline: z29.boolean(),
3240
3639
  /**
3241
3640
  * A list Console offers the value from, beside free text: `telegram-chat` lists the
3242
3641
  * project's connected Telegram chats. Unknown pickers read as free text. Six pickers also
3243
3642
  * constrain the value, at publication and when an operator edits it: `amount`, a
3244
3643
  * non-negative integer in a token's base units (`settings.amount()`), `chain`, a chain
3245
3644
  * `ctx.wallet.balance()` reads (`settings.chain()`), `nft`, an NFT collection
3246
- * `ctx.wallet.nfts()` reads (`settings.nft()`), whose contract or Solana collection mint
3645
+ * `ctx.wallet.nfts()` reads (`settings.nft()`), whose contract or Solana collection
3247
3646
  * Relay also checks on its chain, `contract-call`, a contract function `ctx.wallet.call()`
3248
3647
  * reads (`settings.contractCall()`), whose chain Relay also checks, and `contract-event`, a
3249
3648
  * contract event `ctx.wallet.events()` reads (`settings.contractEvent()`), whose chain and
3250
3649
  * contract Relay also checks, and `solana-program`, a Solana program
3251
- * `ctx.wallet.transactions()` reads (`settings.solanaProgram()`), which Relay also checks is
3650
+ * `ctx.wallet.transactions()` or `ctx.wallet.programAccount()` reads
3651
+ * (`settings.solanaProgram()`), which Relay also checks is
3252
3652
  * an executable program.
3253
3653
  */
3254
- picker: z27.string().optional(),
3654
+ picker: z29.string().optional(),
3255
3655
  /**
3256
3656
  * On an `amount` setting, the token's decimals: Console shows and edits the value in whole
3257
3657
  * tokens.
3258
3658
  */
3259
- decimals: z27.number().int().min(0).max(255).optional(),
3659
+ decimals: z29.number().int().min(0).max(255).optional(),
3260
3660
  /**
3261
3661
  * A value operators set in Console that never leaves Relay: management responses, the CLI
3262
3662
  * and Console withhold it, and the quest's code reads it as usual. Its `default` is `""`.
3263
3663
  */
3264
- secret: z27.literal(true).optional()
3664
+ secret: z29.literal(true).optional()
3265
3665
  }).strict(),
3266
- z27.object({
3666
+ z29.object({
3267
3667
  ...base,
3268
- kind: z27.literal("integer"),
3269
- default: z27.number().int(),
3270
- min: z27.number().int(),
3271
- max: z27.number().int()
3668
+ kind: z29.literal("integer"),
3669
+ default: z29.number().int(),
3670
+ min: z29.number().int(),
3671
+ max: z29.number().int()
3272
3672
  }).strict(),
3273
- z27.object({ ...base, kind: z27.literal("boolean"), default: z27.boolean() }).strict(),
3274
- z27.object({
3673
+ z29.object({ ...base, kind: z29.literal("boolean"), default: z29.boolean() }).strict(),
3674
+ z29.object({
3275
3675
  ...base,
3276
- kind: z27.literal("choice"),
3277
- default: z27.string(),
3278
- options: z27.array(z27.string().min(1)).min(1)
3676
+ kind: z29.literal("choice"),
3677
+ default: z29.string(),
3678
+ options: z29.array(z29.string().min(1)).min(1)
3279
3679
  }).strict()
3280
3680
  ]))();
3281
- var settingsFieldsSchema = /* @__PURE__ */ (() => z27.record(
3282
- z27.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
3681
+ var settingsFieldsSchema = /* @__PURE__ */ (() => z29.record(
3682
+ z29.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
3283
3683
  settingFieldSchema
3284
3684
  ))();
3285
- var settingsValuesSchema = /* @__PURE__ */ (() => z27.record(
3286
- z27.string(),
3287
- z27.union([z27.string(), z27.number().finite(), z27.boolean(), quizContentSchema])
3685
+ var settingsValuesSchema = /* @__PURE__ */ (() => z29.record(
3686
+ z29.string(),
3687
+ z29.union([z29.string(), z29.number().finite(), z29.boolean(), quizContentSchema])
3288
3688
  ))();
3289
3689
  function isAmount(value) {
3290
3690
  return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
@@ -3296,10 +3696,10 @@ function isBoundSetting(field) {
3296
3696
  return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
3297
3697
  }
3298
3698
  function textSettingSchema(field) {
3299
- const text = field.secret ? z27.string().max(field.maxLength).refine(
3699
+ const text = field.secret ? z29.string().max(field.maxLength).refine(
3300
3700
  (value) => value === "" || value.length >= field.minLength,
3301
3701
  `Use at least ${field.minLength} characters`
3302
- ) : z27.string().min(field.minLength).max(field.maxLength);
3702
+ ) : z29.string().min(field.minLength).max(field.maxLength);
3303
3703
  switch (field.picker) {
3304
3704
  case "amount":
3305
3705
  return text.refine(
@@ -3314,7 +3714,7 @@ function textSettingSchema(field) {
3314
3714
  case "nft":
3315
3715
  return text.refine(
3316
3716
  isNftCollection,
3317
- 'Use an NFT collection such as "eip155:1/erc721:0x\u2026", "eip155:8453/erc1155:0x\u2026/1" for one ERC-1155 token ID, or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection mint>" (mainnet; devnet is "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<collection mint>")'
3717
+ 'Use an NFT collection such as "eip155:1/erc721:0x\u2026", "eip155:8453/erc1155:0x\u2026/1" for one ERC-1155 token ID, or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection>" (mainnet; devnet is "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<collection>")'
3318
3718
  );
3319
3719
  case "contract-call":
3320
3720
  return text.refine(
@@ -3355,17 +3755,17 @@ function parseSettings(fields2, input) {
3355
3755
  shape[key] = textSettingSchema(field).default(field.default);
3356
3756
  break;
3357
3757
  case "integer":
3358
- shape[key] = z27.number().int().min(field.min).max(field.max).default(field.default);
3758
+ shape[key] = z29.number().int().min(field.min).max(field.max).default(field.default);
3359
3759
  break;
3360
3760
  case "boolean":
3361
- shape[key] = z27.boolean().default(field.default);
3761
+ shape[key] = z29.boolean().default(field.default);
3362
3762
  break;
3363
3763
  case "choice":
3364
- shape[key] = z27.enum(field.options).default(field.default);
3764
+ shape[key] = z29.enum(field.options).default(field.default);
3365
3765
  break;
3366
3766
  }
3367
3767
  }
3368
- return settingsValuesSchema.parse(z27.object(shape).strict().parse(input));
3768
+ return settingsValuesSchema.parse(z29.object(shape).strict().parse(input));
3369
3769
  }
3370
3770
  function missingResourceSettings(fields2, values2) {
3371
3771
  return Object.entries(fields2).filter(
@@ -3386,21 +3786,20 @@ function authoringKey(input) {
3386
3786
  }
3387
3787
 
3388
3788
  // src/campaigns.ts
3389
- import * as z28 from "zod";
3390
- var timestamp4 = /* @__PURE__ */ (() => z28.number().int().safe().nonnegative())();
3391
- var availabilityWindowSchema = /* @__PURE__ */ (() => z28.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
3789
+ import * as z30 from "zod";
3790
+ var availabilityWindowSchema = /* @__PURE__ */ (() => z30.object({ from: timestamp4, until: timestamp4 }).strict().refine(endsAfterStart, {
3392
3791
  message: "Window end must follow its start",
3393
3792
  path: ["until"]
3394
3793
  }))();
3395
- var campaignDefinitionSchema = /* @__PURE__ */ (() => z28.object({
3794
+ var campaignDefinitionSchema = /* @__PURE__ */ (() => z30.object({
3396
3795
  key: identifier,
3397
- title: z28.string().trim().min(1).max(120),
3796
+ title: z30.string().trim().min(1).max(120),
3398
3797
  window: availabilityWindowSchema.optional(),
3399
- enrollment: z28.enum(["none", "required"]).default("none")
3798
+ enrollment: z30.enum(["none", "required"]).default("none")
3400
3799
  }).strict())();
3401
3800
  var campaignAuthoringSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.omit({ key: true, title: true }).extend({
3402
3801
  ...authoringIdentityShape,
3403
- title: z28.string().trim().min(1).max(120).optional()
3802
+ title: z30.string().trim().min(1).max(120).optional()
3404
3803
  }).strict().transform((value) => {
3405
3804
  const normalized = value;
3406
3805
  return campaignDefinitionSchema.parse({
@@ -3414,42 +3813,42 @@ function defineCampaign(input) {
3414
3813
  var campaignViewSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.extend({
3415
3814
  enrolledAt: timestamp4.nullable(),
3416
3815
  withdrawnAt: timestamp4.nullable().default(null),
3417
- withdrawalReason: z28.string().nullable().default(null)
3816
+ withdrawalReason: z30.string().nullable().default(null)
3418
3817
  }))();
3419
- var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z28.object({ actionId: identifier, campaign: identifier }).strict())();
3818
+ var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, campaign: identifier }).strict())();
3420
3819
  var memberCampaignEnrollmentInputSchema = /* @__PURE__ */ (() => campaignEnrollmentInputSchema.extend({ member: identifier }))();
3421
3820
  var campaignWithdrawalInputSchema = campaignEnrollmentInputSchema;
3422
3821
  var memberCampaignWithdrawalInputSchema = /* @__PURE__ */ (() => campaignWithdrawalInputSchema.extend({
3423
3822
  member: identifier,
3424
- reason: z28.string().trim().min(1).max(500)
3823
+ reason: z30.string().trim().min(1).max(500)
3425
3824
  }))();
3426
- var campaignEnrollmentSchema = /* @__PURE__ */ (() => z28.object({
3825
+ var campaignEnrollmentSchema = /* @__PURE__ */ (() => z30.object({
3427
3826
  campaign: identifier,
3428
3827
  member: identifier,
3429
3828
  enrolledAt: timestamp4,
3430
3829
  withdrawnAt: timestamp4.nullable().default(null),
3431
- withdrawalReason: z28.string().nullable().default(null)
3830
+ withdrawalReason: z30.string().nullable().default(null)
3432
3831
  }))();
3433
3832
 
3434
3833
  // src/resource-handle.ts
3435
- import * as z29 from "zod";
3834
+ import * as z31 from "zod";
3436
3835
  function resourceHandle(_kind, definition) {
3437
3836
  return definition;
3438
3837
  }
3439
- var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z29.literal("")).brand())();
3838
+ var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z31.literal("")).brand())();
3440
3839
  function ledgerKey(ledger) {
3441
3840
  return typeof ledger === "string" ? ledger : ledger.key;
3442
3841
  }
3443
3842
 
3444
3843
  // src/groups.ts
3445
- import * as z30 from "zod";
3446
- var projectGroupSchema = /* @__PURE__ */ (() => z30.object({
3844
+ import * as z32 from "zod";
3845
+ var projectGroupSchema = /* @__PURE__ */ (() => z32.object({
3447
3846
  key: identifier,
3448
- title: z30.string().trim().min(1).max(120)
3847
+ title: z32.string().trim().min(1).max(120)
3449
3848
  }).strict())();
3450
3849
  var projectGroupAuthoringSchema = /* @__PURE__ */ (() => projectGroupSchema.omit({ key: true, title: true }).extend({
3451
3850
  ...authoringIdentityShape,
3452
- title: z30.string().trim().min(1).max(120).optional()
3851
+ title: z32.string().trim().min(1).max(120).optional()
3453
3852
  }).strict().transform((value) => {
3454
3853
  return projectGroupSchema.parse({
3455
3854
  ...value,
@@ -3462,93 +3861,93 @@ function defineGroup(input) {
3462
3861
  function projectGroupKey(group) {
3463
3862
  return identifier.parse(group.key);
3464
3863
  }
3465
- var groupTitle = /* @__PURE__ */ (() => z30.string().trim().min(1).max(120))();
3466
- var reason = /* @__PURE__ */ (() => z30.string().trim().min(1).max(1e3))();
3467
- var timestamp5 = /* @__PURE__ */ (() => z30.number().int().nonnegative().max(864e13))();
3468
- var createGroupSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
3469
- var updateGroupSchema = /* @__PURE__ */ (() => z30.object({ title: groupTitle }).strict())();
3470
- var addGroupMemberSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, member: identifier, reason }).strict())();
3471
- var removeGroupMemberSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, reason }).strict())();
3472
- var groupArchiveInputSchema = /* @__PURE__ */ (() => z30.object({ reason: lifecycleReasonSchema.optional() }).strict())();
3473
- var groupPageQuerySchema = /* @__PURE__ */ (() => z30.strictObject({
3864
+ var groupTitle = /* @__PURE__ */ (() => z32.string().trim().min(1).max(120))();
3865
+ var reason = /* @__PURE__ */ (() => z32.string().trim().min(1).max(1e3))();
3866
+ var timestamp5 = /* @__PURE__ */ (() => z32.number().int().nonnegative().max(864e13))();
3867
+ var createGroupSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
3868
+ var updateGroupSchema = /* @__PURE__ */ (() => z32.object({ title: groupTitle }).strict())();
3869
+ var addGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, member: identifier, reason }).strict())();
3870
+ var removeGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, reason }).strict())();
3871
+ var groupArchiveInputSchema = /* @__PURE__ */ (() => z32.object({ reason: lifecycleReasonSchema.optional() }).strict())();
3872
+ var groupPageQuerySchema = /* @__PURE__ */ (() => z32.strictObject({
3474
3873
  cursor: pageCursorSchema.optional(),
3475
3874
  /** Items per page, 1–100; the default is 50. */
3476
- limit: z30.number().int().min(1).max(100).optional()
3875
+ limit: z32.number().int().min(1).max(100).optional()
3477
3876
  }))();
3478
- var managedGroupSchema = /* @__PURE__ */ (() => z30.object({
3877
+ var managedGroupSchema = /* @__PURE__ */ (() => z32.object({
3479
3878
  key: identifier,
3480
- title: z30.string(),
3481
- members: z30.number().int().nonnegative(),
3879
+ title: z32.string(),
3880
+ members: z32.number().int().nonnegative(),
3482
3881
  createdAt: timestamp5,
3483
3882
  archivedAt: timestamp5.nullable()
3484
3883
  }))();
3485
- var groupPageSchema = /* @__PURE__ */ (() => z30.object({
3486
- items: z30.array(managedGroupSchema),
3884
+ var groupPageSchema = /* @__PURE__ */ (() => z32.object({
3885
+ items: z32.array(managedGroupSchema),
3487
3886
  nextCursor: pageCursorSchema.nullable()
3488
3887
  }))();
3489
- var groupMemberSchema = /* @__PURE__ */ (() => z30.object({
3888
+ var groupMemberSchema = /* @__PURE__ */ (() => z32.object({
3490
3889
  member: identifier,
3491
3890
  addedAt: timestamp5.nullable()
3492
3891
  }))();
3493
- var groupMemberPageSchema = /* @__PURE__ */ (() => z30.object({
3494
- items: z30.array(groupMemberSchema),
3892
+ var groupMemberPageSchema = /* @__PURE__ */ (() => z32.object({
3893
+ items: z32.array(groupMemberSchema),
3495
3894
  nextCursor: pageCursorSchema.nullable()
3496
3895
  }))();
3497
3896
 
3498
3897
  // src/prerequisites.ts
3499
- import * as z31 from "zod";
3500
- var amount = /* @__PURE__ */ (() => z31.number().int().safe().nonnegative())();
3898
+ import * as z33 from "zod";
3899
+ var amount = /* @__PURE__ */ (() => z33.number().int().safe().nonnegative())();
3501
3900
  var threshold = /* @__PURE__ */ (() => amount.positive())();
3502
- var completionPrerequisiteSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("scope", [
3503
- z31.object({
3504
- kind: z31.literal("completion"),
3901
+ var completionPrerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("scope", [
3902
+ z33.object({
3903
+ kind: z33.literal("completion"),
3505
3904
  quest: identifier,
3506
- scope: z31.literal("ever")
3905
+ scope: z33.literal("ever")
3507
3906
  }).strict(),
3508
- z31.object({
3509
- kind: z31.literal("completion"),
3907
+ z33.object({
3908
+ kind: z33.literal("completion"),
3510
3909
  quest: identifier,
3511
- scope: z31.literal("period"),
3910
+ scope: z33.literal("period"),
3512
3911
  period: calendarPeriodSchema.exclude(["lifetime"])
3513
3912
  }).strict()
3514
3913
  ]))();
3515
- var balancePrerequisiteSchema = /* @__PURE__ */ (() => z31.object({
3516
- kind: z31.literal("balance"),
3914
+ var balancePrerequisiteSchema = /* @__PURE__ */ (() => z33.object({
3915
+ kind: z33.literal("balance"),
3517
3916
  balance: identifier,
3518
3917
  minimum: threshold
3519
3918
  }).strict())();
3520
- var groupPrerequisiteSchema = /* @__PURE__ */ (() => z31.object({ kind: z31.literal("group"), group: identifier, title: z31.string() }).strict())();
3521
- var prerequisiteSchema = /* @__PURE__ */ (() => z31.discriminatedUnion("kind", [
3919
+ var groupPrerequisiteSchema = /* @__PURE__ */ (() => z33.object({ kind: z33.literal("group"), group: identifier, title: z33.string() }).strict())();
3920
+ var prerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("kind", [
3522
3921
  completionPrerequisiteSchema,
3523
3922
  balancePrerequisiteSchema,
3524
3923
  groupPrerequisiteSchema
3525
3924
  ]))();
3526
- var missingPrerequisiteSchema = /* @__PURE__ */ (() => z31.union([
3527
- z31.object({
3528
- kind: z31.literal("completion"),
3925
+ var missingPrerequisiteSchema = /* @__PURE__ */ (() => z33.union([
3926
+ z33.object({
3927
+ kind: z33.literal("completion"),
3529
3928
  quest: identifier,
3530
- title: z31.string(),
3531
- scope: z31.literal("ever")
3929
+ title: z33.string(),
3930
+ scope: z33.literal("ever")
3532
3931
  }),
3533
- z31.object({
3534
- kind: z31.literal("completion"),
3932
+ z33.object({
3933
+ kind: z33.literal("completion"),
3535
3934
  quest: identifier,
3536
- title: z31.string(),
3537
- scope: z31.literal("period"),
3935
+ title: z33.string(),
3936
+ scope: z33.literal("period"),
3538
3937
  period: calendarPeriodSchema.exclude(["lifetime"]),
3539
- resetsAt: z31.number().int().safe()
3938
+ resetsAt: z33.number().int().safe()
3540
3939
  }),
3541
- z31.object({
3542
- kind: z31.literal("balance"),
3940
+ z33.object({
3941
+ kind: z33.literal("balance"),
3543
3942
  balance: identifier,
3544
- title: z31.string(),
3943
+ title: z33.string(),
3545
3944
  minimum: threshold,
3546
3945
  current: amount
3547
3946
  }),
3548
- z31.object({
3549
- kind: z31.literal("group"),
3947
+ z33.object({
3948
+ kind: z33.literal("group"),
3550
3949
  group: identifier,
3551
- title: z31.string()
3950
+ title: z33.string()
3552
3951
  })
3553
3952
  ]))();
3554
3953
  function completed(quest, options = {}) {
@@ -3579,29 +3978,29 @@ function inGroup(group) {
3579
3978
  var maxPointsAmount = 2147483647;
3580
3979
 
3581
3980
  // src/schema.ts
3582
- import * as z32 from "zod";
3583
- var pointsRewardSchema = /* @__PURE__ */ (() => z32.object({
3584
- kind: z32.literal("points").default("points"),
3981
+ import * as z34 from "zod";
3982
+ var pointsRewardSchema = /* @__PURE__ */ (() => z34.object({
3983
+ kind: z34.literal("points").default("points"),
3585
3984
  balance: identifier,
3586
- amount: z32.number().int().min(0).max(maxPointsAmount)
3985
+ amount: z34.number().int().min(0).max(maxPointsAmount)
3587
3986
  }).strict())();
3588
- var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z32.object({
3987
+ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z34.object({
3589
3988
  /** An automatic achievement backed by the project badge catalog. */
3590
3989
  badge: identifier.optional(),
3591
3990
  /** Membership in the project group with this key, added when the reward is delivered. */
3592
3991
  group: identifier.optional(),
3593
3992
  id: identifier,
3594
- title: z32.string().min(1).max(120),
3595
- tiers: z32.array(
3596
- z32.object({ id: identifier, title: z32.string().min(1).max(120) }).strict()
3993
+ title: z34.string().min(1).max(120),
3994
+ tiers: z34.array(
3995
+ z34.object({ id: identifier, title: z34.string().min(1).max(120) }).strict()
3597
3996
  ).min(1).max(20).refine(
3598
3997
  (tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
3599
3998
  "Tier IDs must be unique"
3600
3999
  ),
3601
- inventory: z32.object({ kind: z32.literal("untracked") }).strict(),
3602
- fulfillment: z32.discriminatedUnion("kind", [
3603
- z32.object({ kind: z32.literal("staff-handover") }).strict(),
3604
- z32.object({ kind: z32.literal("automatic") }).strict()
4000
+ inventory: z34.object({ kind: z34.literal("untracked") }).strict(),
4001
+ fulfillment: z34.discriminatedUnion("kind", [
4002
+ z34.object({ kind: z34.literal("staff-handover") }).strict(),
4003
+ z34.object({ kind: z34.literal("automatic") }).strict()
3605
4004
  ])
3606
4005
  }).strict().refine(
3607
4006
  (value) => value.badge === void 0 && value.group === void 0 || value.fulfillment.kind === "automatic" && value.tiers.length === 1 && value.tiers[0].id === "awarded",
@@ -3610,12 +4009,12 @@ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z32.object({
3610
4009
  (value) => value.badge === void 0 || value.group === void 0,
3611
4010
  "A reward is either a badge or a group membership"
3612
4011
  ))();
3613
- var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z32.object({
4012
+ var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z34.object({
3614
4013
  id: identifier,
3615
4014
  key: identifier.nullable()
3616
4015
  }))();
3617
- var tierRewardSchema = /* @__PURE__ */ (() => z32.object({
3618
- kind: z32.literal("tier"),
4016
+ var tierRewardSchema = /* @__PURE__ */ (() => z34.object({
4017
+ kind: z34.literal("tier"),
3619
4018
  reward: tieredRewardDefinitionSchema,
3620
4019
  tier: identifier
3621
4020
  }).strict().refine(
@@ -3627,7 +4026,7 @@ var badgeRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
3627
4026
  const badge = value.reward.badge;
3628
4027
  if (!badge || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
3629
4028
  context.addIssue({ code: "custom", message: "Invalid badge reward" });
3630
- return z32.NEVER;
4029
+ return z34.NEVER;
3631
4030
  }
3632
4031
  return { ...value, reward: { ...value.reward, badge } };
3633
4032
  }
@@ -3651,7 +4050,7 @@ var groupRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
3651
4050
  const group = value.reward.group;
3652
4051
  if (!group || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
3653
4052
  context.addIssue({ code: "custom", message: "Invalid group reward" });
3654
- return z32.NEVER;
4053
+ return z34.NEVER;
3655
4054
  }
3656
4055
  return { ...value, reward: { ...value.reward, group } };
3657
4056
  }
@@ -3671,15 +4070,15 @@ function groupReward(key, title) {
3671
4070
  });
3672
4071
  }
3673
4072
  var integrationRewardSchema = discordRewardSchema;
3674
- var rewardSchema = /* @__PURE__ */ (() => z32.union([
4073
+ var rewardSchema = /* @__PURE__ */ (() => z34.union([
3675
4074
  pointsRewardSchema,
3676
4075
  tierRewardSchema,
3677
4076
  integrationRewardSchema
3678
4077
  ]))();
3679
- var rewardTypeSchema = /* @__PURE__ */ (() => z32.string())();
3680
- var rewardEntrySchema = /* @__PURE__ */ (() => z32.object({
4078
+ var rewardTypeSchema = /* @__PURE__ */ (() => z34.string())();
4079
+ var rewardEntrySchema = /* @__PURE__ */ (() => z34.object({
3681
4080
  type: rewardTypeSchema,
3682
- data: z32.record(z32.string(), z32.json())
4081
+ data: z34.record(z34.string(), z34.json())
3683
4082
  }))();
3684
4083
  function rewardKey(reward) {
3685
4084
  if (reward.kind === "tier" && reward.reward.badge) {
@@ -3693,39 +4092,39 @@ function rewardKey(reward) {
3693
4092
  }
3694
4093
  return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
3695
4094
  }
3696
- var triggerSchema = /* @__PURE__ */ (() => z32.union([
3697
- z32.object({
3698
- kind: z32.literal("manual"),
3699
- input: z32.literal("text"),
4095
+ var triggerSchema = /* @__PURE__ */ (() => z34.union([
4096
+ z34.object({
4097
+ kind: z34.literal("manual"),
4098
+ input: z34.literal("text"),
3700
4099
  constraints: textOptionsSchema,
3701
- actor: z32.enum(["member", "staff"]).optional()
4100
+ actor: z34.enum(["member", "staff"]).optional()
3702
4101
  }).strict(),
3703
- z32.object({
3704
- kind: z32.literal("manual"),
3705
- input: z32.literal("url"),
4102
+ z34.object({
4103
+ kind: z34.literal("manual"),
4104
+ input: z34.literal("url"),
3706
4105
  constraints: urlOptionsSchema,
3707
- actor: z32.enum(["member", "staff"]).optional()
4106
+ actor: z34.enum(["member", "staff"]).optional()
3708
4107
  }).strict(),
3709
- z32.object({
3710
- kind: z32.literal("manual"),
3711
- input: z32.enum(["photo", "quiz", "none"]),
3712
- actor: z32.enum(["member", "staff"]).optional()
4108
+ z34.object({
4109
+ kind: z34.literal("manual"),
4110
+ input: z34.enum(["photo", "quiz", "none"]),
4111
+ actor: z34.enum(["member", "staff"]).optional()
3713
4112
  }).strict(),
3714
- z32.object({
3715
- kind: z32.literal("automatic"),
4113
+ z34.object({
4114
+ kind: z34.literal("automatic"),
3716
4115
  tracker: trackerTriggerPolicySchema.optional()
3717
4116
  }).strict()
3718
4117
  ]))();
3719
- var triggerResponseSchema = /* @__PURE__ */ (() => z32.union(
4118
+ var triggerResponseSchema = /* @__PURE__ */ (() => z34.union(
3720
4119
  triggerSchema.options.map((option) => option.strip())
3721
4120
  ))();
3722
- var photoResultSchema = /* @__PURE__ */ (() => z32.object({
3723
- kind: z32.enum(["pass", "fail", "unclear"]),
3724
- reason: z32.string().min(1).max(2e3)
4121
+ var photoResultSchema = /* @__PURE__ */ (() => z34.object({
4122
+ kind: z34.enum(["pass", "fail", "unclear"]),
4123
+ reason: z34.string().min(1).max(2e3)
3725
4124
  }).strict())();
3726
- var textReviewInputSchema = /* @__PURE__ */ (() => z32.object({
3727
- text: z32.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
3728
- criteria: z32.string().trim().min(1).max(2e3)
4125
+ var textReviewInputSchema = /* @__PURE__ */ (() => z34.object({
4126
+ text: z34.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
4127
+ criteria: z34.string().trim().min(1).max(2e3)
3729
4128
  }).strict())();
3730
4129
  var textResultSchema = photoResultSchema;
3731
4130
  var deferPolicy = {
@@ -3739,31 +4138,31 @@ var retryCooldownPolicy = {
3739
4138
  minMs: 1e3,
3740
4139
  maxMs: 6048e5
3741
4140
  };
3742
- var retryCooldownMsSchema = /* @__PURE__ */ (() => z32.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
3743
- var evaluatorProgressSchema = /* @__PURE__ */ (() => z32.object({
3744
- current: z32.number().finite().nonnegative(),
3745
- target: z32.number().finite().positive(),
3746
- reason: z32.string().min(1).max(2e3)
4141
+ var retryCooldownMsSchema = /* @__PURE__ */ (() => z34.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
4142
+ var evaluatorProgressSchema = /* @__PURE__ */ (() => z34.object({
4143
+ current: z34.number().finite().nonnegative(),
4144
+ target: z34.number().finite().positive(),
4145
+ reason: z34.string().min(1).max(2e3)
3747
4146
  }).refine((value) => value.current <= value.target, {
3748
4147
  message: "Progress current must not exceed target"
3749
4148
  }))();
3750
- var decisionSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
3751
- z32.strictObject({
3752
- kind: z32.literal("defer"),
3753
- reason: z32.string().min(1).max(2e3),
3754
- retryAfterMs: z32.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
4149
+ var decisionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4150
+ z34.strictObject({
4151
+ kind: z34.literal("defer"),
4152
+ reason: z34.string().min(1).max(2e3),
4153
+ retryAfterMs: z34.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
3755
4154
  /** Absolute Unix milliseconds; the platform can only shorten its existing deadline. */
3756
- until: z32.number().int().safe().nonnegative().optional()
4155
+ until: z34.number().int().safe().nonnegative().optional()
3757
4156
  }),
3758
- evaluatorProgressSchema.safeExtend({ kind: z32.literal("progress") }).strict(),
3759
- z32.object({
3760
- kind: z32.literal("accept"),
3761
- rewards: z32.array(rewardSchema).max(10),
4157
+ evaluatorProgressSchema.safeExtend({ kind: z34.literal("progress") }).strict(),
4158
+ z34.object({
4159
+ kind: z34.literal("accept"),
4160
+ rewards: z34.array(rewardSchema).max(10),
3762
4161
  completionKey: completionKeySchema.optional()
3763
4162
  }).strict(),
3764
- z32.object({
3765
- kind: z32.literal("reject"),
3766
- reason: z32.string().min(1).max(2e3),
4163
+ z34.object({
4164
+ kind: z34.literal("reject"),
4165
+ reason: z34.string().min(1).max(2e3),
3767
4166
  /**
3768
4167
  * A stable key for the rejection's cause, such as `wrong-answers`, stored as the attempt's
3769
4168
  * `code`: lowercase letters, digits and hyphens, at most 64 characters, and none of the
@@ -3771,28 +4170,28 @@ var decisionSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
3771
4170
  */
3772
4171
  code: rejectCodeSchema.optional(),
3773
4172
  /** The evaluator asked for human review, but review is off for the quest, so this is a reject. */
3774
- requestedReview: z32.literal(true).optional()
4173
+ requestedReview: z34.literal(true).optional()
3775
4174
  }).strict(),
3776
- z32.object({
3777
- kind: z32.literal("review"),
3778
- reason: z32.string().min(1).max(2e3),
3779
- rewards: z32.array(rewardSchema).max(10).optional(),
4175
+ z34.object({
4176
+ kind: z34.literal("review"),
4177
+ reason: z34.string().min(1).max(2e3),
4178
+ rewards: z34.array(rewardSchema).max(10).optional(),
3780
4179
  completionKey: completionKeySchema.optional()
3781
4180
  }).strict()
3782
4181
  ]))();
3783
- var reviewModeSchema = /* @__PURE__ */ (() => z32.enum(["workers-ai"]))();
3784
- var storedReviewModeSchema = /* @__PURE__ */ (() => z32.enum([
4182
+ var reviewModeSchema = /* @__PURE__ */ (() => z34.enum(["workers-ai"]))();
4183
+ var storedReviewModeSchema = /* @__PURE__ */ (() => z34.enum([
3785
4184
  "fixture-pass",
3786
4185
  "fixture-fail",
3787
4186
  "fixture-unclear",
3788
4187
  "fixture-error",
3789
4188
  "workers-ai"
3790
4189
  ]))();
3791
- var rewardBundleSchema = /* @__PURE__ */ (() => z32.array(rewardSchema).max(10).refine(
4190
+ var rewardBundleSchema = /* @__PURE__ */ (() => z34.array(rewardSchema).max(10).refine(
3792
4191
  (rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
3793
4192
  "Use one entry per balance or shared reward"
3794
4193
  ))();
3795
- var mediaUrlSchema = /* @__PURE__ */ (() => z32.string().max(2e3).refine((value) => {
4194
+ var mediaUrlSchema = /* @__PURE__ */ (() => z34.string().max(2e3).refine((value) => {
3796
4195
  if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
3797
4196
  return true;
3798
4197
  }
@@ -3802,78 +4201,78 @@ var mediaUrlSchema = /* @__PURE__ */ (() => z32.string().max(2e3).refine((value)
3802
4201
  return false;
3803
4202
  }
3804
4203
  }, "Use an HTTPS URL or a same-site path beginning with /"))();
3805
- var questStepActionSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
3806
- z32.object({
3807
- kind: z32.literal("link"),
4204
+ var questStepActionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4205
+ z34.object({
4206
+ kind: z34.literal("link"),
3808
4207
  url: mediaUrlSchema.refine(
3809
4208
  (value) => value.startsWith("https://"),
3810
4209
  "Use an HTTPS URL"
3811
4210
  ),
3812
- label: z32.string().trim().min(1).max(120)
4211
+ label: z34.string().trim().min(1).max(120)
3813
4212
  }).strict()
3814
4213
  ]))();
3815
- var questStepSchema = /* @__PURE__ */ (() => z32.object({
3816
- title: z32.string().trim().min(1).max(120),
3817
- description: z32.string().max(4e3).optional(),
4214
+ var questStepSchema = /* @__PURE__ */ (() => z34.object({
4215
+ title: z34.string().trim().min(1).max(120),
4216
+ description: z34.string().max(4e3).optional(),
3818
4217
  action: questStepActionSchema.optional()
3819
4218
  }).strict())();
3820
- var questPresentationRequirementSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
3821
- z32.object({ kind: z32.literal("account"), provider: authProviderSchema }).strict(),
3822
- z32.object({ kind: z32.literal("wallet"), chain: walletChainSchema.optional() }).strict()
4219
+ var questPresentationRequirementSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4220
+ z34.object({ kind: z34.literal("account"), provider: authProviderSchema }).strict(),
4221
+ z34.object({ kind: z34.literal("wallet"), chain: walletChainSchema.optional() }).strict()
3823
4222
  ]))();
3824
- var questPresentationContentSchema = /* @__PURE__ */ (() => z32.object({
3825
- steps: z32.array(questStepSchema).max(30).optional(),
4223
+ var questPresentationContentSchema = /* @__PURE__ */ (() => z34.object({
4224
+ steps: z34.array(questStepSchema).max(30).optional(),
3826
4225
  image: mediaUrlSchema.optional(),
3827
- imageAlt: z32.string().max(500).optional(),
3828
- requirements: z32.array(questPresentationRequirementSchema).max(10).optional()
4226
+ imageAlt: z34.string().max(500).optional(),
4227
+ requirements: z34.array(questPresentationRequirementSchema).max(10).optional()
3829
4228
  }).strict())();
3830
4229
  var questPresentationSchema = /* @__PURE__ */ (() => questPresentationContentSchema.extend({
3831
4230
  quiz: quizQuestionsSchema.optional(),
3832
- instructions: z32.string().max(4e3).optional(),
3833
- video: z32.object({
4231
+ instructions: z34.string().max(4e3).optional(),
4232
+ video: z34.object({
3834
4233
  url: mediaUrlSchema,
3835
4234
  poster: mediaUrlSchema.optional(),
3836
- captions: z32.object({
4235
+ captions: z34.object({
3837
4236
  url: mediaUrlSchema,
3838
- language: z32.string().min(2).max(20),
3839
- label: z32.string().min(1).max(80)
4237
+ language: z34.string().min(2).max(20),
4238
+ label: z34.string().min(1).max(80)
3840
4239
  }).strict().optional()
3841
4240
  }).strict().optional()
3842
4241
  }).strict())();
3843
- var questProfileSchema = /* @__PURE__ */ (() => z32.object({ visible: z32.boolean() }).strict())();
4242
+ var questProfileSchema = /* @__PURE__ */ (() => z34.object({ visible: z34.boolean() }).strict())();
3844
4243
  var evaluatorProtocol = 2;
3845
- var evaluatorProtocolSchema = /* @__PURE__ */ (() => z32.literal(evaluatorProtocol))();
3846
- var questDescriptionSchema = /* @__PURE__ */ (() => z32.object({
4244
+ var evaluatorProtocolSchema = /* @__PURE__ */ (() => z34.literal(evaluatorProtocol))();
4245
+ var questDescriptionSchema = /* @__PURE__ */ (() => z34.object({
3847
4246
  quest: identifier,
3848
4247
  evaluatorProtocol: evaluatorProtocolSchema,
3849
- title: z32.string().min(1).max(120),
4248
+ title: z34.string().min(1).max(120),
3850
4249
  presentation: questPresentationSchema.default({}),
3851
4250
  /** The declared modules this SDK knows. `integrationModules` lists every declared module. */
3852
- integrations: z32.array(evaluatorIntegrationProviderSchema).max(10).default([]),
4251
+ integrations: z34.array(evaluatorIntegrationProviderSchema).max(10).default([]),
3853
4252
  /**
3854
4253
  * Every integration module the quest declares, including providers this SDK does not know: the
3855
4254
  * open sibling of `integrations`. A description omits it when every module is in
3856
4255
  * `integrations`, as descriptions from older SDKs do; Relay's reads always include it.
3857
4256
  */
3858
- integrationModules: z32.array(integrationModuleProviderSchema).max(10).optional(),
4257
+ integrationModules: z34.array(integrationModuleProviderSchema).max(10).optional(),
3859
4258
  fields: settingsFieldsSchema,
3860
4259
  values: settingsValuesSchema,
3861
4260
  rewards: rewardBundleSchema,
3862
4261
  /** Messages Relay posts in connected chats and channels when a completion pays. */
3863
- announcements: z32.array(announcementSchema).max(3).optional(),
3864
- humanReview: z32.boolean(),
4262
+ announcements: z34.array(announcementSchema).max(3).optional(),
4263
+ humanReview: z34.boolean(),
3865
4264
  trigger: triggerSchema,
3866
4265
  performance: contentPerformancePolicySchema.optional(),
3867
- requires: z32.array(prerequisiteSchema).max(30).default([]),
4266
+ requires: z34.array(prerequisiteSchema).max(30).default([]),
3868
4267
  campaign: campaignDefinitionSchema.optional(),
3869
4268
  availability: availabilityWindowSchema.optional(),
3870
- completion: z32.preprocess(refuseStreakTimeZone, completionPolicySchema),
3871
- visibility: z32.enum(["visible", "hidden"]).default("visible"),
4269
+ completion: z34.preprocess(refuseStreakTimeZone, completionPolicySchema),
4270
+ visibility: z34.enum(["visible", "hidden"]).default("visible"),
3872
4271
  /** Whether completions show on participant profiles (`/v1/profiles/:id/completions`). */
3873
4272
  profile: questProfileSchema.default({ visible: false }),
3874
- budgets: z32.array(budgetSchema).max(20).default([]),
4273
+ budgets: z34.array(budgetSchema).max(20).default([]),
3875
4274
  /** Budgets counted per tracker record author; only on quests with a tracker trigger. */
3876
- authorBudgets: z32.array(authorBudgetSchema).max(20).optional(),
4275
+ authorBudgets: z34.array(authorBudgetSchema).max(20).optional(),
3877
4276
  /**
3878
4277
  * Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
3879
4278
  * before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
@@ -3884,33 +4283,39 @@ var questDescriptionSchema = /* @__PURE__ */ (() => z32.object({
3884
4283
  * submitting it again. Only for repeatable quests members submit; same bounds as
3885
4284
  * `retryCooldownMs`. Omitted: no cooldown.
3886
4285
  */
3887
- completionCooldownMs: retryCooldownMsSchema.optional()
4286
+ completionCooldownMs: retryCooldownMsSchema.optional(),
4287
+ /**
4288
+ * Check-in stations: a transaction completes the quest only when its memo's `reference` names
4289
+ * one, inside the station's window. Only on quests a signed Solana transaction completes.
4290
+ * Experimental.
4291
+ */
4292
+ stations: questStationsSchema.optional()
3888
4293
  }).strict())();
3889
- var artifactSchema = /* @__PURE__ */ (() => z32.object({ code: z32.string().min(1).max(1e6) }).strict())();
4294
+ var artifactSchema = /* @__PURE__ */ (() => z34.object({ code: z34.string().min(1).max(1e6) }).strict())();
3890
4295
  var releaseSchema = /* @__PURE__ */ (() => artifactSchema.extend({
3891
4296
  /** The SDK runtime the code imports. Absent, the code bundles its own SDK. */
3892
4297
  runtime: sdkRuntimeReferenceSchema.optional(),
3893
4298
  settings: settingsValuesSchema,
3894
4299
  provider: reviewModeSchema,
3895
4300
  expectedRelease: identifier.nullable().optional(),
3896
- settingRenames: z32.record(z32.string(), z32.string()).optional()
4301
+ settingRenames: z34.record(z34.string(), z34.string()).optional()
3897
4302
  }).strict())();
3898
- var batchReleaseSchema = /* @__PURE__ */ (() => z32.object({
3899
- releases: z32.array(releaseSchema).min(1).max(limits.quests)
4303
+ var batchReleaseSchema = /* @__PURE__ */ (() => z34.object({
4304
+ releases: z34.array(releaseSchema).min(1).max(limits.quests)
3900
4305
  }).strict())();
3901
- var questSettingsInputSchema = /* @__PURE__ */ (() => z32.object({
4306
+ var questSettingsInputSchema = /* @__PURE__ */ (() => z34.object({
3902
4307
  quest: identifier,
3903
4308
  expectedRelease: identifier,
3904
4309
  set: settingsValuesSchema,
3905
- reset: z32.array(z32.string()),
4310
+ reset: z34.array(z34.string()),
3906
4311
  /** Replace the editable presentation fields; null restores the code defaults. */
3907
4312
  presentation: questPresentationContentSchema.nullable().optional(),
3908
4313
  /**
3909
- * Anchor IDLs to paste, by `settings.solanaProgram()` setting key, for programs that publish
4314
+ * IDLs (Anchor, Codama or Shank) to paste, by `settings.solanaProgram()` setting key, for programs that publish
3910
4315
  * none on chain or to use another; null removes a pasted one. A pasted IDL takes precedence
3911
4316
  * over one the program publishes on chain.
3912
4317
  */
3913
- solanaIdls: z32.record(z32.string(), anchorIdlSchema.nullable()).optional()
4318
+ solanaIdls: z34.record(z34.string(), anchorIdlSchema.nullable()).optional()
3914
4319
  }).strict())();
3915
4320
  var storedQuestDescriptionSchema = /* @__PURE__ */ (() => questDescriptionSchema.extend({
3916
4321
  completion: completionPolicySchema
@@ -3921,42 +4326,42 @@ var publishedReleaseSchema = /* @__PURE__ */ (() => responseShape(
3921
4326
  * Every reward of the quest, kinds this SDK does not know included: the open sibling of
3922
4327
  * `rewards`, which keeps SDK 1.x's closed `Reward`. Absent from older Relay versions.
3923
4328
  */
3924
- rewardEntries: z32.array(rewardEntrySchema).optional(),
4329
+ rewardEntries: z34.array(rewardEntrySchema).optional(),
3925
4330
  key: identifier.optional(),
3926
- code: z32.string(),
4331
+ code: z34.string(),
3927
4332
  /** The SDK runtime `code` imports. Absent, the code bundles its own SDK. */
3928
4333
  runtime: sdkRuntimeReferenceSchema.optional(),
3929
4334
  provider: storedReviewModeSchema,
3930
4335
  id: identifier,
3931
- createdAt: z32.number(),
3932
- origin: z32.object({ typeVersion: identifier }).strict().optional(),
3933
- lifecycle: z32.enum(["active", "paused", "archived"]).default("active"),
3934
- configuration: z32.object({
4336
+ createdAt: z34.number(),
4337
+ origin: z34.object({ typeVersion: identifier }).strict().optional(),
4338
+ lifecycle: z34.enum(["active", "paused", "archived"]).default("active"),
4339
+ configuration: z34.object({
3935
4340
  defaults: settingsValuesSchema,
3936
4341
  overrides: settingsValuesSchema,
3937
- preserved: z32.array(z32.string()),
4342
+ preserved: z34.array(z34.string()),
3938
4343
  presentation: questPresentationContentSchema.optional(),
3939
4344
  presentationDefaults: questPresentationContentSchema.optional()
3940
4345
  }).strict().optional(),
3941
4346
  /**
3942
- * The Anchor IDLs `ctx.wallet.transactions()` decodes instructions with, by
4347
+ * The IDLs `ctx.wallet.transactions()` decodes instructions with, by
3943
4348
  * `settings.solanaProgram()` setting key. Stored when the setting is saved; a setting without
3944
4349
  * an IDL has no entry.
3945
4350
  */
3946
- solanaIdls: z32.record(z32.string(), solanaProgramIdlSchema).optional(),
4351
+ solanaIdls: z34.record(z34.string(), solanaProgramIdlSchema).optional(),
3947
4352
  /**
3948
4353
  * The secret settings (`settings.text({ secret: true })`) that hold a value. Responses leave
3949
4354
  * every secret setting out of `values` and `configuration`; one not listed here is empty.
3950
4355
  * Absent when the release has no secret setting.
3951
4356
  */
3952
- withheldSettings: z32.array(z32.string()).optional()
4357
+ withheldSettings: z34.array(z34.string()).optional()
3953
4358
  })
3954
4359
  ))();
3955
- var templateSchema = /* @__PURE__ */ (() => z32.object({
3956
- code: z32.string(),
4360
+ var templateSchema = /* @__PURE__ */ (() => z34.object({
4361
+ code: z34.string(),
3957
4362
  definition: questDescriptionSchema
3958
4363
  }))();
3959
- var quizAnswersSchema = /* @__PURE__ */ (() => z32.record(identifier, identifier).refine(
4364
+ var quizAnswersSchema = /* @__PURE__ */ (() => z34.record(identifier, identifier).refine(
3960
4365
  (answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
3961
4366
  "Provide between 1 and 50 answers"
3962
4367
  ).transform(
@@ -3964,17 +4369,17 @@ var quizAnswersSchema = /* @__PURE__ */ (() => z32.record(identifier, identifier
3964
4369
  Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
3965
4370
  )
3966
4371
  ))();
3967
- var quizEvidenceSchema = /* @__PURE__ */ (() => z32.object({
3968
- kind: z32.literal("quiz"),
4372
+ var quizEvidenceSchema = /* @__PURE__ */ (() => z34.object({
4373
+ kind: z34.literal("quiz"),
3969
4374
  release: identifier.optional(),
3970
4375
  answers: quizAnswersSchema
3971
4376
  }).strict())();
3972
- var submissionEvidenceSchema = /* @__PURE__ */ (() => z32.union([
4377
+ var submissionEvidenceSchema = /* @__PURE__ */ (() => z34.union([
3973
4378
  quizEvidenceSchema,
3974
4379
  textEvidenceSchema,
3975
4380
  urlEvidenceSchema
3976
4381
  ]))();
3977
- var submitSchema = /* @__PURE__ */ (() => z32.object({
4382
+ var submitSchema = /* @__PURE__ */ (() => z34.object({
3978
4383
  actionId: identifier,
3979
4384
  quest: identifier,
3980
4385
  member: identifier,
@@ -3982,7 +4387,7 @@ var submitSchema = /* @__PURE__ */ (() => z32.object({
3982
4387
  input: submissionEvidenceSchema.optional(),
3983
4388
  release: identifier.optional(),
3984
4389
  /** @deprecated Relay refuses a submission that sets it to `true` and ignores `false`. Removed in 2.0.0. */
3985
- faultAfterReview: z32.boolean().optional()
4390
+ faultAfterReview: z34.boolean().optional()
3986
4391
  }).strict())();
3987
4392
  var AttemptStatus = {
3988
4393
  Queued: "queued",
@@ -3994,13 +4399,13 @@ var AttemptStatus = {
3994
4399
  NeedsReview: "needs-review",
3995
4400
  Failed: "failed"
3996
4401
  };
3997
- var attemptStatusSchema = /* @__PURE__ */ (() => z32.string())();
4402
+ var attemptStatusSchema = /* @__PURE__ */ (() => z34.string())();
3998
4403
  var AttemptCodeSource = {
3999
4404
  Relay: "relay",
4000
4405
  Evaluator: "evaluator"
4001
4406
  };
4002
- var attemptCodeSourceSchema = /* @__PURE__ */ (() => z32.string())();
4003
- var attemptSchema = /* @__PURE__ */ (() => z32.object({
4407
+ var attemptCodeSourceSchema = /* @__PURE__ */ (() => z34.string())();
4408
+ var attemptSchema = /* @__PURE__ */ (() => z34.object({
4004
4409
  id: identifier,
4005
4410
  release: identifier,
4006
4411
  quest: identifier,
@@ -4008,22 +4413,22 @@ var attemptSchema = /* @__PURE__ */ (() => z32.object({
4008
4413
  evidence: identifier.nullable(),
4009
4414
  input: submissionEvidenceSchema.optional(),
4010
4415
  status: attemptStatusSchema,
4011
- reason: z32.string().nullable(),
4012
- retries: z32.number(),
4013
- generation: z32.number(),
4014
- completion: z32.string().nullable(),
4416
+ reason: z34.string().nullable(),
4417
+ retries: z34.number(),
4418
+ generation: z34.number(),
4419
+ completion: z34.string().nullable(),
4015
4420
  reviewRewards: rewardBundleSchema.nullable().default(null),
4016
4421
  /** Scheduled reruns advance this number; failure retries preserve it. */
4017
- evaluationRun: z32.number().int().nonnegative().default(0),
4018
- deferCount: z32.number().int().nonnegative().default(0),
4019
- deferUntil: z32.number().int().safe().nullable().default(null),
4020
- nextEvaluationAt: z32.number().int().safe().nullable().default(null),
4422
+ evaluationRun: z34.number().int().nonnegative().default(0),
4423
+ deferCount: z34.number().int().nonnegative().default(0),
4424
+ deferUntil: z34.number().int().safe().nullable().default(null),
4425
+ nextEvaluationAt: z34.number().int().safe().nullable().default(null),
4021
4426
  /**
4022
4427
  * Open code: consumers must tolerate new values. Relay writes its own codes, such as
4023
4428
  * `budget-exhausted`; an attempt the evaluator rejected with `decision.reject({ reason, code })`
4024
4429
  * carries the evaluator's code in management reads, and null in responses to members.
4025
4430
  */
4026
- code: z32.string().nullable().default(null),
4431
+ code: z34.string().nullable().default(null),
4027
4432
  /**
4028
4433
  * Who wrote `code`: `relay` or `evaluator` (an `AttemptCodeSource`), null when `code` is null.
4029
4434
  * Open: consumers must tolerate new values. An evaluator can reject with a code Relay also writes,
@@ -4036,8 +4441,15 @@ var attemptSchema = /* @__PURE__ */ (() => z32.object({
4036
4441
  * The evaluator asked for human review of a quest with review off, so Domino rejected the attempt
4037
4442
  * with the evaluator's reason. Only set on a rejected attempt.
4038
4443
  */
4039
- requestedReview: z32.boolean().default(false),
4040
- createdAt: z32.number()
4444
+ requestedReview: z34.boolean().default(false),
4445
+ createdAt: z34.number(),
4446
+ /**
4447
+ * The action that started the attempt: the signed Solana transaction an app's server submitted
4448
+ * with `management.attempts.submitSolanaTransaction()`. Absent for any other attempt.
4449
+ *
4450
+ * @experimental A minor release can change quest actions.
4451
+ */
4452
+ action: attemptActionSchema.nullable().optional()
4041
4453
  }))();
4042
4454
  var QuestSubmissionStatus = {
4043
4455
  Open: "open",
@@ -4045,9 +4457,9 @@ var QuestSubmissionStatus = {
4045
4457
  Discarded: "discarded",
4046
4458
  Expired: "expired"
4047
4459
  };
4048
- var questSubmissionStatusSchema = /* @__PURE__ */ (() => z32.string())();
4460
+ var questSubmissionStatusSchema = /* @__PURE__ */ (() => z34.string())();
4049
4461
  var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
4050
- z32.object({
4462
+ z34.object({
4051
4463
  id: identifier,
4052
4464
  quest: identifier,
4053
4465
  member: identifier,
@@ -4057,85 +4469,85 @@ var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
4057
4469
  /** An uploaded photo's evidence ID. */
4058
4470
  evidence: identifier.nullable(),
4059
4471
  /** Submitting was refused because the quest changed: review the draft before submitting again. */
4060
- reviewRequired: z32.boolean(),
4472
+ reviewRequired: z34.boolean(),
4061
4473
  status: questSubmissionStatusSchema,
4062
4474
  /** The attempt a `submitted` submission admitted. */
4063
4475
  attempt: identifier.nullable(),
4064
- createdAt: z32.number(),
4065
- updatedAt: z32.number(),
4476
+ createdAt: z34.number(),
4477
+ updatedAt: z34.number(),
4066
4478
  /** When an open submission expires unless it changes again. */
4067
- expiresAt: z32.number()
4479
+ expiresAt: z34.number()
4068
4480
  })
4069
4481
  ))();
4070
- var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z32.object({
4482
+ var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z34.object({
4071
4483
  release: identifier.nullable().optional(),
4072
4484
  input: submissionEvidenceSchema.nullable().optional(),
4073
4485
  evidence: identifier.nullable().optional()
4074
4486
  }).strict())();
4075
4487
  var questSubmissionResultSchema = /* @__PURE__ */ (() => responseShape(
4076
- z32.object({
4488
+ z34.object({
4077
4489
  submission: questSubmissionSchema,
4078
4490
  attempt: attemptSchema,
4079
- replayed: z32.boolean()
4491
+ replayed: z34.boolean()
4080
4492
  })
4081
4493
  ))();
4082
- var eventSchema = /* @__PURE__ */ (() => z32.object({
4083
- id: z32.number(),
4084
- attempt: z32.string().nullable(),
4085
- kind: z32.string(),
4086
- detail: z32.string(),
4087
- actor: z32.string().nullable().default(null),
4088
- at: z32.number()
4089
- }))();
4090
- var pickupSelectionSchema = /* @__PURE__ */ (() => z32.object({
4494
+ var eventSchema = /* @__PURE__ */ (() => z34.object({
4495
+ id: z34.number(),
4496
+ attempt: z34.string().nullable(),
4497
+ kind: z34.string(),
4498
+ detail: z34.string(),
4499
+ actor: z34.string().nullable().default(null),
4500
+ at: z34.number()
4501
+ }))();
4502
+ var pickupSelectionSchema = /* @__PURE__ */ (() => z34.object({
4091
4503
  item: identifier,
4092
- revision: z32.number().int().nonnegative()
4504
+ revision: z34.number().int().nonnegative()
4093
4505
  }).strict())();
4094
- var pickupAllocationSchema = /* @__PURE__ */ (() => z32.object({
4506
+ var pickupAllocationSchema = /* @__PURE__ */ (() => z34.object({
4095
4507
  item: identifier,
4096
- label: z32.string().min(1).max(80)
4508
+ label: z34.string().min(1).max(80)
4097
4509
  }).strict())();
4098
- var pickupPolicySchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
4099
- z32.object({ kind: z32.literal("untracked") }).strict(),
4100
- z32.object({
4101
- kind: z32.literal("at-pickup"),
4102
- tiers: z32.array(
4103
- z32.object({
4510
+ var pickupPolicySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4511
+ z34.object({ kind: z34.literal("untracked") }).strict(),
4512
+ z34.object({
4513
+ kind: z34.literal("at-pickup"),
4514
+ tiers: z34.array(
4515
+ z34.object({
4104
4516
  tier: identifier,
4105
- variants: z32.array(pickupAllocationSchema).min(1).max(100)
4517
+ variants: z34.array(pickupAllocationSchema).min(1).max(100)
4106
4518
  }).strict()
4107
4519
  ).min(1).max(100)
4108
4520
  }).strict()
4109
4521
  ]))();
4110
- var pickupCatalogSchema = /* @__PURE__ */ (() => z32.object({
4522
+ var pickupCatalogSchema = /* @__PURE__ */ (() => z34.object({
4111
4523
  reward: tieredRewardDefinitionSchema,
4112
- revision: z32.number().int().nonnegative(),
4524
+ revision: z34.number().int().nonnegative(),
4113
4525
  policy: pickupPolicySchema
4114
4526
  }))();
4115
- var pickupAvailabilitySchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
4116
- z32.object({ kind: z32.literal("untracked") }).strict(),
4117
- z32.object({
4118
- kind: z32.literal("at-pickup"),
4119
- revision: z32.number().int().nonnegative(),
4120
- variants: z32.array(
4527
+ var pickupAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4528
+ z34.object({ kind: z34.literal("untracked") }).strict(),
4529
+ z34.object({
4530
+ kind: z34.literal("at-pickup"),
4531
+ revision: z34.number().int().nonnegative(),
4532
+ variants: z34.array(
4121
4533
  pickupAllocationSchema.extend({
4122
- available: z32.number().int().nonnegative()
4534
+ available: z34.number().int().nonnegative()
4123
4535
  })
4124
4536
  )
4125
4537
  }).strict()
4126
4538
  ]))();
4127
- var configurePickupSchema = /* @__PURE__ */ (() => z32.object({
4539
+ var configurePickupSchema = /* @__PURE__ */ (() => z34.object({
4128
4540
  reward: identifier,
4129
- revision: z32.number().int().nonnegative(),
4541
+ revision: z34.number().int().nonnegative(),
4130
4542
  actionId: identifier,
4131
- policy: z32.discriminatedUnion("kind", [
4132
- z32.object({ kind: z32.literal("untracked") }).strict(),
4133
- z32.object({
4134
- kind: z32.literal("at-pickup"),
4135
- tiers: z32.array(
4136
- z32.object({
4543
+ policy: z34.discriminatedUnion("kind", [
4544
+ z34.object({ kind: z34.literal("untracked") }).strict(),
4545
+ z34.object({
4546
+ kind: z34.literal("at-pickup"),
4547
+ tiers: z34.array(
4548
+ z34.object({
4137
4549
  tier: identifier,
4138
- variants: z32.array(
4550
+ variants: z34.array(
4139
4551
  pickupAllocationSchema.extend({
4140
4552
  item: identifier.optional()
4141
4553
  })
@@ -4145,10 +4557,10 @@ var configurePickupSchema = /* @__PURE__ */ (() => z32.object({
4145
4557
  }).strict()
4146
4558
  ])
4147
4559
  }).strict())();
4148
- var entitlementRecoverySchema = /* @__PURE__ */ (() => z32.object({
4560
+ var entitlementRecoverySchema = /* @__PURE__ */ (() => z34.object({
4149
4561
  completion: identifier,
4150
- reason: z32.string(),
4151
- flaggedAt: z32.number(),
4562
+ reason: z34.string(),
4563
+ flaggedAt: z34.number(),
4152
4564
  /** Null means no accepted completion currently earns this reward. */
4153
4565
  remainingTier: identifier.nullable()
4154
4566
  }))();
@@ -4158,40 +4570,40 @@ var entitlementBase = /* @__PURE__ */ (() => ({
4158
4570
  reward: tieredRewardDefinitionSchema,
4159
4571
  earnedTier: identifier,
4160
4572
  tier: identifier,
4161
- revision: z32.number().int().positive()
4573
+ revision: z34.number().int().positive()
4162
4574
  }))();
4163
- var entitlementStateSchema = /* @__PURE__ */ (() => z32.discriminatedUnion("status", [
4164
- z32.object({ ...entitlementBase, status: z32.literal("available") }).strict(),
4165
- z32.object({
4575
+ var entitlementStateSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("status", [
4576
+ z34.object({ ...entitlementBase, status: z34.literal("available") }).strict(),
4577
+ z34.object({
4166
4578
  ...entitlementBase,
4167
- status: z32.literal("handing-over"),
4579
+ status: z34.literal("handing-over"),
4168
4580
  handover: identifier,
4169
- startedAt: z32.number(),
4581
+ startedAt: z34.number(),
4170
4582
  allocation: pickupAllocationSchema.optional()
4171
4583
  }).strict(),
4172
- z32.object({
4584
+ z34.object({
4173
4585
  ...entitlementBase,
4174
- status: z32.literal("collected"),
4586
+ status: z34.literal("collected"),
4175
4587
  handover: identifier,
4176
- startedAt: z32.number(),
4588
+ startedAt: z34.number(),
4177
4589
  allocation: pickupAllocationSchema.optional(),
4178
- collectedAt: z32.number(),
4590
+ collectedAt: z34.number(),
4179
4591
  recovery: entitlementRecoverySchema.optional()
4180
4592
  }).strict(),
4181
4593
  // An operator voided it: it can no longer be handed over. A quest grant of the same reward to
4182
4594
  // the member (the same grant key) makes it available again; a voided referral reward stays void.
4183
- z32.object({
4595
+ z34.object({
4184
4596
  ...entitlementBase,
4185
- status: z32.literal("void"),
4186
- voidedAt: z32.number()
4597
+ status: z34.literal("void"),
4598
+ voidedAt: z34.number()
4187
4599
  }).strict()
4188
4600
  ]))();
4189
- var tieredRewardReadSchema = /* @__PURE__ */ (() => z32.object({
4601
+ var tieredRewardReadSchema = /* @__PURE__ */ (() => z34.object({
4190
4602
  id: identifier,
4191
- title: z32.string(),
4192
- tiers: z32.array(z32.object({ id: identifier, title: z32.string() }).loose()),
4193
- inventory: z32.object({ kind: z32.string() }).loose(),
4194
- fulfillment: z32.object({ kind: z32.string() }).loose()
4603
+ title: z34.string(),
4604
+ tiers: z34.array(z34.object({ id: identifier, title: z34.string() }).loose()),
4605
+ inventory: z34.object({ kind: z34.string() }).loose(),
4606
+ fulfillment: z34.object({ kind: z34.string() }).loose()
4195
4607
  }).loose())();
4196
4608
  var entitlementReadBase = /* @__PURE__ */ (() => ({
4197
4609
  id: identifier,
@@ -4199,63 +4611,63 @@ var entitlementReadBase = /* @__PURE__ */ (() => ({
4199
4611
  reward: tieredRewardReadSchema,
4200
4612
  earnedTier: identifier,
4201
4613
  tier: identifier,
4202
- revision: z32.number().int()
4614
+ revision: z34.number().int()
4203
4615
  }))();
4204
- var allocationReadSchema = /* @__PURE__ */ (() => z32.object({ item: identifier, label: z32.string() }).loose())();
4205
- var entitlementSchema = /* @__PURE__ */ (() => z32.union([
4206
- z32.discriminatedUnion("status", [
4207
- z32.object({ ...entitlementReadBase, status: z32.literal("available") }).loose(),
4208
- z32.object({
4616
+ var allocationReadSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, label: z34.string() }).loose())();
4617
+ var entitlementSchema = /* @__PURE__ */ (() => z34.union([
4618
+ z34.discriminatedUnion("status", [
4619
+ z34.object({ ...entitlementReadBase, status: z34.literal("available") }).loose(),
4620
+ z34.object({
4209
4621
  ...entitlementReadBase,
4210
- status: z32.literal("handing-over"),
4622
+ status: z34.literal("handing-over"),
4211
4623
  handover: identifier,
4212
- startedAt: z32.number(),
4624
+ startedAt: z34.number(),
4213
4625
  allocation: allocationReadSchema.optional()
4214
4626
  }).loose(),
4215
- z32.object({
4627
+ z34.object({
4216
4628
  ...entitlementReadBase,
4217
- status: z32.literal("collected"),
4629
+ status: z34.literal("collected"),
4218
4630
  handover: identifier,
4219
- startedAt: z32.number(),
4631
+ startedAt: z34.number(),
4220
4632
  allocation: allocationReadSchema.optional(),
4221
- collectedAt: z32.number(),
4633
+ collectedAt: z34.number(),
4222
4634
  recovery: entitlementRecoverySchema.optional()
4223
4635
  }).loose(),
4224
- z32.object({
4636
+ z34.object({
4225
4637
  ...entitlementReadBase,
4226
- status: z32.literal("void"),
4227
- voidedAt: z32.number()
4638
+ status: z34.literal("void"),
4639
+ voidedAt: z34.number()
4228
4640
  }).loose()
4229
4641
  ]),
4230
- z32.object({ ...entitlementReadBase, status: z32.string() }).loose().transform(({ status, ...entitlement }) => ({
4642
+ z34.object({ ...entitlementReadBase, status: z34.string() }).loose().transform(({ status, ...entitlement }) => ({
4231
4643
  ...entitlement,
4232
4644
  status: "unsupported",
4233
4645
  reportedStatus: status
4234
4646
  }))
4235
4647
  ]))();
4236
- var beginHandoverSchema = /* @__PURE__ */ (() => z32.object({
4648
+ var beginHandoverSchema = /* @__PURE__ */ (() => z34.object({
4237
4649
  actionId: identifier,
4238
- revision: z32.number().int().positive(),
4650
+ revision: z34.number().int().positive(),
4239
4651
  selection: pickupSelectionSchema.optional()
4240
4652
  }).strict())();
4241
- var confirmHandoverSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, handover: identifier }).strict())();
4242
- var entitlementCorrectionSchema = /* @__PURE__ */ (() => z32.object({
4653
+ var confirmHandoverSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, handover: identifier }).strict())();
4654
+ var entitlementCorrectionSchema = /* @__PURE__ */ (() => z34.object({
4243
4655
  actionId: identifier,
4244
- revision: z32.number().int().positive(),
4245
- reason: z32.string().trim().min(1).max(500)
4656
+ revision: z34.number().int().positive(),
4657
+ reason: z34.string().trim().min(1).max(500)
4246
4658
  }).strict())();
4247
4659
  var CompletionSourceKind = {
4248
4660
  Quest: "quest",
4249
4661
  Leaderboard: "leaderboard"
4250
4662
  };
4251
- var completionSourceKindSchema = /* @__PURE__ */ (() => z32.string().min(1).max(64))();
4252
- var completionSourceSchema = /* @__PURE__ */ (() => z32.object({
4663
+ var completionSourceKindSchema = /* @__PURE__ */ (() => z34.string().min(1).max(64))();
4664
+ var completionSourceSchema = /* @__PURE__ */ (() => z34.object({
4253
4665
  kind: completionSourceKindSchema,
4254
4666
  id: identifier
4255
4667
  }))();
4256
- var completionRecordSchema = /* @__PURE__ */ (() => z32.object({
4668
+ var completionRecordSchema = /* @__PURE__ */ (() => z34.object({
4257
4669
  /** The occurrence the completion consumed. For a leaderboard prize, the settlement ID. */
4258
- key: z32.string().default("once"),
4670
+ key: z34.string().default("once"),
4259
4671
  id: identifier,
4260
4672
  /** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
4261
4673
  quest: identifier,
@@ -4263,19 +4675,19 @@ var completionRecordSchema = /* @__PURE__ */ (() => z32.object({
4263
4675
  /** What paid the completion. `source.id` repeats `quest`. */
4264
4676
  source: completionSourceSchema.optional()
4265
4677
  }))();
4266
- var questAvailabilitySchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kind", [
4267
- z32.object({
4268
- kind: z32.literal("available"),
4269
- input: z32.enum(["photo", "quiz", "none", "text", "url"])
4678
+ var questAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4679
+ z34.object({
4680
+ kind: z34.literal("available"),
4681
+ input: z34.enum(["photo", "quiz", "none", "text", "url"])
4270
4682
  }).strict(),
4271
- z32.object({ kind: z32.literal("completed") }).strict(),
4272
- z32.object({
4273
- kind: z32.literal("locked"),
4274
- missing: z32.array(missingPrerequisiteSchema).min(1)
4683
+ z34.object({ kind: z34.literal("completed") }).strict(),
4684
+ z34.object({
4685
+ kind: z34.literal("locked"),
4686
+ missing: z34.array(missingPrerequisiteSchema).min(1)
4275
4687
  }).strict(),
4276
- z32.object({
4277
- kind: z32.literal("blocked"),
4278
- reason: z32.enum([
4688
+ z34.object({
4689
+ kind: z34.literal("blocked"),
4690
+ reason: z34.enum([
4279
4691
  "budget-exhausted",
4280
4692
  "connection-required",
4281
4693
  "wallet-required",
@@ -4284,56 +4696,56 @@ var questAvailabilitySchema = /* @__PURE__ */ (() => z32.discriminatedUnion("kin
4284
4696
  "enrollment-required"
4285
4697
  ]),
4286
4698
  /** Which window refused admission when `reason` is `outside-window`. */
4287
- window: z32.enum(["tracker", "quest"]).optional(),
4288
- resetsAt: z32.number().int().safe().optional()
4699
+ window: z34.enum(["tracker", "quest"]).optional(),
4700
+ resetsAt: z34.number().int().safe().optional()
4289
4701
  }).strict(),
4290
- z32.object({ kind: z32.literal("staff-required") }).strict(),
4291
- z32.object({ kind: z32.literal("automatic") }).strict(),
4292
- z32.object({ kind: z32.literal("checking"), attempt: identifier }).strict(),
4293
- z32.object({ kind: z32.literal("needs-review"), attempt: identifier }).strict(),
4294
- z32.object({ kind: z32.literal("retryable"), attempt: identifier }).strict()
4702
+ z34.object({ kind: z34.literal("staff-required") }).strict(),
4703
+ z34.object({ kind: z34.literal("automatic") }).strict(),
4704
+ z34.object({ kind: z34.literal("checking"), attempt: identifier }).strict(),
4705
+ z34.object({ kind: z34.literal("needs-review"), attempt: identifier }).strict(),
4706
+ z34.object({ kind: z34.literal("retryable"), attempt: identifier }).strict()
4295
4707
  ]))();
4296
- var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z32.union(
4708
+ var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z34.union(
4297
4709
  questAvailabilitySchema.options.map((option) => option.strip())
4298
4710
  ))();
4299
- var questBudgetViewSchema = /* @__PURE__ */ (() => z32.object({
4711
+ var questBudgetViewSchema = /* @__PURE__ */ (() => z34.object({
4300
4712
  id: identifier,
4301
- scope: z32.enum(["member", "project"]),
4302
- period: z32.enum(["day", "week", "month", "lifetime"]),
4303
- remaining: z32.number().int().safe().nonnegative(),
4304
- resetsAt: z32.number().int().safe().nullable()
4713
+ scope: z34.enum(["member", "project"]),
4714
+ period: z34.enum(["day", "week", "month", "lifetime"]),
4715
+ remaining: z34.number().int().safe().nonnegative(),
4716
+ resetsAt: z34.number().int().safe().nullable()
4305
4717
  }))();
4306
4718
  var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
4307
- z32.object({
4719
+ z34.object({
4308
4720
  member: identifier,
4309
- quests: z32.array(
4310
- z32.object({
4721
+ quests: z34.array(
4722
+ z34.object({
4311
4723
  quest: identifier,
4312
4724
  key: identifier.optional(),
4313
4725
  release: identifier.optional(),
4314
- title: z32.string(),
4726
+ title: z34.string(),
4315
4727
  presentation: questPresentationSchema.default({}),
4316
- connections: z32.array(authProviderSchema).default([]),
4728
+ connections: z34.array(authProviderSchema).default([]),
4317
4729
  trigger: triggerResponseSchema,
4318
4730
  availability: questAvailabilityResponseSchema,
4319
- completed: z32.boolean(),
4731
+ completed: z34.boolean(),
4320
4732
  completion: completionPolicySchema.default({ kind: "once" }),
4321
4733
  streak: streakProgressSchema.nullable().optional(),
4322
4734
  counter: counterProgressSchema.nullable().optional(),
4323
4735
  /** Latest attempt's committed evaluator progress, while it remains deferred/evaluating. */
4324
4736
  progress: evaluatorProgressSchema.nullable().default(null),
4325
- completionCount: z32.number().int().nonnegative().default(0),
4326
- visibility: z32.enum(["visible", "hidden"]).default("visible"),
4327
- missing: z32.array(missingPrerequisiteSchema),
4737
+ completionCount: z34.number().int().nonnegative().default(0),
4738
+ visibility: z34.enum(["visible", "hidden"]).default("visible"),
4739
+ missing: z34.array(missingPrerequisiteSchema),
4328
4740
  campaign: campaignViewSchema.nullable().default(null),
4329
4741
  window: availabilityWindowSchema.nullable().default(null),
4330
- budgets: z32.array(questBudgetViewSchema).default([]),
4742
+ budgets: z34.array(questBudgetViewSchema).default([]),
4331
4743
  /**
4332
4744
  * Unix milliseconds when the member may submit again, while the quest's retry cooldown
4333
4745
  * after their rejected attempt runs. Until then a new attempt is refused with
4334
4746
  * `retry-cooldown`. Absent when no cooldown is running.
4335
4747
  */
4336
- retryAt: z32.number().int().safe().optional(),
4748
+ retryAt: z34.number().int().safe().optional(),
4337
4749
  /**
4338
4750
  * Unix milliseconds when the member may next submit the quest, while it waits on something
4339
4751
  * that ends by itself: the retry cooldown after a rejection, the completion cooldown after
@@ -4342,128 +4754,128 @@ var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
4342
4754
  * several apply; use it for countdowns. Absent when the member can submit now, or when
4343
4755
  * nothing will reopen the quest (a used-up lifetime budget, a closed window).
4344
4756
  */
4345
- nextAvailableAt: z32.number().int().safe().optional(),
4757
+ nextAvailableAt: z34.number().int().safe().optional(),
4346
4758
  attempt: attemptSchema.nullable()
4347
4759
  })
4348
4760
  ),
4349
- entitlements: z32.array(entitlementSchema)
4761
+ entitlements: z34.array(entitlementSchema)
4350
4762
  })
4351
4763
  ))();
4352
4764
  var snapshotSchema = /* @__PURE__ */ (() => responseShape(
4353
- z32.object({
4354
- releases: z32.array(publishedReleaseSchema),
4355
- completions: z32.array(completionRecordSchema),
4356
- entitlements: z32.array(entitlementSchema),
4357
- attempts: z32.array(attemptSchema),
4358
- balances: z32.array(
4359
- z32.object({
4360
- member: z32.string(),
4361
- balance: z32.string(),
4362
- earned: z32.number(),
4363
- held: z32.number(),
4364
- available: z32.number()
4765
+ z34.object({
4766
+ releases: z34.array(publishedReleaseSchema),
4767
+ completions: z34.array(completionRecordSchema),
4768
+ entitlements: z34.array(entitlementSchema),
4769
+ attempts: z34.array(attemptSchema),
4770
+ balances: z34.array(
4771
+ z34.object({
4772
+ member: z34.string(),
4773
+ balance: z34.string(),
4774
+ earned: z34.number(),
4775
+ held: z34.number(),
4776
+ available: z34.number()
4365
4777
  })
4366
4778
  ),
4367
- events: z32.array(eventSchema)
4779
+ events: z34.array(eventSchema)
4368
4780
  })
4369
4781
  ))();
4370
- var evidenceSchema = /* @__PURE__ */ (() => z32.object({
4782
+ var evidenceSchema = /* @__PURE__ */ (() => z34.object({
4371
4783
  id: identifier,
4372
4784
  member: identifier,
4373
- type: z32.enum(["image/jpeg", "image/png"]),
4374
- size: z32.number()
4785
+ type: z34.enum(["image/jpeg", "image/png"]),
4786
+ size: z34.number()
4375
4787
  }))();
4376
- var errorSchema = /* @__PURE__ */ (() => z32.object({
4377
- error: z32.string(),
4378
- code: z32.string().optional(),
4788
+ var errorSchema = /* @__PURE__ */ (() => z34.object({
4789
+ error: z34.string(),
4790
+ code: z34.string().optional(),
4379
4791
  /** Which window refused admission when `code` is `outside-window`. */
4380
- window: z32.enum(["tracker", "quest"]).optional(),
4381
- missing: z32.array(missingPrerequisiteSchema).optional(),
4792
+ window: z34.enum(["tracker", "quest"]).optional(),
4793
+ missing: z34.array(missingPrerequisiteSchema).optional(),
4382
4794
  /**
4383
4795
  * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
4384
4796
  * `completion-cooldown`.
4385
4797
  */
4386
- retryAt: z32.number().int().safe().optional()
4798
+ retryAt: z34.number().int().safe().optional()
4387
4799
  }))();
4388
- var staffDecisionSchema = /* @__PURE__ */ (() => z32.object({
4800
+ var staffDecisionSchema = /* @__PURE__ */ (() => z34.object({
4389
4801
  actionId: identifier,
4390
- generation: z32.number().int().nonnegative(),
4391
- decision: z32.enum(["accept", "reject"]),
4392
- reason: z32.string().trim().min(1).max(2e3)
4802
+ generation: z34.number().int().nonnegative(),
4803
+ decision: z34.enum(["accept", "reject"]),
4804
+ reason: z34.string().trim().min(1).max(2e3)
4393
4805
  }).strict())();
4394
- var acceptAnywaySchema = /* @__PURE__ */ (() => z32.object({
4806
+ var acceptAnywaySchema = /* @__PURE__ */ (() => z34.object({
4395
4807
  actionId: identifier,
4396
- reason: z32.string().trim().min(1).max(2e3)
4808
+ reason: z34.string().trim().min(1).max(2e3)
4397
4809
  }).strict())();
4398
- var evidenceRedactionInputSchema = /* @__PURE__ */ (() => z32.object({
4810
+ var evidenceRedactionInputSchema = /* @__PURE__ */ (() => z34.object({
4399
4811
  actionId: identifier,
4400
- reason: z32.string().trim().min(1).max(2e3)
4812
+ reason: z34.string().trim().min(1).max(2e3)
4401
4813
  }).strict())();
4402
- var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z32.object({
4814
+ var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z34.object({
4403
4815
  actionId: identifier,
4404
4816
  quest: identifier,
4405
- decidedBefore: z32.number().int().nonnegative(),
4406
- reason: z32.string().trim().min(1).max(2e3)
4817
+ decidedBefore: z34.number().int().nonnegative(),
4818
+ reason: z34.string().trim().min(1).max(2e3)
4407
4819
  }).strict())();
4408
- var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() => z32.union([
4409
- z32.object({ days: z32.number().int().min(1).max(3650) }).strict(),
4410
- z32.literal("keep")
4820
+ var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() => z34.union([
4821
+ z34.object({ days: z34.number().int().min(1).max(3650) }).strict(),
4822
+ z34.literal("keep")
4411
4823
  ]))();
4412
- var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() => z32.object({
4824
+ var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() => z34.object({
4413
4825
  actionId: identifier,
4414
4826
  evidenceRetention: evidenceRetentionPeriodSchema
4415
4827
  }).strict())();
4416
- var stockSchema = /* @__PURE__ */ (() => z32.object({ item: identifier, quantity: z32.number().int().min(0).max(1e4) }).strict())();
4417
- var reservationSchema = /* @__PURE__ */ (() => z32.object({
4828
+ var stockSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, quantity: z34.number().int().min(0).max(1e4) }).strict())();
4829
+ var reservationSchema = /* @__PURE__ */ (() => z34.object({
4418
4830
  actionId: identifier,
4419
4831
  member: identifier,
4420
4832
  item: identifier,
4421
4833
  balance: identifier,
4422
- price: z32.number().int().positive().max(1e4)
4834
+ price: z34.number().int().positive().max(1e4)
4423
4835
  }).strict())();
4424
4836
  var pageOptions = /* @__PURE__ */ (() => ({
4425
- limit: z32.number().int().min(1).max(100).default(25),
4426
- cursor: z32.string().min(1).max(4096).optional()
4837
+ limit: z34.number().int().min(1).max(100).default(25),
4838
+ cursor: z34.string().min(1).max(4096).optional()
4427
4839
  }))();
4428
- var reviewListSchema = /* @__PURE__ */ (() => z32.object({
4840
+ var reviewListSchema = /* @__PURE__ */ (() => z34.object({
4429
4841
  ...pageOptions,
4430
4842
  member: identifier.optional(),
4431
4843
  quest: identifier.optional()
4432
4844
  }).strict())();
4433
- var memberListSchema = /* @__PURE__ */ (() => z32.object({
4845
+ var memberListSchema = /* @__PURE__ */ (() => z34.object({
4434
4846
  ...pageOptions,
4435
4847
  prefix: identifier.optional()
4436
4848
  }).strict())();
4437
- var reviewItemSchema = /* @__PURE__ */ (() => z32.object({
4849
+ var reviewItemSchema = /* @__PURE__ */ (() => z34.object({
4438
4850
  attempt: attemptSchema,
4439
- title: z32.string(),
4440
- checks: z32.array(
4441
- z32.object({ criteria: z32.string(), result: photoResultSchema })
4851
+ title: z34.string(),
4852
+ checks: z34.array(
4853
+ z34.object({ criteria: z34.string(), result: photoResultSchema })
4442
4854
  )
4443
4855
  }))();
4444
- var reviewPageSchema = /* @__PURE__ */ (() => z32.object({
4445
- items: z32.array(reviewItemSchema).max(100),
4446
- nextCursor: z32.string().nullable()
4856
+ var reviewPageSchema = /* @__PURE__ */ (() => z34.object({
4857
+ items: z34.array(reviewItemSchema).max(100),
4858
+ nextCursor: z34.string().nullable()
4447
4859
  }))();
4448
- var memberPageSchema = /* @__PURE__ */ (() => z32.object({
4449
- items: z32.array(z32.object({ member: identifier })).max(100),
4450
- nextCursor: z32.string().nullable()
4860
+ var memberPageSchema = /* @__PURE__ */ (() => z34.object({
4861
+ items: z34.array(z34.object({ member: identifier })).max(100),
4862
+ nextCursor: z34.string().nullable()
4451
4863
  }))();
4452
- var createStockItemSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, name: z32.string().trim().min(1).max(80) }).strict())();
4453
- var stockItemSchema = /* @__PURE__ */ (() => z32.object({ id: identifier, name: z32.string() }))();
4454
- var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z32.strictObject({
4864
+ var createStockItemSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, name: z34.string().trim().min(1).max(80) }).strict())();
4865
+ var stockItemSchema = /* @__PURE__ */ (() => z34.object({ id: identifier, name: z34.string() }))();
4866
+ var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z34.strictObject({
4455
4867
  contentAttempt: identifier,
4456
4868
  observation: identifier,
4457
- observedAt: z32.number().int().safe().nonnegative(),
4869
+ observedAt: z34.number().int().safe().nonnegative(),
4458
4870
  metrics: contentMetricsSchema,
4459
4871
  rewards: rewardBundleSchema
4460
4872
  }))();
4461
4873
  var contentPerformanceQuerySchema = /* @__PURE__ */ (() => contentQualificationQuerySchema.extend({
4462
- content: z32.string().min(1).max(256)
4874
+ content: z34.string().min(1).max(256)
4463
4875
  }))();
4464
- var contentPerformancePageSchema = /* @__PURE__ */ (() => z32.strictObject({
4465
- current: z32.strictObject({
4466
- state: z32.enum([
4876
+ var contentPerformancePageSchema = /* @__PURE__ */ (() => z34.strictObject({
4877
+ current: z34.strictObject({
4878
+ state: z34.enum([
4467
4879
  "content-pending",
4468
4880
  "content-unqualified",
4469
4881
  "waiting",
@@ -4474,19 +4886,19 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z32.strictObject({
4474
4886
  "failed",
4475
4887
  "superseded"
4476
4888
  ]),
4477
- reason: z32.string().nullable(),
4889
+ reason: z34.string().nullable(),
4478
4890
  contentAttempt: identifier,
4479
4891
  attempt: identifier.nullable(),
4480
4892
  reward: contentQualificationSchema.shape.reward
4481
4893
  }),
4482
- items: z32.array(
4483
- z32.strictObject({
4894
+ items: z34.array(
4895
+ z34.strictObject({
4484
4896
  attempt: identifier,
4485
4897
  contentAttempt: identifier,
4486
4898
  observation: identifier,
4487
- observedAt: z32.number(),
4899
+ observedAt: z34.number(),
4488
4900
  metrics: contentMetricsSchema,
4489
- state: z32.enum([
4901
+ state: z34.enum([
4490
4902
  "pending",
4491
4903
  "qualified",
4492
4904
  "unqualified",
@@ -4494,43 +4906,43 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z32.strictObject({
4494
4906
  "failed",
4495
4907
  "superseded"
4496
4908
  ]),
4497
- reason: z32.string().nullable()
4909
+ reason: z34.string().nullable()
4498
4910
  })
4499
4911
  ),
4500
4912
  nextCursor: pageCursorSchema.nullable()
4501
4913
  }))();
4502
4914
 
4503
4915
  // src/point-ledgers.ts
4504
- import * as z33 from "zod";
4505
- var pointLedgerPropertiesSchema = /* @__PURE__ */ (() => z33.object({
4506
- name: z33.string().trim().min(1).max(120),
4507
- description: z33.string().trim().max(1e3).default("")
4916
+ import * as z35 from "zod";
4917
+ var pointLedgerPropertiesSchema = /* @__PURE__ */ (() => z35.object({
4918
+ name: z35.string().trim().min(1).max(120),
4919
+ description: z35.string().trim().max(1e3).default("")
4508
4920
  }).strict())();
4509
4921
  var createPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ actionId: identifier, key: identifier.optional() }).strict())();
4510
4922
  var pointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({
4511
4923
  id: identifier
4512
4924
  }))();
4513
4925
  var managedPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerSchema.extend({
4514
- archivedAt: z33.number().int().nonnegative().nullable()
4926
+ archivedAt: z35.number().int().nonnegative().nullable()
4515
4927
  }))();
4516
4928
  var pointLedgerDeclarationSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ key: identifier }).strict())();
4517
- var pointLedgerArtifactSchema = /* @__PURE__ */ (() => z33.union([
4929
+ var pointLedgerArtifactSchema = /* @__PURE__ */ (() => z35.union([
4518
4930
  pointLedgerDeclarationSchema,
4519
- z33.object({ code: z33.string().min(1).max(2e6) }).strict()
4931
+ z35.object({ code: z35.string().min(1).max(2e6) }).strict()
4520
4932
  ]))();
4521
- var pointLedgerReferenceSchema = /* @__PURE__ */ (() => z33.object({
4933
+ var pointLedgerReferenceSchema = /* @__PURE__ */ (() => z35.object({
4522
4934
  id: identifier,
4523
4935
  key: identifier.nullable(),
4524
- name: z33.string()
4936
+ name: z35.string()
4525
4937
  }))();
4526
- var points = /* @__PURE__ */ (() => z33.number().int().safe())();
4527
- var pointBalanceSchema = /* @__PURE__ */ (() => z33.object({
4938
+ var points = /* @__PURE__ */ (() => z35.number().int().safe())();
4939
+ var pointBalanceSchema = /* @__PURE__ */ (() => z35.object({
4528
4940
  ledger: pointLedgerReferenceSchema,
4529
4941
  balance: points,
4530
4942
  available: points
4531
4943
  }))();
4532
- var pointBalancesSchema = /* @__PURE__ */ (() => z33.object({
4533
- items: z33.array(pointBalanceSchema)
4944
+ var pointBalancesSchema = /* @__PURE__ */ (() => z35.object({
4945
+ items: z35.array(pointBalanceSchema)
4534
4946
  }))();
4535
4947
  var PointEntryKind = {
4536
4948
  /** Points a quest completion, an engagement settlement or an operator awarded. */
@@ -4542,8 +4954,8 @@ var PointEntryKind = {
4542
4954
  /** Undoes part or all of an award or a positive adjustment (`reverses`). */
4543
4955
  Reverse: "reverse"
4544
4956
  };
4545
- var pointEntryKindSchema = /* @__PURE__ */ (() => z33.string().min(1).max(64))();
4546
- var pointEntrySchema = /* @__PURE__ */ (() => z33.object({
4957
+ var pointEntryKindSchema = /* @__PURE__ */ (() => z35.string().min(1).max(64))();
4958
+ var pointEntrySchema = /* @__PURE__ */ (() => z35.object({
4547
4959
  id: identifier,
4548
4960
  amount: points,
4549
4961
  kind: pointEntryKindSchema,
@@ -4555,204 +4967,261 @@ var pointEntrySchema = /* @__PURE__ */ (() => z33.object({
4555
4967
  * True for an opening balance a member import recorded (an `adjust`). Absent from Relay
4556
4968
  * versions without imports.
4557
4969
  */
4558
- imported: z33.boolean().optional()
4970
+ imported: z35.boolean().optional()
4559
4971
  }))();
4560
- var pointHistoryQuerySchema = /* @__PURE__ */ (() => z33.strictObject({
4972
+ var pointHistoryQuerySchema = /* @__PURE__ */ (() => z35.strictObject({
4561
4973
  ledger: identifier,
4562
4974
  cursor: pageCursorSchema.optional()
4563
4975
  }))();
4564
- var pointHistoryPageSchema = /* @__PURE__ */ (() => z33.object({
4565
- items: z33.array(pointEntrySchema),
4976
+ var pointHistoryPageSchema = /* @__PURE__ */ (() => z35.object({
4977
+ items: z35.array(pointEntrySchema),
4566
4978
  nextCursor: pageCursorSchema.nullable()
4567
4979
  }))();
4568
4980
 
4569
4981
  // src/profiles.ts
4570
- import * as z34 from "zod";
4571
- var count3 = /* @__PURE__ */ (() => z34.number().int().nonnegative().safe())();
4572
- var profileVisibilitySchema = /* @__PURE__ */ (() => z34.enum([
4982
+ import * as z36 from "zod";
4983
+ var count3 = /* @__PURE__ */ (() => z36.number().int().nonnegative().safe())();
4984
+ var profileVisibilitySchema = /* @__PURE__ */ (() => z36.enum([
4573
4985
  "private",
4574
4986
  "participants",
4575
4987
  "public"
4576
4988
  ]))();
4577
- var avatarProviderSchema = /* @__PURE__ */ (() => z34.enum(["x", "discord", "google"]))();
4578
- var profileDefaultProviderSchema = /* @__PURE__ */ (() => z34.enum(["x", "discord"]))();
4579
- var profileDefaultsSchema = /* @__PURE__ */ (() => z34.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
4580
- (providers) => new Set(providers).size === providers.length,
4581
- "List each provider once"
4989
+ var avatarProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord", "google"]))();
4990
+ var profileDefaultProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord"]))();
4991
+ function orderedSources(sources) {
4992
+ return z36.array(sources).max(sources.options.length).refine(
4993
+ (values2) => new Set(values2).size === values2.length,
4994
+ "List each provider once"
4995
+ );
4996
+ }
4997
+ var profileDefaultsSchema = /* @__PURE__ */ (() => orderedSources(
4998
+ profileDefaultProviderSchema
4582
4999
  ))();
4583
- var avatarSeedSchema = /* @__PURE__ */ (() => z34.string().min(1).max(100))();
4584
- var profileAvatarSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("source", [
4585
- z34.object({
4586
- source: z34.literal("upload"),
4587
- url: z34.string().url(),
5000
+ var knownProfileDefaultSources = ["x", "discord", "sol"];
5001
+ var profileDefaultSourcesSchema = /* @__PURE__ */ (() => orderedSources(
5002
+ z36.enum(knownProfileDefaultSources)
5003
+ ))();
5004
+ var profileNameSourceSchema = /* @__PURE__ */ (() => z36.enum(["sol"]))();
5005
+ var openValue = /* @__PURE__ */ (() => z36.string().min(1).max(64))();
5006
+ var avatarSeedSchema = /* @__PURE__ */ (() => z36.string().min(1).max(100))();
5007
+ var profileAvatarSchema = /* @__PURE__ */ (() => z36.discriminatedUnion("source", [
5008
+ z36.object({
5009
+ source: z36.literal("upload"),
5010
+ url: z36.string().url(),
4588
5011
  seed: avatarSeedSchema
4589
5012
  }),
4590
- z34.object({
4591
- source: z34.literal("account"),
5013
+ z36.object({
5014
+ source: z36.literal("account"),
4592
5015
  provider: avatarProviderSchema,
4593
- url: z34.string().url(),
5016
+ url: z36.string().url(),
4594
5017
  seed: avatarSeedSchema
4595
5018
  }),
4596
- z34.object({ source: z34.literal("generated"), seed: avatarSeedSchema })
5019
+ z36.object({ source: z36.literal("generated"), seed: avatarSeedSchema })
4597
5020
  ]))();
4598
- var profileSummarySchema = /* @__PURE__ */ (() => z34.object({
5021
+ var profileSummarySchema = /* @__PURE__ */ (() => z36.object({
4599
5022
  id: identifier,
4600
- name: z34.string(),
5023
+ name: z36.string(),
4601
5024
  avatar: profileAvatarSchema
4602
5025
  }))();
4603
5026
  var invisible = /[\p{Cc}؜᠎​-‏‪-‮⁠-⁤⁦-⁩]/u;
4604
- var displayNameSchema = /* @__PURE__ */ (() => z34.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
4605
- z34.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
5027
+ var displayNameSchema = /* @__PURE__ */ (() => z36.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
5028
+ z36.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
4606
5029
  ))();
4607
- var profileUpdateSchema = /* @__PURE__ */ (() => z34.object({
5030
+ var profileUpdateSchema = /* @__PURE__ */ (() => z36.object({
4608
5031
  displayName: displayNameSchema.nullable().optional(),
4609
- avatar: z34.discriminatedUnion("source", [
4610
- z34.object({
4611
- source: z34.literal("account"),
5032
+ /** @experimental A minor release can change `.sol` names. */
5033
+ nameSource: profileNameSourceSchema.nullable().optional(),
5034
+ avatar: z36.discriminatedUnion("source", [
5035
+ z36.object({
5036
+ source: z36.literal("account"),
4612
5037
  provider: avatarProviderSchema
4613
5038
  }).strict(),
4614
- z34.object({ source: z34.literal("generated") }).strict()
5039
+ z36.object({ source: z36.literal("generated") }).strict()
4615
5040
  ]).nullable().optional(),
4616
- hidden: z34.boolean().optional()
5041
+ hidden: z36.boolean().optional()
4617
5042
  }).strict().refine(
4618
5043
  (value) => Object.values(value).some((field) => field !== void 0),
4619
5044
  "Change at least one field"
4620
- ))();
5045
+ ).refine((value) => !(value.displayName !== void 0 && value.nameSource), {
5046
+ message: "Choose a name or a name source, not both",
5047
+ path: ["nameSource"]
5048
+ }))();
4621
5049
  var ownProfileSchema = /* @__PURE__ */ (() => profileSummarySchema.extend({
4622
5050
  /** The name the member chose, or null for the default. */
4623
- displayName: z34.string().nullable(),
5051
+ displayName: z36.string().nullable(),
4624
5052
  /** The avatar the member chose: `default` follows the project's defaults. */
4625
- avatarChoice: z34.enum(["default", "upload", "account", "generated"]),
5053
+ avatarChoice: z36.enum(["default", "upload", "account", "generated"]),
4626
5054
  /** The account of an `account` choice. */
4627
5055
  avatarProvider: avatarProviderSchema.nullable(),
4628
- hidden: z34.boolean(),
5056
+ hidden: z36.boolean(),
4629
5057
  /** An operator locked the name and avatar; the member can still hide the profile. */
4630
- locked: z34.boolean(),
5058
+ locked: z36.boolean(),
4631
5059
  /** Who can see profiles in this project, so the app can explain it. */
4632
5060
  visibility: profileVisibilitySchema,
4633
5061
  /** The member's connected accounts a picture or name can come from. */
4634
- options: z34.array(
4635
- z34.object({
5062
+ options: z36.array(
5063
+ z36.object({
4636
5064
  provider: avatarProviderSchema,
4637
- name: z34.string().nullable(),
5065
+ name: z36.string().nullable(),
4638
5066
  /**
4639
5067
  * The account's first name, where the provider sends one (Google does; X and Discord don't).
4640
5068
  * Only the member's own profile carries it.
4641
5069
  */
4642
- givenName: z34.string().nullable().default(null),
4643
- imageUrl: z34.string().url().nullable()
5070
+ givenName: z36.string().nullable().default(null),
5071
+ imageUrl: z36.string().url().nullable()
4644
5072
  })
4645
- )
5073
+ ),
5074
+ /**
5075
+ * What the member's name follows instead of a name they typed (`profileNameSourceSchema`), or
5076
+ * null. Absent from Relay versions without name sources.
5077
+ *
5078
+ * @experimental A minor release can change `.sol` names.
5079
+ */
5080
+ nameSource: openValue.nullable().optional(),
5081
+ /**
5082
+ * The names the member can choose to follow with `nameSource`: `sol`, the primary `.sol` name of
5083
+ * a Solana wallet they linked, when it has one. Absent from Relay versions without name sources.
5084
+ *
5085
+ * @experimental A minor release can change `.sol` names.
5086
+ */
5087
+ nameOptions: z36.array(z36.object({ source: openValue, name: z36.string() })).optional()
4646
5088
  }))();
4647
- var cursor = /* @__PURE__ */ (() => z34.string().min(1).max(512))();
4648
- var profileCompletionQuerySchema = /* @__PURE__ */ (() => z34.object({
4649
- limit: z34.coerce.number().int().min(1).max(100).default(20),
5089
+ var cursor = /* @__PURE__ */ (() => z36.string().min(1).max(512))();
5090
+ var profileCompletionQuerySchema = /* @__PURE__ */ (() => z36.object({
5091
+ limit: z36.coerce.number().int().min(1).max(100).default(20),
4650
5092
  cursor: cursor.optional()
4651
5093
  }).strict())();
4652
- var profileCompletionSchema = /* @__PURE__ */ (() => z34.object({
5094
+ var profileCompletionSchema = /* @__PURE__ */ (() => z36.object({
4653
5095
  quest: identifier,
4654
5096
  key: identifier.optional(),
4655
- title: z34.string(),
5097
+ title: z36.string(),
4656
5098
  completions: count3.positive(),
4657
5099
  /** Null for completions recorded before completion times were. */
4658
5100
  lastCompletedAt: count3.nullable()
4659
5101
  }))();
4660
- var profileCompletionPageSchema = /* @__PURE__ */ (() => z34.object({
4661
- items: z34.array(profileCompletionSchema),
5102
+ var profileCompletionPageSchema = /* @__PURE__ */ (() => z36.object({
5103
+ items: z36.array(profileCompletionSchema),
4662
5104
  nextCursor: cursor.nullable()
4663
5105
  }))();
4664
- var profileReferralSchema = /* @__PURE__ */ (() => z34.object({
5106
+ var profileReferralSchema = /* @__PURE__ */ (() => z36.object({
4665
5107
  program: identifier,
4666
5108
  key: identifier.optional(),
4667
- title: z34.string(),
5109
+ title: z36.string(),
4668
5110
  /** Members this member invited. Invitations are shared by every program. */
4669
5111
  invited: count3,
4670
5112
  /** Invited members who qualified in this program. */
4671
5113
  qualified: count3,
4672
- milestones: z34.array(
4673
- z34.object({ id: identifier, count: count3, reached: z34.boolean() })
5114
+ milestones: z36.array(
5115
+ z36.object({ id: identifier, count: count3, reached: z36.boolean() })
4674
5116
  )
4675
5117
  }))();
4676
- var profileSettingsSchema = /* @__PURE__ */ (() => z34.object({
5118
+ var profileSettingsSchema = /* @__PURE__ */ (() => z36.object({
4677
5119
  visibility: profileVisibilitySchema,
5120
+ /** The `defaultSources` that are accounts, in order: `.sol` names are left out. */
4678
5121
  defaults: profileDefaultsSchema,
5122
+ /**
5123
+ * Every source of default names and pictures, in order (`knownProfileDefaultSources`). Absent
5124
+ * from Relay versions without `.sol` names, where it is `defaults`.
5125
+ *
5126
+ * @experimental A minor release can change `.sol` names.
5127
+ */
5128
+ defaultSources: z36.array(openValue).optional(),
4679
5129
  revision: count3,
4680
- actor: z34.string().nullable(),
5130
+ actor: z36.string().nullable(),
4681
5131
  updatedAt: count3.nullable()
4682
5132
  }))();
4683
- var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.omit({ revision: true, actor: true, updatedAt: true }).extend({
5133
+ var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.omit({
5134
+ revision: true,
5135
+ actor: true,
5136
+ updatedAt: true,
5137
+ defaultSources: true
5138
+ }).extend({
5139
+ /**
5140
+ * Every source of default names and pictures in order, `.sol` names included. `defaults` must
5141
+ * list its accounts in the same order. Without it, the project's `.sol` names keep their place
5142
+ * around the accounts while `defaults` keeps the accounts' order.
5143
+ *
5144
+ * @experimental A minor release can change `.sol` names.
5145
+ */
5146
+ defaultSources: profileDefaultSourcesSchema.optional(),
4684
5147
  actionId: identifier,
4685
5148
  /** The revision the change was made against; a newer one is a 409. */
4686
5149
  expectedRevision: count3,
4687
- reason: z34.string().trim().min(1).max(500)
4688
- }).strict())();
4689
- var profileModerationSchema = /* @__PURE__ */ (() => z34.object({
5150
+ reason: z36.string().trim().min(1).max(500)
5151
+ }).strict().refine(
5152
+ (value) => !value.defaultSources || value.defaultSources.filter((source) => source !== "sol").join() === value.defaults.join(),
5153
+ {
5154
+ message: "List defaultSources' accounts in defaults, in the same order",
5155
+ path: ["defaults"]
5156
+ }
5157
+ ))();
5158
+ var profileModerationSchema = /* @__PURE__ */ (() => z36.object({
4690
5159
  actionId: identifier,
4691
- resetName: z34.boolean().default(false),
4692
- removeAvatar: z34.boolean().default(false),
5160
+ resetName: z36.boolean().default(false),
5161
+ removeAvatar: z36.boolean().default(false),
4693
5162
  /** True locks the name and avatar, false unlocks them. */
4694
- lock: z34.boolean().optional(),
4695
- reason: z34.string().trim().min(1).max(1e3)
5163
+ lock: z36.boolean().optional(),
5164
+ reason: z36.string().trim().min(1).max(1e3)
4696
5165
  }).strict().refine(
4697
5166
  (value) => value.resetName || value.removeAvatar || value.lock !== void 0,
4698
5167
  "Choose an action"
4699
5168
  ))();
4700
- var managedProfileSchema = /* @__PURE__ */ (() => ownProfileSchema.omit({ options: true }).extend({
5169
+ var managedProfileSchema = /* @__PURE__ */ (() => ownProfileSchema.omit({ options: true, nameOptions: true }).extend({
4701
5170
  member: identifier,
4702
5171
  lockedAt: count3.nullable(),
4703
- lockedBy: z34.string().nullable(),
4704
- lockedReason: z34.string().nullable(),
5172
+ lockedBy: z36.string().nullable(),
5173
+ lockedReason: z36.string().nullable(),
4705
5174
  updatedAt: count3
4706
5175
  }))();
4707
5176
  var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
4708
5177
  var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
4709
5178
 
4710
5179
  // src/leaderboards.ts
4711
- import * as z35 from "zod";
4712
- var integer = /* @__PURE__ */ (() => z35.number().int().safe())();
5180
+ import * as z37 from "zod";
5181
+ var integer = /* @__PURE__ */ (() => z37.number().int().safe())();
4713
5182
  var timestamp6 = /* @__PURE__ */ (() => integer.nonnegative().max(864e13))();
4714
- var leaderboardWindowSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4715
- z35.object({ kind: z35.literal("all-time") }).strict(),
4716
- z35.object({ kind: z35.literal("fixed"), start: timestamp6, end: timestamp6 }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
4717
- z35.object({ kind: z35.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
5183
+ var leaderboardWindowSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5184
+ z37.object({ kind: z37.literal("all-time") }).strict(),
5185
+ z37.object({ kind: z37.literal("fixed"), start: timestamp6, end: timestamp6 }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
5186
+ z37.object({ kind: z37.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
4718
5187
  // Not strict: boards published while a calendar window named its own `timeZone` keep reading,
4719
5188
  // and the field drops on parse. The authoring schema refuses it.
4720
- z35.object({
4721
- kind: z35.literal("calendar"),
5189
+ z37.object({
5190
+ kind: z37.literal("calendar"),
4722
5191
  /** The current day, week (ISO, starting on Monday) or month of the project calendar. */
4723
5192
  period: calendarPeriodSchema.exclude(["lifetime"])
4724
5193
  })
4725
5194
  ]))();
4726
5195
  var periodScore = /* @__PURE__ */ (() => ({
4727
5196
  window: leaderboardWindowSchema.default({ kind: "all-time" }),
4728
- quests: z35.array(identifier).min(1).max(100).optional()
5197
+ quests: z37.array(identifier).min(1).max(100).optional()
4729
5198
  }))();
4730
- var scoreSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4731
- z35.object({ kind: z35.literal("balance") }).strict(),
4732
- z35.object({ kind: z35.literal("earned"), ...periodScore }).strict(),
4733
- z35.object({
4734
- kind: z35.literal("net"),
5199
+ var scoreSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5200
+ z37.object({ kind: z37.literal("balance") }).strict(),
5201
+ z37.object({ kind: z37.literal("earned"), ...periodScore }).strict(),
5202
+ z37.object({
5203
+ kind: z37.literal("net"),
4735
5204
  window: leaderboardWindowSchema.default({ kind: "all-time" })
4736
5205
  }).strict()
4737
5206
  ]).default({ kind: "balance" }))();
4738
- var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() => z35.union([
5207
+ var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() => z37.union([
4739
5208
  pointsRewardSchema,
4740
5209
  tierRewardSchema
4741
5210
  ]))();
4742
- var leaderboardPrizeSchema = /* @__PURE__ */ (() => z35.object({
4743
- ranks: z35.tuple([integer.positive(), integer.positive()]).refine(([first, last]) => last >= first, {
5211
+ var leaderboardPrizeSchema = /* @__PURE__ */ (() => z37.object({
5212
+ ranks: z37.tuple([integer.positive(), integer.positive()]).refine(([first, last]) => last >= first, {
4744
5213
  message: "Prize rank range must end at or after it starts"
4745
5214
  }),
4746
- rewards: z35.array(leaderboardPrizeRewardSchema).min(1).max(20)
5215
+ rewards: z37.array(leaderboardPrizeRewardSchema).min(1).max(20)
4747
5216
  }).strict())();
4748
- var baseUnitsSchema = /* @__PURE__ */ (() => z35.string().regex(
5217
+ var baseUnitsSchema = /* @__PURE__ */ (() => z37.string().regex(
4749
5218
  /^(0|[1-9]\d{0,77})$/,
4750
5219
  'Use a whole number of base units, such as "1000000"'
4751
5220
  ))();
4752
- var leaderboardPoolUnitSchema = /* @__PURE__ */ (() => z35.union([
4753
- z35.literal("points"),
4754
- z35.object({
4755
- code: z35.string().trim().min(1).max(32),
5221
+ var leaderboardPoolUnitSchema = /* @__PURE__ */ (() => z37.union([
5222
+ z37.literal("points"),
5223
+ z37.object({
5224
+ code: z37.string().trim().min(1).max(32),
4756
5225
  decimals: integer.min(0).max(36)
4757
5226
  }).strict()
4758
5227
  ]))();
@@ -4794,12 +5263,12 @@ var refinePool = (pool, context) => {
4794
5263
  });
4795
5264
  }
4796
5265
  };
4797
- var leaderboardPoolSchema = /* @__PURE__ */ (() => z35.object(poolShape).strict().superRefine(refinePool))();
4798
- var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z35.object({
4799
- at: z35.literal("window-end"),
4800
- ties: z35.enum(["shared", "earliest"]),
5266
+ var leaderboardPoolSchema = /* @__PURE__ */ (() => z37.object(poolShape).strict().superRefine(refinePool))();
5267
+ var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z37.object({
5268
+ at: z37.literal("window-end"),
5269
+ ties: z37.enum(["shared", "earliest"]),
4801
5270
  /** Rank prizes. A board with a pool may list none. */
4802
- prizes: z35.array(leaderboardPrizeSchema).max(50),
5271
+ prizes: z37.array(leaderboardPrizeSchema).max(50),
4803
5272
  pool: leaderboardPoolSchema.optional()
4804
5273
  }).strict().superRefine((policy, context) => {
4805
5274
  if (!policy.prizes.length && !policy.pool) {
@@ -4831,10 +5300,10 @@ var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z35.object({
4831
5300
  }
4832
5301
  }
4833
5302
  }))();
4834
- var leaderboardDefinitionObject = /* @__PURE__ */ (() => z35.object({
5303
+ var leaderboardDefinitionObject = /* @__PURE__ */ (() => z37.object({
4835
5304
  id: identifier,
4836
5305
  key: identifier.optional(),
4837
- title: z35.string().trim().min(1).max(120),
5306
+ title: z37.string().trim().min(1).max(120),
4838
5307
  /**
4839
5308
  * The point ledger the leaderboard ranks members by. Named `balance` from before ledger fields
4840
5309
  * were named `ledger` (docs/management-api.md#field-names); a points pool's `ledger` is the
@@ -4842,20 +5311,20 @@ var leaderboardDefinitionObject = /* @__PURE__ */ (() => z35.object({
4842
5311
  */
4843
5312
  balance: identifier,
4844
5313
  score: scoreSchema,
4845
- access: z35.enum(["participants", "public"]).default("participants"),
5314
+ access: z37.enum(["participants", "public"]).default("participants"),
4846
5315
  group: identifier.optional(),
4847
5316
  /**
4848
5317
  * List the project's eligible members who have no qualifying points, with a score of 0, ranked
4849
5318
  * after every member who scored and ordered by member ID. Omitted or false lists only members
4850
5319
  * with a qualifying entry. Settlements never include them.
4851
5320
  */
4852
- includeUnscored: z35.boolean().optional(),
5321
+ includeUnscored: z37.boolean().optional(),
4853
5322
  /**
4854
5323
  * How the live standings order equal scores. Omitted or `"shared"`: they share a rank. With
4855
5324
  * `"earliest"`, the member whose last counted entry is earlier ranks first (then member ID), and
4856
5325
  * every scored member gets its own rank: the order `settle.ties: "earliest"` uses.
4857
5326
  */
4858
- ties: z35.enum(["shared", "earliest"]).optional(),
5327
+ ties: z37.enum(["shared", "earliest"]).optional(),
4859
5328
  settle: leaderboardSettlementPolicySchema.optional()
4860
5329
  }).strict())();
4861
5330
  var validateSettlementWindow = (definition, context) => {
@@ -4873,70 +5342,70 @@ var leaderboardDefinitionResponseSchema = /* @__PURE__ */ (() => responseShape(
4873
5342
  ))();
4874
5343
  var leaderboardAuthoringSchema = /* @__PURE__ */ (() => leaderboardDefinitionObject.omit({ id: true }).extend({
4875
5344
  ...authoringIdentityShape,
4876
- score: z35.preprocess(refuseWindowTimeZone, scoreSchema),
5345
+ score: z37.preprocess(refuseWindowTimeZone, scoreSchema),
4877
5346
  group: identifier.optional()
4878
5347
  }).strict().superRefine(validateSettlementWindow))();
4879
- var leaderboardArtifactSchema = /* @__PURE__ */ (() => z35.union([
5348
+ var leaderboardArtifactSchema = /* @__PURE__ */ (() => z37.union([
4880
5349
  leaderboardAuthoringSchema,
4881
- z35.object({ code: z35.string().min(1).max(2e6) }).strict()
5350
+ z37.object({ code: z37.string().min(1).max(2e6) }).strict()
4882
5351
  ]))();
4883
- var publishedLeaderboardSchema = /* @__PURE__ */ (() => z35.object({
4884
- archivedAt: z35.number().int().nonnegative().nullable().optional(),
5352
+ var publishedLeaderboardSchema = /* @__PURE__ */ (() => z37.object({
5353
+ archivedAt: z37.number().int().nonnegative().nullable().optional(),
4885
5354
  version: identifier,
4886
5355
  definition: leaderboardDefinitionResponseSchema,
4887
5356
  publishedAt: timestamp6,
4888
- actor: z35.string().nullable()
5357
+ actor: z37.string().nullable()
4889
5358
  }))();
4890
- var leaderboardQuerySchema = /* @__PURE__ */ (() => z35.object({
4891
- limit: z35.coerce.number().int().min(1).max(100).default(25),
4892
- cursor: z35.string().max(4096).optional()
5359
+ var leaderboardQuerySchema = /* @__PURE__ */ (() => z37.object({
5360
+ limit: z37.coerce.number().int().min(1).max(100).default(25),
5361
+ cursor: z37.string().max(4096).optional()
4893
5362
  }).strict())();
4894
- var leaderboardRowSchema = /* @__PURE__ */ (() => z35.object({
5363
+ var leaderboardRowSchema = /* @__PURE__ */ (() => z37.object({
4895
5364
  /** The row's stable key: a pseudonym per board and member. */
4896
5365
  participant: identifier,
4897
5366
  member: identifier.optional(),
4898
5367
  /** The profile's name where the viewer can see it, otherwise the pseudonym's. */
4899
- name: z35.string(),
5368
+ name: z37.string(),
4900
5369
  score: integer,
4901
5370
  rank: integer.positive(),
4902
5371
  /** The member's profile, where visible to this viewer and not hidden by the member. */
4903
5372
  profile: profileSummarySchema.nullable()
4904
5373
  }))();
4905
- var leaderboardPageSchema = /* @__PURE__ */ (() => z35.object({
5374
+ var leaderboardPageSchema = /* @__PURE__ */ (() => z37.object({
4906
5375
  leaderboard: identifier,
4907
- title: z35.string(),
5376
+ title: z37.string(),
4908
5377
  version: identifier,
4909
- calculation: z35.enum(["balance", "earned", "net"]),
4910
- period: z35.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5378
+ calculation: z37.enum(["balance", "earned", "net"]),
5379
+ period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
4911
5380
  calculatedAt: timestamp6,
4912
5381
  lastEntryAt: timestamp6.nullable(),
4913
5382
  total: integer.nonnegative(),
4914
- items: z35.array(leaderboardRowSchema),
5383
+ items: z37.array(leaderboardRowSchema),
4915
5384
  me: leaderboardRowSchema.nullable(),
4916
- nearby: z35.array(leaderboardRowSchema),
4917
- nextCursor: z35.string().nullable()
5385
+ nearby: z37.array(leaderboardRowSchema),
5386
+ nextCursor: z37.string().nullable()
4918
5387
  }))();
4919
- var leaderboardPlacementSchema = /* @__PURE__ */ (() => z35.object({
5388
+ var leaderboardPlacementSchema = /* @__PURE__ */ (() => z37.object({
4920
5389
  leaderboard: identifier,
4921
5390
  key: identifier.optional(),
4922
- title: z35.string(),
5391
+ title: z37.string(),
4923
5392
  profile: identifier,
4924
5393
  rank: integer.positive().nullable(),
4925
5394
  score: integer.nullable(),
4926
5395
  /** Ranked participants on the board. */
4927
5396
  total: integer.nonnegative()
4928
5397
  }))();
4929
- var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() => z35.strictObject({
5398
+ var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() => z37.strictObject({
4930
5399
  board: identifier,
4931
5400
  cursor: pageCursorSchema.optional()
4932
5401
  }))();
4933
- var leaderboardHistoryPageSchema = /* @__PURE__ */ (() => z35.object({
5402
+ var leaderboardHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
4934
5403
  leaderboard: identifier,
4935
- period: z35.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
4936
- items: z35.array(pointEntrySchema),
5404
+ period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5405
+ items: z37.array(pointEntrySchema),
4937
5406
  nextCursor: pageCursorSchema.nullable()
4938
5407
  }))();
4939
- var leaderboardPreviewSchema = /* @__PURE__ */ (() => z35.object({
5408
+ var leaderboardPreviewSchema = /* @__PURE__ */ (() => z37.object({
4940
5409
  published: publishedLeaderboardSchema,
4941
5410
  before: leaderboardPageSchema.nullable(),
4942
5411
  after: leaderboardPageSchema
@@ -4945,53 +5414,53 @@ var mutationBase = /* @__PURE__ */ (() => ({
4945
5414
  actionId: identifier,
4946
5415
  member: identifier,
4947
5416
  balance: identifier,
4948
- reason: z35.string().trim().min(1).max(1e3)
5417
+ reason: z37.string().trim().min(1).max(1e3)
4949
5418
  }))();
4950
5419
  var datedMutation = /* @__PURE__ */ (() => ({ ...mutationBase, effectiveAt: timestamp6.optional() }))();
4951
- var pointsMutationSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4952
- z35.object({
5420
+ var pointsMutationSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5421
+ z37.object({
4953
5422
  ...datedMutation,
4954
- kind: z35.literal("award"),
4955
- referralEligible: z35.boolean().optional(),
5423
+ kind: z37.literal("award"),
5424
+ referralEligible: z37.boolean().optional(),
4956
5425
  amount: integer.positive()
4957
5426
  }).strict(),
4958
- z35.object({
5427
+ z37.object({
4959
5428
  ...datedMutation,
4960
- kind: z35.literal("spend"),
5429
+ kind: z37.literal("spend"),
4961
5430
  amount: integer.positive()
4962
5431
  }).strict(),
4963
- z35.object({
5432
+ z37.object({
4964
5433
  ...datedMutation,
4965
- kind: z35.literal("adjust"),
5434
+ kind: z37.literal("adjust"),
4966
5435
  amount: integer.refine((n) => n !== 0)
4967
5436
  }).strict(),
4968
- z35.object({
5437
+ z37.object({
4969
5438
  ...datedMutation,
4970
- kind: z35.literal("set"),
5439
+ kind: z37.literal("set"),
4971
5440
  total: integer.nonnegative(),
4972
5441
  expectedTotal: integer.nonnegative(),
4973
- classification: z35.enum(["earned", "spend"])
5442
+ classification: z37.enum(["earned", "spend"])
4974
5443
  }).strict(),
4975
- z35.object({
5444
+ z37.object({
4976
5445
  ...mutationBase,
4977
- kind: z35.literal("reverse"),
5446
+ kind: z37.literal("reverse"),
4978
5447
  entry: identifier,
4979
5448
  amount: integer.positive()
4980
5449
  }).strict()
4981
5450
  ]))();
4982
- var pointsEntrySchema = /* @__PURE__ */ (() => z35.object({
5451
+ var pointsEntrySchema = /* @__PURE__ */ (() => z37.object({
4983
5452
  id: identifier,
4984
- completion: z35.string().nullable(),
5453
+ completion: z37.string().nullable(),
4985
5454
  member: identifier,
4986
5455
  balance: identifier,
4987
5456
  amount: integer,
4988
- kind: z35.enum(["award", "spend", "adjust", "reverse"]),
5457
+ kind: z37.enum(["award", "spend", "adjust", "reverse"]),
4989
5458
  effectiveAt: timestamp6,
4990
5459
  receivedAt: timestamp6,
4991
5460
  quest: identifier.nullable(),
4992
5461
  original: identifier.nullable(),
4993
- reason: z35.string(),
4994
- actor: z35.string().nullable(),
5462
+ reason: z37.string(),
5463
+ actor: z37.string().nullable(),
4995
5464
  /**
4996
5465
  * The member import whose opening balance this `adjust` is, or null. Imported entries emit no
4997
5466
  * `points.awarded` and count on balance leaderboards only. Absent from Relay versions without
@@ -4999,103 +5468,116 @@ var pointsEntrySchema = /* @__PURE__ */ (() => z35.object({
4999
5468
  */
5000
5469
  import: identifier.nullable().optional()
5001
5470
  }))();
5002
- var managedPointHistoryPageSchema = /* @__PURE__ */ (() => z35.object({
5003
- items: z35.array(pointsEntrySchema),
5471
+ var managedPointHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
5472
+ items: z37.array(pointsEntrySchema),
5004
5473
  nextCursor: pageCursorSchema.nullable(),
5005
5474
  /** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
5006
- next: z35.number().nullable()
5475
+ next: z37.number().nullable()
5007
5476
  }))();
5008
- var pointsResultSchema = /* @__PURE__ */ (() => z35.object({
5477
+ var pointsResultSchema = /* @__PURE__ */ (() => z37.object({
5009
5478
  entry: pointsEntrySchema,
5010
5479
  total: integer.nonnegative()
5011
5480
  }))();
5012
- var pointsAccountSchema = /* @__PURE__ */ (() => z35.object({
5481
+ var pointsAccountSchema = /* @__PURE__ */ (() => z37.object({
5013
5482
  member: identifier,
5014
5483
  balance: identifier,
5015
5484
  total: integer.nonnegative(),
5016
5485
  held: integer.nonnegative()
5017
5486
  }))();
5018
- var leaderboardExclusionSchema = /* @__PURE__ */ (() => z35.object({
5487
+ var leaderboardExclusionSchema = /* @__PURE__ */ (() => z37.object({
5019
5488
  actionId: identifier,
5020
5489
  member: identifier,
5021
- excluded: z35.boolean(),
5022
- reason: z35.string().trim().min(1).max(1e3)
5490
+ excluded: z37.boolean(),
5491
+ reason: z37.string().trim().min(1).max(1e3)
5023
5492
  }).strict())();
5024
- var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() => z35.object({
5493
+ var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() => z37.object({
5025
5494
  leaderboard: identifier,
5026
5495
  group: identifier,
5027
- generated: z35.boolean(),
5496
+ generated: z37.boolean(),
5028
5497
  boundAt: timestamp6.nullable()
5029
5498
  }))();
5030
- var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() => z35.object({
5499
+ var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() => z37.object({
5031
5500
  actionId: identifier,
5032
5501
  group: identifier,
5033
- reason: z35.string().trim().min(1).max(1e3)
5502
+ reason: z37.string().trim().min(1).max(1e3)
5034
5503
  }).strict())();
5035
- var leaderboardGroupSchema = /* @__PURE__ */ (() => z35.object({
5504
+ var leaderboardGroupSchema = /* @__PURE__ */ (() => z37.object({
5036
5505
  actionId: identifier,
5037
5506
  member: identifier,
5038
- included: z35.boolean(),
5039
- reason: z35.string().trim().min(1).max(1e3)
5507
+ included: z37.boolean(),
5508
+ reason: z37.string().trim().min(1).max(1e3)
5040
5509
  }).strict())();
5041
- var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() => z35.enum(["pending", "approved"]))();
5042
- var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() => z35.object({
5510
+ var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() => z37.enum(["pending", "approved"]))();
5511
+ var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() => z37.object({
5043
5512
  id: identifier,
5044
5513
  leaderboard: identifier,
5045
5514
  version: identifier,
5046
- title: z35.string(),
5047
- period: z35.object({ start: timestamp6, end: timestamp6 }),
5048
- ties: z35.enum(["shared", "earliest"]),
5515
+ title: z37.string(),
5516
+ period: z37.object({ start: timestamp6, end: timestamp6 }),
5517
+ ties: z37.enum(["shared", "earliest"]),
5049
5518
  status: leaderboardSettlementStatusSchema,
5050
5519
  total: integer.nonnegative(),
5051
5520
  winners: integer.nonnegative(),
5052
5521
  createdAt: timestamp6,
5053
5522
  approvedAt: timestamp6.nullable(),
5054
- approvedBy: z35.string().nullable(),
5055
- approvalReason: z35.string().nullable()
5056
- }))();
5057
- var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z35.object({
5523
+ approvedBy: z37.string().nullable(),
5524
+ approvalReason: z37.string().nullable()
5525
+ }))();
5526
+ var settlementPaymentSchema = /* @__PURE__ */ (() => z37.object({
5527
+ status: z37.string(),
5528
+ /** The CAIP-2 cluster of the batch that pays or paid the share; null when unpaid. */
5529
+ network: z37.string().nullable(),
5530
+ /** The transaction that paid the share; null until paid. */
5531
+ signature: z37.string().nullable(),
5532
+ paidAt: timestamp6.nullable()
5533
+ }))();
5534
+ var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z37.object({
5058
5535
  member: identifier,
5059
5536
  score: integer,
5060
5537
  rank: integer.positive(),
5061
5538
  position: integer.positive(),
5062
5539
  scoredAt: timestamp6,
5063
- prizes: z35.array(integer.nonnegative()),
5540
+ prizes: z37.array(integer.nonnegative()),
5064
5541
  completion: identifier.nullable(),
5065
5542
  revokedAt: timestamp6.nullable(),
5066
5543
  /**
5067
5544
  * The member's pool share in the pool's base units, frozen with the row: `"0"` for a member the
5068
5545
  * pool leaves out. Absent when the settlement has no pool.
5069
5546
  */
5070
- share: baseUnitsSchema.optional()
5547
+ share: baseUnitsSchema.optional(),
5548
+ /**
5549
+ * How the row's pool share was paid on chain, for a non-zero share in a pool whose unit is not
5550
+ * points. Absent otherwise, and from Relay versions without Solana payouts.
5551
+ */
5552
+ payment: settlementPaymentSchema.optional()
5071
5553
  }))();
5072
- var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() => z35.object({
5554
+ var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() => z37.object({
5073
5555
  ...poolShape,
5074
5556
  allocated: baseUnitsSchema,
5075
5557
  unallocated: baseUnitsSchema
5076
5558
  }))();
5077
- var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() => z35.object({
5078
- content: z35.string(),
5559
+ var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() => z37.object({
5560
+ content: z37.string(),
5079
5561
  member: identifier,
5080
5562
  /** When the last good measurement was observed, if Relay has one. */
5081
5563
  observedAt: timestamp6.nullable()
5082
5564
  }))();
5083
5565
  var leaderboardSettlementSchema = /* @__PURE__ */ (() => leaderboardSettlementSummarySchema.extend({
5084
- prizes: z35.array(leaderboardPrizeSchema),
5085
- excluded: z35.array(identifier),
5566
+ prizes: z37.array(leaderboardPrizeSchema),
5567
+ excluded: z37.array(identifier),
5086
5568
  /**
5087
5569
  * Content frozen at its last good measurement because its closing measurement never came; a
5088
5570
  * reviewer can retry measurement. Relay sends it for every settlement, empty when nothing is
5089
5571
  * missing.
5090
5572
  */
5091
- unmeasured: z35.array(leaderboardSettlementUnmeasuredSchema).optional(),
5573
+ unmeasured: z37.array(leaderboardSettlementUnmeasuredSchema).optional(),
5092
5574
  /** The settlement's pool prize, or null without one. Absent from Relay versions without pools. */
5093
5575
  pool: leaderboardSettlementPoolSchema.nullable().optional(),
5094
- rows: z35.array(leaderboardSettlementRowSchema)
5576
+ rows: z37.array(leaderboardSettlementRowSchema)
5095
5577
  }))();
5096
- var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() => z35.object({
5578
+ var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() => z37.object({
5097
5579
  actionId: identifier,
5098
- reason: z35.string().trim().min(1).max(500)
5580
+ reason: z37.string().trim().min(1).max(500)
5099
5581
  }).strict())();
5100
5582
 
5101
5583
  export {
@@ -5138,6 +5620,9 @@ export {
5138
5620
  youtubeShortsNamespace,
5139
5621
  tiktokVideosNamespace,
5140
5622
  walletBalancesNamespace,
5623
+ walletProgramActivityNamespace,
5624
+ walletNftsNamespace,
5625
+ walletStakeNamespace,
5141
5626
  telegramSignInMethodsSchema,
5142
5627
  telegramAccountConnectionSchema,
5143
5628
  telegramInitDataSchema,
@@ -5153,6 +5638,8 @@ export {
5153
5638
  telegramReactionDataSchema,
5154
5639
  telegramMessageDataSchema,
5155
5640
  limits,
5641
+ base58,
5642
+ base58Bytes,
5156
5643
  solanaAddressSchema,
5157
5644
  walletChainSchema,
5158
5645
  cosmosNetworkSchema,
@@ -5168,6 +5655,10 @@ export {
5168
5655
  walletSignatureSchema,
5169
5656
  isEvmChainId,
5170
5657
  evmChainIdSchema,
5658
+ solanaMemoProgram,
5659
+ solanaSignatureSchema,
5660
+ walletTransactionChallengeSchema,
5661
+ walletTransactionProofSchema,
5171
5662
  linkedWalletSchema,
5172
5663
  walletUnlinkInputSchema,
5173
5664
  walletAddressInput,
@@ -5180,9 +5671,11 @@ export {
5180
5671
  caip10,
5181
5672
  walletBalanceSchema,
5182
5673
  walletBalanceSampleSchema,
5674
+ walletProgramActivitySchema,
5183
5675
  parseNftCollection,
5184
5676
  isNftCollection,
5185
5677
  walletNftsSchema,
5678
+ walletNftSampleSchema,
5186
5679
  parseContractFunction,
5187
5680
  parseContractCall,
5188
5681
  isContractCall,
@@ -5199,6 +5692,12 @@ export {
5199
5692
  maxWalletTransactions,
5200
5693
  maxWalletTransactionLookback,
5201
5694
  walletTransactionsSchema,
5695
+ solanaTransactionFixtureInputSchema,
5696
+ solanaSeedSchema,
5697
+ maxSolanaSeeds,
5698
+ walletProgramAccountSchema,
5699
+ walletStakeSchema,
5700
+ walletStakeSampleSchema,
5202
5701
  lifecycleReasonSchema,
5203
5702
  offsetDateTimeSchema,
5204
5703
  discordMessageSchema,
@@ -5238,6 +5737,9 @@ export {
5238
5737
  xContentMetrics,
5239
5738
  customContentSchema,
5240
5739
  walletBalanceSourceSchema,
5740
+ walletProgramActivitySourceSchema,
5741
+ walletNftSourceSchema,
5742
+ walletStakeSourceSchema,
5241
5743
  xSearchSourceSchema,
5242
5744
  customSourceSchema,
5243
5745
  trackerSourceSchema,
@@ -5257,6 +5759,12 @@ export {
5257
5759
  trackerPropertiesSchema,
5258
5760
  trackerCreateSchema,
5259
5761
  managedTrackerCreateSchema,
5762
+ walletProgramActivityTrackerSourceSchema,
5763
+ programActivityTrackerCreateSchema,
5764
+ walletNftsTrackerSourceSchema,
5765
+ nftTrackerCreateSchema,
5766
+ walletStakeTrackerSourceSchema,
5767
+ stakeTrackerCreateSchema,
5260
5768
  trackerUpdateSchema,
5261
5769
  trackerControlSchema,
5262
5770
  trackerAccountSchema,
@@ -5364,6 +5872,16 @@ export {
5364
5872
  quizQuestionSchema,
5365
5873
  quizQuestionsSchema,
5366
5874
  quizContentSchema,
5875
+ inWindow,
5876
+ maxSolanaActionReference,
5877
+ solanaActionMemo,
5878
+ parseSolanaActionMemo,
5879
+ takesSolanaTransaction,
5880
+ questStationsSchema,
5881
+ stationRefusal,
5882
+ solanaSignatureSchema2,
5883
+ solanaTransactionSubmissionSchema,
5884
+ attemptActionSchema,
5367
5885
  resourceSourceSchema,
5368
5886
  resourceRequestSchema,
5369
5887
  resourceOptionsSchema,
@@ -5523,6 +6041,9 @@ export {
5523
6041
  avatarProviderSchema,
5524
6042
  profileDefaultProviderSchema,
5525
6043
  profileDefaultsSchema,
6044
+ knownProfileDefaultSources,
6045
+ profileDefaultSourcesSchema,
6046
+ profileNameSourceSchema,
5526
6047
  avatarSeedSchema,
5527
6048
  profileAvatarSchema,
5528
6049
  profileSummarySchema,
@@ -5569,6 +6090,7 @@ export {
5569
6090
  leaderboardGroupSchema,
5570
6091
  leaderboardSettlementStatusSchema,
5571
6092
  leaderboardSettlementSummarySchema,
6093
+ settlementPaymentSchema,
5572
6094
  leaderboardSettlementRowSchema,
5573
6095
  leaderboardSettlementPoolSchema,
5574
6096
  leaderboardSettlementUnmeasuredSchema,