@domino-sdk/relay 1.54.0 → 1.56.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 (65) hide show
  1. package/CHANGELOG.md +1859 -0
  2. package/dist/analytics-URV-mxjH.d.ts +482 -0
  3. package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
  4. package/dist/authoring.d.ts +277 -40
  5. package/dist/authoring.js +142 -14
  6. package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +7 -7
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-RP4LLEON.js → chunk-ABJ4G47X.js} +1 -1
  12. package/dist/{chunk-IELNFM3V.js → chunk-BHHUSBSD.js} +97 -8
  13. package/dist/chunk-BJYMTCWG.js +950 -0
  14. package/dist/{chunk-K6TVMNU4.js → chunk-CK7HO32Z.js} +1 -1
  15. package/dist/{chunk-GTQJSDBS.js → chunk-CXKXPB7K.js} +32 -16
  16. package/dist/{chunk-TL5TL5RD.js → chunk-G6XVBYH7.js} +4 -4
  17. package/dist/{chunk-S2PMKZSX.js → chunk-H2MD6E7Z.js} +21 -2
  18. package/dist/{chunk-YVC3B72P.js → chunk-INSWI2VZ.js} +1 -1
  19. package/dist/{chunk-XFAYQFRO.js → chunk-KBVH4XZC.js} +1 -1
  20. package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
  21. package/dist/{chunk-7BNCLWAO.js → chunk-MNU6UPXY.js} +1 -1
  22. package/dist/{chunk-JL7J3EQQ.js → chunk-NK6EER33.js} +46 -16
  23. package/dist/{chunk-QIDQWXSF.js → chunk-OTITLABX.js} +2 -2
  24. package/dist/{chunk-53JMTUWG.js → chunk-QNQNKIAA.js} +1 -1
  25. package/dist/{chunk-ZJ3FVZRP.js → chunk-RBPMT53S.js} +132 -99
  26. package/dist/chunk-ULQU7KC4.js +704 -0
  27. package/dist/chunk-VSHV7FEA.js +344 -0
  28. package/dist/{chunk-LPHXTZDA.js → chunk-W5U2WXG3.js} +2 -2
  29. package/dist/{client-CzNtl8UO.d.ts → client-bX3oTpRu.d.ts} +111 -8
  30. package/dist/{deployments-ovtqtAcx.d.ts → deployments-D3lxfQMB.d.ts} +1436 -185
  31. package/dist/{groups-B5R1RCsl.d.ts → groups-DPE004_V.d.ts} +135 -139
  32. package/dist/index.d.ts +8 -8
  33. package/dist/index.js +9 -9
  34. package/dist/integrations-CcD5NPEA.d.ts +633 -0
  35. package/dist/internal.d.ts +11 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-CH1RZekg.d.ts → offers-CtzMeB7O.d.ts} +207 -2
  38. package/dist/{pages-BTlOg8sl.d.ts → pages-BlLqB8ZQ.d.ts} +82 -2
  39. package/dist/portal-proxy.d.ts +11 -1
  40. package/dist/portal-proxy.js +27 -6
  41. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  42. package/dist/react/index.d.ts +566 -13
  43. package/dist/react/index.js +105 -15
  44. package/dist/runtime/authoring.js +1 -1
  45. package/dist/runtime/chunks/NDB42VFF.js +1 -0
  46. package/dist/runtime/manifest.json +3 -3
  47. package/dist/runtime/schema.js +1 -1
  48. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  49. package/dist/schema.d.ts +383 -79
  50. package/dist/schema.js +105 -41
  51. package/dist/server/index.d.ts +11 -10
  52. package/dist/server/index.js +1590 -1175
  53. package/dist/{submission-input-BNah53go.d.ts → submission-input-wTiYGdgA.d.ts} +2 -2
  54. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-Bh3i0HiH.d.ts} +1 -1
  55. package/dist/testing.d.ts +85 -12
  56. package/dist/testing.js +322 -37
  57. package/dist/{transport-C8BlCzmF.d.ts → transport-CnKA-_RL.d.ts} +7625 -1265
  58. package/dist/vite.d.ts +54 -1
  59. package/dist/vite.js +35 -0
  60. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  61. package/package.json +3 -2
  62. package/dist/chunk-2NUD237O.js +0 -102
  63. package/dist/chunk-CCE2JWES.js +0 -1083
  64. package/dist/integrations-CllF-kWg.d.ts +0 -314
  65. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
package/dist/authoring.js CHANGED
@@ -2,6 +2,15 @@ import {
2
2
  formatUnits,
3
3
  parseUnits
4
4
  } from "./chunk-V7UKZLHA.js";
5
+ import {
6
+ defineDashboard,
7
+ tiktokVideoBodySchema,
8
+ tiktokVideoMetrics,
9
+ tiktokVideosNamespace,
10
+ youtubeShortBodySchema,
11
+ youtubeShortMetrics,
12
+ youtubeShortsNamespace
13
+ } from "./chunk-ULQU7KC4.js";
5
14
  import {
6
15
  CapabilityError,
7
16
  capabilityErrorCodes
@@ -10,7 +19,7 @@ import {
10
19
  sourceDataSchema,
11
20
  sourceRoles,
12
21
  validateQuestShape
13
- } from "./chunk-S2PMKZSX.js";
22
+ } from "./chunk-H2MD6E7Z.js";
14
23
  import {
15
24
  badgeDeclarationSchema,
16
25
  defineOffer,
@@ -18,13 +27,13 @@ import {
18
27
  engagementScoreInputSchema,
19
28
  engagementScoreSchema,
20
29
  leaderboardAuthoringSchema,
21
- pointLedgerDeclarationSchema,
22
30
  referralAuthoringSchema
23
- } from "./chunk-CCE2JWES.js";
31
+ } from "./chunk-BJYMTCWG.js";
24
32
  import {
33
+ pointLedgerDeclarationSchema,
25
34
  telegramReactionDataSchema,
26
35
  telegramReactionsNamespace
27
- } from "./chunk-2NUD237O.js";
36
+ } from "./chunk-VSHV7FEA.js";
28
37
  import {
29
38
  authoringKey,
30
39
  badgeReward,
@@ -52,6 +61,9 @@ import {
52
61
  groupReward,
53
62
  identifier,
54
63
  inGroup,
64
+ isAmount,
65
+ isBalanceChain,
66
+ isBoundSetting,
55
67
  isEvmChainId,
56
68
  ledgerKey,
57
69
  ledgerSettingSchema,
@@ -73,6 +85,7 @@ import {
73
85
  sourceIdentities,
74
86
  streakPolicySchema,
75
87
  textOptionsSchema,
88
+ textSettingSchema,
76
89
  tierRewardSchema,
77
90
  tieredRewardDefinitionSchema,
78
91
  trackerDataIssue,
@@ -84,7 +97,7 @@ import {
84
97
  whereSchemaIssue,
85
98
  whereSettings,
86
99
  xSearchSourceSchema
87
- } from "./chunk-IELNFM3V.js";
100
+ } from "./chunk-BHHUSBSD.js";
88
101
 
89
102
  // src/builders.ts
90
103
  import * as z from "zod";
@@ -155,9 +168,22 @@ function earned(options = {}) {
155
168
  return { kind: "earned", ...options };
156
169
  }
157
170
  function defineLeaderboard(input) {
158
- const { ledger, group, score, ...properties } = input;
171
+ const { ledger, group, score, settle, ...properties } = input;
172
+ const pool = settle?.pool;
159
173
  const definition = leaderboardAuthoringSchema.parse({
160
174
  ...properties,
175
+ ...settle ? {
176
+ settle: {
177
+ ...settle,
178
+ prizes: settle.prizes ?? [],
179
+ ...pool ? {
180
+ pool: {
181
+ ...pool,
182
+ ...pool.ledger === void 0 ? {} : { ledger: ledgerKey(pool.ledger) }
183
+ }
184
+ } : {}
185
+ }
186
+ } : {},
161
187
  balance: ledgerKey(ledger),
162
188
  ...group ? { group: identifier.parse(group.key) } : {},
163
189
  score: score?.kind === "earned" ? { ...score, quests: score.quests?.map((quest) => quest.key) } : score
@@ -274,6 +300,28 @@ var telegram = {
274
300
  });
275
301
  }
276
302
  };
303
+ var youtube = {
304
+ shorts() {
305
+ return customSource(youtubeShortsNamespace, {
306
+ identities: ["member"],
307
+ content: {
308
+ body: youtubeShortBodySchema,
309
+ metrics: youtubeShortMetrics
310
+ }
311
+ });
312
+ }
313
+ };
314
+ var tiktok = {
315
+ videos() {
316
+ return customSource(tiktokVideosNamespace, {
317
+ identities: ["member"],
318
+ content: {
319
+ body: tiktokVideoBodySchema,
320
+ metrics: tiktokVideoMetrics
321
+ }
322
+ });
323
+ }
324
+ };
277
325
  var pointLedgers = () => ({
278
326
  provider: "domino",
279
327
  resource: "point-ledger"
@@ -355,6 +403,54 @@ var settings = {
355
403
  z.string().max(field.maxLength).default(field.default).meta(field)
356
404
  );
357
405
  },
406
+ /**
407
+ * A non-negative token amount in base units, as an integer string such as `"1000000"`: exact at
408
+ * any scale, so an 18-decimal threshold fits. A tracker filter may compare with it
409
+ * (`gte: { setting }`). With `decimals`, Console shows and edits it in whole tokens.
410
+ */
411
+ amount(options) {
412
+ if (!isAmount(options.default)) {
413
+ throw new Error(
414
+ `settings.amount() takes a base-unit integer string as its default, not "${options.default}"`
415
+ );
416
+ }
417
+ const field = {
418
+ ...options,
419
+ kind: "text",
420
+ minLength: 1,
421
+ maxLength: 100,
422
+ multiline: false,
423
+ picker: "amount"
424
+ };
425
+ return setting(
426
+ "text",
427
+ textSettingSchema(field).default(field.default).meta(field)
428
+ );
429
+ },
430
+ /**
431
+ * A chain `ctx.wallet.balance()` reads: `"solana"` (or Solana mainnet's CAIP-2 ID), or an EVM
432
+ * chain's CAIP-2 ID such as `"eip155:8453"`. Typed as the query's chain, so it passes to
433
+ * `ctx.wallet.balance({ chain })` as it is.
434
+ */
435
+ chain(options) {
436
+ if (!isBalanceChain(options.default)) {
437
+ throw new Error(
438
+ `settings.chain() takes "solana" or an EVM chain ID such as "eip155:8453" as its default, not "${options.default}"`
439
+ );
440
+ }
441
+ const field = {
442
+ ...options,
443
+ kind: "text",
444
+ minLength: 1,
445
+ maxLength: 64,
446
+ multiline: false,
447
+ picker: "chain"
448
+ };
449
+ return setting(
450
+ "text",
451
+ textSettingSchema(field).transform((value) => value).default(field.default).meta(field)
452
+ );
453
+ },
358
454
  integer(options) {
359
455
  return setting(
360
456
  "integer",
@@ -600,6 +696,7 @@ var evaluators = {
600
696
  };
601
697
  }
602
698
  };
699
+ var completionPolicies = { once, keyed, streak, progress };
603
700
  function questBuilder(template) {
604
701
  return function defineQuest2(definition) {
605
702
  const key = authoringKey(definition);
@@ -612,7 +709,8 @@ function questBuilder(template) {
612
709
  ];
613
710
  const contentTrigger = definition.trigger.kind === "automatic" && definition.trigger.tracker?.content === true;
614
711
  const trackerTrigger2 = definition.trigger.kind === "automatic" && definition.trigger.tracker !== void 0;
615
- const completion = definition.completion;
712
+ const declared = definition.completion;
713
+ const completion = typeof declared === "function" ? declared(completionPolicies) : declared;
616
714
  if (contentTrigger && completion !== void 0) {
617
715
  throw new Error(
618
716
  "A content quest completes once per content item: remove its completion"
@@ -632,7 +730,8 @@ function questBuilder(template) {
632
730
  metrics: definition.performance.metrics,
633
731
  maxAgeMs: definition.performance.maxAgeMs
634
732
  }) : void 0,
635
- ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
733
+ ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs },
734
+ ...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs }
636
735
  },
637
736
  { template }
638
737
  );
@@ -641,10 +740,15 @@ function questBuilder(template) {
641
740
  "retryCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
642
741
  );
643
742
  }
743
+ if (definition.completionCooldownMs !== void 0 && !retryCooldownMsSchema.safeParse(definition.completionCooldownMs).success) {
744
+ throw new Error(
745
+ "completionCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
746
+ );
747
+ }
644
748
  if (definition.performance) {
645
- const declared = triggerContentMetrics.get(definition.trigger) ?? [];
749
+ const declared2 = triggerContentMetrics.get(definition.trigger) ?? [];
646
750
  const unknown = definition.performance.metrics.filter(
647
- (metric) => !declared.includes(metric)
751
+ (metric) => !declared2.includes(metric)
648
752
  );
649
753
  if (unknown.length) {
650
754
  throw new Error(
@@ -669,9 +773,9 @@ function questBuilder(template) {
669
773
  for (const setting2 of whereSettings(
670
774
  definition.trigger.kind === "automatic" ? definition.trigger.tracker?.where : void 0
671
775
  )) {
672
- if (fields[setting2]?.kind !== "integer") {
776
+ if (!isBoundSetting(fields[setting2])) {
673
777
  throw new Error(
674
- `The tracker filter compares with setting "${setting2}", which is not an integer setting`
778
+ `The tracker filter compares with setting "${setting2}", which is not an integer or amount setting`
675
779
  );
676
780
  }
677
781
  }
@@ -724,7 +828,8 @@ function questBuilder(template) {
724
828
  requires: definition.requires ?? [],
725
829
  ...definition.campaign ? { campaign: definition.campaign } : {},
726
830
  ...definition.availability ? { availability: definition.availability } : {},
727
- ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
831
+ ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs },
832
+ ...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs }
728
833
  });
729
834
  }
730
835
  return resourceHandle("quest", {
@@ -809,12 +914,19 @@ function questBuilder(template) {
809
914
  requestedReview: true
810
915
  });
811
916
  }
917
+ if ((result.kind === "accept" || result.kind === "review") && result.completionKey !== void 0 && completion?.kind !== "keyed") {
918
+ ctx.diagnose?.({
919
+ code: "completion-key-ignored",
920
+ message: ignoredCompletionKey(completion, result.completionKey)
921
+ });
922
+ }
923
+ const keyContext = { ...ctx, settings: settings2, tracker: pinned };
812
924
  return decisionSchema.parse(
813
925
  result.kind === "accept" || result.kind === "review" ? {
814
926
  ...result,
815
927
  rewards: result.rewards ?? ctx.rewards,
816
928
  ...completion?.kind === "keyed" || completion?.kind === "progress" ? {
817
- completionKey: completion.kind === "progress" ? completion.distinct({ ...ctx, tracker: pinned }) : result.completionKey ?? completion.key({ ...ctx, tracker: pinned })
929
+ completionKey: completion.kind === "progress" ? completion.distinct(keyContext) : result.completionKey ?? completion.key(keyContext)
818
930
  } : {}
819
931
  } : result
820
932
  );
@@ -822,6 +934,19 @@ function questBuilder(template) {
822
934
  });
823
935
  };
824
936
  }
937
+ function ignoredCompletionKey(completion, key) {
938
+ const ignored = `ignores completionKey ${JSON.stringify(key)}`;
939
+ switch (completion?.kind) {
940
+ case void 0:
941
+ return `A content quest completes once per content item, under a key Relay sets, so it ${ignored}`;
942
+ case "once":
943
+ return `once() completes the quest once per member and ${ignored}: use keyed(...) to complete it once per key`;
944
+ case "streak":
945
+ return `streak(...) keys its own completions and ${ignored}`;
946
+ case "progress":
947
+ return `progress(...) keys each contribution with its distinct(...) and ${ignored}: derive the key in distinct(...)`;
948
+ }
949
+ }
825
950
  var defineQuest = questBuilder(false);
826
951
  var defineQuestType = questBuilder(true);
827
952
  export {
@@ -842,6 +967,7 @@ export {
842
967
  decision,
843
968
  defineBadge,
844
969
  defineCampaign,
970
+ defineDashboard,
845
971
  defineEngagementReward,
846
972
  defineGroup,
847
973
  defineLeaderboard,
@@ -873,9 +999,11 @@ export {
873
999
  staffHandover,
874
1000
  streak,
875
1001
  telegram,
1002
+ tiktok,
876
1003
  trackerDataSchema,
877
1004
  trackerTriggerContextSchema,
878
1005
  untracked,
879
1006
  x,
1007
+ youtube,
880
1008
  z2 as z
881
1009
  };
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod';
2
- import { a as AttemptStatus } from './schema-BJ9bOgpN.js';
2
+ import { a as AttemptStatus } from './schema-C4m9RhCR.js';
3
3
 
4
4
  declare const collectionCodeSchema: z.ZodString;
5
5
  declare const collectionPassSchema: z.ZodObject<{
@@ -523,7 +523,10 @@ declare const automaticOutcomeSchema: z.ZodUnion<readonly [z.ZodObject<{
523
523
  updatedAt: z.ZodNumber;
524
524
  }, z.core.$strip>]>;
525
525
  type AutomaticOutcome = z.infer<typeof automaticOutcomeSchema>;
526
- /** Whether a linked attempt can be replaced after current admission rules pass. */
526
+ /**
527
+ * Whether a linked attempt can be replaced after current admission rules pass: a rejection by
528
+ * budget exhaustion, or a failure because a project integration the quest needs was not ready.
529
+ */
527
530
  declare const isRetryableAutomaticOutcome: (outcome: Pick<z.input<typeof automaticOutcomeSchema>, "linkedAttempt">) => boolean;
528
531
  declare const automaticOutcomeQuerySchema: z.ZodObject<{
529
532
  quest: z.ZodOptional<z.ZodString>;
package/dist/avatar.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { L as LinkedWallet } from './wallet-Ac7OFpOr.js';
2
- import { P as ProfileAvatar } from './profiles-Cdv4BSd_.js';
2
+ import { P as ProfileAvatar } from './profiles-BoOK03cR.js';
3
3
  import 'zod';
4
4
 
5
5
  /**
package/dist/browser.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-CzNtl8UO.js';
2
- export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-C36j_6v-.js';
1
+ import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-bX3oTpRu.js';
2
+ export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-Bh3i0HiH.js';
3
3
  export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-FN4zg3hw.js';
4
- import './groups-B5R1RCsl.js';
4
+ import './schema-C4m9RhCR.js';
5
5
  import 'zod';
6
- import './schema-BJ9bOgpN.js';
7
- import './pages-BTlOg8sl.js';
8
- import './submission-input-BNah53go.js';
6
+ import './pages-BlLqB8ZQ.js';
7
+ import './submission-input-wTiYGdgA.js';
8
+ import './groups-DPE004_V.js';
9
9
  import './action-DBzILFx9.js';
10
10
  import './participant-activity-iciCEs_8.js';
11
11
  import './accounts-DRPENuZe.js';
12
- import './profiles-Cdv4BSd_.js';
12
+ import './profiles-BoOK03cR.js';
13
13
  import './wallet-Ac7OFpOr.js';
14
14
 
15
15
  /** Browser client with durable submission recovery; safe to construct during SSR. */
package/dist/browser.js CHANGED
@@ -12,19 +12,19 @@ import {
12
12
  solanaSigner,
13
13
  telegramMiniAppInitData,
14
14
  walletStandardSolanaSigner
15
- } from "./chunk-QIDQWXSF.js";
16
- import "./chunk-JL7J3EQQ.js";
17
- import "./chunk-YVC3B72P.js";
18
- import "./chunk-ZJ3FVZRP.js";
19
- import "./chunk-CCE2JWES.js";
20
- import "./chunk-2NUD237O.js";
15
+ } from "./chunk-OTITLABX.js";
16
+ import "./chunk-NK6EER33.js";
17
+ import "./chunk-INSWI2VZ.js";
18
+ import "./chunk-RBPMT53S.js";
19
+ import "./chunk-BJYMTCWG.js";
20
+ import "./chunk-VSHV7FEA.js";
21
21
  import {
22
22
  getHostEnvironment
23
23
  } from "./chunk-KDR2VAJP.js";
24
- import "./chunk-XFAYQFRO.js";
25
- import "./chunk-RP4LLEON.js";
26
- import "./chunk-53JMTUWG.js";
27
- import "./chunk-IELNFM3V.js";
24
+ import "./chunk-KBVH4XZC.js";
25
+ import "./chunk-ABJ4G47X.js";
26
+ import "./chunk-QNQNKIAA.js";
27
+ import "./chunk-BHHUSBSD.js";
28
28
  export {
29
29
  browserSubmissionStore,
30
30
  cosmosChainList,
@@ -1,5 +1,71 @@
1
1
  import * as z from 'zod';
2
2
 
3
+ declare const completionPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ kind: z.ZodLiteral<"streak">;
5
+ days: z.ZodNumber;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ kind: z.ZodLiteral<"progress">;
8
+ goal: z.ZodObject<{
9
+ kind: z.ZodLiteral<"count">;
10
+ count: z.ZodNumber;
11
+ }, z.core.$strict>;
12
+ window: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"lifetime">;
14
+ }, z.core.$strict>, z.ZodObject<{
15
+ kind: z.ZodLiteral<"calendar">;
16
+ period: z.ZodEnum<{
17
+ day: "day";
18
+ week: "week";
19
+ month: "month";
20
+ }>;
21
+ latenessMs: z.ZodDefault<z.ZodNumber>;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"rolling">;
24
+ durationMs: z.ZodNumber;
25
+ }, z.core.$strict>], "kind">;
26
+ repeat: z.ZodDefault<z.ZodEnum<{
27
+ repeat: "repeat";
28
+ once: "once";
29
+ }>>;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"once">;
32
+ }, z.core.$strict>, z.ZodObject<{
33
+ kind: z.ZodLiteral<"keyed">;
34
+ }, z.core.$strict>], "kind">;
35
+ declare const completionKeySchema: z.ZodString;
36
+ declare const budgetSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ scope: z.ZodEnum<{
39
+ member: "member";
40
+ project: "project";
41
+ }>;
42
+ period: z.ZodEnum<{
43
+ lifetime: "lifetime";
44
+ day: "day";
45
+ week: "week";
46
+ month: "month";
47
+ }>;
48
+ limit: z.ZodNumber;
49
+ cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
50
+ balance: z.ZodString;
51
+ }, z.core.$strict>]>;
52
+ }, z.core.$strict>;
53
+ type Budget = z.infer<typeof budgetSchema>;
54
+ /**
55
+ * One of the member's accepted, unrevoked quest completions, as `ctx.member.completions()` reads
56
+ * it. `quest` is the quest's key and `key` the completion key. `completedAt` is when it was
57
+ * recorded, in epoch milliseconds on the member's clock (a test member's advanced one); null for
58
+ * older completions recorded without a time.
59
+ */
60
+ declare const memberCompletionSchema: z.ZodObject<{
61
+ quest: z.ZodString;
62
+ key: z.ZodString;
63
+ completedAt: z.ZodNullable<z.ZodNumber>;
64
+ }, z.core.$strip>;
65
+ type MemberCompletion = z.infer<typeof memberCompletionSchema>;
66
+ /** The most completions one `ctx.member.completions()` call returns, and its default `limit`. */
67
+ declare const maxMemberCompletions = 100;
68
+
3
69
  /**
4
70
  * Why an evaluator capability could not answer:
5
71
  *
@@ -12,7 +78,15 @@ import * as z from 'zod';
12
78
  * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
13
79
  * linked, or an image that does not exist.
14
80
  *
15
- * Later versions can add codes. Treat an unknown code as a failure its `message` explains.
81
+ * Later versions can add codes. Relay also sends codes this tuple does not list, as SDK 1.x keeps
82
+ * it fixed:
83
+ *
84
+ * - `integration-required`: the project's integration needs configuration before the call can
85
+ * answer.
86
+ * - `capability-limit`: the evaluation run already made its eight capability calls, which all
87
+ * capabilities share. Never retryable: the run makes the same calls again.
88
+ *
89
+ * Treat an unknown code as a failure its `message` explains.
16
90
  */
17
91
  declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
18
92
  /** @compat open */
@@ -68,4 +142,4 @@ declare class CapabilityError extends Error {
68
142
  static from(failure: CapabilityFailure): CapabilityError;
69
143
  }
70
144
 
71
- export { CapabilityError as C, type KnownCapabilityErrorCode as K, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, capabilityFailureSchema as d };
145
+ export { type Budget as B, CapabilityError as C, type KnownCapabilityErrorCode as K, type MemberCompletion as M, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, budgetSchema as d, capabilityFailureSchema as e, completionKeySchema as f, completionPolicySchema as g, memberCompletionSchema as h, maxMemberCompletions as m };
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@domino-sdk/relay";
3
- var version = "1.54.0";
3
+ var version = "1.56.0";
4
4
 
5
5
  // src/client-identity.ts
6
6
  function clientIdentity() {