@domino-sdk/relay 1.61.0 → 1.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +276 -8
  2. package/README.md +3 -2
  3. package/dist/{schema-CZ6Rj0ZF.d.ts → accounts-nz3mzfRQ.d.ts} +3146 -1765
  4. package/dist/action-9Xl0StBg.d.ts +33 -0
  5. package/dist/{attempt-captures-DYnJVkfg.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
  6. package/dist/authoring.d.ts +171 -49
  7. package/dist/authoring.js +158 -49
  8. package/dist/{automatic-outcomes-If88LR9f.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +15 -1
  9. package/dist/avatar.d.ts +1 -1
  10. package/dist/browser.d.ts +15 -11
  11. package/dist/browser.js +18 -12
  12. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  13. package/dist/{pages-K7-KjSXw.d.ts → catalog-BaTOKpNw.d.ts} +56 -567
  14. package/dist/{chunk-XBV2CK2H.js → chunk-3RFP6GT5.js} +15 -3
  15. package/dist/{chunk-VURRFVNP.js → chunk-4GQW43UU.js} +239 -361
  16. package/dist/chunk-4NOFSGAL.js +320 -0
  17. package/dist/{chunk-24I4R732.js → chunk-5XLZ34PV.js} +34 -19
  18. package/dist/{chunk-L77O64I4.js → chunk-7X67QLPB.js} +43 -43
  19. package/dist/{chunk-RHBS5FJL.js → chunk-7Z4SZ6YM.js} +3 -3
  20. package/dist/{chunk-QEAS4ZGS.js → chunk-AQOL3SK5.js} +1 -1
  21. package/dist/chunk-EHUSD3O2.js +377 -0
  22. package/dist/chunk-FO2LCZTL.js +19 -0
  23. package/dist/{chunk-DYXDZFKA.js → chunk-FU5CGNTR.js} +166 -178
  24. package/dist/chunk-FWLQ5XCS.js +21 -0
  25. package/dist/chunk-GLH6MEI2.js +193 -0
  26. package/dist/chunk-ICXZZNPS.js +199 -0
  27. package/dist/{chunk-ZDJLPN4L.js → chunk-ID3BZXFZ.js} +2696 -2693
  28. package/dist/chunk-KP2MCX3R.js +587 -0
  29. package/dist/{chunk-SKGTNTLF.js → chunk-LZWXCBUB.js} +213 -297
  30. package/dist/chunk-MTKRIQEU.js +31 -0
  31. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  32. package/dist/{chunk-PPB7HALD.js → chunk-N4BDKS6Y.js} +27 -26
  33. package/dist/{chunk-5I54XBK2.js → chunk-N4LNEGQX.js} +2 -2
  34. package/dist/chunk-NQDEWJWE.js +554 -0
  35. package/dist/chunk-QR6HH4DI.js +508 -0
  36. package/dist/chunk-TLSQETTY.js +41 -0
  37. package/dist/{chunk-MHPKEVEW.js → chunk-U66GUVSG.js} +7 -2
  38. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  39. package/dist/chunk-UZ765UGH.js +18 -0
  40. package/dist/{chunk-7A4J67ZL.js → chunk-VWQGWGCH.js} +7 -7
  41. package/dist/chunk-W7YSMSGC.js +725 -0
  42. package/dist/{client-C51w7fMb.d.ts → client-DHmG7rn6.d.ts} +126 -93
  43. package/dist/{announcements-CHx3-HBw.d.ts → dashboards-CLemT6kj.d.ts} +14 -137
  44. package/dist/{deployments-kWoHFaqj.d.ts → deployments-DTULi7dF.d.ts} +450 -18
  45. package/dist/identity-integration-DOeNZaxF.d.ts +1271 -0
  46. package/dist/index.d.ts +13 -11
  47. package/dist/index.js +16 -11
  48. package/dist/internal.d.ts +29 -13
  49. package/dist/internal.js +57 -17
  50. package/dist/{integrations-B3y36OaB.d.ts → limits-kNzYdZ00.d.ts} +464 -53
  51. package/dist/{offers-BoV4ryUc.d.ts → offers-CYeN_I0Y.d.ts} +22 -4
  52. package/dist/{participant-activity-DHL8QYks.d.ts → participant-activity-D-Drp24G.d.ts} +16 -3
  53. package/dist/portal-proxy.d.ts +75 -2
  54. package/dist/portal-proxy.js +153 -25
  55. package/dist/react/index.d.ts +214 -27
  56. package/dist/react/index.js +196 -42
  57. package/dist/{action-DBzILFx9.d.ts → request-error-D_dUPLwo.d.ts} +1 -31
  58. package/dist/reward-deliveries-drp-x1G-.d.ts +782 -0
  59. package/dist/runtime/authoring.js +1 -1
  60. package/dist/runtime/chunks/UGDV5W4N.js +1 -0
  61. package/dist/runtime/manifest.json +3 -3
  62. package/dist/runtime/schema.js +1 -1
  63. package/dist/schema.d.ts +330 -31
  64. package/dist/schema.js +147 -91
  65. package/dist/server/index.d.ts +14 -12
  66. package/dist/server/index.js +6425 -6260
  67. package/dist/sign-in-providers-B1Q9eDRm.d.ts +44 -0
  68. package/dist/submission-input-DZCbjQUH.d.ts +343 -0
  69. package/dist/{telegram-browser-BUceZIGZ.d.ts → telegram-browser-NL0Asmsi.d.ts} +46 -6
  70. package/dist/telegram.d.ts +64 -0
  71. package/dist/telegram.js +23 -0
  72. package/dist/testing.d.ts +326 -27
  73. package/dist/testing.js +440 -90
  74. package/dist/tracker-data-esm3WG8R.d.ts +1881 -0
  75. package/dist/{transport-BrX9pIGN.d.ts → transport-Czht_irp.d.ts} +43483 -38512
  76. package/dist/{wallet-CIqFoxdm.d.ts → wallet-B7e06v4m.d.ts} +32 -9
  77. package/package.json +5 -1
  78. package/dist/accounts-DoabriBX.d.ts +0 -306
  79. package/dist/capability-error-DufwG3G0.d.ts +0 -159
  80. package/dist/chunk-3Y3L2F54.js +0 -982
  81. package/dist/chunk-DHXDBAJF.js +0 -544
  82. package/dist/chunk-EN3M5Z4J.js +0 -13
  83. package/dist/chunk-QNUHWK7R.js +0 -602
  84. package/dist/chunk-SE4PFJPT.js +0 -247
  85. package/dist/groups-CqcA2Ycs.d.ts +0 -2827
  86. package/dist/runtime/chunks/5QVFB4TU.js +0 -1
  87. package/dist/submission-input-C54Q8yAD.d.ts +0 -146
  88. package/dist/x-D1PGi8Sq.d.ts +0 -331
@@ -0,0 +1,33 @@
1
+ import { R as RequestError } from './request-error-D_dUPLwo.js';
2
+
3
+ /** SDK input convenience; the wire request always carries a key. */
4
+ type OptionalActionId<T> = T extends {
5
+ actionId: string;
6
+ } ? Omit<T, "actionId"> & {
7
+ actionId?: string;
8
+ } : never;
9
+ /** One logical write. Keep this object until its outcome is definite. */
10
+ type RelayAction<T> = {
11
+ /** The pending write's key, also available on its uncertain error as `operationId`. */
12
+ readonly actionId: string | undefined;
13
+ readonly busy: boolean;
14
+ readonly error: RequestError | undefined;
15
+ /**
16
+ * Starts a write with a generated key. While an uncertain write is pending, replays its saved
17
+ * callback instead of accepting a different write. Concurrent calls share one request.
18
+ * Put refreshes and other follow-up work outside the callback.
19
+ */
20
+ run(task: (actionId: string) => Promise<T>): Promise<T>;
21
+ /** Replays the exact pending callback and key, only when the error's recovery is `replay`. */
22
+ retry(): Promise<T>;
23
+ /** Acknowledge an authoritative, definite outcome after reconciliation. Refuses while busy. */
24
+ settle(): boolean;
25
+ };
26
+ /**
27
+ * Owns a mutation key across uncertain answers. A definite success or refusal ends the action;
28
+ * the next `run` gets a new key. `reconcile` failures stay pending and cannot be replayed.
29
+ * In-memory only: persist the key yourself if recovery must survive a reload or process restart.
30
+ */
31
+ declare function createRelayAction<T = unknown>(): RelayAction<T>;
32
+
33
+ export { type OptionalActionId as O, type RelayAction as R, createRelayAction as c };
@@ -1,4 +1,4 @@
1
- import { O as OpenIdentityKind } from './schema-CZ6Rj0ZF.js';
1
+ import { O as OpenIdentityKind } from './tracker-data-esm3WG8R.js';
2
2
  import * as z from 'zod';
3
3
 
4
4
  /** One capability call of the captured evaluation run, as Relay stored it. */
@@ -1,24 +1,21 @@
1
- import { B as xContentBodySchema, I as IdentityKind, C as customSourceSchema, W as WithRecordData, D as WithContent, F as WithAccountRoles, y as ResourceHandle, x as QuestHandle, L as LedgerReference, G as GroupHandle, H as pointLedgerDeclarationSchema, J as TrackerSource, N as trackerDefinitionSchema, U as Tracker, V as TrackerData, X as SourceRoles, Y as LedgerHandle, Z as TrackerDataSchema, _ as xSearchSourceSchema, $ as XTweet, a0 as XContentMetric, a1 as TrackerTriggerPolicy, a2 as Where, a3 as MemberIdentity, P as PointBalance, a4 as ReferralHandle, a5 as TrackerTriggerContext, a6 as TrackerReader, a7 as TextReviewInput, a8 as TextResult, z as PhotoResult, a9 as Decision, aa as rewardSchema, ab as TrackerTriggerMode, ac as RoleOf, ad as WhereSetting, ae as ContentBody, af as BadgeHandle, ag as ContentMetricName, ah as triggerSchema, k as QuestPresentation, l as QuestProfile, m as QuizEvidence, ai as TieredRewardDefinition } from './schema-CZ6Rj0ZF.js';
2
- export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-CZ6Rj0ZF.js';
3
- import { M as MemberCompletion, B as Budget, A as AuthorBudget } from './capability-error-DufwG3G0.js';
4
- export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-DufwG3G0.js';
5
- import { N as NftCollection, o as ContractCall, p as ContractEvent, S as SolanaProgram, q as WalletBalanceSourceQuery, r as WalletTransaction, s as WalletInstruction, e as ProfileReferral, t as WalletReader } from './wallet-CIqFoxdm.js';
6
- export { u as ContractCallParts, v as ContractCallReturnType, w as ContractEventInput, x as ContractEventParts, y as ContractFunction, z as CosmosDenom, a as CosmosNetwork, E as EvmChainId, B as NftCollectionParts, D as NftStandard, F as WalletBalance, G as WalletBalanceChange, H as WalletBalanceQuery, I as WalletBalanceSample, J as WalletCall, K as WalletCallArgument, M as WalletCallQuery, Q as WalletDelegations, R as WalletDelegationsQuery, T as WalletEventCondition, U as WalletEventValue, V as WalletEvents, X as WalletEventsQuery, Y as WalletNfts, Z as WalletNftsQuery, _ as WalletTransactions, $ as WalletTransactionsQuery, a0 as cosmosDenomSchema, a1 as cosmosNetworkSchema, a2 as isContractCall, a3 as isContractEvent, a4 as isEvmChainId, a5 as isNftCollection, a6 as isSolanaProgram, a7 as maxWalletEventLogs, a8 as maxWalletEventLookback, a9 as maxWalletTransactionLookback, aa as maxWalletTransactions, ab as parseContractCall, ac as parseContractEvent, ad as parseContractFunction, ae as parseNftCollection } from './wallet-CIqFoxdm.js';
1
+ import { _ as EngagementBudget, $ as leaderboardDefinitionSchema, Z as AuthoringIdentity, a0 as pointLedgerDeclarationSchema, a1 as referralAuthoringSchema, a2 as discordMessagesSourceSchema, a3 as DiscordMessageData, a4 as DiscordMessageTextData, a5 as discordReactionsSourceSchema, a6 as DiscordReactionData, a7 as KnownIntegrationModule, P as PointBalance, C as CampaignDefinition, a8 as TextReviewInput, a9 as TextResult, aa as PhotoResult, ab as DiscordReader, ac as Decision, ad as rewardSchema, ae as triggerSchema, af as IntegrationModule, D as QuestPresentation, d as AvailabilityWindow, F as QuestProfile, G as QuizEvidence, W as IntegrationModuleProvider, ag as TieredRewardDefinition } from './accounts-nz3mzfRQ.js';
2
+ export { ah as KnownIntegrationModuleProvider, ai as defineCampaign, aj as defineGroup } from './accounts-nz3mzfRQ.js';
3
+ import { x as xContentBodySchema, I as IdentityKind, j as customSourceSchema, W as WithRecordData, k as WithContent, l as WithAccountRoles, R as ResourceHandle, Q as QuestHandle, L as LedgerReference, G as GroupHandle, m as TrackerSource, n as trackerDefinitionSchema, o as Tracker, p as TrackerData, q as SourceRoles, r as LedgerHandle, i as TrackerDataSchema, u as xSearchSourceSchema, X as XTweet, v as XContentMetric, y as TrackerTriggerPolicy, z as Where, M as MemberIdentity, A as ReferralHandle, B as TrackerTriggerContext, C as TrackerReader, D as TrackerTriggerMode, E as RoleOf, F as WhereSetting, H as ContentBody, J as BadgeHandle, N as ContentMetricName } from './tracker-data-esm3WG8R.js';
4
+ export { P as LedgerSetting, U as TrackerPage, V as TrackerReadQuery, Y as trackerDataSchema, Z as trackerTriggerContextSchema } from './tracker-data-esm3WG8R.js';
5
+ import { R as ResourceSource, M as MemberCompletion, B as Budget, A as AuthorBudget, a as Announcement } from './capability-error-CuI_F7yM.js';
6
+ export { C as CapabilityError, b as CapabilityErrorCode, T as TikTokVideoBody, c as TikTokVideoMetric, Y as YouTubeShortBody, d as YouTubeShortMetric, e as capabilityErrorCodes } from './capability-error-CuI_F7yM.js';
7
+ import { N as NftCollection, p as ContractCall, q as ContractEvent, r as SolanaProgram, s as WalletBalanceSourceQuery, t as WalletTransaction, u as WalletInstruction, e as ProfileReferral, v as WalletReader } from './wallet-B7e06v4m.js';
8
+ export { w as ContractCallParts, x as ContractCallReturnType, y as ContractEventInput, z as ContractEventParts, B as ContractFunction, D as CosmosDenom, a as CosmosNetwork, E as EvmChainId, F as NftCollectionParts, G as NftStandard, H as WalletBalance, I as WalletBalanceChange, o as WalletBalanceQuery, J as WalletBalanceSample, K as WalletCall, M as WalletCallArgument, Q as WalletCallQuery, R as WalletDelegations, T as WalletDelegationsQuery, U as WalletEventCondition, V as WalletEventValue, X as WalletEvents, Y as WalletEventsQuery, Z as WalletNfts, _ as WalletNftsQuery, $ as WalletTransactions, a0 as WalletTransactionsQuery, a1 as cosmosDenomSchema, a2 as cosmosNetworkSchema, a3 as isContractCall, a4 as isContractEvent, a5 as isEvmChainId, a6 as isNftCollection, a7 as isSolanaProgram, a8 as maxWalletEventLogs, a9 as maxWalletEventLookback, aa as maxWalletTransactionLookback, ab as maxWalletTransactions, ac as parseContractCall, ad as parseContractEvent, ae as parseContractFunction, af as parseNftCollection } from './wallet-B7e06v4m.js';
7
9
  import * as z from 'zod';
8
10
  export { z } from 'zod';
9
- import { f as badgeDeclarationSchema, B as Badge } from './offers-BoV4ryUc.js';
10
- export { g as defineOffer } from './offers-BoV4ryUc.js';
11
- import { E as EngagementBudget, m as leaderboardDefinitionSchema, l as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-CqcA2Ycs.js';
12
- export { n as defineCampaign, o as defineGroup } from './groups-CqcA2Ycs.js';
13
- import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-DoabriBX.js';
14
- export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramMessageData, l as TelegramReactionData } from './accounts-DoabriBX.js';
11
+ import { g as badgeDeclarationSchema, h as OfferAuthoring, B as Badge } from './offers-CYeN_I0Y.js';
15
12
  import { a as StreakPolicy, Q as QuizContent } from './streaks-0YuipsUQ.js';
16
- import { R as ResourceSource, S as Setting, A as AmountSetting, B as BalanceChain, a as BoundSettings, b as Announcement } from './announcements-CHx3-HBw.js';
17
- export { D as DashboardInput, c as DashboardPanelInput, T as TikTokVideoBody, d as TikTokVideoMetric, Y as YouTubeShortBody, e as YouTubeShortMetric, f as defineDashboard } from './announcements-CHx3-HBw.js';
18
- import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-C54Q8yAD.js';
19
- export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-C54Q8yAD.js';
20
- import { I as ImageReader, X as XReader } from './x-D1PGi8Sq.js';
21
- import { I as IntegrationModule } from './integrations-B3y36OaB.js';
13
+ import { S as Setting, A as AmountSetting, B as BalanceChain, a as BoundSettings } from './dashboards-CLemT6kj.js';
14
+ export { D as DashboardInput, b as DashboardPanelInput, e as defineDashboard } from './dashboards-CLemT6kj.js';
15
+ import { e as TelegramReader, P as Prerequisite, b as TextEvidence, U as UrlEvidence, c as TextOptions, d as UrlOptions } from './submission-input-DZCbjQUH.js';
16
+ export { f as TelegramChatMember, g as TelegramChatMemberStatus, h as TelegramConnection, i as TelegramMessageData, j as TelegramReactionData, k as balanceAtLeast, l as completed, m as inGroup } from './submission-input-DZCbjQUH.js';
17
+ import { I as ImageReader, X as XReader } from './limits-kNzYdZ00.js';
18
+ export { L as Limits, l as limits } from './limits-kNzYdZ00.js';
22
19
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
23
20
 
24
21
  declare function defineBadge(input: z.input<typeof badgeDeclarationSchema>): {
@@ -110,6 +107,64 @@ declare const questCompleted: (quest: QuestHandle) => {
110
107
  kind: "quest";
111
108
  quest: QuestHandle;
112
109
  };
110
+ /**
111
+ * Define one points-priced offer for a tier reward. The reward title is used when no title is set.
112
+ * Badge and group rewards throw: only quests grant them.
113
+ */
114
+ declare function defineOffer(input: OfferAuthoring & AuthoringIdentity): {
115
+ title: string;
116
+ enabled: boolean;
117
+ limit: {
118
+ perMember: number;
119
+ };
120
+ reward: {
121
+ kind: "tier";
122
+ reward: {
123
+ id: string;
124
+ title: string;
125
+ tiers: {
126
+ id: string;
127
+ title: string;
128
+ }[];
129
+ inventory: {
130
+ kind: "untracked";
131
+ };
132
+ fulfillment: {
133
+ kind: "staff-handover";
134
+ } | {
135
+ kind: "automatic";
136
+ };
137
+ badge?: string | undefined;
138
+ group?: string | undefined;
139
+ };
140
+ tier: string;
141
+ };
142
+ price: {
143
+ kind: "points";
144
+ balance: string;
145
+ amount: number;
146
+ };
147
+ stock: number;
148
+ key: string;
149
+ requires?: ({
150
+ kind: "completion";
151
+ quest: string;
152
+ scope: "ever";
153
+ } | {
154
+ kind: "completion";
155
+ quest: string;
156
+ scope: "period";
157
+ period: "day" | "week" | "month";
158
+ } | {
159
+ kind: "balance";
160
+ balance: string;
161
+ minimum: number;
162
+ } | {
163
+ kind: "group";
164
+ group: string;
165
+ title: string;
166
+ })[] | undefined;
167
+ } & ResourceHandle<"offer">;
113
168
  type ReferralInput = z.input<typeof referralAuthoringSchema>;
114
169
  type ReferralBonus = NonNullable<ReferralInput["bonuses"]>[number];
115
170
  type ReferralMilestone = NonNullable<ReferralInput["milestones"]>[number];
@@ -257,6 +312,20 @@ declare function earned(options?: Omit<EarnedScore, "kind" | "quests"> & {
257
312
  kind: "earned";
258
313
  };
259
314
  type SettlementInput = NonNullable<LeaderboardInput["settle"]>;
315
+ /**
316
+ * Why `board`'s live standings order equal scores differently from its settlement, or null when
317
+ * they agree or it has no settlement. `ties` defaults to `"shared"` and is not taken from
318
+ * `settle.ties`, so a board that sets only `settle.ties: "earliest"` shows shared ranks live and
319
+ * pays first-to-reach. `defineLeaderboard` and `domino check` warn with it. Exported from `/authoring`, not `/schema`, to keep
320
+ * the schema entry's browser size down.
321
+ */
322
+ declare function leaderboardTiesWarning(board: {
323
+ key?: string;
324
+ ties?: string;
325
+ settle?: {
326
+ ties: string;
327
+ };
328
+ }): string | null;
260
329
  declare function defineLeaderboard(input: Omit<LeaderboardInput, "key" | "id" | "balance" | "group" | "score" | "settle"> & AuthoringIdentity & {
261
330
  ledger: LedgerReference;
262
331
  group?: GroupHandle;
@@ -312,6 +381,7 @@ declare function defineLeaderboard(input: Omit<LeaderboardInput, "key" | "id" |
312
381
  };
313
382
  };
314
383
  key: string;
384
+ ties?: "shared" | "earliest" | undefined;
315
385
  includeUnscored?: boolean | undefined;
316
386
  settle?: {
317
387
  at: "window-end";
@@ -721,12 +791,21 @@ declare const settings: {
721
791
  }, z.core.$strict>>;
722
792
  correct: z.ZodString;
723
793
  }, z.core.$strict>>>>;
794
+ /**
795
+ * Free text. With `secret: true`, operators set the value in Console and it never leaves Relay:
796
+ * management responses, `domino deploy` and Console withhold it, and the quest's code reads it as
797
+ * usual. A secret setting has no default, so it reads `""` until an operator sets it.
798
+ */
724
799
  text(options: Label & {
725
- default: string;
726
800
  minLength?: number;
727
801
  maxLength?: number;
728
802
  multiline?: boolean;
729
- }): Setting<"text", z.ZodDefault<z.ZodString>>;
803
+ } & ({
804
+ default: string;
805
+ secret?: false;
806
+ } | {
807
+ secret: true;
808
+ })): Setting<"text", z.ZodDefault<z.ZodString>>;
730
809
  /**
731
810
  * A Telegram chat the project connected, by its numeric ID: Console lists the connected chats
732
811
  * to choose from. Pass it to `ctx.telegram.member({ chat })`.
@@ -840,6 +919,10 @@ declare function invoked(tx: WalletTransaction, program: string): boolean;
840
919
  */
841
920
  declare function instruction(tx: WalletTransaction, name: string): WalletInstruction["args"] | null;
842
921
 
922
+ /**
923
+ * A reward that awards the member this badge. Quests grant it, and operators by hand; offers,
924
+ * leaderboard prizes and referral programs throw when given one.
925
+ */
843
926
  declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
844
927
  reward: {
845
928
  badge: string;
@@ -866,7 +949,8 @@ declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
866
949
  * A reward that adds the member to a group when the completion's rewards are delivered. Publishing
867
950
  * the quest creates the group, with no members, where it is missing; an archived group refuses.
868
951
  * Revoking the completion removes the membership unless an operator's add or another unrevoked
869
- * completion also backs it.
952
+ * completion also backs it. Only quests grant it; offers, leaderboard prizes and referral programs
953
+ * throw when given one.
870
954
  */
871
955
  declare const groupMembership: (group: GroupHandle) => {
872
956
  reward: {
@@ -967,10 +1051,11 @@ type TrackerTriggerInput<T extends Tracker = Tracker, W extends Where<TrackerDat
967
1051
  /** The tracker handle `defineTracker` returns. */
968
1052
  tracker: T;
969
1053
  /**
970
- * Which observations fire. `"new-record"`: each record's first observation (the default for X
971
- * and Discord trackers, where it means each newly collected post, message or reaction).
972
- * `"new-observation"`: each observation that becomes its record's current one (the default for
973
- * custom trackers). `"data-changed"`: a
1054
+ * Which observations fire. `"new-record"`: each record's first observation (the default for X,
1055
+ * Discord and Telegram trackers, where it means each newly collected post, message or reaction,
1056
+ * so a removed and re-added Telegram reaction does not fire again). `"new-observation"`: each
1057
+ * observation that becomes its record's current one (the default for other custom trackers,
1058
+ * YouTube and TikTok included, where every refresh observes each video again). `"data-changed"`: a
974
1059
  * new record, or a current observation whose `data` differs from the previous one.
975
1060
  */
976
1061
  on?: TrackerTriggerMode;
@@ -982,10 +1067,11 @@ type TrackerTriggerInput<T extends Tracker = Tracker, W extends Where<TrackerDat
982
1067
  */
983
1068
  where?: W;
984
1069
  /**
985
- * The record account whose member the quest pays: `"author"` (the default), `"inReplyTo"` on
986
- * an X tracker, `"messageAuthor"` on a Discord reactions tracker, or a named account a custom
987
- * source declares in `accounts`. Skipped when that account is the record's author account or
988
- * belongs to the author's member, such as a reaction to one's own message.
1070
+ * The record account whose member the quest pays: `"author"` (the default), `"inReplyTo"`,
1071
+ * `"quoted"` or `"reposted"` on an X tracker, `"messageAuthor"` on a Discord reactions tracker,
1072
+ * or a named account a custom source declares in `accounts`. Skipped when that account is the
1073
+ * record's author account or belongs to the author's member, such as a reaction to one's own
1074
+ * message.
989
1075
  */
990
1076
  beneficiary?: RoleOf<T>;
991
1077
  /**
@@ -1126,7 +1212,18 @@ declare const budget: {
1126
1212
  (definition: BudgetDefinition<Budget>): Budget;
1127
1213
  (definition: BudgetDefinition<AuthorBudget>): AuthorBudget;
1128
1214
  };
1129
- declare const keyed: (key: (ctx: KeyedContext) => string) => {
1215
+ /** Options of a `keyed(...)` completion. */
1216
+ type KeyedOptions = {
1217
+ /**
1218
+ * `"members"`: each key completes the quest once in the whole project and environment, for
1219
+ * whichever member uses it first, such as a single-use code or a post that pays once. Another
1220
+ * member's attempt with a used key is rejected with `key-used`. Without it, each member
1221
+ * completes the quest once per key.
1222
+ */
1223
+ across?: "members";
1224
+ };
1225
+ declare const keyed: (key: (ctx: KeyedContext) => string, options?: KeyedOptions) => {
1226
+ across?: "members" | undefined;
1130
1227
  kind: "keyed";
1131
1228
  key: (ctx: KeyedContext) => string;
1132
1229
  };
@@ -1136,7 +1233,12 @@ type ProgressDefinition<C> = {
1136
1233
  window?: ReturnType<typeof calendar>;
1137
1234
  repeat?: "once" | "repeat";
1138
1235
  };
1139
- /** Accepted evidence contributes once under its distinct key; Relay commits progress with rewards. */
1236
+ /**
1237
+ * A counter completion policy: accepted evidence contributes once under its distinct key, and
1238
+ * the quest completes when `goal` distinct actions fall in the window. Relay commits the count
1239
+ * with rewards. Not evaluator progress (`decision.progress`), which reports how far a member is
1240
+ * toward a target the evaluator measures and never counts toward a counter.
1241
+ */
1140
1242
  declare const progress: (definition: ProgressDefinition<KeyedContext>) => {
1141
1243
  distinct: (ctx: KeyedContext) => string;
1142
1244
  kind: "progress";
@@ -1358,13 +1460,19 @@ type EvaluationCalendar = {
1358
1460
  * the trigger that supplies them and null otherwise. `G` defaults to `any`, which
1359
1461
  * leaves them nullable and lets a shared evaluator, such as `evaluators.photo()`, fit every quest.
1360
1462
  */
1361
- type IntegrationReaders<D extends readonly IntegrationModule[]> = Pick<{
1463
+ /**
1464
+ * The declared modules this SDK has readers for. A module it does not know types no reader; an
1465
+ * array typed `IntegrationModule[]`, whose providers are not literals, types every known reader,
1466
+ * as before modules opened.
1467
+ */
1468
+ type KnownModules<D extends readonly IntegrationModule[]> = readonly (D[number] extends infer Module extends IntegrationModule ? Module extends KnownIntegrationModule ? Module : string extends Module["provider"] ? KnownIntegrationModule : never : never)[];
1469
+ type IntegrationReaders<D extends readonly KnownIntegrationModule[]> = Pick<{
1362
1470
  x: XReader;
1363
1471
  discord: DiscordReader;
1364
1472
  }, D[number]["provider"]>;
1365
1473
  type EvaluationContext<T, I = {
1366
1474
  photo: string;
1367
- }, G = any, D extends readonly IntegrationModule[] = readonly IntegrationModule[]> = {
1475
+ }, G = any, D extends readonly KnownIntegrationModule[] = readonly KnownIntegrationModule[]> = {
1368
1476
  settings: T;
1369
1477
  member: EvaluationMember;
1370
1478
  input: I;
@@ -1404,15 +1512,15 @@ type EvaluationContext<T, I = {
1404
1512
  };
1405
1513
  wallet: WalletReader;
1406
1514
  /**
1407
- * Telegram membership in the chats the project connected. It needs no `integrations` entry;
1408
- * Relay provides it to every quest from SDK 1.23.0 on, and it is absent from older runtimes and
1409
- * test contexts that do not supply it.
1515
+ * The member's linked Telegram account and their membership in the chats the project connected.
1516
+ * It needs no `integrations` entry; Relay provides it to every quest from SDK 1.23.0 on, and it
1517
+ * is absent from older runtimes and test contexts that do not supply it.
1410
1518
  */
1411
1519
  telegram?: TelegramReader;
1412
1520
  } & IntegrationReaders<D>;
1413
1521
  type Evaluator<T, I = {
1414
1522
  photo: string;
1415
- }, G = any, D extends readonly IntegrationModule[] = readonly []> = (ctx: EvaluationContext<T, I, G, D>) => Promise<Outcome>;
1523
+ }, G = any, D extends readonly KnownIntegrationModule[] = readonly []> = (ctx: EvaluationContext<T, I, G, D>) => Promise<Outcome>;
1416
1524
  declare const evaluators: {
1417
1525
  quiz(answerKey: QuizEvidence["answers"], options?: {
1418
1526
  minimumCorrect?: number;
@@ -1449,7 +1557,7 @@ type CompletionPolicy = ReturnType<typeof once> | ReturnType<typeof keyed> | Str
1449
1557
  /** The completion builders, with key callbacks reading quest `G`'s typed context. */
1450
1558
  type CompletionPolicies<S, G> = {
1451
1559
  once: typeof once;
1452
- keyed: (key: (ctx: QuestKeyedContext<S, G>) => string) => ReturnType<typeof keyed>;
1560
+ keyed: (key: (ctx: QuestKeyedContext<S, G>) => string, options?: KeyedOptions) => ReturnType<typeof keyed>;
1453
1561
  streak: typeof streak;
1454
1562
  progress: (definition: ProgressDefinition<QuestKeyedContext<S, G>>) => ReturnType<typeof progress>;
1455
1563
  };
@@ -1498,6 +1606,10 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1498
1606
  settings: z.core.$InferObjectOutput<T, {}>;
1499
1607
  }) => QuestPresentation) | undefined;
1500
1608
  trigger: G & NoInfer<IntegerSettingBounds<G, T>>;
1609
+ /**
1610
+ * The modules the quest uses: `discord` and `x` from this module enable their readers. A
1611
+ * module this SDK does not know, `{ provider }`, builds but types no reader.
1612
+ */
1501
1613
  integrations?: D | undefined;
1502
1614
  requires?: readonly Prerequisite[];
1503
1615
  campaign?: CampaignDefinition;
@@ -1587,7 +1699,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1587
1699
  })[] | ((ctx: {
1588
1700
  settings: z.core.$InferObjectOutput<T, {}>;
1589
1701
  }) => Announcement[]) | undefined;
1590
- evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
1702
+ evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<KnownModules<D>>> | undefined;
1591
1703
  /**
1592
1704
  * A content quest's performance stage: once content evaluation accepts an item, each later
1593
1705
  * complete and fresh sample of `metrics` (a subset of the tracker's declared metrics) gates the
@@ -1694,6 +1806,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1694
1806
  label: string;
1695
1807
  picker?: string | undefined;
1696
1808
  decimals?: number | undefined;
1809
+ secret?: true | undefined;
1697
1810
  description?: string | undefined;
1698
1811
  } | {
1699
1812
  kind: "integer";
@@ -1866,6 +1979,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1866
1979
  kind: "once";
1867
1980
  } | {
1868
1981
  kind: "keyed";
1982
+ across?: "members" | undefined;
1869
1983
  };
1870
1984
  visibility: "visible" | "hidden";
1871
1985
  profile: {
@@ -1880,6 +1994,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1880
1994
  balance: string;
1881
1995
  };
1882
1996
  }[];
1997
+ integrationModules?: IntegrationModuleProvider[] | undefined;
1883
1998
  announcements?: ({
1884
1999
  action: "post-message";
1885
2000
  text: string;
@@ -1962,12 +2077,12 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1962
2077
  };
1963
2078
  wallet: WalletReader;
1964
2079
  /**
1965
- * Telegram membership in the chats the project connected. It needs no `integrations` entry;
1966
- * Relay provides it to every quest from SDK 1.23.0 on, and it is absent from older runtimes and
1967
- * test contexts that do not supply it.
2080
+ * The member's linked Telegram account and their membership in the chats the project connected.
2081
+ * It needs no `integrations` entry; Relay provides it to every quest from SDK 1.23.0 on, and it
2082
+ * is absent from older runtimes and test contexts that do not supply it.
1968
2083
  */
1969
2084
  telegram?: TelegramReader;
1970
- } & IntegrationReaders<readonly IntegrationModule[]> & {
2085
+ } & IntegrationReaders<readonly KnownIntegrationModule[]> & {
1971
2086
  rewards: Reward[];
1972
2087
  humanReview: boolean;
1973
2088
  performance?: unknown;
@@ -1992,6 +2107,10 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1992
2107
  settings: z.core.$InferObjectOutput<T, {}>;
1993
2108
  }) => QuestPresentation) | undefined;
1994
2109
  trigger: G & NoInfer<IntegerSettingBounds<G, T>>;
2110
+ /**
2111
+ * The modules the quest uses: `discord` and `x` from this module enable their readers. A
2112
+ * module this SDK does not know, `{ provider }`, builds but types no reader.
2113
+ */
1995
2114
  integrations?: D | undefined;
1996
2115
  requires?: readonly Prerequisite[];
1997
2116
  campaign?: CampaignDefinition;
@@ -2081,7 +2200,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2081
2200
  })[] | ((ctx: {
2082
2201
  settings: z.core.$InferObjectOutput<T, {}>;
2083
2202
  }) => Announcement[]) | undefined;
2084
- evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
2203
+ evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<KnownModules<D>>> | undefined;
2085
2204
  /**
2086
2205
  * A content quest's performance stage: once content evaluation accepts an item, each later
2087
2206
  * complete and fresh sample of `metrics` (a subset of the tracker's declared metrics) gates the
@@ -2188,6 +2307,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2188
2307
  label: string;
2189
2308
  picker?: string | undefined;
2190
2309
  decimals?: number | undefined;
2310
+ secret?: true | undefined;
2191
2311
  description?: string | undefined;
2192
2312
  } | {
2193
2313
  kind: "integer";
@@ -2360,6 +2480,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2360
2480
  kind: "once";
2361
2481
  } | {
2362
2482
  kind: "keyed";
2483
+ across?: "members" | undefined;
2363
2484
  };
2364
2485
  visibility: "visible" | "hidden";
2365
2486
  profile: {
@@ -2374,6 +2495,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2374
2495
  balance: string;
2375
2496
  };
2376
2497
  }[];
2498
+ integrationModules?: IntegrationModuleProvider[] | undefined;
2377
2499
  announcements?: ({
2378
2500
  action: "post-message";
2379
2501
  text: string;
@@ -2456,12 +2578,12 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2456
2578
  };
2457
2579
  wallet: WalletReader;
2458
2580
  /**
2459
- * Telegram membership in the chats the project connected. It needs no `integrations` entry;
2460
- * Relay provides it to every quest from SDK 1.23.0 on, and it is absent from older runtimes and
2461
- * test contexts that do not supply it.
2581
+ * The member's linked Telegram account and their membership in the chats the project connected.
2582
+ * It needs no `integrations` entry; Relay provides it to every quest from SDK 1.23.0 on, and it
2583
+ * is absent from older runtimes and test contexts that do not supply it.
2462
2584
  */
2463
2585
  telegram?: TelegramReader;
2464
- } & IntegrationReaders<readonly IntegrationModule[]> & {
2586
+ } & IntegrationReaders<readonly KnownIntegrationModule[]> & {
2465
2587
  rewards: Reward[];
2466
2588
  humanReview: boolean;
2467
2589
  performance?: unknown;
@@ -2476,4 +2598,4 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2476
2598
  }): Promise<Decision>;
2477
2599
  } & ResourceHandle<"quest">;
2478
2600
 
2479
- export { AmountSetting, BalanceChain, ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, ContractCall, ContractEvent, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, type KeyedContext, LedgerHandle, LedgerReference, MemberCompletion, type MemberCompletionQuery, MemberIdentity, NftCollection, type Outcome, type PerformanceContext, type PerformanceOutcome, PointBalance, ProfileReferral, QuestHandle, type QuestKeyedContext, ReferralHandle, RoleOf, Setting, SolanaProgram, TelegramReader, Tracker, TrackerData, TrackerDataSchema, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletBalanceSourceQuery, WalletInstruction, WalletReader, WalletTransaction, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, groupMembership, instruction, invoked, keyed, manual, once, pointLedgers, points, progress, questCompleted, received, rolling, settings, spent, staffHandover, streak, swapped, telegram, tiktok, untracked, wallet, x, youtube };
2601
+ export { AmountSetting, BalanceChain, ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, ContractCall, ContractEvent, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, IntegrationModuleProvider, type KeyedContext, type KeyedOptions, KnownIntegrationModule, LedgerHandle, LedgerReference, MemberCompletion, type MemberCompletionQuery, MemberIdentity, NftCollection, type Outcome, type PerformanceContext, type PerformanceOutcome, PointBalance, ProfileReferral, QuestHandle, type QuestKeyedContext, ReferralHandle, RoleOf, Setting, SolanaProgram, TelegramReader, Tracker, TrackerData, TrackerDataSchema, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletBalanceSourceQuery, WalletInstruction, WalletReader, WalletTransaction, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineOffer, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, groupMembership, instruction, invoked, keyed, leaderboardTiesWarning, manual, once, pointLedgers, points, progress, questCompleted, received, rolling, settings, spent, staffHandover, streak, swapped, telegram, tiktok, untracked, wallet, x, youtube };