@domino-sdk/relay 1.53.1 → 1.55.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 (66) hide show
  1. package/CHANGELOG.md +1848 -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 +233 -78
  5. package/dist/authoring.js +112 -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 +8 -7
  9. package/dist/browser.js +14 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-53JMTUWG.js → chunk-56DBFNR2.js} +1 -1
  12. package/dist/chunk-C7QZ4UBB.js +937 -0
  13. package/dist/chunk-F6HECAXA.js +661 -0
  14. package/dist/{chunk-VKHSC5MD.js → chunk-GL43VQ5D.js} +16 -16
  15. package/dist/{chunk-GTQJSDBS.js → chunk-IUF7DW76.js} +27 -16
  16. package/dist/{chunk-YBR4BUFK.js → chunk-IZRITLVV.js} +2 -2
  17. package/dist/chunk-KDR2VAJP.js +34 -0
  18. package/dist/{chunk-S2PMKZSX.js → chunk-SABMNPF2.js} +21 -2
  19. package/dist/{chunk-XFAYQFRO.js → chunk-TLK2MD4S.js} +1 -1
  20. package/dist/{chunk-ZJ3FVZRP.js → chunk-UY6KMLQG.js} +10 -3
  21. package/dist/{chunk-JYJAS4E3.js → chunk-VFBQVY4X.js} +1 -1
  22. package/dist/{chunk-YVC3B72P.js → chunk-WHG5WE43.js} +1 -1
  23. package/dist/chunk-WHMXXHPX.js +344 -0
  24. package/dist/{chunk-MP2ZF5U6.js → chunk-WUEQOKJH.js} +4 -4
  25. package/dist/{chunk-7BNCLWAO.js → chunk-XALIFNMD.js} +1 -1
  26. package/dist/{chunk-IELNFM3V.js → chunk-YCOKTQ4E.js} +96 -7
  27. package/dist/{chunk-LPHXTZDA.js → chunk-YE3XYB2F.js} +2 -2
  28. package/dist/{chunk-K6TVMNU4.js → chunk-YEVD4A5X.js} +1 -1
  29. package/dist/{client-CzNtl8UO.d.ts → client-C4zUZKpj.d.ts} +35 -7
  30. package/dist/{deployments-ovtqtAcx.d.ts → deployments-B32QS1CI.d.ts} +1060 -233
  31. package/dist/{groups-B5R1RCsl.d.ts → groups-O6onGPmC.d.ts} +131 -137
  32. package/dist/host-environment-FN4zg3hw.d.ts +30 -0
  33. package/dist/index.d.ts +8 -8
  34. package/dist/index.js +9 -9
  35. package/dist/integrations-C6_uUh-s.d.ts +584 -0
  36. package/dist/internal.d.ts +12 -10
  37. package/dist/internal.js +14 -8
  38. package/dist/{offers-CH1RZekg.d.ts → offers-BMDNcvwB.d.ts} +2 -2
  39. package/dist/{pages-BTlOg8sl.d.ts → pages-BFloMpyQ.d.ts} +25 -1
  40. package/dist/portal-proxy.d.ts +11 -1
  41. package/dist/portal-proxy.js +26 -5
  42. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  43. package/dist/react/index.d.ts +488 -13
  44. package/dist/react/index.js +51 -15
  45. package/dist/runtime/authoring.js +1 -1
  46. package/dist/runtime/chunks/WKATKZXE.js +1 -0
  47. package/dist/runtime/manifest.json +3 -3
  48. package/dist/runtime/schema.js +1 -1
  49. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  50. package/dist/schema.d.ts +392 -334
  51. package/dist/schema.js +84 -40
  52. package/dist/server/index.d.ts +11 -10
  53. package/dist/server/index.js +1604 -838
  54. package/dist/{submission-input-BNah53go.d.ts → submission-input-BbdawqVy.d.ts} +2 -2
  55. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-CwaxROAZ.d.ts} +1 -1
  56. package/dist/testing.d.ts +85 -12
  57. package/dist/testing.js +322 -37
  58. package/dist/{transport-DuB_fiA2.d.ts → transport-CZJOW5Sr.d.ts} +8018 -3150
  59. package/dist/vite.d.ts +54 -1
  60. package/dist/vite.js +35 -0
  61. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  62. package/package.json +3 -2
  63. package/dist/chunk-2NUD237O.js +0 -102
  64. package/dist/chunk-CCE2JWES.js +0 -1083
  65. package/dist/integrations-CllF-kWg.d.ts +0 -314
  66. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
package/dist/authoring.js CHANGED
@@ -2,6 +2,9 @@ import {
2
2
  formatUnits,
3
3
  parseUnits
4
4
  } from "./chunk-V7UKZLHA.js";
5
+ import {
6
+ defineDashboard
7
+ } from "./chunk-F6HECAXA.js";
5
8
  import {
6
9
  CapabilityError,
7
10
  capabilityErrorCodes
@@ -10,7 +13,7 @@ import {
10
13
  sourceDataSchema,
11
14
  sourceRoles,
12
15
  validateQuestShape
13
- } from "./chunk-S2PMKZSX.js";
16
+ } from "./chunk-SABMNPF2.js";
14
17
  import {
15
18
  badgeDeclarationSchema,
16
19
  defineOffer,
@@ -18,13 +21,13 @@ import {
18
21
  engagementScoreInputSchema,
19
22
  engagementScoreSchema,
20
23
  leaderboardAuthoringSchema,
21
- pointLedgerDeclarationSchema,
22
24
  referralAuthoringSchema
23
- } from "./chunk-CCE2JWES.js";
25
+ } from "./chunk-C7QZ4UBB.js";
24
26
  import {
27
+ pointLedgerDeclarationSchema,
25
28
  telegramReactionDataSchema,
26
29
  telegramReactionsNamespace
27
- } from "./chunk-2NUD237O.js";
30
+ } from "./chunk-WHMXXHPX.js";
28
31
  import {
29
32
  authoringKey,
30
33
  badgeReward,
@@ -52,6 +55,9 @@ import {
52
55
  groupReward,
53
56
  identifier,
54
57
  inGroup,
58
+ isAmount,
59
+ isBalanceChain,
60
+ isBoundSetting,
55
61
  isEvmChainId,
56
62
  ledgerKey,
57
63
  ledgerSettingSchema,
@@ -73,6 +79,7 @@ import {
73
79
  sourceIdentities,
74
80
  streakPolicySchema,
75
81
  textOptionsSchema,
82
+ textSettingSchema,
76
83
  tierRewardSchema,
77
84
  tieredRewardDefinitionSchema,
78
85
  trackerDataIssue,
@@ -84,7 +91,7 @@ import {
84
91
  whereSchemaIssue,
85
92
  whereSettings,
86
93
  xSearchSourceSchema
87
- } from "./chunk-IELNFM3V.js";
94
+ } from "./chunk-YCOKTQ4E.js";
88
95
 
89
96
  // src/builders.ts
90
97
  import * as z from "zod";
@@ -155,9 +162,22 @@ function earned(options = {}) {
155
162
  return { kind: "earned", ...options };
156
163
  }
157
164
  function defineLeaderboard(input) {
158
- const { ledger, group, score, ...properties } = input;
165
+ const { ledger, group, score, settle, ...properties } = input;
166
+ const pool = settle?.pool;
159
167
  const definition = leaderboardAuthoringSchema.parse({
160
168
  ...properties,
169
+ ...settle ? {
170
+ settle: {
171
+ ...settle,
172
+ prizes: settle.prizes ?? [],
173
+ ...pool ? {
174
+ pool: {
175
+ ...pool,
176
+ ...pool.ledger === void 0 ? {} : { ledger: ledgerKey(pool.ledger) }
177
+ }
178
+ } : {}
179
+ }
180
+ } : {},
161
181
  balance: ledgerKey(ledger),
162
182
  ...group ? { group: identifier.parse(group.key) } : {},
163
183
  score: score?.kind === "earned" ? { ...score, quests: score.quests?.map((quest) => quest.key) } : score
@@ -355,6 +375,54 @@ var settings = {
355
375
  z.string().max(field.maxLength).default(field.default).meta(field)
356
376
  );
357
377
  },
378
+ /**
379
+ * A non-negative token amount in base units, as an integer string such as `"1000000"`: exact at
380
+ * any scale, so an 18-decimal threshold fits. A tracker filter may compare with it
381
+ * (`gte: { setting }`). With `decimals`, Console shows and edits it in whole tokens.
382
+ */
383
+ amount(options) {
384
+ if (!isAmount(options.default)) {
385
+ throw new Error(
386
+ `settings.amount() takes a base-unit integer string as its default, not "${options.default}"`
387
+ );
388
+ }
389
+ const field = {
390
+ ...options,
391
+ kind: "text",
392
+ minLength: 1,
393
+ maxLength: 100,
394
+ multiline: false,
395
+ picker: "amount"
396
+ };
397
+ return setting(
398
+ "text",
399
+ textSettingSchema(field).default(field.default).meta(field)
400
+ );
401
+ },
402
+ /**
403
+ * A chain `ctx.wallet.balance()` reads: `"solana"` (or Solana mainnet's CAIP-2 ID), or an EVM
404
+ * chain's CAIP-2 ID such as `"eip155:8453"`. Typed as the query's chain, so it passes to
405
+ * `ctx.wallet.balance({ chain })` as it is.
406
+ */
407
+ chain(options) {
408
+ if (!isBalanceChain(options.default)) {
409
+ throw new Error(
410
+ `settings.chain() takes "solana" or an EVM chain ID such as "eip155:8453" as its default, not "${options.default}"`
411
+ );
412
+ }
413
+ const field = {
414
+ ...options,
415
+ kind: "text",
416
+ minLength: 1,
417
+ maxLength: 64,
418
+ multiline: false,
419
+ picker: "chain"
420
+ };
421
+ return setting(
422
+ "text",
423
+ textSettingSchema(field).transform((value) => value).default(field.default).meta(field)
424
+ );
425
+ },
358
426
  integer(options) {
359
427
  return setting(
360
428
  "integer",
@@ -600,6 +668,7 @@ var evaluators = {
600
668
  };
601
669
  }
602
670
  };
671
+ var completionPolicies = { once, keyed, streak, progress };
603
672
  function questBuilder(template) {
604
673
  return function defineQuest2(definition) {
605
674
  const key = authoringKey(definition);
@@ -612,7 +681,8 @@ function questBuilder(template) {
612
681
  ];
613
682
  const contentTrigger = definition.trigger.kind === "automatic" && definition.trigger.tracker?.content === true;
614
683
  const trackerTrigger2 = definition.trigger.kind === "automatic" && definition.trigger.tracker !== void 0;
615
- const completion = definition.completion;
684
+ const declared = definition.completion;
685
+ const completion = typeof declared === "function" ? declared(completionPolicies) : declared;
616
686
  if (contentTrigger && completion !== void 0) {
617
687
  throw new Error(
618
688
  "A content quest completes once per content item: remove its completion"
@@ -632,7 +702,8 @@ function questBuilder(template) {
632
702
  metrics: definition.performance.metrics,
633
703
  maxAgeMs: definition.performance.maxAgeMs
634
704
  }) : void 0,
635
- ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
705
+ ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs },
706
+ ...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs }
636
707
  },
637
708
  { template }
638
709
  );
@@ -641,10 +712,15 @@ function questBuilder(template) {
641
712
  "retryCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
642
713
  );
643
714
  }
715
+ if (definition.completionCooldownMs !== void 0 && !retryCooldownMsSchema.safeParse(definition.completionCooldownMs).success) {
716
+ throw new Error(
717
+ "completionCooldownMs must be whole milliseconds from 1000 (one second) to 604800000 (seven days)"
718
+ );
719
+ }
644
720
  if (definition.performance) {
645
- const declared = triggerContentMetrics.get(definition.trigger) ?? [];
721
+ const declared2 = triggerContentMetrics.get(definition.trigger) ?? [];
646
722
  const unknown = definition.performance.metrics.filter(
647
- (metric) => !declared.includes(metric)
723
+ (metric) => !declared2.includes(metric)
648
724
  );
649
725
  if (unknown.length) {
650
726
  throw new Error(
@@ -669,9 +745,9 @@ function questBuilder(template) {
669
745
  for (const setting2 of whereSettings(
670
746
  definition.trigger.kind === "automatic" ? definition.trigger.tracker?.where : void 0
671
747
  )) {
672
- if (fields[setting2]?.kind !== "integer") {
748
+ if (!isBoundSetting(fields[setting2])) {
673
749
  throw new Error(
674
- `The tracker filter compares with setting "${setting2}", which is not an integer setting`
750
+ `The tracker filter compares with setting "${setting2}", which is not an integer or amount setting`
675
751
  );
676
752
  }
677
753
  }
@@ -724,7 +800,8 @@ function questBuilder(template) {
724
800
  requires: definition.requires ?? [],
725
801
  ...definition.campaign ? { campaign: definition.campaign } : {},
726
802
  ...definition.availability ? { availability: definition.availability } : {},
727
- ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs }
803
+ ...definition.retryCooldownMs === void 0 ? {} : { retryCooldownMs: definition.retryCooldownMs },
804
+ ...definition.completionCooldownMs === void 0 ? {} : { completionCooldownMs: definition.completionCooldownMs }
728
805
  });
729
806
  }
730
807
  return resourceHandle("quest", {
@@ -809,12 +886,19 @@ function questBuilder(template) {
809
886
  requestedReview: true
810
887
  });
811
888
  }
889
+ if ((result.kind === "accept" || result.kind === "review") && result.completionKey !== void 0 && completion?.kind !== "keyed") {
890
+ ctx.diagnose?.({
891
+ code: "completion-key-ignored",
892
+ message: ignoredCompletionKey(completion, result.completionKey)
893
+ });
894
+ }
895
+ const keyContext = { ...ctx, settings: settings2, tracker: pinned };
812
896
  return decisionSchema.parse(
813
897
  result.kind === "accept" || result.kind === "review" ? {
814
898
  ...result,
815
899
  rewards: result.rewards ?? ctx.rewards,
816
900
  ...completion?.kind === "keyed" || completion?.kind === "progress" ? {
817
- completionKey: completion.kind === "progress" ? completion.distinct({ ...ctx, tracker: pinned }) : result.completionKey ?? completion.key({ ...ctx, tracker: pinned })
901
+ completionKey: completion.kind === "progress" ? completion.distinct(keyContext) : result.completionKey ?? completion.key(keyContext)
818
902
  } : {}
819
903
  } : result
820
904
  );
@@ -822,6 +906,19 @@ function questBuilder(template) {
822
906
  });
823
907
  };
824
908
  }
909
+ function ignoredCompletionKey(completion, key) {
910
+ const ignored = `ignores completionKey ${JSON.stringify(key)}`;
911
+ switch (completion?.kind) {
912
+ case void 0:
913
+ return `A content quest completes once per content item, under a key Relay sets, so it ${ignored}`;
914
+ case "once":
915
+ return `once() completes the quest once per member and ${ignored}: use keyed(...) to complete it once per key`;
916
+ case "streak":
917
+ return `streak(...) keys its own completions and ${ignored}`;
918
+ case "progress":
919
+ return `progress(...) keys each contribution with its distinct(...) and ${ignored}: derive the key in distinct(...)`;
920
+ }
921
+ }
825
922
  var defineQuest = questBuilder(false);
826
923
  var defineQuestType = questBuilder(true);
827
924
  export {
@@ -842,6 +939,7 @@ export {
842
939
  decision,
843
940
  defineBadge,
844
941
  defineCampaign,
942
+ defineDashboard,
845
943
  defineEngagementReward,
846
944
  defineGroup,
847
945
  defineLeaderboard,
@@ -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,14 +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';
3
- import './groups-B5R1RCsl.js';
1
+ import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-C4zUZKpj.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-CwaxROAZ.js';
3
+ export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-FN4zg3hw.js';
4
+ import './schema-C4m9RhCR.js';
4
5
  import 'zod';
5
- import './schema-BJ9bOgpN.js';
6
- import './pages-BTlOg8sl.js';
7
- import './submission-input-BNah53go.js';
6
+ import './pages-BFloMpyQ.js';
7
+ import './submission-input-BbdawqVy.js';
8
+ import './groups-O6onGPmC.js';
8
9
  import './action-DBzILFx9.js';
9
10
  import './participant-activity-iciCEs_8.js';
10
11
  import './accounts-DRPENuZe.js';
11
- import './profiles-Cdv4BSd_.js';
12
+ import './profiles-BoOK03cR.js';
12
13
  import './wallet-Ac7OFpOr.js';
13
14
 
14
15
  /** Browser client with durable submission recovery; safe to construct during SSR. */
package/dist/browser.js CHANGED
@@ -12,16 +12,19 @@ import {
12
12
  solanaSigner,
13
13
  telegramMiniAppInitData,
14
14
  walletStandardSolanaSigner
15
- } from "./chunk-YBR4BUFK.js";
16
- import "./chunk-VKHSC5MD.js";
17
- import "./chunk-YVC3B72P.js";
18
- import "./chunk-ZJ3FVZRP.js";
19
- import "./chunk-CCE2JWES.js";
20
- import "./chunk-2NUD237O.js";
21
- import "./chunk-XFAYQFRO.js";
22
- import "./chunk-JYJAS4E3.js";
23
- import "./chunk-53JMTUWG.js";
24
- import "./chunk-IELNFM3V.js";
15
+ } from "./chunk-IZRITLVV.js";
16
+ import "./chunk-GL43VQ5D.js";
17
+ import "./chunk-WHG5WE43.js";
18
+ import "./chunk-UY6KMLQG.js";
19
+ import "./chunk-C7QZ4UBB.js";
20
+ import "./chunk-WHMXXHPX.js";
21
+ import {
22
+ getHostEnvironment
23
+ } from "./chunk-KDR2VAJP.js";
24
+ import "./chunk-TLK2MD4S.js";
25
+ import "./chunk-VFBQVY4X.js";
26
+ import "./chunk-56DBFNR2.js";
27
+ import "./chunk-YCOKTQ4E.js";
25
28
  export {
26
29
  browserSubmissionStore,
27
30
  cosmosChainList,
@@ -32,6 +35,7 @@ export {
32
35
  discoverSignInWallets,
33
36
  discoverSolanaWallets,
34
37
  evmSigner,
38
+ getHostEnvironment,
35
39
  signInOptions,
36
40
  solanaSigner,
37
41
  telegramMiniAppInitData,
@@ -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
  import {
2
2
  identifier
3
- } from "./chunk-IELNFM3V.js";
3
+ } from "./chunk-YCOKTQ4E.js";
4
4
 
5
5
  // src/auth.ts
6
6
  import * as z from "zod";