@domino-sdk/relay 1.11.1 → 1.15.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 (53) hide show
  1. package/README.md +1 -0
  2. package/build.mjs +15 -0
  3. package/dist/accounts-5ciAkCMP.d.ts +147 -0
  4. package/dist/{request-error-D_dUPLwo.d.ts → action-DBzILFx9.d.ts} +31 -1
  5. package/dist/attempt-captures-DHwIVoRP.d.ts +285 -0
  6. package/dist/authoring.d.ts +12 -10
  7. package/dist/authoring.js +6 -4
  8. package/dist/{automatic-outcomes-kPIDv6X_.d.ts → automatic-outcomes-BcEn_L46.d.ts} +1 -1
  9. package/dist/browser.d.ts +9 -9
  10. package/dist/browser.js +7 -6
  11. package/dist/capability-error-oTd3eYFH.d.ts +151 -0
  12. package/dist/chunk-2UAVZCMH.js +314 -0
  13. package/dist/{chunk-AGFUDCNM.js → chunk-3PPEXDWR.js} +1 -1
  14. package/dist/chunk-CHD6HHWG.js +485 -0
  15. package/dist/{chunk-T657WO56.js → chunk-LLMJ2SUT.js} +6 -2
  16. package/dist/chunk-NIYCAW2I.js +79 -0
  17. package/dist/{chunk-XK5E4HAS.js → chunk-PJXBW754.js} +80 -28
  18. package/dist/{chunk-PUDL4JBY.js → chunk-PUY35TH3.js} +2 -2
  19. package/dist/chunk-UJACD6K2.js +987 -0
  20. package/dist/chunk-W335CWYJ.js +53 -0
  21. package/dist/{chunk-X7ECZ3AK.js → chunk-XMBM2XD5.js} +1 -1
  22. package/dist/{chunk-2K2QBPAD.js → chunk-ZLYBUM7K.js} +6 -4
  23. package/dist/{client-fUSERMAC.d.ts → client-DFSCmf3H.d.ts} +27 -8
  24. package/dist/{activity-CNiPDPK6.d.ts → deployments-Ci6GyANg.d.ts} +15 -15
  25. package/dist/{groups-BK8ts2yK.d.ts → groups-Bi7lc54m.d.ts} +1 -1
  26. package/dist/{images-aw6W7vFZ.d.ts → images-Cb8QHGjn.d.ts} +1 -1
  27. package/dist/index.d.ts +10 -10
  28. package/dist/index.js +8 -6
  29. package/dist/{capability-error-ty3SqD_b.d.ts → integrations-Cr9EhGI_.d.ts} +1 -149
  30. package/dist/internal.d.ts +11 -4
  31. package/dist/internal.js +8 -3
  32. package/dist/{offers-C2FANzrG.d.ts → offers-Catj06u7.d.ts} +2 -2
  33. package/dist/{pages-Chb6OZSB.d.ts → pages-CpYt56Km.d.ts} +1 -1
  34. package/dist/{participant-activity-DkL3nY5a.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -0
  35. package/dist/portal-proxy.js +1 -1
  36. package/dist/react/index.d.ts +247 -179
  37. package/dist/react/index.js +954 -383
  38. package/dist/{schema-DEM8y8Fm.d.ts → schema-BaVl2VBS.d.ts} +1 -1
  39. package/dist/schema.d.ts +15 -13
  40. package/dist/schema.js +16 -14
  41. package/dist/server/index.d.ts +12 -70916
  42. package/dist/server/index.js +594 -841
  43. package/dist/{sign-in-options-iWOp9puZ.d.ts → sign-in-options-CU1ND6-y.d.ts} +2 -2
  44. package/dist/submission-input-Bi4HipqI.d.ts +146 -0
  45. package/dist/testing.d.ts +641 -0
  46. package/dist/testing.js +1282 -0
  47. package/dist/transport-0ttRwUat.d.ts +73361 -0
  48. package/package.json +6 -2
  49. package/dist/action-9Xl0StBg.d.ts +0 -33
  50. package/dist/chunk-OCXGG75K.js +0 -171
  51. package/dist/chunk-ZFABFKIY.js +0 -1295
  52. package/dist/referral-reward-kinds-M3f0PdiR.d.ts +0 -171
  53. package/dist/submission-input-BbBJTVlT.d.ts +0 -290
package/README.md CHANGED
@@ -17,6 +17,7 @@ pnpm add @domino-sdk/relay
17
17
  | `@domino-sdk/relay/build` | Bundling authored modules; needs `esbuild` installed |
18
18
  | `@domino-sdk/relay/portal-proxy` | Server proxies and hosted app Workers |
19
19
  | `@domino-sdk/relay/vite` | The Vite plugin that keeps server code out of the browser build |
20
+ | `@domino-sdk/relay/testing` | Unit-testing quests locally (`runQuest`); for test files only |
20
21
 
21
22
  `@domino-sdk/relay/internal` is shared by Relay's own services and Console. It is not a supported API and can change in any release.
22
23
 
package/build.mjs CHANGED
@@ -17,6 +17,20 @@ async function esbuild() {
17
17
  }
18
18
  }
19
19
 
20
+ /** The quest testing kit stays in tests: a quest bundle that imports it fails to build. */
21
+ const testsOnly = {
22
+ name: "domino:tests-only",
23
+ setup(build) {
24
+ build.onResolve({ filter: /^@domino-sdk\/relay\/testing$/ }, (args) => ({
25
+ errors: [
26
+ {
27
+ text: `Quest code cannot import @domino-sdk/relay/testing (imported by ${args.importer}). The testing kit runs quests in tests; import it from a test file instead.`,
28
+ },
29
+ ],
30
+ }))
31
+ },
32
+ }
33
+
20
34
  /** Bundle an authored quest without evaluating developer code in the build process. */
21
35
  export async function buildQuest(entry, options = {}) {
22
36
  if (
@@ -45,6 +59,7 @@ export async function buildQuest(entry, options = {}) {
45
59
  platform: "neutral",
46
60
  target: "es2022",
47
61
  minify: true,
62
+ plugins: [testsOnly],
48
63
  })
49
64
  const file = result.outputFiles[0]
50
65
 
@@ -0,0 +1,147 @@
1
+ import { z } from 'zod';
2
+
3
+ /** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
4
+ declare const discordMessageSchema: z.ZodObject<{
5
+ guildId: z.ZodString;
6
+ channelId: z.ZodString;
7
+ messageId: z.ZodString;
8
+ userId: z.ZodString;
9
+ content: z.ZodNullable<z.ZodString>;
10
+ replyTo: z.ZodNullable<z.ZodString>;
11
+ publishedAt: z.ZodNumber;
12
+ }, z.core.$strict>;
13
+ type DiscordMessage = z.infer<typeof discordMessageSchema>;
14
+ /**
15
+ * Messages posted in the project's Discord server, written by the Discord gateway. The record's
16
+ * `author` is the message author's Discord account. Message text is stored only with `text: true`.
17
+ * Edits update stored text. Deleting a message, or turning text off, removes retained text.
18
+ */
19
+ declare const discordMessagesSourceSchema: z.ZodObject<{
20
+ kind: z.ZodLiteral<"discord-messages">;
21
+ /** Store each message's text in `data.text`. Off unless set. */
22
+ text: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.core.$strict>;
24
+ /**
25
+ * Reactions added in the project's Discord server, written by the Discord gateway. The record's
26
+ * `author` is the reactor's Discord account and its `messageAuthor` account is the message's
27
+ * author, when Discord could name it.
28
+ */
29
+ declare const discordReactionsSourceSchema: z.ZodObject<{
30
+ kind: z.ZodLiteral<"discord-reactions">;
31
+ }, z.core.$strict>;
32
+ /** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
33
+ declare const discordMessageDataSchema: z.ZodObject<{
34
+ guildId: z.ZodString;
35
+ channelId: z.ZodString;
36
+ messageId: z.ZodString;
37
+ replyTo: z.ZodNullable<z.ZodString>;
38
+ publishedAt: z.ZodNumber;
39
+ }, z.core.$strip>;
40
+ type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
41
+ /**
42
+ * The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
43
+ * bot does not receive message content.
44
+ */
45
+ declare const discordMessageTextDataSchema: z.ZodObject<{
46
+ guildId: z.ZodString;
47
+ channelId: z.ZodString;
48
+ messageId: z.ZodString;
49
+ replyTo: z.ZodNullable<z.ZodString>;
50
+ publishedAt: z.ZodNumber;
51
+ text: z.ZodNullable<z.ZodString>;
52
+ }, z.core.$strip>;
53
+ type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
54
+ /** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
55
+ declare const discordReactionDataSchema: z.ZodObject<{
56
+ guildId: z.ZodString;
57
+ channelId: z.ZodString;
58
+ messageId: z.ZodString;
59
+ emoji: z.ZodObject<{
60
+ id: z.ZodNullable<z.ZodString>;
61
+ name: z.ZodString;
62
+ }, z.core.$strip>;
63
+ reactorRoles: z.ZodArray<z.ZodString>;
64
+ messagePublishedAt: z.ZodNumber;
65
+ }, z.core.$strip>;
66
+ type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
67
+ /** Rewards and resource selectors supported by the Discord integration. */
68
+ declare const discordRewardSchema: z.ZodObject<{
69
+ kind: z.ZodLiteral<"integration">;
70
+ provider: z.ZodLiteral<"discord">;
71
+ action: z.ZodLiteral<"grant-role">;
72
+ roleId: z.ZodString;
73
+ }, z.core.$strict>;
74
+ declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
75
+ provider: z.ZodLiteral<"discord">;
76
+ resource: z.ZodLiteral<"channel">;
77
+ types: z.ZodArray<z.ZodEnum<{
78
+ text: "text";
79
+ announcement: "announcement";
80
+ }>>;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ provider: z.ZodLiteral<"discord">;
83
+ resource: z.ZodLiteral<"role">;
84
+ assignable: z.ZodDefault<z.ZodBoolean>;
85
+ }, z.core.$strict>]>;
86
+
87
+ declare const authProviderSchema: z.ZodEnum<{
88
+ discord: "discord";
89
+ google: "google";
90
+ apple: "apple";
91
+ x: "x";
92
+ }>;
93
+ type AuthProvider = z.infer<typeof authProviderSchema>;
94
+ declare const accountConnectionSchema: z.ZodObject<{
95
+ provider: z.ZodEnum<{
96
+ discord: "discord";
97
+ google: "google";
98
+ apple: "apple";
99
+ x: "x";
100
+ }>;
101
+ configured: z.ZodBoolean;
102
+ status: z.ZodEnum<{
103
+ disconnected: "disconnected";
104
+ connected: "connected";
105
+ reconnect: "reconnect";
106
+ }>;
107
+ subject: z.ZodNullable<z.ZodString>;
108
+ revision: z.ZodNumber;
109
+ }, z.core.$strip>;
110
+ type AccountConnection = z.infer<typeof accountConnectionSchema>;
111
+ declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
112
+ declare const discordMessageInputSchema: z.ZodObject<{
113
+ channelId: z.ZodString;
114
+ messageId: z.ZodString;
115
+ }, z.core.$strict>;
116
+ declare const discordMemberSchema: z.ZodObject<{
117
+ userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
118
+ nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
119
+ displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
120
+ boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
121
+ roles: z.ZodArray<z.ZodString>;
122
+ joinedAt: z.ZodNullable<z.ZodString>;
123
+ pending: z.ZodBoolean;
124
+ }, z.core.$strip>;
125
+ type DiscordMember = z.infer<typeof discordMemberSchema>;
126
+ /**
127
+ * Reads the project's connected Discord server for the member's linked Discord account. The
128
+ * account and the integration are pinned at the attempt's first Discord read: later links and
129
+ * unlinks do not change the attempt. Provider failures, and an integration that is not ready,
130
+ * throw `CapabilityError` with code `"provider-unavailable"`.
131
+ */
132
+ interface DiscordReader {
133
+ /** The member's server membership; null when they are not in the server or have not linked Discord. */
134
+ member(): Promise<DiscordMember | null>;
135
+ /**
136
+ * A message in the connected server; null when it does not exist. The bot reads it, so the
137
+ * member needs no linked Discord account. A channel outside the connected server, or one the
138
+ * bot cannot see, throws
139
+ * `CapabilityError` with code `"author-error"`.
140
+ */
141
+ message(input: {
142
+ channelId: string;
143
+ messageId: string;
144
+ }): Promise<DiscordMessage | null>;
145
+ }
146
+
147
+ export { type AccountConnection as A, type DiscordMessageData as D, type AuthProvider as a, type DiscordMessageTextData as b, discordReactionsSourceSchema as c, discordMessagesSourceSchema as d, type DiscordReactionData as e, type DiscordReader as f, type DiscordMember as g, type DiscordMessage as h, accountConnectionSchema as i, authProviderSchema as j, discordMemberInputSchema as k, discordMemberSchema as l, discordMessageDataSchema as m, discordMessageInputSchema as n, discordMessageSchema as o, discordMessageTextDataSchema as p, discordReactionDataSchema as q, discordResourceSourceSchema as r, discordRewardSchema as s };
@@ -64,4 +64,34 @@ declare class RequestError extends Error {
64
64
  constructor(message: string, details: RequestErrorDetails);
65
65
  }
66
66
 
67
- export { RequestError as R, type RequestErrorDetails as a, type RequestErrorKind as b, type RequestRecovery as c, isRequestError as i };
67
+ /** SDK input convenience; the wire request always carries a key. */
68
+ type OptionalActionId<T> = T extends {
69
+ actionId: string;
70
+ } ? Omit<T, "actionId"> & {
71
+ actionId?: string;
72
+ } : never;
73
+ /** One logical write. Keep this object until its outcome is definite. */
74
+ type RelayAction<T> = {
75
+ /** The pending write's key, also available on its uncertain error as `operationId`. */
76
+ readonly actionId: string | undefined;
77
+ readonly busy: boolean;
78
+ readonly error: RequestError | undefined;
79
+ /**
80
+ * Starts a write with a generated key. While an uncertain write is pending, replays its saved
81
+ * callback instead of accepting a different write. Concurrent calls share one request.
82
+ * Put refreshes and other follow-up work outside the callback.
83
+ */
84
+ run(task: (actionId: string) => Promise<T>): Promise<T>;
85
+ /** Replays the exact pending callback and key, only when the error's recovery is `replay`. */
86
+ retry(): Promise<T>;
87
+ /** Acknowledge an authoritative, definite outcome after reconciliation. Refuses while busy. */
88
+ settle(): boolean;
89
+ };
90
+ /**
91
+ * Owns a mutation key across uncertain answers. A definite success or refusal ends the action;
92
+ * the next `run` gets a new key. `reconcile` failures stay pending and cannot be replayed.
93
+ * In-memory only: persist the key yourself if recovery must survive a reload or process restart.
94
+ */
95
+ declare function createRelayAction<T = unknown>(): RelayAction<T>;
96
+
97
+ export { type OptionalActionId as O, type RelayAction as R, RequestError as a, type RequestErrorDetails as b, type RequestErrorKind as c, type RequestRecovery as d, createRelayAction as e, isRequestError as i };
@@ -0,0 +1,285 @@
1
+ import { O as OpenIdentityKind } from './schema-BaVl2VBS.js';
2
+ import { z } from 'zod';
3
+
4
+ /** One capability call of the captured evaluation run, as Relay stored it. */
5
+ declare const capturedFactSchema: z.ZodObject<{
6
+ sequence: z.ZodNumber;
7
+ request: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
8
+ outcome: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
9
+ value: z.ZodJSONSchema;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ error: z.ZodObject<{
12
+ code: z.ZodString;
13
+ message: z.ZodString;
14
+ retryable: z.ZodBoolean;
15
+ }, z.core.$loose>;
16
+ }, z.core.$strip>]>>;
17
+ captured: z.ZodBoolean;
18
+ }, z.core.$strip>;
19
+ /** @compat output */
20
+ type CapturedFact = z.infer<typeof capturedFactSchema>;
21
+ /**
22
+ * Everything one evaluation run of a test-environment attempt read: the release's settings and
23
+ * rewards, the attempt's pinned input, clock, seed and calendar, and each capability call with its
24
+ * captured answer. `replayAttempt` from `@domino-sdk/relay/testing` evaluates quest code against
25
+ * it locally. Relay serves captures only from the test environment.
26
+ */
27
+ declare const attemptCaptureSchema: z.ZodObject<{
28
+ format: z.ZodLiteral<1>;
29
+ attempt: z.ZodString;
30
+ environment: z.ZodLiteral<"test">;
31
+ quest: z.ZodObject<{
32
+ id: z.ZodString;
33
+ key: z.ZodNullable<z.ZodString>;
34
+ }, z.core.$strip>;
35
+ release: z.ZodString;
36
+ evaluationRun: z.ZodNumber;
37
+ protocol: z.ZodNumber;
38
+ seed: z.ZodString;
39
+ now: z.ZodNumber;
40
+ context: z.ZodObject<{
41
+ settings: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodObject<{
42
+ id: z.ZodString;
43
+ prompt: z.ZodString;
44
+ choices: z.ZodArray<z.ZodObject<{
45
+ id: z.ZodString;
46
+ label: z.ZodString;
47
+ }, z.core.$strict>>;
48
+ correct: z.ZodString;
49
+ }, z.core.$strict>>]>>;
50
+ rewards: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
51
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
52
+ balance: z.ZodString;
53
+ amount: z.ZodNumber;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ kind: z.ZodLiteral<"tier">;
56
+ reward: z.ZodObject<{
57
+ id: z.ZodString;
58
+ title: z.ZodString;
59
+ tiers: z.ZodArray<z.ZodObject<{
60
+ id: z.ZodString;
61
+ title: z.ZodString;
62
+ }, z.core.$strict>>;
63
+ inventory: z.ZodObject<{
64
+ kind: z.ZodLiteral<"untracked">;
65
+ }, z.core.$strict>;
66
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
67
+ kind: z.ZodLiteral<"staff-handover">;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ kind: z.ZodLiteral<"automatic">;
70
+ }, z.core.$strict>], "kind">;
71
+ }, z.core.$strict>;
72
+ tier: z.ZodString;
73
+ }, z.core.$strict>, z.ZodObject<{
74
+ kind: z.ZodLiteral<"integration">;
75
+ provider: z.ZodLiteral<"discord">;
76
+ action: z.ZodLiteral<"grant-role">;
77
+ roleId: z.ZodString;
78
+ }, z.core.$strict>]>>;
79
+ humanReview: z.ZodBoolean;
80
+ integrations: z.ZodArray<z.ZodString>;
81
+ member: z.ZodString;
82
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
83
+ tracker: z.ZodNullable<z.ZodObject<{
84
+ tracker: z.ZodString;
85
+ key: z.ZodString;
86
+ beneficiary: z.ZodString;
87
+ record: z.ZodObject<{
88
+ id: z.ZodString;
89
+ source: z.ZodString;
90
+ occurredAt: z.ZodNumber;
91
+ observedAt: z.ZodNumber;
92
+ firstSeenAt: z.ZodNumber;
93
+ author: z.ZodNullable<z.ZodObject<{
94
+ id: z.ZodString;
95
+ verified: z.ZodNullable<z.ZodBoolean>;
96
+ kind: z.ZodOptional<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>;
97
+ }, z.core.$strip>>;
98
+ accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
99
+ kind: z.ZodOptional<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>;
100
+ id: z.ZodString;
101
+ }, z.core.$strip>>>;
102
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
103
+ removed: z.ZodBoolean;
104
+ }, z.core.$strip>;
105
+ content: z.ZodOptional<z.ZodObject<{
106
+ revision: z.ZodString;
107
+ observation: z.ZodString;
108
+ body: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
109
+ }, z.core.$strip>>;
110
+ attribution: z.ZodObject<{
111
+ member: z.ZodString;
112
+ capturedAt: z.ZodNumber;
113
+ account: z.ZodUnion<readonly [z.ZodObject<{
114
+ provider: z.ZodLiteral<"wallet">;
115
+ id: z.ZodString;
116
+ revision: z.ZodNumber;
117
+ linkedAt: z.ZodNullable<z.ZodNumber>;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ issuer: z.ZodString;
120
+ subject: z.ZodString;
121
+ revision: z.ZodNumber;
122
+ linkedAt: z.ZodNullable<z.ZodNumber>;
123
+ provider: z.ZodLiteral<"x">;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ issuer: z.ZodString;
126
+ subject: z.ZodString;
127
+ revision: z.ZodNumber;
128
+ linkedAt: z.ZodNullable<z.ZodNumber>;
129
+ provider: z.ZodLiteral<"discord">;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ provider: z.ZodLiteral<"member">;
132
+ id: z.ZodString;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ provider: z.ZodTemplateLiteral<`app:${string}`>;
135
+ subject: z.ZodString;
136
+ revision: z.ZodNumber;
137
+ linkedAt: z.ZodNullable<z.ZodNumber>;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ provider: z.ZodString;
140
+ }, z.core.$strip>]>;
141
+ }, z.core.$strip>;
142
+ enrolledAt: z.ZodOptional<z.ZodNumber>;
143
+ }, z.core.$strip>>;
144
+ eligibleAt: z.ZodNumber;
145
+ calendar: z.ZodObject<{
146
+ segments: z.ZodArray<z.ZodObject<{
147
+ effectiveAt: z.ZodNumber;
148
+ timeZone: z.ZodString;
149
+ }, z.core.$loose>>;
150
+ }, z.core.$strip>;
151
+ performance: z.ZodNullable<z.ZodObject<{
152
+ contentAttempt: z.ZodString;
153
+ observation: z.ZodString;
154
+ observedAt: z.ZodNumber;
155
+ metrics: z.ZodRecord<z.ZodString, z.ZodNumber>;
156
+ rewards: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
157
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
158
+ balance: z.ZodString;
159
+ amount: z.ZodNumber;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"tier">;
162
+ reward: z.ZodObject<{
163
+ id: z.ZodString;
164
+ title: z.ZodString;
165
+ tiers: z.ZodArray<z.ZodObject<{
166
+ id: z.ZodString;
167
+ title: z.ZodString;
168
+ }, z.core.$strict>>;
169
+ inventory: z.ZodObject<{
170
+ kind: z.ZodLiteral<"untracked">;
171
+ }, z.core.$strict>;
172
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
173
+ kind: z.ZodLiteral<"staff-handover">;
174
+ }, z.core.$strict>, z.ZodObject<{
175
+ kind: z.ZodLiteral<"automatic">;
176
+ }, z.core.$strict>], "kind">;
177
+ }, z.core.$strict>;
178
+ tier: z.ZodString;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ kind: z.ZodLiteral<"integration">;
181
+ provider: z.ZodLiteral<"discord">;
182
+ action: z.ZodLiteral<"grant-role">;
183
+ roleId: z.ZodString;
184
+ }, z.core.$strict>]>>;
185
+ }, z.core.$strict>>;
186
+ }, z.core.$strip>;
187
+ facts: z.ZodArray<z.ZodObject<{
188
+ sequence: z.ZodNumber;
189
+ request: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
190
+ outcome: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
191
+ value: z.ZodJSONSchema;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ error: z.ZodObject<{
194
+ code: z.ZodString;
195
+ message: z.ZodString;
196
+ retryable: z.ZodBoolean;
197
+ }, z.core.$loose>;
198
+ }, z.core.$strip>]>>;
199
+ captured: z.ZodBoolean;
200
+ }, z.core.$strip>>;
201
+ recorded: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
202
+ kind: z.ZodLiteral<"defer">;
203
+ reason: z.ZodString;
204
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
205
+ until: z.ZodOptional<z.ZodNumber>;
206
+ }, z.core.$strict>, z.ZodObject<{
207
+ current: z.ZodNumber;
208
+ target: z.ZodNumber;
209
+ reason: z.ZodString;
210
+ kind: z.ZodLiteral<"progress">;
211
+ }, z.core.$strict>, z.ZodObject<{
212
+ kind: z.ZodLiteral<"accept">;
213
+ rewards: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
214
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
215
+ balance: z.ZodString;
216
+ amount: z.ZodNumber;
217
+ }, z.core.$strict>, z.ZodObject<{
218
+ kind: z.ZodLiteral<"tier">;
219
+ reward: z.ZodObject<{
220
+ id: z.ZodString;
221
+ title: z.ZodString;
222
+ tiers: z.ZodArray<z.ZodObject<{
223
+ id: z.ZodString;
224
+ title: z.ZodString;
225
+ }, z.core.$strict>>;
226
+ inventory: z.ZodObject<{
227
+ kind: z.ZodLiteral<"untracked">;
228
+ }, z.core.$strict>;
229
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
230
+ kind: z.ZodLiteral<"staff-handover">;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ kind: z.ZodLiteral<"automatic">;
233
+ }, z.core.$strict>], "kind">;
234
+ }, z.core.$strict>;
235
+ tier: z.ZodString;
236
+ }, z.core.$strict>, z.ZodObject<{
237
+ kind: z.ZodLiteral<"integration">;
238
+ provider: z.ZodLiteral<"discord">;
239
+ action: z.ZodLiteral<"grant-role">;
240
+ roleId: z.ZodString;
241
+ }, z.core.$strict>]>>;
242
+ completionKey: z.ZodOptional<z.ZodString>;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ kind: z.ZodLiteral<"reject">;
245
+ reason: z.ZodString;
246
+ requestedReview: z.ZodOptional<z.ZodLiteral<true>>;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ kind: z.ZodLiteral<"review">;
249
+ reason: z.ZodString;
250
+ rewards: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
251
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
252
+ balance: z.ZodString;
253
+ amount: z.ZodNumber;
254
+ }, z.core.$strict>, z.ZodObject<{
255
+ kind: z.ZodLiteral<"tier">;
256
+ reward: z.ZodObject<{
257
+ id: z.ZodString;
258
+ title: z.ZodString;
259
+ tiers: z.ZodArray<z.ZodObject<{
260
+ id: z.ZodString;
261
+ title: z.ZodString;
262
+ }, z.core.$strict>>;
263
+ inventory: z.ZodObject<{
264
+ kind: z.ZodLiteral<"untracked">;
265
+ }, z.core.$strict>;
266
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
267
+ kind: z.ZodLiteral<"staff-handover">;
268
+ }, z.core.$strict>, z.ZodObject<{
269
+ kind: z.ZodLiteral<"automatic">;
270
+ }, z.core.$strict>], "kind">;
271
+ }, z.core.$strict>;
272
+ tier: z.ZodString;
273
+ }, z.core.$strict>, z.ZodObject<{
274
+ kind: z.ZodLiteral<"integration">;
275
+ provider: z.ZodLiteral<"discord">;
276
+ action: z.ZodLiteral<"grant-role">;
277
+ roleId: z.ZodString;
278
+ }, z.core.$strict>]>>>;
279
+ completionKey: z.ZodOptional<z.ZodString>;
280
+ }, z.core.$strict>], "kind">>;
281
+ }, z.core.$strip>;
282
+ /** @compat output */
283
+ type AttemptCapture = z.infer<typeof attemptCaptureSchema>;
284
+
285
+ export { type AttemptCapture as A, type CapturedFact as C, attemptCaptureSchema as a, capturedFactSchema as c };
@@ -1,16 +1,18 @@
1
- import { x as xContentBodySchema, I as IdentityKind, o as customSourceSchema, W as WithRecordData, p as WithContent, q as WithAccountRoles, r as QuestHandle, L as LedgerReference, G as GroupHandle, n as ResourceHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as xSearchSourceSchema, X as XTweet, F as XContentMetric, H as TrackerTriggerPolicy, J as Where, N as MemberIdentity, O as TrackerTriggerContext, U as TrackerReader, V as TextReviewInput, Y as TextResult, P as PhotoResult, Z as Decision, _ as rewardSchema, $ as TrackerTriggerMode, a0 as RoleOf, a1 as WhereSetting, a2 as ContentBody, a3 as ContentMetricName, a4 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a5 as TieredRewardDefinition } from './schema-DEM8y8Fm.js';
2
- export { a6 as LedgerSetting, a7 as TrackerDataSchema, a8 as TrackerPage, a9 as TrackerReadQuery, aa as trackerDataSchema, ab as trackerTriggerContextSchema } from './schema-DEM8y8Fm.js';
1
+ import { x as xContentBodySchema, I as IdentityKind, o as customSourceSchema, W as WithRecordData, p as WithContent, q as WithAccountRoles, r as QuestHandle, L as LedgerReference, G as GroupHandle, n as ResourceHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as xSearchSourceSchema, X as XTweet, F as XContentMetric, H as TrackerTriggerPolicy, J as Where, N as MemberIdentity, U as TrackerTriggerContext, V as TrackerReader, Y as TextReviewInput, Z as TextResult, P as PhotoResult, _ as Decision, $ as rewardSchema, a0 as TrackerTriggerMode, a1 as RoleOf, a2 as WhereSetting, a3 as ContentBody, a4 as ContentMetricName, a5 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a6 as TieredRewardDefinition } from './schema-BaVl2VBS.js';
2
+ export { a7 as LedgerSetting, a8 as TrackerDataSchema, a9 as TrackerPage, aa as TrackerReadQuery, ab as trackerDataSchema, ac as trackerTriggerContextSchema } from './schema-BaVl2VBS.js';
3
3
  import { z } from 'zod';
4
4
  export { z } from 'zod';
5
- import { E as EngagementBudget, r as leaderboardDefinitionSchema, q as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-BK8ts2yK.js';
6
- export { u as defineCampaign, v as defineGroup } from './groups-BK8ts2yK.js';
7
- import { d as discordMessagesSourceSchema, D as DiscordMessageData, e as DiscordMessageTextData, f as discordReactionsSourceSchema, g as DiscordReactionData, h as DiscordReader, P as Prerequisite, T as TextEvidence, U as UrlEvidence, b as TextOptions, c as UrlOptions } from './submission-input-BbBJTVlT.js';
8
- export { i as balanceAtLeast, j as completed, k as inGroup } from './submission-input-BbBJTVlT.js';
5
+ import { E as EngagementBudget, r as leaderboardDefinitionSchema, q as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-Bi7lc54m.js';
6
+ export { u as defineCampaign, v as defineGroup } from './groups-Bi7lc54m.js';
7
+ import { d as discordMessagesSourceSchema, D as DiscordMessageData, b as DiscordMessageTextData, c as discordReactionsSourceSchema, e as DiscordReactionData, f as DiscordReader } from './accounts-5ciAkCMP.js';
9
8
  import { Q as QuizContent, a as StreakPolicy } from './streaks-CWyq8Px5.js';
10
- import { R as ResourceSource, S as Setting, I as IntegrationModule, X as XReader, B as Budget, a as IntegerSettings } from './capability-error-ty3SqD_b.js';
11
- export { C as CapabilityError, b as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-ty3SqD_b.js';
12
- import { I as ImageReader } from './images-aw6W7vFZ.js';
13
- export { d as defineOffer } from './offers-C2FANzrG.js';
9
+ import { R as ResourceSource, S as Setting, I as IntegrationModule, B as Budget, a as IntegerSettings } from './integrations-Cr9EhGI_.js';
10
+ import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-Bi4HipqI.js';
11
+ export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-Bi4HipqI.js';
12
+ import { I as ImageReader } from './images-Cb8QHGjn.js';
13
+ import { X as XReader } from './capability-error-oTd3eYFH.js';
14
+ export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-oTd3eYFH.js';
15
+ export { d as defineOffer } from './offers-Catj06u7.js';
14
16
  import { h as WalletReader } from './wallet-CDyo-U4n.js';
15
17
  export { i as CosmosDenom, a as CosmosNetwork, E as EvmChainId, j as WalletBalance, k as WalletBalanceQuery, l as cosmosDenomSchema, m as cosmosNetworkSchema, n as isEvmChainId } from './wallet-CDyo-U4n.js';
16
18
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
package/dist/authoring.js CHANGED
@@ -12,17 +12,19 @@ import {
12
12
  validateQuestShape
13
13
  } from "./chunk-4OLQYRSA.js";
14
14
  import {
15
- cosmosDenomSchema,
16
- cosmosNetworkSchema,
17
15
  defineOffer,
18
16
  engagementDefinitionSchema,
19
17
  engagementScoreInputSchema,
20
18
  engagementScoreSchema,
21
- isEvmChainId,
22
19
  leaderboardAuthoringSchema,
23
20
  pointLedgerDeclarationSchema,
24
21
  referralAuthoringSchema
25
- } from "./chunk-ZFABFKIY.js";
22
+ } from "./chunk-UJACD6K2.js";
23
+ import {
24
+ cosmosDenomSchema,
25
+ cosmosNetworkSchema,
26
+ isEvmChainId
27
+ } from "./chunk-2UAVZCMH.js";
26
28
  import "./chunk-NPGENI7K.js";
27
29
  import {
28
30
  authoringKey,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { a as AttemptStatus } from './schema-DEM8y8Fm.js';
2
+ import { a as AttemptStatus } from './schema-BaVl2VBS.js';
3
3
 
4
4
  declare const collectionCodeSchema: z.ZodString;
5
5
  declare const collectionPassSchema: z.ZodObject<{
package/dist/browser.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { n as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-fUSERMAC.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, 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, w as walletStandardSolanaSigner } from './sign-in-options-iWOp9puZ.js';
3
- import './groups-BK8ts2yK.js';
1
+ import { n as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-DFSCmf3H.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, 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, w as walletStandardSolanaSigner } from './sign-in-options-CU1ND6-y.js';
3
+ import './groups-Bi7lc54m.js';
4
4
  import 'zod';
5
- import './schema-DEM8y8Fm.js';
6
- import './pages-Chb6OZSB.js';
7
- import './submission-input-BbBJTVlT.js';
8
- import './request-error-D_dUPLwo.js';
9
- import './participant-activity-DkL3nY5a.js';
10
- import './action-9Xl0StBg.js';
5
+ import './schema-BaVl2VBS.js';
6
+ import './pages-CpYt56Km.js';
7
+ import './submission-input-Bi4HipqI.js';
8
+ import './action-DBzILFx9.js';
9
+ import './participant-activity-DYdUUhw2.js';
10
+ import './accounts-5ciAkCMP.js';
11
11
  import './profiles-BHMVj0kM.js';
12
12
  import './wallet-CDyo-U4n.js';
13
13
 
package/dist/browser.js CHANGED
@@ -11,14 +11,15 @@ import {
11
11
  signInOptions,
12
12
  solanaSigner,
13
13
  walletStandardSolanaSigner
14
- } from "./chunk-PUDL4JBY.js";
15
- import "./chunk-XK5E4HAS.js";
16
- import "./chunk-X7ECZ3AK.js";
17
- import "./chunk-T657WO56.js";
18
- import "./chunk-ZFABFKIY.js";
14
+ } from "./chunk-PUY35TH3.js";
15
+ import "./chunk-PJXBW754.js";
16
+ import "./chunk-XMBM2XD5.js";
17
+ import "./chunk-LLMJ2SUT.js";
18
+ import "./chunk-UJACD6K2.js";
19
+ import "./chunk-2UAVZCMH.js";
19
20
  import "./chunk-6QJ3LADK.js";
20
21
  import "./chunk-NPGENI7K.js";
21
- import "./chunk-AGFUDCNM.js";
22
+ import "./chunk-3PPEXDWR.js";
22
23
  import "./chunk-PT5STHFH.js";
23
24
  import "./chunk-46C33ASD.js";
24
25
  export {