@domino-sdk/relay 1.9.0 → 1.10.1

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 (44) hide show
  1. package/dist/{activity-CCe1e_7a.d.ts → activity-C0O3g7VJ.d.ts} +115 -115
  2. package/dist/authoring.d.ts +49 -49
  3. package/dist/authoring.js +3 -3
  4. package/dist/{automatic-outcomes-Dyk0VTUs.d.ts → automatic-outcomes-kPIDv6X_.d.ts} +1 -1
  5. package/dist/avatar.d.ts +2 -2
  6. package/dist/browser.d.ts +8 -8
  7. package/dist/browser.js +8 -7
  8. package/dist/{capability-error-Bv996M-h.d.ts → capability-error-ty3SqD_b.d.ts} +1 -1
  9. package/dist/chunk-2M3HLQFP.js +13 -0
  10. package/dist/{chunk-KGJSKGKI.js → chunk-5WK4EB5I.js} +1120 -910
  11. package/dist/{chunk-5ECM6AWV.js → chunk-A2KXEGGD.js} +3 -3
  12. package/dist/{chunk-L3QFIRGO.js → chunk-FH7ZFHDB.js} +2 -2
  13. package/dist/{chunk-FWSSMSIA.js → chunk-MDN5EJY2.js} +37 -8
  14. package/dist/{chunk-2V74CHDL.js → chunk-MJMFGTVV.js} +52 -37
  15. package/dist/{chunk-2N464DDE.js → chunk-NM2ZAWTF.js} +48 -37
  16. package/dist/{chunk-ETPL6AAJ.js → chunk-PFKV2M4B.js} +1 -1
  17. package/dist/{chunk-6ON4RMEN.js → chunk-PRLGLZM4.js} +1 -1
  18. package/dist/{chunk-JW4G3SY5.js → chunk-S4IHOJEP.js} +60 -47
  19. package/dist/{chunk-23QJ7WH4.js → chunk-WZJQ7XAT.js} +1 -1
  20. package/dist/{chunk-734LYHWP.js → chunk-XMZNIFXH.js} +232 -7
  21. package/dist/{client-CbASImpi.d.ts → client-Yq11HA_f.d.ts} +26 -11
  22. package/dist/{groups-Dvmd4CYk.d.ts → groups-BK8ts2yK.d.ts} +94 -6
  23. package/dist/{images-Dekv3DYF.d.ts → images-aw6W7vFZ.d.ts} +2 -2
  24. package/dist/index.d.ts +9 -9
  25. package/dist/index.js +7 -6
  26. package/dist/internal.d.ts +3 -3
  27. package/dist/internal.js +5 -5
  28. package/dist/{offers-BEGVSOTD.d.ts → offers-C2FANzrG.d.ts} +3 -3
  29. package/dist/{pages-HmS6eedC.d.ts → pages-D00JDZB-.d.ts} +33 -2
  30. package/dist/portal-proxy.js +8 -2
  31. package/dist/react/index.d.ts +14 -17
  32. package/dist/react/index.js +8 -7
  33. package/dist/{referral-reward-kinds-Flbb1D2q.d.ts → referral-reward-kinds-M3f0PdiR.d.ts} +2 -2
  34. package/dist/{schema-BCuiO7eD.d.ts → schema-DEM8y8Fm.d.ts} +1 -1
  35. package/dist/schema.d.ts +11239 -13
  36. package/dist/schema.js +38 -6
  37. package/dist/server/index.d.ts +43117 -22
  38. package/dist/server/index.js +303 -14
  39. package/dist/{sign-in-options-z3wsfizk.d.ts → sign-in-options-Coim0G1u.d.ts} +3 -3
  40. package/dist/{submission-input-Bs14jIsu.d.ts → submission-input-BbBJTVlT.d.ts} +3 -3
  41. package/dist/util.d-w9f9t3ua.d.ts +5 -0
  42. package/dist/{wallet-YssWxGg8.d.ts → wallet-CDyo-U4n.d.ts} +1 -1
  43. package/package.json +1 -1
  44. package/dist/{profiles-D2aFcOxu.d.ts → profiles-BHMVj0kM.d.ts} +5 -5
@@ -1,114 +1,313 @@
1
- // src/pages.ts
1
+ // src/response.ts
2
2
  import { z } from "zod";
3
- var pageCursorSchema = z.string().min(1).max(4096);
4
- var pageQuerySchema = z.strictObject({
3
+ var responseFormat = /* @__PURE__ */ Symbol("domino.response.tolerant-v1");
4
+ function markResponseSchema(schema) {
5
+ return Object.assign(schema, { [responseFormat]: true });
6
+ }
7
+ var shapes = /* @__PURE__ */ new WeakMap();
8
+ function responseShape(schema) {
9
+ const existing = shapes.get(schema);
10
+ if (existing) {
11
+ return existing;
12
+ }
13
+ const definition = { ...schema._zod.def };
14
+ if (schema instanceof z.ZodObject) {
15
+ Object.assign(definition, {
16
+ shape: Object.fromEntries(
17
+ Object.entries(schema.shape).map(([key, child]) => [
18
+ key,
19
+ responseShape(child)
20
+ ])
21
+ ),
22
+ catchall: schema._zod.def.catchall instanceof z.ZodNever || !schema._zod.def.catchall ? void 0 : responseShape(schema._zod.def.catchall)
23
+ });
24
+ } else if (schema instanceof z.ZodNumber) {
25
+ Object.assign(definition, {
26
+ checks: schema._zod.def.checks?.filter((check) => {
27
+ const rule = check._zod.def;
28
+ return rule.check !== "less_than" || !("value" in rule) || rule.value === Number.MAX_SAFE_INTEGER || rule.value === 864e13;
29
+ })
30
+ });
31
+ } else if (schema instanceof z.ZodArray) {
32
+ Object.assign(definition, {
33
+ element: responseShape(schema.element),
34
+ checks: []
35
+ });
36
+ } else if (schema instanceof z.ZodUnion) {
37
+ Object.assign(definition, { options: schema.options.map(responseShape) });
38
+ } else if (schema instanceof z.ZodTuple) {
39
+ Object.assign(definition, {
40
+ items: schema._zod.def.items.map(responseShape),
41
+ rest: schema._zod.def.rest ? responseShape(schema._zod.def.rest) : null
42
+ });
43
+ } else if (schema instanceof z.ZodIntersection) {
44
+ Object.assign(definition, {
45
+ left: responseShape(schema._zod.def.left),
46
+ right: responseShape(schema._zod.def.right)
47
+ });
48
+ } else if (schema instanceof z.ZodLazy) {
49
+ Object.assign(definition, {
50
+ getter: () => responseShape(schema._zod.def.getter())
51
+ });
52
+ } else if (schema instanceof z.ZodRecord) {
53
+ Object.assign(definition, { valueType: responseShape(schema.valueType) });
54
+ } else if (schema instanceof z.ZodPipe) {
55
+ Object.assign(definition, {
56
+ in: responseShape(schema.in),
57
+ out: responseShape(schema.out)
58
+ });
59
+ } else if ("innerType" in definition && definition.innerType instanceof z.ZodType) {
60
+ Object.assign(definition, {
61
+ innerType: responseShape(definition.innerType)
62
+ });
63
+ }
64
+ const reader = z.clone(schema, definition);
65
+ shapes.set(schema, reader);
66
+ shapes.set(reader, reader);
67
+ return reader;
68
+ }
69
+ function knownResponse(schema) {
70
+ return responseShape(schema);
71
+ }
72
+ function fields(schema) {
73
+ if (schema instanceof z.ZodObject) {
74
+ return schema.shape;
75
+ }
76
+ if ("innerType" in schema._zod.def && schema._zod.def.innerType instanceof z.ZodType) {
77
+ return fields(schema._zod.def.innerType);
78
+ }
79
+ return void 0;
80
+ }
81
+ function values(schema) {
82
+ if (schema instanceof z.ZodLiteral) {
83
+ return [...schema.values];
84
+ }
85
+ if (schema instanceof z.ZodEnum) {
86
+ return schema.options;
87
+ }
88
+ if ("innerType" in schema._zod.def && schema._zod.def.innerType instanceof z.ZodType) {
89
+ return values(schema._zod.def.innerType);
90
+ }
91
+ return void 0;
92
+ }
93
+ function unknownVariant(schema, input) {
94
+ if (schema instanceof z.ZodLiteral) {
95
+ return typeof input === "string" && [...schema.values].every((value) => typeof value === "string") && !schema.values.has(input);
96
+ }
97
+ if (schema instanceof z.ZodEnum) {
98
+ return typeof input === "string" && !schema.options.includes(input);
99
+ }
100
+ if (schema instanceof z.ZodArray && Array.isArray(input)) {
101
+ return input.some((item) => unknownVariant(schema.element, item));
102
+ }
103
+ if (schema instanceof z.ZodTuple && Array.isArray(input)) {
104
+ return input.some((item, index) => {
105
+ const child = schema._zod.def.items[index] ?? schema._zod.def.rest;
106
+ return child ? unknownVariant(child, item) : false;
107
+ });
108
+ }
109
+ if (schema instanceof z.ZodIntersection) {
110
+ return unknownVariant(schema._zod.def.left, input) || unknownVariant(schema._zod.def.right, input);
111
+ }
112
+ if (schema instanceof z.ZodLazy) {
113
+ return unknownVariant(schema._zod.def.getter(), input);
114
+ }
115
+ if (schema instanceof z.ZodRecord && input !== null && typeof input === "object" && !Array.isArray(input)) {
116
+ return Object.entries(input).some(
117
+ ([key, value]) => unknownVariant(schema.keyType, key) || unknownVariant(schema.valueType, value)
118
+ );
119
+ }
120
+ if (schema instanceof z.ZodUnion) {
121
+ let options = [...schema.options];
122
+ if (typeof input === "string") {
123
+ const choices = options.flatMap((option) => values(option) ?? []);
124
+ if (choices.some((choice) => typeof choice === "string") && !choices.includes(input)) {
125
+ return true;
126
+ }
127
+ }
128
+ if (input !== null && typeof input === "object" && !Array.isArray(input)) {
129
+ const raw = z.record(z.string(), z.unknown()).parse(input);
130
+ const keys = ["kind", "status", "provider", "input", "type", "mode"];
131
+ for (const key of keys) {
132
+ if (typeof raw[key] !== "string") {
133
+ continue;
134
+ }
135
+ const choices = options.map((option) => {
136
+ const field = fields(option)?.[key];
137
+ return field ? values(field) : void 0;
138
+ });
139
+ if (choices.some((choice) => !choice)) {
140
+ continue;
141
+ }
142
+ const matching = options.filter(
143
+ (_, index) => choices[index]?.includes(raw[key])
144
+ );
145
+ if (!matching.length) {
146
+ return true;
147
+ }
148
+ options = matching;
149
+ }
150
+ }
151
+ return options.every((option) => unknownVariant(option, input));
152
+ }
153
+ if (schema instanceof z.ZodObject && input !== null && typeof input === "object" && !Array.isArray(input)) {
154
+ const raw = z.record(z.string(), z.unknown()).parse(input);
155
+ return Object.entries(schema.shape).some(
156
+ ([key, child]) => unknownVariant(child, raw[key])
157
+ ) || Object.entries(raw).some(
158
+ ([key, value]) => !(key in schema.shape) && !!schema._zod.def.catchall && unknownVariant(schema._zod.def.catchall, value)
159
+ );
160
+ }
161
+ if (schema instanceof z.ZodPipe) {
162
+ if (unknownVariant(schema.in, input)) {
163
+ return true;
164
+ }
165
+ const intermediate = z.safeParse(schema.in, input);
166
+ return intermediate.success && unknownVariant(schema.out, intermediate.data);
167
+ }
168
+ if ("innerType" in schema._zod.def && schema._zod.def.innerType instanceof z.ZodType) {
169
+ return unknownVariant(schema._zod.def.innerType, input);
170
+ }
171
+ return false;
172
+ }
173
+ function responseSchema(schema) {
174
+ const reader = knownResponse(schema);
175
+ return markResponseSchema(
176
+ z.json().transform((raw, context) => {
177
+ const parsed = reader.safeParse(raw);
178
+ if (parsed.success) {
179
+ return { kind: "supported", value: parsed.data };
180
+ }
181
+ if (unknownVariant(reader, raw)) {
182
+ return { kind: "unsupported", raw };
183
+ }
184
+ for (const issue of parsed.error.issues) {
185
+ context.addIssue({ ...issue });
186
+ }
187
+ return z.NEVER;
188
+ })
189
+ );
190
+ }
191
+ function responseListSchema(schema) {
192
+ return markResponseSchema(
193
+ z.array(responseSchema(schema)).transform((items) => ({
194
+ items,
195
+ unsupportedCount: items.filter((item) => item.kind === "unsupported").length
196
+ }))
197
+ );
198
+ }
199
+
200
+ // src/pages.ts
201
+ import { z as z2 } from "zod";
202
+ var pageCursorSchema = z2.string().min(1).max(4096);
203
+ var pageQuerySchema = z2.strictObject({
5
204
  cursor: pageCursorSchema.optional()
6
205
  });
7
206
 
8
207
  // src/accounts.ts
9
- import { z as z2 } from "zod";
10
- var authProviderSchema = z2.enum(["google", "apple", "x", "discord"]);
11
- var accountConnectionSchema = z2.object({
208
+ import { z as z3 } from "zod";
209
+ var authProviderSchema = z3.enum(["google", "apple", "x", "discord"]);
210
+ var accountConnectionSchema = z3.object({
12
211
  provider: authProviderSchema,
13
- configured: z2.boolean(),
14
- status: z2.enum(["disconnected", "connected", "reconnect"]),
15
- subject: z2.string().nullable(),
16
- revision: z2.number().int().nonnegative()
17
- });
18
- var discordMemberInputSchema = z2.object({}).strict();
19
- var discordMessageInputSchema = z2.object({
20
- channelId: z2.string().regex(/^[0-9]{1,20}$/),
21
- messageId: z2.string().regex(/^[0-9]{1,20}$/)
212
+ configured: z3.boolean(),
213
+ status: z3.enum(["disconnected", "connected", "reconnect"]),
214
+ subject: z3.string().nullable(),
215
+ revision: z3.number().int().nonnegative()
216
+ });
217
+ var discordMemberInputSchema = z3.object({}).strict();
218
+ var discordMessageInputSchema = z3.object({
219
+ channelId: z3.string().regex(/^[0-9]{1,20}$/),
220
+ messageId: z3.string().regex(/^[0-9]{1,20}$/)
22
221
  }).strict();
23
- var discordMemberSchema = z2.object({
24
- userId: z2.string().regex(/^[0-9]{1,20}$/).nullable().default(null),
25
- nickname: z2.string().nullable().default(null),
26
- displayName: z2.string().nullable().default(null),
27
- boostingSince: z2.string().datetime({ offset: true }).nullable().default(null),
28
- roles: z2.array(z2.string().regex(/^[0-9]{1,20}$/)),
29
- joinedAt: z2.string().datetime({ offset: true }).nullable(),
30
- pending: z2.boolean()
222
+ var discordMemberSchema = z3.object({
223
+ userId: z3.string().regex(/^[0-9]{1,20}$/).nullable().default(null),
224
+ nickname: z3.string().nullable().default(null),
225
+ displayName: z3.string().nullable().default(null),
226
+ boostingSince: z3.string().datetime({ offset: true }).nullable().default(null),
227
+ roles: z3.array(z3.string().regex(/^[0-9]{1,20}$/)),
228
+ joinedAt: z3.string().datetime({ offset: true }).nullable(),
229
+ pending: z3.boolean()
31
230
  });
32
231
 
33
232
  // src/identifier.ts
34
- import { z as z3 } from "zod";
35
- var identifier = z3.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/);
233
+ import { z as z4 } from "zod";
234
+ var identifier = z4.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/);
36
235
 
37
236
  // src/discord.ts
38
- import { z as z4 } from "zod";
39
- var discordMessageSchema = z4.object({
40
- guildId: z4.string(),
41
- channelId: z4.string(),
42
- messageId: z4.string(),
43
- userId: z4.string(),
44
- content: z4.string().nullable(),
45
- replyTo: z4.string().nullable(),
46
- publishedAt: z4.number()
237
+ import { z as z5 } from "zod";
238
+ var discordMessageSchema = z5.object({
239
+ guildId: z5.string(),
240
+ channelId: z5.string(),
241
+ messageId: z5.string(),
242
+ userId: z5.string(),
243
+ content: z5.string().nullable(),
244
+ replyTo: z5.string().nullable(),
245
+ publishedAt: z5.number()
47
246
  }).strict();
48
- var discordMessagesSourceSchema = z4.strictObject({
49
- kind: z4.literal("discord-messages"),
247
+ var discordMessagesSourceSchema = z5.strictObject({
248
+ kind: z5.literal("discord-messages"),
50
249
  /** Store each message's text in `data.text`. Off unless set. */
51
- text: z4.boolean().optional()
250
+ text: z5.boolean().optional()
52
251
  });
53
- var discordReactionsSourceSchema = z4.strictObject({
54
- kind: z4.literal("discord-reactions")
252
+ var discordReactionsSourceSchema = z5.strictObject({
253
+ kind: z5.literal("discord-reactions")
55
254
  });
56
- var discordMessageDataSchema = z4.object({
57
- guildId: z4.string(),
58
- channelId: z4.string(),
59
- messageId: z4.string(),
255
+ var discordMessageDataSchema = z5.object({
256
+ guildId: z5.string(),
257
+ channelId: z5.string(),
258
+ messageId: z5.string(),
60
259
  /** The ID of the message this one replies to, or null. */
61
- replyTo: z4.string().nullable(),
260
+ replyTo: z5.string().nullable(),
62
261
  /** When Discord says the message was posted, in epoch milliseconds. */
63
- publishedAt: z4.number()
262
+ publishedAt: z5.number()
64
263
  });
65
264
  var discordMessageTextDataSchema = discordMessageDataSchema.extend({
66
- text: z4.string().nullable()
265
+ text: z5.string().nullable()
67
266
  });
68
- var discordReactionDataSchema = z4.object({
69
- guildId: z4.string(),
70
- channelId: z4.string(),
267
+ var discordReactionDataSchema = z5.object({
268
+ guildId: z5.string(),
269
+ channelId: z5.string(),
71
270
  /** The message reacted to. */
72
- messageId: z4.string(),
271
+ messageId: z5.string(),
73
272
  /** A custom emoji's ID, or null for a Unicode emoji, whose `name` is the emoji itself. */
74
- emoji: z4.object({ id: z4.string().nullable(), name: z4.string() }),
273
+ emoji: z5.object({ id: z5.string().nullable(), name: z5.string() }),
75
274
  /** The role IDs the reactor held in the server when reacting. */
76
- reactorRoles: z4.array(z4.string()),
275
+ reactorRoles: z5.array(z5.string()),
77
276
  /** When the reacted-to message was posted, in epoch milliseconds. */
78
- messagePublishedAt: z4.number()
79
- });
80
- var discordRewardSchema = z4.strictObject({
81
- kind: z4.literal("integration"),
82
- provider: z4.literal("discord"),
83
- action: z4.literal("grant-role"),
84
- roleId: z4.string().regex(/^[0-9]{1,20}$/)
85
- });
86
- var discordResourceSourceSchema = z4.union([
87
- z4.strictObject({
88
- provider: z4.literal("discord"),
89
- resource: z4.literal("channel"),
90
- types: z4.array(z4.enum(["text", "announcement"])).min(1)
277
+ messagePublishedAt: z5.number()
278
+ });
279
+ var discordRewardSchema = z5.strictObject({
280
+ kind: z5.literal("integration"),
281
+ provider: z5.literal("discord"),
282
+ action: z5.literal("grant-role"),
283
+ roleId: z5.string().regex(/^[0-9]{1,20}$/)
284
+ });
285
+ var discordResourceSourceSchema = z5.union([
286
+ z5.strictObject({
287
+ provider: z5.literal("discord"),
288
+ resource: z5.literal("channel"),
289
+ types: z5.array(z5.enum(["text", "announcement"])).min(1)
91
290
  }),
92
- z4.strictObject({
93
- provider: z4.literal("discord"),
94
- resource: z4.literal("role"),
95
- assignable: z4.boolean().default(false)
291
+ z5.strictObject({
292
+ provider: z5.literal("discord"),
293
+ resource: z5.literal("role"),
294
+ assignable: z5.boolean().default(false)
96
295
  })
97
296
  ]);
98
297
 
99
298
  // src/tracker-data.ts
100
- import { z as z5 } from "zod";
299
+ import { z as z6 } from "zod";
101
300
  var maxDepth = 16;
102
301
  var maxBytes = 32768;
103
302
  var trackerDataMaxBranches = 16;
104
303
  var trackerDataMaxEntries = 256;
105
- var scalar = z5.union([z5.string(), z5.number().finite(), z5.boolean(), z5.null()]);
106
- var size = z5.number().int().safe().nonnegative();
107
- var bound = z5.number().finite();
108
- var branches = () => z5.array(node).min(1).max(trackerDataMaxBranches);
109
- var node = z5.lazy(
110
- () => z5.strictObject({
111
- type: z5.enum([
304
+ var scalar = z6.union([z6.string(), z6.number().finite(), z6.boolean(), z6.null()]);
305
+ var size = z6.number().int().safe().nonnegative();
306
+ var bound = z6.number().finite();
307
+ var branches = () => z6.array(node).min(1).max(trackerDataMaxBranches);
308
+ var node = z6.lazy(
309
+ () => z6.strictObject({
310
+ type: z6.enum([
112
311
  "object",
113
312
  "array",
114
313
  "string",
@@ -117,15 +316,15 @@ var node = z5.lazy(
117
316
  "boolean",
118
317
  "null"
119
318
  ]).optional(),
120
- properties: z5.record(z5.string(), node).refine(
319
+ properties: z6.record(z6.string(), node).refine(
121
320
  (properties) => Object.keys(properties).length <= trackerDataMaxEntries,
122
321
  `An object schema lists at most ${trackerDataMaxEntries} properties`
123
322
  ).optional(),
124
- required: z5.array(z5.string()).max(trackerDataMaxEntries).optional(),
125
- additionalProperties: z5.union([z5.boolean(), node]).optional(),
126
- propertyNames: z5.strictObject({
127
- type: z5.literal("string"),
128
- enum: z5.array(z5.string()).max(trackerDataMaxEntries).optional()
323
+ required: z6.array(z6.string()).max(trackerDataMaxEntries).optional(),
324
+ additionalProperties: z6.union([z6.boolean(), node]).optional(),
325
+ propertyNames: z6.strictObject({
326
+ type: z6.literal("string"),
327
+ enum: z6.array(z6.string()).max(trackerDataMaxEntries).optional()
129
328
  }).optional(),
130
329
  items: node.optional(),
131
330
  minItems: size.optional(),
@@ -136,7 +335,7 @@ var node = z5.lazy(
136
335
  maximum: bound.optional(),
137
336
  exclusiveMinimum: bound.optional(),
138
337
  exclusiveMaximum: bound.optional(),
139
- enum: z5.array(scalar).min(1).max(trackerDataMaxEntries).optional(),
338
+ enum: z6.array(scalar).min(1).max(trackerDataMaxEntries).optional(),
140
339
  const: scalar.optional(),
141
340
  anyOf: branches().optional(),
142
341
  oneOf: branches().optional(),
@@ -198,7 +397,7 @@ function nestedUnionIssue(schema, path, insideUnion) {
198
397
  }
199
398
  return null;
200
399
  }
201
- var trackerDataSchemaSchema = z5.unknown().superRefine((value, ctx) => {
400
+ var trackerDataSchemaSchema = z6.unknown().superRefine((value, ctx) => {
202
401
  const issue = shapeIssue(value);
203
402
  if (issue) {
204
403
  ctx.addIssue({ code: "custom", message: issue, abort: true });
@@ -305,7 +504,7 @@ function subset(schema, path) {
305
504
  function trackerDataSchema(schema) {
306
505
  let json;
307
506
  try {
308
- json = z5.toJSONSchema(schema, {
507
+ json = z6.toJSONSchema(schema, {
309
508
  target: "draft-2020-12",
310
509
  io: "input",
311
510
  unrepresentable: "throw",
@@ -364,16 +563,16 @@ function pathText(path) {
364
563
  }
365
564
  var describe = (value) => value === null ? "null" : Array.isArray(value) ? "an array" : typeof value;
366
565
  var shownValues = 10;
367
- function oneOf(values) {
368
- const shown = values.slice(0, shownValues).map((value) => JSON.stringify(value)).join(", ");
369
- return values.length > shownValues ? `expected one of ${shown}, or ${values.length - shownValues} more` : `expected one of ${shown}`;
566
+ function oneOf(values2) {
567
+ const shown = values2.slice(0, shownValues).map((value) => JSON.stringify(value)).join(", ");
568
+ return values2.length > shownValues ? `expected one of ${shown}, or ${values2.length - shownValues} more` : `expected one of ${shown}`;
370
569
  }
371
570
  var enumSets = /* @__PURE__ */ new WeakMap();
372
571
  var literalLists = /* @__PURE__ */ new WeakMap();
373
- function setOf(owner, values) {
572
+ function setOf(owner, values2) {
374
573
  let found = enumSets.get(owner);
375
574
  if (!found) {
376
- found = new Set(values);
575
+ found = new Set(values2);
377
576
  enumSets.set(owner, found);
378
577
  }
379
578
  return found;
@@ -395,8 +594,8 @@ function matches(schema, value, at, budget) {
395
594
  return issue(() => `expected ${JSON.stringify(schema.const)}`);
396
595
  }
397
596
  if (schema.enum && !setOf(schema, schema.enum).has(value)) {
398
- const values = schema.enum;
399
- return issue(() => oneOf(values));
597
+ const values2 = schema.enum;
598
+ return issue(() => oneOf(values2));
400
599
  }
401
600
  switch (schema.type) {
402
601
  case "null":
@@ -673,21 +872,21 @@ function whereSchemaIssue(schema, where) {
673
872
  }
674
873
 
675
874
  // src/trackers.ts
676
- import { z as z6 } from "zod";
677
- var timestamp = z6.number().int().safe().nonnegative().max(864e13);
678
- var count = z6.number().int().safe().nonnegative();
679
- var externalId = z6.string().min(1).max(256);
875
+ import { z as z7 } from "zod";
876
+ var timestamp = z7.number().int().safe().nonnegative().max(864e13);
877
+ var count = z7.number().int().safe().nonnegative();
878
+ var externalId = z7.string().min(1).max(256);
680
879
  var metric = count.nullable().default(null);
681
- var xTweetSchema = z6.looseObject({
880
+ var xTweetSchema = z7.looseObject({
682
881
  id: externalId,
683
882
  userId: externalId,
684
- content: z6.string(),
685
- createdAt: z6.iso.datetime({ offset: true }),
686
- author: z6.looseObject({
883
+ content: z7.string(),
884
+ createdAt: z7.iso.datetime({ offset: true }),
885
+ author: z7.looseObject({
687
886
  id: externalId,
688
- username: z6.string(),
689
- name: z6.string(),
690
- verified: z6.boolean().nullable().default(null)
887
+ username: z7.string(),
888
+ name: z7.string(),
889
+ verified: z7.boolean().nullable().default(null)
691
890
  }),
692
891
  likeCount: metric,
693
892
  replyCount: metric,
@@ -695,84 +894,84 @@ var xTweetSchema = z6.looseObject({
695
894
  quoteCount: metric,
696
895
  viewCount: metric,
697
896
  bookmarkCount: metric,
698
- isReply: z6.boolean(),
699
- isRetweet: z6.boolean(),
700
- isQuoteTweet: z6.boolean()
701
- });
702
- var xContentBodySchema = z6.strictObject({
703
- version: z6.literal(1),
704
- id: z6.string().min(1),
705
- authorId: z6.string().min(1),
897
+ isReply: z7.boolean(),
898
+ isRetweet: z7.boolean(),
899
+ isQuoteTweet: z7.boolean()
900
+ });
901
+ var xContentBodySchema = z7.strictObject({
902
+ version: z7.literal(1),
903
+ id: z7.string().min(1),
904
+ authorId: z7.string().min(1),
706
905
  publishedAt: timestamp,
707
- text: z6.string(),
708
- isReply: z6.boolean(),
709
- isRetweet: z6.boolean(),
710
- isQuoteTweet: z6.boolean(),
711
- media: z6.array(z6.strictObject({ type: z6.string(), url: z6.string() })).nullable(),
712
- mentionedAuthorIds: z6.array(z6.string().min(1)).nullable(),
713
- videoLengthSeconds: z6.number().nonnegative().nullable(),
714
- references: z6.strictObject({
715
- replyId: z6.string().nullable(),
716
- replyAuthorId: z6.string().nullable(),
717
- quoteId: z6.string().nullable(),
718
- quoteAuthorId: z6.string().nullable(),
719
- repostId: z6.string().nullable(),
720
- repostAuthorId: z6.string().nullable()
906
+ text: z7.string(),
907
+ isReply: z7.boolean(),
908
+ isRetweet: z7.boolean(),
909
+ isQuoteTweet: z7.boolean(),
910
+ media: z7.array(z7.strictObject({ type: z7.string(), url: z7.string() })).nullable(),
911
+ mentionedAuthorIds: z7.array(z7.string().min(1)).nullable(),
912
+ videoLengthSeconds: z7.number().nonnegative().nullable(),
913
+ references: z7.strictObject({
914
+ replyId: z7.string().nullable(),
915
+ replyAuthorId: z7.string().nullable(),
916
+ quoteId: z7.string().nullable(),
917
+ quoteAuthorId: z7.string().nullable(),
918
+ repostId: z7.string().nullable(),
919
+ repostAuthorId: z7.string().nullable()
721
920
  })
722
921
  });
723
- var trackerContentQuerySchema = z6.strictObject({
922
+ var trackerContentQuerySchema = z7.strictObject({
724
923
  id: externalId,
725
- observation: z6.string().regex(/^observation_[a-f0-9]{64}$/)
924
+ observation: z7.string().regex(/^observation_[a-f0-9]{64}$/)
726
925
  });
727
926
  var trackerContentReadSchema = trackerContentQuerySchema.extend({
728
927
  member: identifier
729
928
  });
730
929
  var attributionContext = { member: identifier, capturedAt: timestamp };
731
- var trackerEvidenceSchema = z6.strictObject({
930
+ var trackerEvidenceSchema = z7.strictObject({
732
931
  contentRevision: identifier,
733
932
  observation: identifier
734
933
  });
735
- var trackerContentSchema = z6.strictObject({
934
+ var trackerContentSchema = z7.strictObject({
736
935
  tracker: identifier,
737
- source: z6.literal("x"),
936
+ source: z7.literal("x"),
738
937
  evidence: trackerEvidenceSchema,
739
938
  content: xContentBodySchema,
740
939
  observedAt: timestamp,
741
- removed: z6.boolean(),
742
- attribution: z6.discriminatedUnion("kind", [
743
- z6.strictObject({
940
+ removed: z7.boolean(),
941
+ attribution: z7.discriminatedUnion("kind", [
942
+ z7.strictObject({
744
943
  ...attributionContext,
745
- kind: z6.literal("linked"),
746
- account: z6.strictObject({
747
- provider: z6.literal("x"),
748
- issuer: z6.string().min(1),
944
+ kind: z7.literal("linked"),
945
+ account: z7.strictObject({
946
+ provider: z7.literal("x"),
947
+ issuer: z7.string().min(1),
749
948
  subject: externalId,
750
949
  revision: count,
751
950
  linkedAt: timestamp.nullable()
752
951
  })
753
952
  }),
754
- z6.strictObject({ ...attributionContext, kind: z6.literal("unlinked") }),
755
- z6.strictObject({
953
+ z7.strictObject({ ...attributionContext, kind: z7.literal("unlinked") }),
954
+ z7.strictObject({
756
955
  ...attributionContext,
757
- kind: z6.literal("different-author")
956
+ kind: z7.literal("different-author")
758
957
  })
759
958
  ])
760
959
  });
761
960
  var knownIdentityKinds = ["wallet", "x", "discord", "member"];
762
- var appIdentityKindSchema = z6.templateLiteral([
961
+ var appIdentityKindSchema = z7.templateLiteral([
763
962
  "app:",
764
- z6.string().regex(
963
+ z7.string().regex(
765
964
  /^[a-z0-9][a-z0-9_-]{0,39}$/,
766
965
  "Name an app identity kind like app:telegram: lowercase letters, digits, _ or -, at most 40"
767
966
  )
768
967
  ]);
769
- var identityKindSchema = z6.union([
770
- z6.enum(knownIdentityKinds),
968
+ var identityKindSchema = z7.union([
969
+ z7.enum(knownIdentityKinds),
771
970
  appIdentityKindSchema
772
971
  ]);
773
972
  var isAppIdentityKind = (kind) => kind.startsWith("app:");
774
- var openIdentityKindSchema = z6.string().min(1).max(64);
775
- var memberIdentitySchema = z6.object({
973
+ var openIdentityKindSchema = z7.string().min(1).max(64);
974
+ var memberIdentitySchema = z7.object({
776
975
  kind: openIdentityKindSchema,
777
976
  /** The stable user ID for `x` and `discord`; the subject your app signed the member in with for `app:<name>`. */
778
977
  subject: externalId,
@@ -784,13 +983,13 @@ var memberIdentitySchema = z6.object({
784
983
  /** The latest link time, refreshed on app identity relink; null when the link time is unknown. */
785
984
  linkedAt: timestamp.nullable()
786
985
  });
787
- var accountRoleSchema = z6.string().regex(
986
+ var accountRoleSchema = z7.string().regex(
788
987
  /^[a-zA-Z][a-zA-Z0-9_]{0,39}$/,
789
988
  "Name roles like author or recipient: a letter, then letters, digits or underscores"
790
989
  );
791
990
  var xAccountRoles = ["author", "inReplyTo"];
792
- var distinct = (values) => new Set(values).size === values.length;
793
- var contentMetricNameSchema = z6.string().regex(
991
+ var distinct = (values2) => new Set(values2).size === values2.length;
992
+ var contentMetricNameSchema = z7.string().regex(
794
993
  /^[a-z][a-zA-Z0-9]{0,39}$/,
795
994
  "Name metrics like likes or watchTime: a lowercase letter, then letters or digits"
796
995
  );
@@ -802,24 +1001,24 @@ var xContentMetrics = [
802
1001
  "views",
803
1002
  "bookmarks"
804
1003
  ];
805
- var customContentSchema = z6.strictObject({
806
- metrics: z6.array(contentMetricNameSchema).max(10).refine(distinct, "List each metric once")
1004
+ var customContentSchema = z7.strictObject({
1005
+ metrics: z7.array(contentMetricNameSchema).max(10).refine(distinct, "List each metric once")
807
1006
  });
808
- var xSearchSourceSchema = z6.object({
809
- kind: z6.literal("x-search"),
810
- query: z6.string().trim().min(1).max(2e3)
1007
+ var xSearchSourceSchema = z7.object({
1008
+ kind: z7.literal("x-search"),
1009
+ query: z7.string().trim().min(1).max(2e3)
811
1010
  }).strict();
812
- var customSourceSchema = z6.object({
813
- kind: z6.literal("custom"),
1011
+ var customSourceSchema = z7.object({
1012
+ kind: z7.literal("custom"),
814
1013
  namespace: identifier,
815
1014
  /**
816
1015
  * The identity kinds a record's author and named accounts can be, attributed to members
817
1016
  * through verified links: `wallet`, `x`, `discord`, `member`, or your app's own `app:<name>`.
818
1017
  * Omitted when authors are opaque IDs, which no quest can pay.
819
1018
  */
820
- identities: z6.array(identityKindSchema).min(1).max(8).refine(distinct, "List each identity kind once").optional(),
1019
+ identities: z7.array(identityKindSchema).min(1).max(8).refine(distinct, "List each identity kind once").optional(),
821
1020
  /** Roles of the named accounts records can carry besides their author, such as `recipient`. */
822
- accounts: z6.array(accountRoleSchema).min(1).max(10).refine(distinct, "List each account role once").refine(
1021
+ accounts: z7.array(accountRoleSchema).min(1).max(10).refine(distinct, "List each account role once").refine(
823
1022
  (roles) => !roles.includes("author"),
824
1023
  "author is every record's own role; name other accounts"
825
1024
  ).optional(),
@@ -842,7 +1041,7 @@ var customSourceSchema = z6.object({
842
1041
  (source) => !source.accounts || source.identities,
843
1042
  "Named accounts need identities"
844
1043
  );
845
- var trackerSourceSchema = z6.discriminatedUnion("kind", [
1044
+ var trackerSourceSchema = z7.discriminatedUnion("kind", [
846
1045
  xSearchSourceSchema,
847
1046
  customSourceSchema,
848
1047
  discordMessagesSourceSchema,
@@ -879,125 +1078,125 @@ function sourceContent(source) {
879
1078
  return void 0;
880
1079
  }
881
1080
  }
882
- var windowSchema = z6.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
1081
+ var windowSchema = z7.object({ start: timestamp, end: timestamp.optional() }).strict().refine(
883
1082
  (w) => w.end === void 0 || w.end > w.start,
884
1083
  "End must follow start"
885
1084
  );
886
- var trackerDefinitionSchema = z6.object({
1085
+ var trackerDefinitionSchema = z7.object({
887
1086
  key: identifier,
888
- title: z6.string().trim().min(1).max(120),
1087
+ title: z7.string().trim().min(1).max(120),
889
1088
  source: trackerSourceSchema,
890
1089
  window: windowSchema,
891
- refreshSeconds: z6.number().int().min(300).max(86400).default(21600),
892
- maxPages: z6.number().int().min(1).max(1e3).default(60)
1090
+ refreshSeconds: z7.number().int().min(300).max(86400).default(21600),
1091
+ maxPages: z7.number().int().min(1).max(1e3).default(60)
893
1092
  }).strict();
894
- var trackerArtifactSchema = z6.union([
1093
+ var trackerArtifactSchema = z7.union([
895
1094
  trackerDefinitionSchema,
896
- z6.object({ code: z6.string().min(1).max(2e6) }).strict()
1095
+ z7.object({ code: z7.string().min(1).max(2e6) }).strict()
897
1096
  ]);
898
- var knownTrackerSourceResponseSchema = z6.discriminatedUnion("kind", [
899
- z6.object(xSearchSourceSchema.shape),
900
- z6.object({
1097
+ var knownTrackerSourceResponseSchema = z7.discriminatedUnion("kind", [
1098
+ z7.object(xSearchSourceSchema.shape),
1099
+ z7.object({
901
1100
  ...customSourceSchema.shape,
902
- identities: z6.array(openIdentityKindSchema).optional()
1101
+ identities: z7.array(openIdentityKindSchema).optional()
903
1102
  }),
904
- z6.object(discordMessagesSourceSchema.shape),
905
- z6.object(discordReactionsSourceSchema.shape)
1103
+ z7.object(discordMessagesSourceSchema.shape),
1104
+ z7.object(discordReactionsSourceSchema.shape)
906
1105
  ]);
907
- var trackerSourceResponseSchema = z6.union([
1106
+ var trackerSourceResponseSchema = z7.union([
908
1107
  knownTrackerSourceResponseSchema,
909
- z6.object({
910
- kind: z6.string().min(1).refine(
1108
+ z7.object({
1109
+ kind: z7.string().min(1).refine(
911
1110
  (kind) => !trackerSourceKinds.some((known) => known === kind),
912
1111
  "Known source kinds must match their schema"
913
1112
  )
914
- }).catchall(z6.json())
1113
+ }).catchall(z7.json())
915
1114
  ]);
916
1115
  function isKnownTrackerSource(source) {
917
1116
  return knownTrackerSourceResponseSchema.safeParse(source).success;
918
1117
  }
919
- var trackerDefinitionResponseSchema = z6.object({
1118
+ var trackerDefinitionResponseSchema = z7.object({
920
1119
  ...trackerDefinitionSchema.shape,
921
1120
  source: trackerSourceResponseSchema,
922
- window: z6.object(windowSchema.shape)
1121
+ window: z7.object(windowSchema.shape)
923
1122
  });
924
- var publishedTrackerSchema = z6.object({
1123
+ var publishedTrackerSchema = z7.object({
925
1124
  id: identifier,
926
1125
  version: identifier,
927
1126
  definition: trackerDefinitionResponseSchema,
928
1127
  publishedAt: timestamp,
929
- actor: z6.string().nullable()
1128
+ actor: z7.string().nullable()
930
1129
  });
931
- var trackerStatusSchema = z6.object({
932
- archivedAt: z6.number().int().nonnegative().nullable().optional(),
1130
+ var trackerStatusSchema = z7.object({
1131
+ archivedAt: z7.number().int().nonnegative().nullable().optional(),
933
1132
  published: publishedTrackerSchema,
934
- paused: z6.boolean(),
935
- state: z6.enum(["idle", "syncing", "error", "complete"]),
1133
+ paused: z7.boolean(),
1134
+ state: z7.enum(["idle", "syncing", "error", "complete"]),
936
1135
  lastStartedAt: timestamp.nullable(),
937
1136
  lastCompletedAt: timestamp.nullable(),
938
1137
  nextSyncAt: timestamp.nullable(),
939
- coverage: z6.enum(["unknown", "partial", "complete"]),
940
- error: z6.string().nullable(),
1138
+ coverage: z7.enum(["unknown", "partial", "complete"]),
1139
+ error: z7.string().nullable(),
941
1140
  records: count
942
1141
  });
943
- var trackerControlSchema = z6.object({
1142
+ var trackerControlSchema = z7.object({
944
1143
  actionId: identifier,
945
- action: z6.enum(["pause", "resume", "refresh"])
1144
+ action: z7.enum(["pause", "resume", "refresh"])
946
1145
  }).strict();
947
- var trackerAccountSchema = z6.strictObject({
1146
+ var trackerAccountSchema = z7.strictObject({
948
1147
  kind: identityKindSchema.optional(),
949
1148
  id: externalId
950
1149
  });
951
- var trackerRecordInputSchema = z6.object({
1150
+ var trackerRecordInputSchema = z7.object({
952
1151
  id: externalId,
953
1152
  occurredAt: timestamp,
954
1153
  observedAt: timestamp,
955
- author: z6.object({
1154
+ author: z7.object({
956
1155
  id: externalId,
957
- verified: z6.boolean().nullable().default(null),
1156
+ verified: z7.boolean().nullable().default(null),
958
1157
  /** The author's identity kind; needed when the source names more than one. */
959
1158
  kind: identityKindSchema.optional()
960
1159
  }).strict().nullable().default(null),
961
1160
  /** Named accounts besides the author, by the roles the custom source declares. */
962
- accounts: z6.record(accountRoleSchema, trackerAccountSchema).refine(
1161
+ accounts: z7.record(accountRoleSchema, trackerAccountSchema).refine(
963
1162
  (accounts) => Object.keys(accounts).length <= 10,
964
1163
  "At most 10 accounts"
965
1164
  ).optional(),
966
- data: z6.record(z6.string(), z6.json()),
967
- removed: z6.boolean().default(false)
1165
+ data: z7.record(z7.string(), z7.json()),
1166
+ removed: z7.boolean().default(false)
968
1167
  }).strict().refine(
969
1168
  (v) => new TextEncoder().encode(JSON.stringify(v.data)).byteLength <= 131072,
970
1169
  "Record exceeds 128 KB"
971
1170
  );
972
- var trackerRecordAccountSchema = z6.object({
1171
+ var trackerRecordAccountSchema = z7.object({
973
1172
  kind: openIdentityKindSchema.optional(),
974
- id: z6.string()
1173
+ id: z7.string()
975
1174
  });
976
- var trackerRecordSchema = z6.object({
977
- id: z6.string(),
1175
+ var trackerRecordSchema = z7.object({
1176
+ id: z7.string(),
978
1177
  occurredAt: timestamp,
979
1178
  observedAt: timestamp,
980
- author: z6.object({
981
- id: z6.string(),
982
- verified: z6.boolean().nullable().default(null),
1179
+ author: z7.object({
1180
+ id: z7.string(),
1181
+ verified: z7.boolean().nullable().default(null),
983
1182
  kind: openIdentityKindSchema.optional()
984
1183
  }).nullable().default(null),
985
- accounts: z6.record(z6.string(), trackerRecordAccountSchema).optional(),
986
- data: z6.record(z6.string(), z6.json()),
987
- removed: z6.boolean().default(false),
988
- source: z6.string(),
1184
+ accounts: z7.record(z7.string(), trackerRecordAccountSchema).optional(),
1185
+ data: z7.record(z7.string(), z7.json()),
1186
+ removed: z7.boolean().default(false),
1187
+ source: z7.string(),
989
1188
  firstSeenAt: timestamp,
990
1189
  /** Present only when includeEvidence is true; custom sources have no X evidence. */
991
1190
  evidence: trackerEvidenceSchema.nullable().optional()
992
1191
  });
993
- var trackerIngestSchema = z6.object({
1192
+ var trackerIngestSchema = z7.object({
994
1193
  actionId: identifier,
995
- records: z6.array(trackerRecordInputSchema).min(1).max(100)
1194
+ records: z7.array(trackerRecordInputSchema).min(1).max(100)
996
1195
  }).strict();
997
- var trackerIngestResultSchema = z6.object({
1196
+ var trackerIngestResultSchema = z7.object({
998
1197
  stored: count,
999
1198
  /** Tracker-trigger decisions this ingest caused. Absent from servers without tracker triggers. */
1000
- admissions: z6.object({
1199
+ admissions: z7.object({
1001
1200
  admitted: count,
1002
1201
  skipped: count,
1003
1202
  /**
@@ -1018,11 +1217,11 @@ var trackerOutcomeFields = {
1018
1217
  /** The release admitted, or the one active when the observation was skipped. */
1019
1218
  release: identifier,
1020
1219
  /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
1021
- account: z6.string().nullable(),
1220
+ account: z7.string().nullable(),
1022
1221
  createdAt: timestamp,
1023
1222
  updatedAt: timestamp,
1024
1223
  /** Null for automatic decisions; the staff actor after a retry. */
1025
- actor: z6.string().nullable()
1224
+ actor: z7.string().nullable()
1026
1225
  };
1027
1226
  var trackerSkipCodes = [
1028
1227
  /** The quest is paused or no longer active. Catch-up after a pause is an operator decision. */
@@ -1077,26 +1276,26 @@ var trackerSkipCodes = [
1077
1276
  /** A prerequisite quest was not complete when the record occurred. */
1078
1277
  "prerequisites-incomplete"
1079
1278
  ];
1080
- var trackerOutcomeSchema = z6.discriminatedUnion("state", [
1081
- z6.object({
1279
+ var trackerOutcomeSchema = z7.discriminatedUnion("state", [
1280
+ z7.object({
1082
1281
  ...trackerOutcomeFields,
1083
- state: z6.literal("admitted"),
1084
- code: z6.null(),
1085
- reason: z6.null(),
1282
+ state: z7.literal("admitted"),
1283
+ code: z7.null(),
1284
+ reason: z7.null(),
1086
1285
  /** The attributed member. */
1087
1286
  member: identifier,
1088
1287
  /** The admitted attempt. Its evaluation, decision and rewards live on the attempt. */
1089
1288
  attempt: identifier
1090
1289
  }),
1091
- z6.object({
1290
+ z7.object({
1092
1291
  ...trackerOutcomeFields,
1093
- state: z6.literal("skipped"),
1292
+ state: z7.literal("skipped"),
1094
1293
  /** Why the observation was skipped, as one of `trackerSkipCodes`. */
1095
- code: z6.string().min(1),
1294
+ code: z7.string().min(1),
1096
1295
  /** Why the observation was skipped, for people. */
1097
- reason: z6.string(),
1296
+ reason: z7.string(),
1098
1297
  /** Which window refused admission when `code` is `outside-window`. */
1099
- window: z6.enum(["tracker", "quest"]).optional(),
1298
+ window: z7.enum(["tracker", "quest"]).optional(),
1100
1299
  /** The attributed member, when attribution got that far. */
1101
1300
  member: identifier.nullable(),
1102
1301
  attempt: identifier.nullable()
@@ -1107,67 +1306,67 @@ var trackerOutcomeFilters = {
1107
1306
  quest: identifier.optional(),
1108
1307
  record: externalId.optional(),
1109
1308
  member: identifier.optional(),
1110
- state: z6.enum(["admitted", "skipped"]).optional(),
1309
+ state: z7.enum(["admitted", "skipped"]).optional(),
1111
1310
  /** Only skips with this code, such as `unlinked-account`. */
1112
- code: z6.string().min(1).max(100).optional(),
1113
- limit: z6.coerce.number().int().min(1).max(100).default(25)
1311
+ code: z7.string().min(1).max(100).optional(),
1312
+ limit: z7.coerce.number().int().min(1).max(100).default(25)
1114
1313
  };
1115
- var trackerTriggerOutcomeQuerySchema = z6.strictObject({
1314
+ var trackerTriggerOutcomeQuerySchema = z7.strictObject({
1116
1315
  ...trackerOutcomeFilters,
1117
1316
  cursor: pageCursorSchema.optional()
1118
1317
  });
1119
- var trackerTriggerOutcomePageSchema = z6.object({
1120
- items: z6.array(trackerOutcomeSchema).max(100),
1318
+ var trackerTriggerOutcomePageSchema = z7.object({
1319
+ items: z7.array(trackerOutcomeSchema).max(100),
1121
1320
  nextCursor: pageCursorSchema.nullable()
1122
1321
  });
1123
- var trackerOutcomeQuerySchema = z6.strictObject({
1322
+ var trackerOutcomeQuerySchema = z7.strictObject({
1124
1323
  ...trackerOutcomeFilters,
1125
1324
  /** Opaque cursor from `next`: older outcomes. */
1126
- before: z6.string().max(512).optional()
1325
+ before: z7.string().max(512).optional()
1127
1326
  });
1128
- var trackerOutcomePageSchema = z6.strictObject({
1327
+ var trackerOutcomePageSchema = z7.strictObject({
1129
1328
  /** Newest first. */
1130
- items: z6.array(trackerOutcomeSchema).max(100),
1131
- next: z6.string().nullable()
1329
+ items: z7.array(trackerOutcomeSchema).max(100),
1330
+ next: z7.string().nullable()
1132
1331
  });
1133
- var trackerOutcomeRetrySchema = z6.strictObject({
1332
+ var trackerOutcomeRetrySchema = z7.strictObject({
1134
1333
  actionId: identifier,
1135
1334
  /** Quest key or ID. */
1136
1335
  quest: identifier,
1137
1336
  record: externalId,
1138
1337
  observedAt: timestamp
1139
1338
  });
1140
- var booleanQuery = z6.union([
1141
- z6.boolean(),
1142
- z6.enum(["true", "false"]).transform((v) => v === "true")
1339
+ var booleanQuery = z7.union([
1340
+ z7.boolean(),
1341
+ z7.enum(["true", "false"]).transform((v) => v === "true")
1143
1342
  ]);
1144
- var trackerQuerySchema = z6.object({
1343
+ var trackerQuerySchema = z7.object({
1145
1344
  author: externalId.optional(),
1146
1345
  member: identifier.optional(),
1147
1346
  verified: booleanQuery.optional(),
1148
- since: z6.coerce.number().int().safe().nonnegative().optional(),
1149
- until: z6.coerce.number().int().safe().nonnegative().optional(),
1347
+ since: z7.coerce.number().int().safe().nonnegative().optional(),
1348
+ until: z7.coerce.number().int().safe().nonnegative().optional(),
1150
1349
  removed: booleanQuery.default(false),
1151
- minLikes: z6.coerce.number().int().safe().nonnegative().optional(),
1152
- minViews: z6.coerce.number().int().safe().nonnegative().optional(),
1153
- limit: z6.coerce.number().int().min(1).max(100).default(25),
1154
- cursor: z6.string().max(2048).optional(),
1350
+ minLikes: z7.coerce.number().int().safe().nonnegative().optional(),
1351
+ minViews: z7.coerce.number().int().safe().nonnegative().optional(),
1352
+ limit: z7.coerce.number().int().min(1).max(100).default(25),
1353
+ cursor: z7.string().max(2048).optional(),
1155
1354
  includeEvidence: booleanQuery.optional()
1156
1355
  }).strict().refine(
1157
1356
  (q) => q.since === void 0 || q.until === void 0 || q.until > q.since,
1158
1357
  "Until must follow since"
1159
1358
  );
1160
- var trackerPageSchema = z6.object({
1359
+ var trackerPageSchema = z7.object({
1161
1360
  tracker: identifier,
1162
- items: z6.array(trackerRecordSchema),
1163
- nextCursor: z6.string().nullable(),
1361
+ items: z7.array(trackerRecordSchema),
1362
+ nextCursor: z7.string().nullable(),
1164
1363
  total: count,
1165
1364
  status: trackerStatusSchema
1166
1365
  });
1167
- var trackerSummarySchema = z6.object({
1366
+ var trackerSummarySchema = z7.object({
1168
1367
  records: count,
1169
1368
  authors: count,
1170
- metrics: z6.object({
1369
+ metrics: z7.object({
1171
1370
  likes: count,
1172
1371
  replies: count,
1173
1372
  reposts: count,
@@ -1183,26 +1382,26 @@ var trackerPreviewLimits = {
1183
1382
  posts: 100,
1184
1383
  days: 30
1185
1384
  };
1186
- var trackerPreviewInputSchema = z6.object({
1385
+ var trackerPreviewInputSchema = z7.object({
1187
1386
  query: xSearchSourceSchema.shape.query,
1188
1387
  /** Start of the searched window. The window ends when the sample is fetched. */
1189
1388
  since: timestamp
1190
1389
  }).strict();
1191
- var trackerPreviewSchema = z6.object({
1192
- query: z6.string(),
1390
+ var trackerPreviewSchema = z7.object({
1391
+ query: z7.string(),
1193
1392
  since: timestamp,
1194
1393
  fetchedAt: timestamp,
1195
1394
  pages: count,
1196
1395
  /** Every match in the sample, newest first, verified or not. */
1197
- posts: z6.array(xTweetSchema).max(trackerPreviewLimits.posts),
1396
+ posts: z7.array(xTweetSchema).max(trackerPreviewLimits.posts),
1198
1397
  /** X had more matches than the sample holds. */
1199
- more: z6.boolean()
1398
+ more: z7.boolean()
1200
1399
  });
1201
1400
 
1202
1401
  // src/content.ts
1203
- import { z as z7 } from "zod";
1204
- var contentQualificationDecisionSchema = z7.strictObject({
1205
- kind: z7.enum([
1402
+ import { z as z8 } from "zod";
1403
+ var contentQualificationDecisionSchema = z8.strictObject({
1404
+ kind: z8.enum([
1206
1405
  "accept",
1207
1406
  "reject",
1208
1407
  "review",
@@ -1210,26 +1409,26 @@ var contentQualificationDecisionSchema = z7.strictObject({
1210
1409
  "progress",
1211
1410
  "superseded"
1212
1411
  ]),
1213
- reason: z7.string().nullable()
1412
+ reason: z8.string().nullable()
1214
1413
  });
1215
- var contentQualificationQuerySchema = z7.strictObject({
1414
+ var contentQualificationQuerySchema = z8.strictObject({
1216
1415
  quest: identifier,
1217
1416
  member: identifier.optional(),
1218
1417
  /** A content item's record ID in the quest's tracker. */
1219
- content: z7.string().min(1).max(256).optional(),
1418
+ content: z8.string().min(1).max(256).optional(),
1220
1419
  cursor: pageCursorSchema.optional()
1221
1420
  });
1222
- var contentQualificationSchema = z7.strictObject({
1421
+ var contentQualificationSchema = z8.strictObject({
1223
1422
  quest: identifier,
1224
1423
  /** The content item's record ID in the quest's tracker. */
1225
- content: z7.string(),
1424
+ content: z8.string(),
1226
1425
  member: identifier,
1227
1426
  release: identifier,
1228
1427
  attempt: identifier,
1229
1428
  revision: identifier,
1230
1429
  observation: identifier,
1231
- current: z7.boolean(),
1232
- state: z7.enum([
1430
+ current: z8.boolean(),
1431
+ state: z8.enum([
1233
1432
  "pending",
1234
1433
  "qualified",
1235
1434
  "unqualified",
@@ -1240,117 +1439,117 @@ var contentQualificationSchema = z7.strictObject({
1240
1439
  "blocked",
1241
1440
  "unavailable"
1242
1441
  ]),
1243
- reason: z7.string().nullable(),
1244
- reward: z7.strictObject({
1442
+ reason: z8.string().nullable(),
1443
+ reward: z8.strictObject({
1245
1444
  attempt: identifier.nullable(),
1246
1445
  completion: identifier.nullable(),
1247
- state: z7.enum(["unresolved", "awarded", "excluded"])
1446
+ state: z8.enum(["unresolved", "awarded", "excluded"])
1248
1447
  })
1249
1448
  });
1250
- var contentQualificationPageSchema = z7.strictObject({
1251
- items: z7.array(contentQualificationSchema),
1449
+ var contentQualificationPageSchema = z8.strictObject({
1450
+ items: z8.array(contentQualificationSchema),
1252
1451
  nextCursor: pageCursorSchema.nullable()
1253
1452
  });
1254
1453
  var contentMetricSchema = contentMetricNameSchema;
1255
- var contentMetricsSchema = z7.record(
1454
+ var contentMetricsSchema = z8.record(
1256
1455
  contentMetricSchema,
1257
- z7.number().int().safe().nonnegative()
1456
+ z8.number().int().safe().nonnegative()
1258
1457
  );
1259
- var contentPerformancePolicySchema = z7.strictObject({
1260
- metrics: z7.array(contentMetricSchema).min(1).max(10).refine(
1261
- (values) => new Set(values).size === values.length,
1458
+ var contentPerformancePolicySchema = z8.strictObject({
1459
+ metrics: z8.array(contentMetricSchema).min(1).max(10).refine(
1460
+ (values2) => new Set(values2).size === values2.length,
1262
1461
  "Metrics must be unique"
1263
1462
  ),
1264
- maxAgeMs: z7.number().int().positive().max(864e5).default(36e5)
1463
+ maxAgeMs: z8.number().int().positive().max(864e5).default(36e5)
1265
1464
  });
1266
1465
 
1267
1466
  // src/counters.ts
1268
- import { z as z8 } from "zod";
1467
+ import { z as z9 } from "zod";
1269
1468
  var day = 864e5;
1270
- var counterGoalSchema = z8.object({
1271
- kind: z8.literal("count"),
1272
- count: z8.number().int().min(1).max(1e4)
1469
+ var counterGoalSchema = z9.object({
1470
+ kind: z9.literal("count"),
1471
+ count: z9.number().int().min(1).max(1e4)
1273
1472
  }).strict();
1274
- var counterWindowSchema = z8.discriminatedUnion("kind", [
1275
- z8.object({ kind: z8.literal("lifetime") }).strict(),
1276
- z8.object({
1277
- kind: z8.literal("calendar"),
1278
- period: z8.enum(["day", "week", "month"]),
1279
- latenessMs: z8.number().int().min(0).max(90 * day).default(7 * day)
1473
+ var counterWindowSchema = z9.discriminatedUnion("kind", [
1474
+ z9.object({ kind: z9.literal("lifetime") }).strict(),
1475
+ z9.object({
1476
+ kind: z9.literal("calendar"),
1477
+ period: z9.enum(["day", "week", "month"]),
1478
+ latenessMs: z9.number().int().min(0).max(90 * day).default(7 * day)
1280
1479
  }).strict(),
1281
- z8.object({
1282
- kind: z8.literal("rolling"),
1283
- durationMs: z8.number().int().min(1).max(365 * day)
1480
+ z9.object({
1481
+ kind: z9.literal("rolling"),
1482
+ durationMs: z9.number().int().min(1).max(365 * day)
1284
1483
  }).strict()
1285
1484
  ]);
1286
- var counterPolicySchema = z8.object({
1287
- kind: z8.literal("progress"),
1485
+ var counterPolicySchema = z9.object({
1486
+ kind: z9.literal("progress"),
1288
1487
  goal: counterGoalSchema,
1289
1488
  window: counterWindowSchema,
1290
- repeat: z8.enum(["once", "repeat"]).default("once")
1489
+ repeat: z9.enum(["once", "repeat"]).default("once")
1291
1490
  }).strict();
1292
- var achievementBase = z8.object({
1491
+ var achievementBase = z9.object({
1293
1492
  id: identifier,
1294
- ordinal: z8.number().int().positive(),
1295
- achievedAt: z8.number().int(),
1296
- window: z8.string()
1493
+ ordinal: z9.number().int().positive(),
1494
+ achievedAt: z9.number().int(),
1495
+ window: z9.string()
1297
1496
  });
1298
- var counterAchievementSchema = z8.discriminatedUnion("status", [
1497
+ var counterAchievementSchema = z9.discriminatedUnion("status", [
1299
1498
  achievementBase.extend({
1300
- status: z8.literal("revoked"),
1499
+ status: z9.literal("revoked"),
1301
1500
  completion: identifier,
1302
- revokedAt: z8.number().int()
1501
+ revokedAt: z9.number().int()
1303
1502
  }),
1304
1503
  achievementBase.extend({
1305
- status: z8.literal("awarded"),
1504
+ status: z9.literal("awarded"),
1306
1505
  completion: identifier
1307
1506
  }),
1308
1507
  achievementBase.extend({
1309
- status: z8.literal("budget-exhausted"),
1508
+ status: z9.literal("budget-exhausted"),
1310
1509
  budget: identifier
1311
1510
  })
1312
1511
  ]);
1313
- var counterProgressSchema = z8.object({
1314
- goal: z8.number().int().positive(),
1315
- current: z8.number().int().nonnegative(),
1316
- window: z8.object({
1317
- key: z8.string(),
1318
- start: z8.number().int().nullable(),
1319
- end: z8.number().int().nullable()
1512
+ var counterProgressSchema = z9.object({
1513
+ goal: z9.number().int().positive(),
1514
+ current: z9.number().int().nonnegative(),
1515
+ window: z9.object({
1516
+ key: z9.string(),
1517
+ start: z9.number().int().nullable(),
1518
+ end: z9.number().int().nullable()
1320
1519
  }),
1321
- repeat: z8.enum(["once", "repeat"]),
1322
- settled: z8.number().int().nonnegative(),
1520
+ repeat: z9.enum(["once", "repeat"]),
1521
+ settled: z9.number().int().nonnegative(),
1323
1522
  latest: counterAchievementSchema.nullable()
1324
1523
  });
1325
- var counterContributionSchema = z8.object({
1524
+ var counterContributionSchema = z9.object({
1326
1525
  id: identifier,
1327
- distinct: z8.string(),
1526
+ distinct: z9.string(),
1328
1527
  attempt: identifier,
1329
- occurredAt: z8.number().int(),
1330
- recordedAt: z8.number().int(),
1331
- window: z8.string(),
1332
- status: z8.enum(["counted", "late", "future", "excluded"]),
1528
+ occurredAt: z9.number().int(),
1529
+ recordedAt: z9.number().int(),
1530
+ window: z9.string(),
1531
+ status: z9.enum(["counted", "late", "future", "excluded"]),
1333
1532
  achievement: counterAchievementSchema.nullable(),
1334
- reason: z8.string().nullable()
1533
+ reason: z9.string().nullable()
1335
1534
  });
1336
- var counterHistorySchema = z8.object({
1337
- items: z8.array(counterContributionSchema),
1338
- nextCursor: z8.string().nullable()
1535
+ var counterHistorySchema = z9.object({
1536
+ items: z9.array(counterContributionSchema),
1537
+ nextCursor: z9.string().nullable()
1339
1538
  });
1340
- var counterModerationSchema = z8.object({
1341
- actionId: z8.uuid(),
1342
- excluded: z8.boolean(),
1343
- reason: z8.string().trim().min(1).max(2e3)
1539
+ var counterModerationSchema = z9.object({
1540
+ actionId: z9.uuid(),
1541
+ excluded: z9.boolean(),
1542
+ reason: z9.string().trim().min(1).max(2e3)
1344
1543
  }).strict();
1345
- var counterHistoryQuerySchema = z8.object({
1346
- cursor: z8.string().max(2e3).optional(),
1347
- limit: z8.coerce.number().int().min(1).max(100).optional()
1544
+ var counterHistoryQuerySchema = z9.object({
1545
+ cursor: z9.string().max(2e3).optional(),
1546
+ limit: z9.coerce.number().int().min(1).max(100).optional()
1348
1547
  }).strict();
1349
- var counterModerationResultSchema = z8.object({ excluded: z8.boolean() });
1548
+ var counterModerationResultSchema = z9.object({ excluded: z9.boolean() });
1350
1549
 
1351
1550
  // src/calendar.ts
1352
- import { z as z9 } from "zod";
1353
- var timestamp2 = z9.number().int().safe();
1551
+ import { z as z10 } from "zod";
1552
+ var timestamp2 = z10.number().int().safe();
1354
1553
  var fixedOffset = /^(?:[+-]|(?:Etc\/)?GMT[+-]\d|(?:EST|MST|HST)$)/i;
1355
1554
  function canonicalTimeZone(zone) {
1356
1555
  let resolved;
@@ -1366,18 +1565,18 @@ function canonicalTimeZone(zone) {
1366
1565
  }
1367
1566
  return fixedOffset.test(zone) || fixedOffset.test(resolved) ? null : resolved;
1368
1567
  }
1369
- var timeZoneSchema = z9.string().min(1).max(100).transform((zone, ctx) => {
1568
+ var timeZoneSchema = z10.string().min(1).max(100).transform((zone, ctx) => {
1370
1569
  const canonical = canonicalTimeZone(zone);
1371
1570
  if (canonical === null) {
1372
1571
  ctx.addIssue({
1373
1572
  code: "custom",
1374
1573
  message: fixedOffset.test(zone) ? "Use a named IANA timezone, such as Europe/Budapest or UTC. Fixed offsets have no daylight-saving rules." : "Use an IANA timezone name, such as Europe/Budapest or UTC"
1375
1574
  });
1376
- return z9.NEVER;
1575
+ return z10.NEVER;
1377
1576
  }
1378
1577
  return canonical;
1379
1578
  });
1380
- var timeZoneNameSchema = z9.string().min(1).max(100);
1579
+ var timeZoneNameSchema = z10.string().min(1).max(100);
1381
1580
  var movedTimeZone = (what) => `${what} no longer take a timeZone: they follow the project calendar. Set calendar.timeZone in relay.json or in Console settings.`;
1382
1581
  var record = (value) => typeof value === "object" && value !== null;
1383
1582
  function refuseStreakTimeZone(value, ctx) {
@@ -1401,78 +1600,78 @@ function refuseWindowTimeZone(value, ctx) {
1401
1600
  }
1402
1601
  return value;
1403
1602
  }
1404
- var calendarPeriodSchema = z9.enum(["lifetime", "day", "week", "month"]);
1405
- var projectCalendarSchema = z9.object({
1603
+ var calendarPeriodSchema = z10.enum(["lifetime", "day", "week", "month"]);
1604
+ var projectCalendarSchema = z10.object({
1406
1605
  /** The timezone of the current calendar day. */
1407
1606
  timeZone: timeZoneNameSchema,
1408
1607
  /** The current calendar date, such as `2026-10-01`. */
1409
- today: z9.string(),
1608
+ today: z10.string(),
1410
1609
  /** When the current calendar day ends, in epoch milliseconds. */
1411
1610
  nextBoundary: timestamp2,
1412
1611
  /** A change that takes effect at the next day boundary, or null. */
1413
- pending: z9.object({ timeZone: timeZoneNameSchema, effectiveAt: timestamp2 }).nullable(),
1612
+ pending: z10.object({ timeZone: timeZoneNameSchema, effectiveAt: timestamp2 }).nullable(),
1414
1613
  /** The `calendar.timeZone` the last deployment that declared one set, or null. */
1415
1614
  declared: timeZoneNameSchema.nullable(),
1416
1615
  /**
1417
1616
  * A stored timezone the calendar no longer accepts, such as a fixed offset a streak named before
1418
1617
  * v1. The calendar reads it as UTC until an operator chooses a timezone. Null otherwise.
1419
1618
  */
1420
- unsupported: z9.string().nullable().default(null)
1619
+ unsupported: z10.string().nullable().default(null)
1421
1620
  });
1422
- var projectCalendarInputSchema = z9.object({
1621
+ var projectCalendarInputSchema = z10.object({
1423
1622
  actionId: identifier,
1424
1623
  timeZone: timeZoneSchema,
1425
- reason: z9.string().trim().min(1).max(500)
1624
+ reason: z10.string().trim().min(1).max(500)
1426
1625
  }).strict();
1427
- var projectCalendarDeclarationSchema = z9.object({ timeZone: timeZoneSchema }).strict();
1626
+ var projectCalendarDeclarationSchema = z10.object({ timeZone: timeZoneSchema }).strict();
1428
1627
 
1429
1628
  // src/streaks.ts
1430
- import { z as z10 } from "zod";
1431
- var streakPolicySchema = z10.object({
1432
- kind: z10.literal("streak"),
1433
- days: z10.number().int().min(1).max(3650)
1434
- });
1435
- var streakProgressSchema = z10.object({
1436
- goal: z10.number().int().positive(),
1437
- current: z10.number().int().nonnegative(),
1438
- best: z10.number().int().nonnegative(),
1439
- today: z10.string(),
1440
- todayQualified: z10.boolean(),
1629
+ import { z as z11 } from "zod";
1630
+ var streakPolicySchema = z11.object({
1631
+ kind: z11.literal("streak"),
1632
+ days: z11.number().int().min(1).max(3650)
1633
+ });
1634
+ var streakProgressSchema = z11.object({
1635
+ goal: z11.number().int().positive(),
1636
+ current: z11.number().int().nonnegative(),
1637
+ best: z11.number().int().nonnegative(),
1638
+ today: z11.string(),
1639
+ todayQualified: z11.boolean(),
1441
1640
  timeZone: timeZoneNameSchema,
1442
- nextBoundary: z10.number().int(),
1443
- pendingTimeZone: z10.object({
1641
+ nextBoundary: z11.number().int(),
1642
+ pendingTimeZone: z11.object({
1444
1643
  timeZone: timeZoneNameSchema,
1445
- effectiveAt: z10.number().int()
1644
+ effectiveAt: z11.number().int()
1446
1645
  }).nullable(),
1447
- days: z10.array(
1448
- z10.object({
1449
- day: z10.number().int(),
1450
- date: z10.string(),
1646
+ days: z11.array(
1647
+ z11.object({
1648
+ day: z11.number().int(),
1649
+ date: z11.string(),
1451
1650
  // The zone the day was recorded in, as stored: days from before v1 can name a fixed offset.
1452
- timeZone: z10.string(),
1453
- occurredAt: z10.number().int()
1651
+ timeZone: z11.string(),
1652
+ occurredAt: z11.number().int()
1454
1653
  })
1455
1654
  ),
1456
- milestone: z10.discriminatedUnion("status", [
1457
- z10.object({ status: z10.literal("pending") }),
1458
- z10.object({
1459
- status: z10.literal("awarded"),
1460
- completion: z10.string(),
1461
- achievedAt: z10.number().int()
1655
+ milestone: z11.discriminatedUnion("status", [
1656
+ z11.object({ status: z11.literal("pending") }),
1657
+ z11.object({
1658
+ status: z11.literal("awarded"),
1659
+ completion: z11.string(),
1660
+ achievedAt: z11.number().int()
1462
1661
  }),
1463
- z10.object({
1464
- status: z10.literal("budget-exhausted"),
1465
- budget: z10.string(),
1466
- achievedAt: z10.number().int()
1662
+ z11.object({
1663
+ status: z11.literal("budget-exhausted"),
1664
+ budget: z11.string(),
1665
+ achievedAt: z11.number().int()
1467
1666
  })
1468
1667
  ])
1469
1668
  });
1470
1669
 
1471
1670
  // src/tracker-triggers.ts
1472
- import { z as z11 } from "zod";
1473
- var timestamp3 = z11.number().int().safe().nonnegative().max(864e13);
1474
- var count2 = z11.number().int().safe().nonnegative();
1475
- var trackerTriggerModeSchema = z11.enum([
1671
+ import { z as z12 } from "zod";
1672
+ var timestamp3 = z12.number().int().safe().nonnegative().max(864e13);
1673
+ var count2 = z12.number().int().safe().nonnegative();
1674
+ var trackerTriggerModeSchema = z12.enum([
1476
1675
  "new-record",
1477
1676
  "new-observation",
1478
1677
  "data-changed"
@@ -1480,20 +1679,20 @@ var trackerTriggerModeSchema = z11.enum([
1480
1679
  function defaultTriggerMode(source) {
1481
1680
  return source === "custom" ? "new-observation" : "new-record";
1482
1681
  }
1483
- var trackerBoundSchema = z11.union([
1484
- z11.number().finite(),
1485
- z11.strictObject({ setting: z11.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) })
1682
+ var trackerBoundSchema = z12.union([
1683
+ z12.number().finite(),
1684
+ z12.strictObject({ setting: z12.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) })
1486
1685
  ]);
1487
- var dataPath = z11.string().max(200).regex(
1686
+ var dataPath = z12.string().max(200).regex(
1488
1687
  /^[^.\s]+(\.[^.\s]+)*$/,
1489
1688
  "Use dot-separated keys, such as metrics.likes"
1490
1689
  );
1491
- var trackerConditionSchema = z11.union([
1492
- z11.strictObject({
1690
+ var trackerConditionSchema = z12.union([
1691
+ z12.strictObject({
1493
1692
  path: dataPath,
1494
- equals: z11.union([z11.string().max(1e3), z11.number().finite(), z11.boolean()])
1693
+ equals: z12.union([z12.string().max(1e3), z12.number().finite(), z12.boolean()])
1495
1694
  }),
1496
- z11.strictObject({
1695
+ z12.strictObject({
1497
1696
  path: dataPath,
1498
1697
  gt: trackerBoundSchema.optional(),
1499
1698
  gte: trackerBoundSchema.optional(),
@@ -1506,9 +1705,9 @@ var trackerConditionSchema = z11.union([
1506
1705
  "Compare with equals, gt, gte, lt or lte"
1507
1706
  )
1508
1707
  ]);
1509
- var trackerWhereSchema = z11.union([
1708
+ var trackerWhereSchema = z12.union([
1510
1709
  trackerConditionSchema,
1511
- z11.array(trackerConditionSchema).min(1).max(10)
1710
+ z12.array(trackerConditionSchema).min(1).max(10)
1512
1711
  ]);
1513
1712
  function whereConditions(where) {
1514
1713
  return where === void 0 ? [] : Array.isArray(where) ? where : [where];
@@ -1520,17 +1719,17 @@ function whereSettings(where) {
1520
1719
  )
1521
1720
  );
1522
1721
  }
1523
- var triggerEnrollmentSchema = z11.enum(["none", "required"]);
1524
- var triggerSinceSchema = z11.enum(["activation", "window", "enrollment"]);
1525
- var triggerHistoricalSchema = z11.enum(["staff", "claim", "automatic"]);
1526
- var trackerTriggerPolicySchema = z11.strictObject({
1722
+ var triggerEnrollmentSchema = z12.enum(["none", "required"]);
1723
+ var triggerSinceSchema = z12.enum(["activation", "window", "enrollment"]);
1724
+ var triggerHistoricalSchema = z12.enum(["staff", "claim", "automatic"]);
1725
+ var trackerTriggerPolicySchema = z12.strictObject({
1527
1726
  /** The tracker's authoring key; publication binds it to the tracker's stable ID. */
1528
1727
  tracker: identifier,
1529
1728
  /**
1530
1729
  * The tracker's source kind, one of `trackerSourceKinds` today. An open string, so readers of
1531
1730
  * releases keep parsing them when a later Relay adds a managed source.
1532
1731
  */
1533
- source: z11.string().min(1).max(100),
1732
+ source: z12.string().min(1).max(100),
1534
1733
  /** Which observations fire. */
1535
1734
  on: trackerTriggerModeSchema,
1536
1735
  where: trackerWhereSchema.optional(),
@@ -1551,7 +1750,7 @@ var trackerTriggerPolicySchema = z11.strictObject({
1551
1750
  * that re-evaluates edits and runs `performance`, firing on each new record and paying its
1552
1751
  * author.
1553
1752
  */
1554
- content: z11.literal(true).optional()
1753
+ content: z12.literal(true).optional()
1555
1754
  }).refine(
1556
1755
  (policy) => policy.since !== "enrollment" || policy.enrollment === "required",
1557
1756
  'since: "enrollment" needs enrollment: "required"'
@@ -1570,72 +1769,72 @@ function beneficiaryRole(policy) {
1570
1769
  return policy.beneficiary;
1571
1770
  }
1572
1771
  var xLink = {
1573
- issuer: z11.string().min(1),
1772
+ issuer: z12.string().min(1),
1574
1773
  /** The account's stable user ID. */
1575
- subject: z11.string().min(1).max(256),
1774
+ subject: z12.string().min(1).max(256),
1576
1775
  /** The member's account selection revision. */
1577
1776
  revision: count2,
1578
1777
  /** When the member linked the account; null when unknown. */
1579
1778
  linkedAt: timestamp3.nullable()
1580
1779
  };
1581
- var trackerAttributionSchema = z11.object({
1780
+ var trackerAttributionSchema = z12.object({
1582
1781
  member: identifier,
1583
1782
  capturedAt: timestamp3,
1584
- account: z11.union([
1585
- z11.object({
1586
- provider: z11.literal("wallet"),
1783
+ account: z12.union([
1784
+ z12.object({
1785
+ provider: z12.literal("wallet"),
1587
1786
  /** Canonical CAIP-10 account ID, as the record names it. */
1588
- id: z11.string().min(5).max(256),
1787
+ id: z12.string().min(5).max(256),
1589
1788
  /** The wallet link's revision. */
1590
1789
  revision: count2,
1591
1790
  /** When the member verified the wallet. */
1592
1791
  linkedAt: timestamp3.nullable()
1593
1792
  }),
1594
- z11.object({ provider: z11.literal("x"), ...xLink }),
1595
- z11.object({ provider: z11.literal("discord"), ...xLink }),
1596
- z11.object({
1597
- provider: z11.literal("member"),
1793
+ z12.object({ provider: z12.literal("x"), ...xLink }),
1794
+ z12.object({ provider: z12.literal("discord"), ...xLink }),
1795
+ z12.object({
1796
+ provider: z12.literal("member"),
1598
1797
  /** The member ID the record names. */
1599
1798
  id: identifier
1600
1799
  }),
1601
- z11.object({
1800
+ z12.object({
1602
1801
  /** Your app's identity kind, such as `app:telegram`. */
1603
1802
  provider: appIdentityKindSchema,
1604
1803
  /** The subject your app signed the member in with, as the record names it. */
1605
- subject: z11.string().min(1).max(256),
1804
+ subject: z12.string().min(1).max(256),
1606
1805
  /** The identity's revision in the project. */
1607
1806
  revision: count2,
1608
1807
  /** When the identity was linked to the member. */
1609
1808
  linkedAt: timestamp3.nullable()
1610
1809
  }),
1611
1810
  /** A kind a later Relay adds. */
1612
- z11.object({ provider: z11.string().min(1) })
1811
+ z12.object({ provider: z12.string().min(1) })
1613
1812
  ])
1614
1813
  });
1615
- var trackerTriggerRecordSchema = z11.object({
1616
- id: z11.string().min(1).max(256),
1617
- source: z11.string(),
1814
+ var trackerTriggerRecordSchema = z12.object({
1815
+ id: z12.string().min(1).max(256),
1816
+ source: z12.string(),
1618
1817
  occurredAt: timestamp3,
1619
1818
  observedAt: timestamp3,
1620
1819
  firstSeenAt: timestamp3,
1621
- author: z11.object({
1622
- id: z11.string().min(1).max(256),
1623
- verified: z11.boolean().nullable(),
1820
+ author: z12.object({
1821
+ id: z12.string().min(1).max(256),
1822
+ verified: z12.boolean().nullable(),
1624
1823
  kind: openIdentityKindSchema.optional()
1625
1824
  }).nullable(),
1626
- accounts: z11.record(accountRoleSchema, trackerRecordAccountSchema).optional(),
1627
- data: z11.record(z11.string(), z11.json()),
1628
- removed: z11.boolean()
1825
+ accounts: z12.record(accountRoleSchema, trackerRecordAccountSchema).optional(),
1826
+ data: z12.record(z12.string(), z12.json()),
1827
+ removed: z12.boolean()
1629
1828
  });
1630
- var trackerContentStageSchema = z11.object({
1829
+ var trackerContentStageSchema = z12.object({
1631
1830
  /** The body's revision: the hash of its canonical JSON. Edits make a new one. */
1632
1831
  revision: identifier,
1633
1832
  /** The captured observation that carried this body. */
1634
1833
  observation: identifier,
1635
1834
  /** The body: an X post's normalized body, or a custom record's `data.body`. */
1636
- body: z11.record(z11.string(), z11.json())
1835
+ body: z12.record(z12.string(), z12.json())
1637
1836
  });
1638
- var trackerTriggerContextSchema = z11.object({
1837
+ var trackerTriggerContextSchema = z12.object({
1639
1838
  /** The tracker's stable ID. */
1640
1839
  tracker: identifier,
1641
1840
  /** The tracker's authoring key. */
@@ -1657,61 +1856,61 @@ var trackerTriggerContextSchema = z11.object({
1657
1856
  });
1658
1857
 
1659
1858
  // src/completion.ts
1660
- import { z as z12 } from "zod";
1661
- var name = z12.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/);
1662
- var completionPolicySchema = z12.discriminatedUnion("kind", [
1859
+ import { z as z13 } from "zod";
1860
+ var name = z13.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$/);
1861
+ var completionPolicySchema = z13.discriminatedUnion("kind", [
1663
1862
  streakPolicySchema,
1664
1863
  counterPolicySchema,
1665
- z12.object({ kind: z12.literal("once") }).strict(),
1666
- z12.object({ kind: z12.literal("keyed") }).strict()
1864
+ z13.object({ kind: z13.literal("once") }).strict(),
1865
+ z13.object({ kind: z13.literal("keyed") }).strict()
1667
1866
  ]);
1668
- var completionKeySchema = z12.string().min(1).max(500);
1669
- var budgetSchema = z12.object({
1867
+ var completionKeySchema = z13.string().min(1).max(500);
1868
+ var budgetSchema = z13.object({
1670
1869
  id: name,
1671
- scope: z12.enum(["member", "project"]),
1870
+ scope: z13.enum(["member", "project"]),
1672
1871
  /**
1673
1872
  * The project calendar period of the attempt's eligibility time that one bucket covers:
1674
1873
  * `"day"`, `"week"` (ISO, starting on Monday) or `"month"` in the project timezone.
1675
1874
  * `"lifetime"` never resets.
1676
1875
  */
1677
1876
  period: calendarPeriodSchema,
1678
- limit: z12.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1679
- cost: z12.union([
1680
- z12.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1681
- z12.object({ balance: name }).strict()
1877
+ limit: z13.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1878
+ cost: z13.union([
1879
+ z13.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1880
+ z13.object({ balance: name }).strict()
1682
1881
  ])
1683
1882
  }).strict();
1684
1883
 
1685
1884
  // src/integrations.ts
1686
- import { z as z13 } from "zod";
1687
- var evaluatorIntegrationProviderSchema = z13.enum(["discord", "x"]);
1688
- var integrationProviderSchema = z13.enum(["discord"]);
1689
- var discordServerSchema = z13.object({
1690
- id: z13.string().regex(/^[0-9]{1,20}$/),
1691
- name: z13.string().min(1),
1692
- icon: z13.string().nullable()
1693
- });
1694
- var projectIntegrationSchema = z13.object({
1885
+ import { z as z14 } from "zod";
1886
+ var evaluatorIntegrationProviderSchema = z14.enum(["discord", "x"]);
1887
+ var integrationProviderSchema = z14.enum(["discord"]);
1888
+ var discordServerSchema = z14.object({
1889
+ id: z14.string().regex(/^[0-9]{1,20}$/),
1890
+ name: z14.string().min(1),
1891
+ icon: z14.string().nullable()
1892
+ });
1893
+ var projectIntegrationSchema = z14.object({
1695
1894
  provider: integrationProviderSchema,
1696
- configured: z13.boolean(),
1697
- status: z13.enum(["disconnected", "ready", "attention"]),
1698
- revision: z13.number().int().nonnegative(),
1895
+ configured: z14.boolean(),
1896
+ status: z14.enum(["disconnected", "ready", "attention"]),
1897
+ revision: z14.number().int().nonnegative(),
1699
1898
  server: discordServerSchema.nullable(),
1700
- issue: z13.string().nullable(),
1701
- connectedAt: z13.number().default(0)
1899
+ issue: z14.string().nullable(),
1900
+ connectedAt: z14.number().default(0)
1702
1901
  });
1703
1902
 
1704
1903
  // src/submission-input.ts
1705
- import { z as z14 } from "zod";
1706
- var textOptionsSchema = z14.object({
1707
- required: z14.boolean().default(true),
1708
- minLength: z14.number().int().min(0).max(1e4).default(1),
1709
- maxLength: z14.number().int().min(1).max(1e4).default(1e4)
1904
+ import { z as z15 } from "zod";
1905
+ var textOptionsSchema = z15.object({
1906
+ required: z15.boolean().default(true),
1907
+ minLength: z15.number().int().min(0).max(1e4).default(1),
1908
+ maxLength: z15.number().int().min(1).max(1e4).default(1e4)
1710
1909
  }).strict().refine(
1711
1910
  (v) => v.minLength <= v.maxLength,
1712
1911
  "minLength must not exceed maxLength"
1713
1912
  );
1714
- var hostSchema = z14.string().min(1).max(253).refine((host) => {
1913
+ var hostSchema = z15.string().min(1).max(253).refine((host) => {
1715
1914
  if (!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/i.test(host) || host.includes("..")) {
1716
1915
  return false;
1717
1916
  }
@@ -1722,13 +1921,13 @@ var hostSchema = z14.string().min(1).max(253).refine((host) => {
1722
1921
  return false;
1723
1922
  }
1724
1923
  }, "Use a hostname without a scheme, path, port, or wildcard");
1725
- var urlOptionsSchema = z14.object({
1726
- required: z14.boolean().default(true),
1727
- allowedHosts: z14.array(hostSchema).min(1).max(100).optional()
1924
+ var urlOptionsSchema = z15.object({
1925
+ required: z15.boolean().default(true),
1926
+ allowedHosts: z15.array(hostSchema).min(1).max(100).optional()
1728
1927
  }).strict();
1729
- var textEvidenceSchema = z14.object({ kind: z14.literal("text"), value: z14.string().max(1e4) }).strict();
1730
- var urlEvidenceSchema = z14.object({ kind: z14.literal("url"), value: z14.string().max(2048) }).strict();
1731
- var valueEvidenceSchema = z14.discriminatedUnion("kind", [
1928
+ var textEvidenceSchema = z15.object({ kind: z15.literal("text"), value: z15.string().max(1e4) }).strict();
1929
+ var urlEvidenceSchema = z15.object({ kind: z15.literal("url"), value: z15.string().max(2048) }).strict();
1930
+ var valueEvidenceSchema = z15.discriminatedUnion("kind", [
1732
1931
  textEvidenceSchema,
1733
1932
  urlEvidenceSchema
1734
1933
  ]);
@@ -1791,22 +1990,22 @@ function xPostId(value) {
1791
1990
  }
1792
1991
 
1793
1992
  // src/quiz.ts
1794
- import { z as z15 } from "zod";
1795
- var quizId = z15.string().regex(/^[a-zA-Z0-9_-]+$/).max(100);
1796
- var quizChoiceSchema = z15.object({ id: quizId, label: z15.string().trim().min(1).max(500) }).strict();
1797
- var quizQuestionSchema = z15.object({
1993
+ import { z as z16 } from "zod";
1994
+ var quizId = z16.string().regex(/^[a-zA-Z0-9_-]+$/).max(100);
1995
+ var quizChoiceSchema = z16.object({ id: quizId, label: z16.string().trim().min(1).max(500) }).strict();
1996
+ var quizQuestionSchema = z16.object({
1798
1997
  id: quizId,
1799
- prompt: z15.string().trim().min(1).max(1e3),
1800
- choices: z15.array(quizChoiceSchema).min(2).max(8).refine(
1998
+ prompt: z16.string().trim().min(1).max(1e3),
1999
+ choices: z16.array(quizChoiceSchema).min(2).max(8).refine(
1801
2000
  (choices) => new Set(choices.map((choice) => choice.id)).size === choices.length,
1802
2001
  "Choice IDs must be unique"
1803
2002
  )
1804
2003
  }).strict();
1805
- var quizQuestionsSchema = z15.array(quizQuestionSchema).min(1).max(20).refine(
2004
+ var quizQuestionsSchema = z16.array(quizQuestionSchema).min(1).max(20).refine(
1806
2005
  (questions) => new Set(questions.map((question) => question.id)).size === questions.length,
1807
2006
  "Question IDs must be unique"
1808
2007
  );
1809
- var quizContentSchema = z15.array(
2008
+ var quizContentSchema = z16.array(
1810
2009
  quizQuestionSchema.extend({ correct: quizId }).refine(
1811
2010
  (question) => question.choices.some((choice) => choice.id === question.correct),
1812
2011
  "Choose a correct answer from the available choices"
@@ -1817,98 +2016,98 @@ var quizContentSchema = z15.array(
1817
2016
  );
1818
2017
 
1819
2018
  // src/resources.ts
1820
- import { z as z16 } from "zod";
1821
- var resourceSourceSchema = z16.union([
1822
- z16.strictObject({
1823
- provider: z16.literal("domino"),
1824
- resource: z16.literal("point-ledger")
2019
+ import { z as z17 } from "zod";
2020
+ var resourceSourceSchema = z17.union([
2021
+ z17.strictObject({
2022
+ provider: z17.literal("domino"),
2023
+ resource: z17.literal("point-ledger")
1825
2024
  }),
1826
2025
  discordResourceSourceSchema
1827
2026
  ]);
1828
- var resourceRequestSchema = z16.object({
2027
+ var resourceRequestSchema = z17.object({
1829
2028
  source: resourceSourceSchema,
1830
- query: z16.string().max(100).optional(),
1831
- cursor: z16.string().regex(/^\d{1,6}$/).optional(),
1832
- ids: z16.array(z16.string().min(1).max(100)).max(50).optional()
2029
+ query: z17.string().max(100).optional(),
2030
+ cursor: z17.string().regex(/^\d{1,6}$/).optional(),
2031
+ ids: z17.array(z17.string().min(1).max(100)).max(50).optional()
1833
2032
  }).strict();
1834
- var resourceOptionsSchema = z16.object({
1835
- revision: z16.number().int(),
1836
- options: z16.array(
1837
- z16.object({
1838
- id: z16.string(),
1839
- label: z16.string(),
1840
- description: z16.string().optional(),
1841
- group: z16.string().optional(),
1842
- disabledReason: z16.string().optional()
2033
+ var resourceOptionsSchema = z17.object({
2034
+ revision: z17.number().int(),
2035
+ options: z17.array(
2036
+ z17.object({
2037
+ id: z17.string(),
2038
+ label: z17.string(),
2039
+ description: z17.string().optional(),
2040
+ group: z17.string().optional(),
2041
+ disabledReason: z17.string().optional()
1843
2042
  })
1844
2043
  ),
1845
2044
  /** Pass back as `cursor` for the next page; null on the last one. */
1846
- nextCursor: z16.string().nullable().default(null),
2045
+ nextCursor: z17.string().nullable().default(null),
1847
2046
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
1848
- cursor: z16.string().nullable()
2047
+ cursor: z17.string().nullable()
1849
2048
  });
1850
2049
 
1851
2050
  // src/settings.ts
1852
- import { z as z18 } from "zod";
2051
+ import { z as z19 } from "zod";
1853
2052
 
1854
2053
  // src/setting-values.ts
1855
- import { z as z17 } from "zod";
1856
- var settingInstant = z17.iso.datetime({ offset: true }).transform((value) => new Date(value).toISOString());
1857
- var settingResourceId = z17.union([
1858
- z17.literal(""),
1859
- z17.string().regex(/^\S{1,200}$/)
2054
+ import { z as z18 } from "zod";
2055
+ var settingInstant = z18.iso.datetime({ offset: true }).transform((value) => new Date(value).toISOString());
2056
+ var settingResourceId = z18.union([
2057
+ z18.literal(""),
2058
+ z18.string().regex(/^\S{1,200}$/)
1860
2059
  ]);
1861
2060
 
1862
2061
  // src/settings.ts
1863
- var base = { label: z18.string().min(1), description: z18.string().optional() };
1864
- var settingFieldSchema = z18.discriminatedUnion("kind", [
1865
- z18.object({
2062
+ var base = { label: z19.string().min(1), description: z19.string().optional() };
2063
+ var settingFieldSchema = z19.discriminatedUnion("kind", [
2064
+ z19.object({
1866
2065
  ...base,
1867
- kind: z18.literal("point-ledger"),
1868
- default: identifier.or(z18.literal(""))
2066
+ kind: z19.literal("point-ledger"),
2067
+ default: identifier.or(z19.literal(""))
1869
2068
  }).strict(),
1870
- z18.object({ ...base, kind: z18.literal("datetime"), default: settingInstant }).strict(),
1871
- z18.object({
2069
+ z19.object({ ...base, kind: z19.literal("datetime"), default: settingInstant }).strict(),
2070
+ z19.object({
1872
2071
  ...base,
1873
- kind: z18.literal("resource"),
2072
+ kind: z19.literal("resource"),
1874
2073
  default: settingResourceId,
1875
2074
  source: resourceSourceSchema
1876
2075
  }).strict(),
1877
- z18.object({ ...base, kind: z18.literal("quiz"), default: quizContentSchema }).strict(),
1878
- z18.object({
2076
+ z19.object({ ...base, kind: z19.literal("quiz"), default: quizContentSchema }).strict(),
2077
+ z19.object({
1879
2078
  ...base,
1880
- kind: z18.literal("text"),
1881
- default: z18.string(),
1882
- minLength: z18.number().int().nonnegative(),
1883
- maxLength: z18.number().int().positive(),
1884
- multiline: z18.boolean()
2079
+ kind: z19.literal("text"),
2080
+ default: z19.string(),
2081
+ minLength: z19.number().int().nonnegative(),
2082
+ maxLength: z19.number().int().positive(),
2083
+ multiline: z19.boolean()
1885
2084
  }).strict(),
1886
- z18.object({
2085
+ z19.object({
1887
2086
  ...base,
1888
- kind: z18.literal("integer"),
1889
- default: z18.number().int(),
1890
- min: z18.number().int(),
1891
- max: z18.number().int()
2087
+ kind: z19.literal("integer"),
2088
+ default: z19.number().int(),
2089
+ min: z19.number().int(),
2090
+ max: z19.number().int()
1892
2091
  }).strict(),
1893
- z18.object({ ...base, kind: z18.literal("boolean"), default: z18.boolean() }).strict(),
1894
- z18.object({
2092
+ z19.object({ ...base, kind: z19.literal("boolean"), default: z19.boolean() }).strict(),
2093
+ z19.object({
1895
2094
  ...base,
1896
- kind: z18.literal("choice"),
1897
- default: z18.string(),
1898
- options: z18.array(z18.string().min(1)).min(1)
2095
+ kind: z19.literal("choice"),
2096
+ default: z19.string(),
2097
+ options: z19.array(z19.string().min(1)).min(1)
1899
2098
  }).strict()
1900
2099
  ]);
1901
- var settingsFieldsSchema = z18.record(
1902
- z18.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
2100
+ var settingsFieldsSchema = z19.record(
2101
+ z19.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
1903
2102
  settingFieldSchema
1904
2103
  );
1905
- var settingsValuesSchema = z18.record(
1906
- z18.string(),
1907
- z18.union([z18.string(), z18.number().finite(), z18.boolean(), quizContentSchema])
2104
+ var settingsValuesSchema = z19.record(
2105
+ z19.string(),
2106
+ z19.union([z19.string(), z19.number().finite(), z19.boolean(), quizContentSchema])
1908
2107
  );
1909
- function parseSettings(fields, input) {
2108
+ function parseSettings(fields2, input) {
1910
2109
  const shape = {};
1911
- for (const [key, field] of Object.entries(fields)) {
2110
+ for (const [key, field] of Object.entries(fields2)) {
1912
2111
  switch (field.kind) {
1913
2112
  case "point-ledger":
1914
2113
  shape[key] = settingResourceId.default(field.default);
@@ -1923,24 +2122,24 @@ function parseSettings(fields, input) {
1923
2122
  shape[key] = quizContentSchema.default(field.default);
1924
2123
  break;
1925
2124
  case "text":
1926
- shape[key] = z18.string().min(field.minLength).max(field.maxLength).default(field.default);
2125
+ shape[key] = z19.string().min(field.minLength).max(field.maxLength).default(field.default);
1927
2126
  break;
1928
2127
  case "integer":
1929
- shape[key] = z18.number().int().min(field.min).max(field.max).default(field.default);
2128
+ shape[key] = z19.number().int().min(field.min).max(field.max).default(field.default);
1930
2129
  break;
1931
2130
  case "boolean":
1932
- shape[key] = z18.boolean().default(field.default);
2131
+ shape[key] = z19.boolean().default(field.default);
1933
2132
  break;
1934
2133
  case "choice":
1935
- shape[key] = z18.enum(field.options).default(field.default);
2134
+ shape[key] = z19.enum(field.options).default(field.default);
1936
2135
  break;
1937
2136
  }
1938
2137
  }
1939
- return settingsValuesSchema.parse(z18.object(shape).strict().parse(input));
2138
+ return settingsValuesSchema.parse(z19.object(shape).strict().parse(input));
1940
2139
  }
1941
- function missingResourceSettings(fields, values) {
1942
- return Object.entries(fields).filter(
1943
- ([key, field]) => (field.kind === "resource" || field.kind === "point-ledger") && !values[key]
2140
+ function missingResourceSettings(fields2, values2) {
2141
+ return Object.entries(fields2).filter(
2142
+ ([key, field]) => (field.kind === "resource" || field.kind === "point-ledger") && !values2[key]
1944
2143
  ).map(([key]) => key);
1945
2144
  }
1946
2145
  function compatibleSettingKinds(previous, next) {
@@ -1957,21 +2156,21 @@ function authoringKey(input) {
1957
2156
  }
1958
2157
 
1959
2158
  // src/campaigns.ts
1960
- import { z as z19 } from "zod";
1961
- var timestamp4 = z19.number().int().safe().nonnegative();
1962
- var availabilityWindowSchema = z19.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
2159
+ import { z as z20 } from "zod";
2160
+ var timestamp4 = z20.number().int().safe().nonnegative();
2161
+ var availabilityWindowSchema = z20.object({ from: timestamp4, until: timestamp4 }).strict().refine((window) => window.until > window.from, {
1963
2162
  message: "Window end must follow its start",
1964
2163
  path: ["until"]
1965
2164
  });
1966
- var campaignDefinitionSchema = z19.object({
2165
+ var campaignDefinitionSchema = z20.object({
1967
2166
  key: identifier,
1968
- title: z19.string().trim().min(1).max(120),
2167
+ title: z20.string().trim().min(1).max(120),
1969
2168
  window: availabilityWindowSchema.optional(),
1970
- enrollment: z19.enum(["none", "required"]).default("none")
2169
+ enrollment: z20.enum(["none", "required"]).default("none")
1971
2170
  }).strict();
1972
2171
  var campaignAuthoringSchema = campaignDefinitionSchema.omit({ key: true, title: true }).extend({
1973
2172
  ...authoringIdentityShape,
1974
- title: z19.string().trim().min(1).max(120).optional()
2173
+ title: z20.string().trim().min(1).max(120).optional()
1975
2174
  }).strict().transform((value) => {
1976
2175
  const normalized = value;
1977
2176
  return campaignDefinitionSchema.parse({
@@ -1985,42 +2184,42 @@ function defineCampaign(input) {
1985
2184
  var campaignViewSchema = campaignDefinitionSchema.extend({
1986
2185
  enrolledAt: timestamp4.nullable(),
1987
2186
  withdrawnAt: timestamp4.nullable().default(null),
1988
- withdrawalReason: z19.string().nullable().default(null)
2187
+ withdrawalReason: z20.string().nullable().default(null)
1989
2188
  });
1990
- var campaignEnrollmentInputSchema = z19.object({ actionId: identifier, campaign: identifier }).strict();
2189
+ var campaignEnrollmentInputSchema = z20.object({ actionId: identifier, campaign: identifier }).strict();
1991
2190
  var memberCampaignEnrollmentInputSchema = campaignEnrollmentInputSchema.extend({ member: identifier });
1992
2191
  var campaignWithdrawalInputSchema = campaignEnrollmentInputSchema;
1993
2192
  var memberCampaignWithdrawalInputSchema = campaignWithdrawalInputSchema.extend({
1994
2193
  member: identifier,
1995
- reason: z19.string().trim().min(1).max(500)
2194
+ reason: z20.string().trim().min(1).max(500)
1996
2195
  });
1997
- var campaignEnrollmentSchema = z19.object({
2196
+ var campaignEnrollmentSchema = z20.object({
1998
2197
  campaign: identifier,
1999
2198
  member: identifier,
2000
2199
  enrolledAt: timestamp4,
2001
2200
  withdrawnAt: timestamp4.nullable().default(null),
2002
- withdrawalReason: z19.string().nullable().default(null)
2201
+ withdrawalReason: z20.string().nullable().default(null)
2003
2202
  });
2004
2203
 
2005
2204
  // src/resource-handle.ts
2006
- import { z as z20 } from "zod";
2205
+ import { z as z21 } from "zod";
2007
2206
  function resourceHandle(_kind, definition) {
2008
2207
  return definition;
2009
2208
  }
2010
- var ledgerSettingSchema = identifier.or(z20.literal("")).brand();
2209
+ var ledgerSettingSchema = identifier.or(z21.literal("")).brand();
2011
2210
  function ledgerKey(ledger) {
2012
2211
  return typeof ledger === "string" ? ledger : ledger.key;
2013
2212
  }
2014
2213
 
2015
2214
  // src/groups.ts
2016
- import { z as z21 } from "zod";
2017
- var projectGroupSchema = z21.object({
2215
+ import { z as z22 } from "zod";
2216
+ var projectGroupSchema = z22.object({
2018
2217
  key: identifier,
2019
- title: z21.string().trim().min(1).max(120)
2218
+ title: z22.string().trim().min(1).max(120)
2020
2219
  }).strict();
2021
2220
  var projectGroupAuthoringSchema = projectGroupSchema.omit({ key: true, title: true }).extend({
2022
2221
  ...authoringIdentityShape,
2023
- title: z21.string().trim().min(1).max(120).optional()
2222
+ title: z22.string().trim().min(1).max(120).optional()
2024
2223
  }).strict().transform((value) => {
2025
2224
  return projectGroupSchema.parse({
2026
2225
  ...value,
@@ -2033,92 +2232,92 @@ function defineGroup(input) {
2033
2232
  function projectGroupKey(group) {
2034
2233
  return identifier.parse(group.key);
2035
2234
  }
2036
- var groupTitle = z21.string().trim().min(1).max(120);
2037
- var reason = z21.string().trim().min(1).max(1e3);
2038
- var timestamp5 = z21.number().int().nonnegative().max(864e13);
2039
- var createGroupSchema = z21.object({ actionId: identifier, key: identifier, title: groupTitle }).strict();
2040
- var updateGroupSchema = z21.object({ title: groupTitle }).strict();
2041
- var addGroupMemberSchema = z21.object({ actionId: identifier, member: identifier, reason }).strict();
2042
- var removeGroupMemberSchema = z21.object({ actionId: identifier, reason }).strict();
2043
- var groupPageQuerySchema = z21.strictObject({
2235
+ var groupTitle = z22.string().trim().min(1).max(120);
2236
+ var reason = z22.string().trim().min(1).max(1e3);
2237
+ var timestamp5 = z22.number().int().nonnegative().max(864e13);
2238
+ var createGroupSchema = z22.object({ actionId: identifier, key: identifier, title: groupTitle }).strict();
2239
+ var updateGroupSchema = z22.object({ title: groupTitle }).strict();
2240
+ var addGroupMemberSchema = z22.object({ actionId: identifier, member: identifier, reason }).strict();
2241
+ var removeGroupMemberSchema = z22.object({ actionId: identifier, reason }).strict();
2242
+ var groupPageQuerySchema = z22.strictObject({
2044
2243
  cursor: pageCursorSchema.optional(),
2045
2244
  /** Items per page, 1–100; the default is 50. */
2046
- limit: z21.number().int().min(1).max(100).optional()
2245
+ limit: z22.number().int().min(1).max(100).optional()
2047
2246
  });
2048
- var managedGroupSchema = z21.object({
2247
+ var managedGroupSchema = z22.object({
2049
2248
  key: identifier,
2050
- title: z21.string(),
2051
- members: z21.number().int().nonnegative(),
2249
+ title: z22.string(),
2250
+ members: z22.number().int().nonnegative(),
2052
2251
  createdAt: timestamp5,
2053
2252
  archivedAt: timestamp5.nullable()
2054
2253
  });
2055
- var groupPageSchema = z21.object({
2056
- items: z21.array(managedGroupSchema),
2254
+ var groupPageSchema = z22.object({
2255
+ items: z22.array(managedGroupSchema),
2057
2256
  nextCursor: pageCursorSchema.nullable()
2058
2257
  });
2059
- var groupMemberSchema = z21.object({
2258
+ var groupMemberSchema = z22.object({
2060
2259
  member: identifier,
2061
2260
  addedAt: timestamp5.nullable()
2062
2261
  });
2063
- var groupMemberPageSchema = z21.object({
2064
- items: z21.array(groupMemberSchema),
2262
+ var groupMemberPageSchema = z22.object({
2263
+ items: z22.array(groupMemberSchema),
2065
2264
  nextCursor: pageCursorSchema.nullable()
2066
2265
  });
2067
2266
 
2068
2267
  // src/prerequisites.ts
2069
- import { z as z22 } from "zod";
2070
- var amount = z22.number().int().safe().nonnegative();
2268
+ import { z as z23 } from "zod";
2269
+ var amount = z23.number().int().safe().nonnegative();
2071
2270
  var threshold = amount.positive();
2072
- var completionPrerequisiteSchema = z22.discriminatedUnion("scope", [
2073
- z22.object({
2074
- kind: z22.literal("completion"),
2271
+ var completionPrerequisiteSchema = z23.discriminatedUnion("scope", [
2272
+ z23.object({
2273
+ kind: z23.literal("completion"),
2075
2274
  quest: identifier,
2076
- scope: z22.literal("ever")
2275
+ scope: z23.literal("ever")
2077
2276
  }).strict(),
2078
- z22.object({
2079
- kind: z22.literal("completion"),
2277
+ z23.object({
2278
+ kind: z23.literal("completion"),
2080
2279
  quest: identifier,
2081
- scope: z22.literal("period"),
2280
+ scope: z23.literal("period"),
2082
2281
  period: calendarPeriodSchema.exclude(["lifetime"])
2083
2282
  }).strict()
2084
2283
  ]);
2085
- var balancePrerequisiteSchema = z22.object({
2086
- kind: z22.literal("balance"),
2284
+ var balancePrerequisiteSchema = z23.object({
2285
+ kind: z23.literal("balance"),
2087
2286
  balance: identifier,
2088
2287
  minimum: threshold
2089
2288
  }).strict();
2090
- var groupPrerequisiteSchema = z22.object({ kind: z22.literal("group"), group: identifier, title: z22.string() }).strict();
2091
- var prerequisiteSchema = z22.discriminatedUnion("kind", [
2289
+ var groupPrerequisiteSchema = z23.object({ kind: z23.literal("group"), group: identifier, title: z23.string() }).strict();
2290
+ var prerequisiteSchema = z23.discriminatedUnion("kind", [
2092
2291
  completionPrerequisiteSchema,
2093
2292
  balancePrerequisiteSchema,
2094
2293
  groupPrerequisiteSchema
2095
2294
  ]);
2096
- var missingPrerequisiteSchema = z22.union([
2097
- z22.object({
2098
- kind: z22.literal("completion"),
2295
+ var missingPrerequisiteSchema = z23.union([
2296
+ z23.object({
2297
+ kind: z23.literal("completion"),
2099
2298
  quest: identifier,
2100
- title: z22.string(),
2101
- scope: z22.literal("ever")
2299
+ title: z23.string(),
2300
+ scope: z23.literal("ever")
2102
2301
  }),
2103
- z22.object({
2104
- kind: z22.literal("completion"),
2302
+ z23.object({
2303
+ kind: z23.literal("completion"),
2105
2304
  quest: identifier,
2106
- title: z22.string(),
2107
- scope: z22.literal("period"),
2305
+ title: z23.string(),
2306
+ scope: z23.literal("period"),
2108
2307
  period: calendarPeriodSchema.exclude(["lifetime"]),
2109
- resetsAt: z22.number().int().safe()
2308
+ resetsAt: z23.number().int().safe()
2110
2309
  }),
2111
- z22.object({
2112
- kind: z22.literal("balance"),
2310
+ z23.object({
2311
+ kind: z23.literal("balance"),
2113
2312
  balance: identifier,
2114
- title: z22.string(),
2313
+ title: z23.string(),
2115
2314
  minimum: threshold,
2116
2315
  current: amount
2117
2316
  }),
2118
- z22.object({
2119
- kind: z22.literal("group"),
2317
+ z23.object({
2318
+ kind: z23.literal("group"),
2120
2319
  group: identifier,
2121
- title: z22.string()
2320
+ title: z23.string()
2122
2321
  })
2123
2322
  ]);
2124
2323
  function completed(quest, options = {}) {
@@ -2146,33 +2345,33 @@ function inGroup(group) {
2146
2345
  }
2147
2346
 
2148
2347
  // src/schema.ts
2149
- import { z as z23 } from "zod";
2150
- var pointsRewardSchema = z23.object({
2151
- kind: z23.literal("points").default("points"),
2348
+ import { z as z24 } from "zod";
2349
+ var pointsRewardSchema = z24.object({
2350
+ kind: z24.literal("points").default("points"),
2152
2351
  balance: identifier,
2153
- amount: z23.number().int().min(0).max(1e4)
2352
+ amount: z24.number().int().min(0).max(1e4)
2154
2353
  }).strict();
2155
- var tieredRewardDefinitionSchema = z23.object({
2354
+ var tieredRewardDefinitionSchema = z24.object({
2156
2355
  id: identifier,
2157
- title: z23.string().min(1).max(120),
2158
- tiers: z23.array(
2159
- z23.object({ id: identifier, title: z23.string().min(1).max(120) }).strict()
2356
+ title: z24.string().min(1).max(120),
2357
+ tiers: z24.array(
2358
+ z24.object({ id: identifier, title: z24.string().min(1).max(120) }).strict()
2160
2359
  ).min(1).max(20).refine(
2161
2360
  (tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
2162
2361
  "Tier IDs must be unique"
2163
2362
  ),
2164
- inventory: z23.object({ kind: z23.literal("untracked") }).strict(),
2165
- fulfillment: z23.discriminatedUnion("kind", [
2166
- z23.object({ kind: z23.literal("staff-handover") }).strict(),
2167
- z23.object({ kind: z23.literal("automatic") }).strict()
2363
+ inventory: z24.object({ kind: z24.literal("untracked") }).strict(),
2364
+ fulfillment: z24.discriminatedUnion("kind", [
2365
+ z24.object({ kind: z24.literal("staff-handover") }).strict(),
2366
+ z24.object({ kind: z24.literal("automatic") }).strict()
2168
2367
  ])
2169
2368
  }).strict();
2170
- var tieredRewardReferenceSchema = z23.object({
2369
+ var tieredRewardReferenceSchema = z24.object({
2171
2370
  id: identifier,
2172
2371
  key: identifier.nullable()
2173
2372
  });
2174
- var tierRewardSchema = z23.object({
2175
- kind: z23.literal("tier"),
2373
+ var tierRewardSchema = z24.object({
2374
+ kind: z24.literal("tier"),
2176
2375
  reward: tieredRewardDefinitionSchema,
2177
2376
  tier: identifier
2178
2377
  }).strict().refine(
@@ -2180,7 +2379,7 @@ var tierRewardSchema = z23.object({
2180
2379
  "Unknown reward tier"
2181
2380
  );
2182
2381
  var integrationRewardSchema = discordRewardSchema;
2183
- var rewardSchema = z23.union([
2382
+ var rewardSchema = z24.union([
2184
2383
  pointsRewardSchema,
2185
2384
  tierRewardSchema,
2186
2385
  integrationRewardSchema
@@ -2191,39 +2390,39 @@ function rewardKey(reward) {
2191
2390
  }
2192
2391
  return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
2193
2392
  }
2194
- var triggerSchema = z23.union([
2195
- z23.object({
2196
- kind: z23.literal("manual"),
2197
- input: z23.literal("text"),
2393
+ var triggerSchema = z24.union([
2394
+ z24.object({
2395
+ kind: z24.literal("manual"),
2396
+ input: z24.literal("text"),
2198
2397
  constraints: textOptionsSchema,
2199
- actor: z23.enum(["member", "staff"]).optional()
2398
+ actor: z24.enum(["member", "staff"]).optional()
2200
2399
  }).strict(),
2201
- z23.object({
2202
- kind: z23.literal("manual"),
2203
- input: z23.literal("url"),
2400
+ z24.object({
2401
+ kind: z24.literal("manual"),
2402
+ input: z24.literal("url"),
2204
2403
  constraints: urlOptionsSchema,
2205
- actor: z23.enum(["member", "staff"]).optional()
2404
+ actor: z24.enum(["member", "staff"]).optional()
2206
2405
  }).strict(),
2207
- z23.object({
2208
- kind: z23.literal("manual"),
2209
- input: z23.enum(["photo", "quiz", "none"]),
2210
- actor: z23.enum(["member", "staff"]).optional()
2406
+ z24.object({
2407
+ kind: z24.literal("manual"),
2408
+ input: z24.enum(["photo", "quiz", "none"]),
2409
+ actor: z24.enum(["member", "staff"]).optional()
2211
2410
  }).strict(),
2212
- z23.object({
2213
- kind: z23.literal("automatic"),
2411
+ z24.object({
2412
+ kind: z24.literal("automatic"),
2214
2413
  tracker: trackerTriggerPolicySchema.optional()
2215
2414
  }).strict()
2216
2415
  ]);
2217
- var triggerResponseSchema = z23.union(
2416
+ var triggerResponseSchema = z24.union(
2218
2417
  triggerSchema.options.map((option) => option.strip())
2219
2418
  );
2220
- var photoResultSchema = z23.object({
2221
- kind: z23.enum(["pass", "fail", "unclear"]),
2222
- reason: z23.string().min(1).max(2e3)
2419
+ var photoResultSchema = z24.object({
2420
+ kind: z24.enum(["pass", "fail", "unclear"]),
2421
+ reason: z24.string().min(1).max(2e3)
2223
2422
  }).strict();
2224
- var textReviewInputSchema = z23.object({
2225
- text: z23.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
2226
- criteria: z23.string().trim().min(1).max(2e3)
2423
+ var textReviewInputSchema = z24.object({
2424
+ text: z24.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
2425
+ criteria: z24.string().trim().min(1).max(2e3)
2227
2426
  }).strict();
2228
2427
  var textResultSchema = photoResultSchema;
2229
2428
  var deferPolicy = {
@@ -2233,53 +2432,53 @@ var deferPolicy = {
2233
2432
  horizonMs: 864e5,
2234
2433
  maxDefers: 100
2235
2434
  };
2236
- var evaluatorProgressSchema = z23.object({
2237
- current: z23.number().finite().nonnegative(),
2238
- target: z23.number().finite().positive(),
2239
- reason: z23.string().min(1).max(2e3)
2435
+ var evaluatorProgressSchema = z24.object({
2436
+ current: z24.number().finite().nonnegative(),
2437
+ target: z24.number().finite().positive(),
2438
+ reason: z24.string().min(1).max(2e3)
2240
2439
  }).refine((value) => value.current <= value.target, {
2241
2440
  message: "Progress current must not exceed target"
2242
2441
  });
2243
- var decisionSchema = z23.discriminatedUnion("kind", [
2244
- z23.strictObject({
2245
- kind: z23.literal("defer"),
2246
- reason: z23.string().min(1).max(2e3),
2247
- retryAfterMs: z23.number().int().min(deferPolicy.minRetryAfterMs).max(deferPolicy.maxRetryAfterMs).optional(),
2442
+ var decisionSchema = z24.discriminatedUnion("kind", [
2443
+ z24.strictObject({
2444
+ kind: z24.literal("defer"),
2445
+ reason: z24.string().min(1).max(2e3),
2446
+ retryAfterMs: z24.number().int().min(deferPolicy.minRetryAfterMs).max(deferPolicy.maxRetryAfterMs).optional(),
2248
2447
  /** Absolute Unix milliseconds; the platform can only shorten its existing deadline. */
2249
- until: z23.number().int().safe().nonnegative().optional()
2448
+ until: z24.number().int().safe().nonnegative().optional()
2250
2449
  }),
2251
- evaluatorProgressSchema.safeExtend({ kind: z23.literal("progress") }).strict(),
2252
- z23.object({
2253
- kind: z23.literal("accept"),
2254
- rewards: z23.array(rewardSchema).max(10),
2450
+ evaluatorProgressSchema.safeExtend({ kind: z24.literal("progress") }).strict(),
2451
+ z24.object({
2452
+ kind: z24.literal("accept"),
2453
+ rewards: z24.array(rewardSchema).max(10),
2255
2454
  completionKey: completionKeySchema.optional()
2256
2455
  }).strict(),
2257
- z23.object({
2258
- kind: z23.literal("reject"),
2259
- reason: z23.string().min(1).max(2e3),
2456
+ z24.object({
2457
+ kind: z24.literal("reject"),
2458
+ reason: z24.string().min(1).max(2e3),
2260
2459
  /** The evaluator asked for human review, but review is off for the quest, so this is a reject. */
2261
- requestedReview: z23.literal(true).optional()
2460
+ requestedReview: z24.literal(true).optional()
2262
2461
  }).strict(),
2263
- z23.object({
2264
- kind: z23.literal("review"),
2265
- reason: z23.string().min(1).max(2e3),
2266
- rewards: z23.array(rewardSchema).max(10).optional(),
2462
+ z24.object({
2463
+ kind: z24.literal("review"),
2464
+ reason: z24.string().min(1).max(2e3),
2465
+ rewards: z24.array(rewardSchema).max(10).optional(),
2267
2466
  completionKey: completionKeySchema.optional()
2268
2467
  }).strict()
2269
2468
  ]);
2270
- var reviewModeSchema = z23.enum(["workers-ai"]);
2271
- var storedReviewModeSchema = z23.enum([
2469
+ var reviewModeSchema = z24.enum(["workers-ai"]);
2470
+ var storedReviewModeSchema = z24.enum([
2272
2471
  "fixture-pass",
2273
2472
  "fixture-fail",
2274
2473
  "fixture-unclear",
2275
2474
  "fixture-error",
2276
2475
  "workers-ai"
2277
2476
  ]);
2278
- var rewardBundleSchema = z23.array(rewardSchema).max(10).refine(
2477
+ var rewardBundleSchema = z24.array(rewardSchema).max(10).refine(
2279
2478
  (rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
2280
2479
  "Use one entry per balance or shared reward"
2281
2480
  );
2282
- var mediaUrlSchema = z23.string().max(2e3).refine((value) => {
2481
+ var mediaUrlSchema = z24.string().max(2e3).refine((value) => {
2283
2482
  if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
2284
2483
  return true;
2285
2484
  }
@@ -2289,79 +2488,81 @@ var mediaUrlSchema = z23.string().max(2e3).refine((value) => {
2289
2488
  return false;
2290
2489
  }
2291
2490
  }, "Use an HTTPS URL or a same-site path beginning with /");
2292
- var questPresentationSchema = z23.object({
2491
+ var questPresentationSchema = z24.object({
2293
2492
  quiz: quizQuestionsSchema.optional(),
2294
- instructions: z23.string().max(4e3).optional(),
2295
- video: z23.object({
2493
+ instructions: z24.string().max(4e3).optional(),
2494
+ video: z24.object({
2296
2495
  url: mediaUrlSchema,
2297
2496
  poster: mediaUrlSchema.optional(),
2298
- captions: z23.object({
2497
+ captions: z24.object({
2299
2498
  url: mediaUrlSchema,
2300
- language: z23.string().min(2).max(20),
2301
- label: z23.string().min(1).max(80)
2499
+ language: z24.string().min(2).max(20),
2500
+ label: z24.string().min(1).max(80)
2302
2501
  }).strict().optional()
2303
2502
  }).strict().optional()
2304
2503
  }).strict();
2305
- var questProfileSchema = z23.object({ visible: z23.boolean() }).strict();
2504
+ var questProfileSchema = z24.object({ visible: z24.boolean() }).strict();
2306
2505
  var evaluatorProtocol = 2;
2307
- var evaluatorProtocolSchema = z23.literal(evaluatorProtocol);
2308
- var questDescriptionSchema = z23.object({
2506
+ var evaluatorProtocolSchema = z24.literal(evaluatorProtocol);
2507
+ var questDescriptionSchema = z24.object({
2309
2508
  quest: identifier,
2310
2509
  evaluatorProtocol: evaluatorProtocolSchema,
2311
- title: z23.string().min(1).max(120),
2510
+ title: z24.string().min(1).max(120),
2312
2511
  presentation: questPresentationSchema.default({}),
2313
- integrations: z23.array(evaluatorIntegrationProviderSchema).max(10).default([]),
2512
+ integrations: z24.array(evaluatorIntegrationProviderSchema).max(10).default([]),
2314
2513
  fields: settingsFieldsSchema,
2315
2514
  values: settingsValuesSchema,
2316
2515
  rewards: rewardBundleSchema,
2317
- humanReview: z23.boolean(),
2516
+ humanReview: z24.boolean(),
2318
2517
  trigger: triggerSchema,
2319
2518
  performance: contentPerformancePolicySchema.optional(),
2320
- requires: z23.array(prerequisiteSchema).max(30).default([]),
2519
+ requires: z24.array(prerequisiteSchema).max(30).default([]),
2321
2520
  campaign: campaignDefinitionSchema.optional(),
2322
2521
  availability: availabilityWindowSchema.optional(),
2323
- completion: z23.preprocess(refuseStreakTimeZone, completionPolicySchema),
2324
- visibility: z23.enum(["visible", "hidden"]).default("visible"),
2522
+ completion: z24.preprocess(refuseStreakTimeZone, completionPolicySchema),
2523
+ visibility: z24.enum(["visible", "hidden"]).default("visible"),
2325
2524
  /** Whether completions show on participant profiles (`/v1/profiles/:id/completions`). */
2326
2525
  profile: questProfileSchema.default({ visible: false }),
2327
- budgets: z23.array(budgetSchema).max(20).default([])
2526
+ budgets: z24.array(budgetSchema).max(20).default([])
2328
2527
  }).strict();
2329
- var artifactSchema = z23.object({ code: z23.string().min(1).max(1e6) }).strict();
2528
+ var artifactSchema = z24.object({ code: z24.string().min(1).max(1e6) }).strict();
2330
2529
  var releaseSchema = artifactSchema.extend({
2331
2530
  settings: settingsValuesSchema,
2332
2531
  provider: reviewModeSchema,
2333
2532
  expectedRelease: identifier.nullable().optional(),
2334
- settingRenames: z23.record(z23.string(), z23.string()).optional()
2533
+ settingRenames: z24.record(z24.string(), z24.string()).optional()
2335
2534
  }).strict();
2336
- var batchReleaseSchema = z23.object({ releases: z23.array(releaseSchema).min(1).max(50) }).strict();
2337
- var questSettingsInputSchema = z23.object({
2535
+ var batchReleaseSchema = z24.object({ releases: z24.array(releaseSchema).min(1).max(50) }).strict();
2536
+ var questSettingsInputSchema = z24.object({
2338
2537
  quest: identifier,
2339
2538
  expectedRelease: identifier,
2340
2539
  set: settingsValuesSchema,
2341
- reset: z23.array(z23.string())
2540
+ reset: z24.array(z24.string())
2342
2541
  }).strict();
2343
2542
  var storedQuestDescriptionSchema = questDescriptionSchema.extend({
2344
2543
  completion: completionPolicySchema
2345
2544
  });
2346
- var publishedReleaseSchema = storedQuestDescriptionSchema.extend({
2347
- key: identifier.optional(),
2348
- code: z23.string(),
2349
- provider: storedReviewModeSchema,
2350
- id: identifier,
2351
- createdAt: z23.number(),
2352
- origin: z23.object({ typeVersion: identifier }).strict().optional(),
2353
- lifecycle: z23.enum(["active", "paused", "archived"]).default("active"),
2354
- configuration: z23.object({
2355
- defaults: settingsValuesSchema,
2356
- overrides: settingsValuesSchema,
2357
- preserved: z23.array(z23.string())
2358
- }).strict().optional()
2359
- });
2360
- var templateSchema = z23.object({
2361
- code: z23.string(),
2545
+ var publishedReleaseSchema = responseShape(
2546
+ storedQuestDescriptionSchema.extend({
2547
+ key: identifier.optional(),
2548
+ code: z24.string(),
2549
+ provider: storedReviewModeSchema,
2550
+ id: identifier,
2551
+ createdAt: z24.number(),
2552
+ origin: z24.object({ typeVersion: identifier }).strict().optional(),
2553
+ lifecycle: z24.enum(["active", "paused", "archived"]).default("active"),
2554
+ configuration: z24.object({
2555
+ defaults: settingsValuesSchema,
2556
+ overrides: settingsValuesSchema,
2557
+ preserved: z24.array(z24.string())
2558
+ }).strict().optional()
2559
+ })
2560
+ );
2561
+ var templateSchema = z24.object({
2562
+ code: z24.string(),
2362
2563
  definition: questDescriptionSchema
2363
2564
  });
2364
- var quizAnswersSchema = z23.record(identifier, identifier).refine(
2565
+ var quizAnswersSchema = z24.record(identifier, identifier).refine(
2365
2566
  (answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
2366
2567
  "Provide between 1 and 50 answers"
2367
2568
  ).transform(
@@ -2369,17 +2570,17 @@ var quizAnswersSchema = z23.record(identifier, identifier).refine(
2369
2570
  Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
2370
2571
  )
2371
2572
  );
2372
- var quizEvidenceSchema = z23.object({
2373
- kind: z23.literal("quiz"),
2573
+ var quizEvidenceSchema = z24.object({
2574
+ kind: z24.literal("quiz"),
2374
2575
  release: identifier.optional(),
2375
2576
  answers: quizAnswersSchema
2376
2577
  }).strict();
2377
- var submissionEvidenceSchema = z23.union([
2578
+ var submissionEvidenceSchema = z24.union([
2378
2579
  quizEvidenceSchema,
2379
2580
  textEvidenceSchema,
2380
2581
  urlEvidenceSchema
2381
2582
  ]);
2382
- var submitSchema = z23.object({
2583
+ var submitSchema = z24.object({
2383
2584
  actionId: identifier,
2384
2585
  quest: identifier,
2385
2586
  member: identifier,
@@ -2387,7 +2588,7 @@ var submitSchema = z23.object({
2387
2588
  input: submissionEvidenceSchema.optional(),
2388
2589
  release: identifier.optional(),
2389
2590
  /** @deprecated Relay refuses a submission that sets it to `true` and ignores `false`. Removed in 2.0.0. */
2390
- faultAfterReview: z23.boolean().optional()
2591
+ faultAfterReview: z24.boolean().optional()
2391
2592
  }).strict();
2392
2593
  var AttemptStatus = {
2393
2594
  Queued: "queued",
@@ -2399,8 +2600,8 @@ var AttemptStatus = {
2399
2600
  NeedsReview: "needs-review",
2400
2601
  Failed: "failed"
2401
2602
  };
2402
- var attemptStatusSchema = z23.string();
2403
- var attemptSchema = z23.object({
2603
+ var attemptStatusSchema = z24.string();
2604
+ var attemptSchema = z24.object({
2404
2605
  id: identifier,
2405
2606
  release: identifier,
2406
2607
  quest: identifier,
@@ -2408,83 +2609,83 @@ var attemptSchema = z23.object({
2408
2609
  evidence: identifier.nullable(),
2409
2610
  input: submissionEvidenceSchema.optional(),
2410
2611
  status: attemptStatusSchema,
2411
- reason: z23.string().nullable(),
2412
- retries: z23.number(),
2413
- generation: z23.number(),
2414
- completion: z23.string().nullable(),
2612
+ reason: z24.string().nullable(),
2613
+ retries: z24.number(),
2614
+ generation: z24.number(),
2615
+ completion: z24.string().nullable(),
2415
2616
  reviewRewards: rewardBundleSchema.nullable().default(null),
2416
2617
  /** Scheduled reruns advance this number; failure retries preserve it. */
2417
- evaluationRun: z23.number().int().nonnegative().default(0),
2418
- deferCount: z23.number().int().nonnegative().default(0),
2419
- deferUntil: z23.number().int().safe().nullable().default(null),
2420
- nextEvaluationAt: z23.number().int().safe().nullable().default(null),
2618
+ evaluationRun: z24.number().int().nonnegative().default(0),
2619
+ deferCount: z24.number().int().nonnegative().default(0),
2620
+ deferUntil: z24.number().int().safe().nullable().default(null),
2621
+ nextEvaluationAt: z24.number().int().safe().nullable().default(null),
2421
2622
  /** Open code: consumers must tolerate new values. */
2422
- code: z23.string().nullable().default(null),
2623
+ code: z24.string().nullable().default(null),
2423
2624
  progress: evaluatorProgressSchema.nullable().default(null),
2424
2625
  /**
2425
2626
  * The evaluator asked for human review of a quest with review off, so Domino rejected the attempt
2426
2627
  * with the evaluator's reason. Only set on a rejected attempt.
2427
2628
  */
2428
- requestedReview: z23.boolean().default(false),
2429
- createdAt: z23.number()
2430
- });
2431
- var eventSchema = z23.object({
2432
- id: z23.number(),
2433
- attempt: z23.string().nullable(),
2434
- kind: z23.string(),
2435
- detail: z23.string(),
2436
- actor: z23.string().nullable().default(null),
2437
- at: z23.number()
2438
- });
2439
- var pickupSelectionSchema = z23.object({
2629
+ requestedReview: z24.boolean().default(false),
2630
+ createdAt: z24.number()
2631
+ });
2632
+ var eventSchema = z24.object({
2633
+ id: z24.number(),
2634
+ attempt: z24.string().nullable(),
2635
+ kind: z24.string(),
2636
+ detail: z24.string(),
2637
+ actor: z24.string().nullable().default(null),
2638
+ at: z24.number()
2639
+ });
2640
+ var pickupSelectionSchema = z24.object({
2440
2641
  item: identifier,
2441
- revision: z23.number().int().nonnegative()
2642
+ revision: z24.number().int().nonnegative()
2442
2643
  }).strict();
2443
- var pickupAllocationSchema = z23.object({
2644
+ var pickupAllocationSchema = z24.object({
2444
2645
  item: identifier,
2445
- label: z23.string().min(1).max(80)
2646
+ label: z24.string().min(1).max(80)
2446
2647
  }).strict();
2447
- var pickupPolicySchema = z23.discriminatedUnion("kind", [
2448
- z23.object({ kind: z23.literal("untracked") }).strict(),
2449
- z23.object({
2450
- kind: z23.literal("at-pickup"),
2451
- tiers: z23.array(
2452
- z23.object({
2648
+ var pickupPolicySchema = z24.discriminatedUnion("kind", [
2649
+ z24.object({ kind: z24.literal("untracked") }).strict(),
2650
+ z24.object({
2651
+ kind: z24.literal("at-pickup"),
2652
+ tiers: z24.array(
2653
+ z24.object({
2453
2654
  tier: identifier,
2454
- variants: z23.array(pickupAllocationSchema).min(1).max(100)
2655
+ variants: z24.array(pickupAllocationSchema).min(1).max(100)
2455
2656
  }).strict()
2456
2657
  ).min(1).max(100)
2457
2658
  }).strict()
2458
2659
  ]);
2459
- var pickupCatalogSchema = z23.object({
2660
+ var pickupCatalogSchema = z24.object({
2460
2661
  reward: tieredRewardDefinitionSchema,
2461
- revision: z23.number().int().nonnegative(),
2662
+ revision: z24.number().int().nonnegative(),
2462
2663
  policy: pickupPolicySchema
2463
2664
  });
2464
- var pickupAvailabilitySchema = z23.discriminatedUnion("kind", [
2465
- z23.object({ kind: z23.literal("untracked") }).strict(),
2466
- z23.object({
2467
- kind: z23.literal("at-pickup"),
2468
- revision: z23.number().int().nonnegative(),
2469
- variants: z23.array(
2665
+ var pickupAvailabilitySchema = z24.discriminatedUnion("kind", [
2666
+ z24.object({ kind: z24.literal("untracked") }).strict(),
2667
+ z24.object({
2668
+ kind: z24.literal("at-pickup"),
2669
+ revision: z24.number().int().nonnegative(),
2670
+ variants: z24.array(
2470
2671
  pickupAllocationSchema.extend({
2471
- available: z23.number().int().nonnegative()
2672
+ available: z24.number().int().nonnegative()
2472
2673
  })
2473
2674
  )
2474
2675
  }).strict()
2475
2676
  ]);
2476
- var configurePickupSchema = z23.object({
2677
+ var configurePickupSchema = z24.object({
2477
2678
  reward: identifier,
2478
- revision: z23.number().int().nonnegative(),
2679
+ revision: z24.number().int().nonnegative(),
2479
2680
  actionId: identifier,
2480
- policy: z23.discriminatedUnion("kind", [
2481
- z23.object({ kind: z23.literal("untracked") }).strict(),
2482
- z23.object({
2483
- kind: z23.literal("at-pickup"),
2484
- tiers: z23.array(
2485
- z23.object({
2681
+ policy: z24.discriminatedUnion("kind", [
2682
+ z24.object({ kind: z24.literal("untracked") }).strict(),
2683
+ z24.object({
2684
+ kind: z24.literal("at-pickup"),
2685
+ tiers: z24.array(
2686
+ z24.object({
2486
2687
  tier: identifier,
2487
- variants: z23.array(
2688
+ variants: z24.array(
2488
2689
  pickupAllocationSchema.extend({
2489
2690
  item: identifier.optional()
2490
2691
  })
@@ -2494,10 +2695,10 @@ var configurePickupSchema = z23.object({
2494
2695
  }).strict()
2495
2696
  ])
2496
2697
  }).strict();
2497
- var entitlementRecoverySchema = z23.object({
2698
+ var entitlementRecoverySchema = z24.object({
2498
2699
  completion: identifier,
2499
- reason: z23.string(),
2500
- flaggedAt: z23.number(),
2700
+ reason: z24.string(),
2701
+ flaggedAt: z24.number(),
2501
2702
  /** Null means no accepted completion currently earns this reward. */
2502
2703
  remainingTier: identifier.nullable()
2503
2704
  });
@@ -2507,40 +2708,40 @@ var entitlementBase = {
2507
2708
  reward: tieredRewardDefinitionSchema,
2508
2709
  earnedTier: identifier,
2509
2710
  tier: identifier,
2510
- revision: z23.number().int().positive()
2711
+ revision: z24.number().int().positive()
2511
2712
  };
2512
- var entitlementStateSchema = z23.discriminatedUnion("status", [
2513
- z23.object({ ...entitlementBase, status: z23.literal("available") }).strict(),
2514
- z23.object({
2713
+ var entitlementStateSchema = z24.discriminatedUnion("status", [
2714
+ z24.object({ ...entitlementBase, status: z24.literal("available") }).strict(),
2715
+ z24.object({
2515
2716
  ...entitlementBase,
2516
- status: z23.literal("handing-over"),
2717
+ status: z24.literal("handing-over"),
2517
2718
  handover: identifier,
2518
- startedAt: z23.number(),
2719
+ startedAt: z24.number(),
2519
2720
  allocation: pickupAllocationSchema.optional()
2520
2721
  }).strict(),
2521
- z23.object({
2722
+ z24.object({
2522
2723
  ...entitlementBase,
2523
- status: z23.literal("collected"),
2724
+ status: z24.literal("collected"),
2524
2725
  handover: identifier,
2525
- startedAt: z23.number(),
2726
+ startedAt: z24.number(),
2526
2727
  allocation: pickupAllocationSchema.optional(),
2527
- collectedAt: z23.number(),
2728
+ collectedAt: z24.number(),
2528
2729
  recovery: entitlementRecoverySchema.optional()
2529
2730
  }).strict(),
2530
2731
  // An operator voided it: it can no longer be handed over. A quest grant of the same reward to
2531
2732
  // the member (the same grant key) makes it available again; a voided referral reward stays void.
2532
- z23.object({
2733
+ z24.object({
2533
2734
  ...entitlementBase,
2534
- status: z23.literal("void"),
2535
- voidedAt: z23.number()
2735
+ status: z24.literal("void"),
2736
+ voidedAt: z24.number()
2536
2737
  }).strict()
2537
2738
  ]);
2538
- var tieredRewardReadSchema = z23.object({
2739
+ var tieredRewardReadSchema = z24.object({
2539
2740
  id: identifier,
2540
- title: z23.string(),
2541
- tiers: z23.array(z23.object({ id: identifier, title: z23.string() }).loose()),
2542
- inventory: z23.object({ kind: z23.string() }).loose(),
2543
- fulfillment: z23.object({ kind: z23.string() }).loose()
2741
+ title: z24.string(),
2742
+ tiers: z24.array(z24.object({ id: identifier, title: z24.string() }).loose()),
2743
+ inventory: z24.object({ kind: z24.string() }).loose(),
2744
+ fulfillment: z24.object({ kind: z24.string() }).loose()
2544
2745
  }).loose();
2545
2746
  var entitlementReadBase = {
2546
2747
  id: identifier,
@@ -2548,63 +2749,63 @@ var entitlementReadBase = {
2548
2749
  reward: tieredRewardReadSchema,
2549
2750
  earnedTier: identifier,
2550
2751
  tier: identifier,
2551
- revision: z23.number().int()
2752
+ revision: z24.number().int()
2552
2753
  };
2553
- var allocationReadSchema = z23.object({ item: identifier, label: z23.string() }).loose();
2554
- var entitlementSchema = z23.union([
2555
- z23.discriminatedUnion("status", [
2556
- z23.object({ ...entitlementReadBase, status: z23.literal("available") }).loose(),
2557
- z23.object({
2754
+ var allocationReadSchema = z24.object({ item: identifier, label: z24.string() }).loose();
2755
+ var entitlementSchema = z24.union([
2756
+ z24.discriminatedUnion("status", [
2757
+ z24.object({ ...entitlementReadBase, status: z24.literal("available") }).loose(),
2758
+ z24.object({
2558
2759
  ...entitlementReadBase,
2559
- status: z23.literal("handing-over"),
2760
+ status: z24.literal("handing-over"),
2560
2761
  handover: identifier,
2561
- startedAt: z23.number(),
2762
+ startedAt: z24.number(),
2562
2763
  allocation: allocationReadSchema.optional()
2563
2764
  }).loose(),
2564
- z23.object({
2765
+ z24.object({
2565
2766
  ...entitlementReadBase,
2566
- status: z23.literal("collected"),
2767
+ status: z24.literal("collected"),
2567
2768
  handover: identifier,
2568
- startedAt: z23.number(),
2769
+ startedAt: z24.number(),
2569
2770
  allocation: allocationReadSchema.optional(),
2570
- collectedAt: z23.number(),
2771
+ collectedAt: z24.number(),
2571
2772
  recovery: entitlementRecoverySchema.optional()
2572
2773
  }).loose(),
2573
- z23.object({
2774
+ z24.object({
2574
2775
  ...entitlementReadBase,
2575
- status: z23.literal("void"),
2576
- voidedAt: z23.number()
2776
+ status: z24.literal("void"),
2777
+ voidedAt: z24.number()
2577
2778
  }).loose()
2578
2779
  ]),
2579
- z23.object({ ...entitlementReadBase, status: z23.string() }).loose().transform(({ status, ...entitlement }) => ({
2780
+ z24.object({ ...entitlementReadBase, status: z24.string() }).loose().transform(({ status, ...entitlement }) => ({
2580
2781
  ...entitlement,
2581
2782
  status: "unsupported",
2582
2783
  reportedStatus: status
2583
2784
  }))
2584
2785
  ]);
2585
- var beginHandoverSchema = z23.object({
2786
+ var beginHandoverSchema = z24.object({
2586
2787
  actionId: identifier,
2587
- revision: z23.number().int().positive(),
2788
+ revision: z24.number().int().positive(),
2588
2789
  selection: pickupSelectionSchema.optional()
2589
2790
  }).strict();
2590
- var confirmHandoverSchema = z23.object({ actionId: identifier, handover: identifier }).strict();
2591
- var entitlementCorrectionSchema = z23.object({
2791
+ var confirmHandoverSchema = z24.object({ actionId: identifier, handover: identifier }).strict();
2792
+ var entitlementCorrectionSchema = z24.object({
2592
2793
  actionId: identifier,
2593
- revision: z23.number().int().positive(),
2594
- reason: z23.string().trim().min(1).max(500)
2794
+ revision: z24.number().int().positive(),
2795
+ reason: z24.string().trim().min(1).max(500)
2595
2796
  }).strict();
2596
2797
  var CompletionSourceKind = {
2597
2798
  Quest: "quest",
2598
2799
  Leaderboard: "leaderboard"
2599
2800
  };
2600
- var completionSourceKindSchema = z23.string().min(1).max(64);
2601
- var completionSourceSchema = z23.object({
2801
+ var completionSourceKindSchema = z24.string().min(1).max(64);
2802
+ var completionSourceSchema = z24.object({
2602
2803
  kind: completionSourceKindSchema,
2603
2804
  id: identifier
2604
2805
  });
2605
- var completionRecordSchema = z23.object({
2806
+ var completionRecordSchema = z24.object({
2606
2807
  /** The occurrence the completion consumed. For a leaderboard prize, the settlement ID. */
2607
- key: z23.string().default("once"),
2808
+ key: z24.string().default("once"),
2608
2809
  id: identifier,
2609
2810
  /** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
2610
2811
  quest: identifier,
@@ -2612,19 +2813,19 @@ var completionRecordSchema = z23.object({
2612
2813
  /** What paid the completion. `source.id` repeats `quest`. */
2613
2814
  source: completionSourceSchema.optional()
2614
2815
  });
2615
- var questAvailabilitySchema = z23.discriminatedUnion("kind", [
2616
- z23.object({
2617
- kind: z23.literal("available"),
2618
- input: z23.enum(["photo", "quiz", "none", "text", "url"])
2816
+ var questAvailabilitySchema = z24.discriminatedUnion("kind", [
2817
+ z24.object({
2818
+ kind: z24.literal("available"),
2819
+ input: z24.enum(["photo", "quiz", "none", "text", "url"])
2619
2820
  }).strict(),
2620
- z23.object({ kind: z23.literal("completed") }).strict(),
2621
- z23.object({
2622
- kind: z23.literal("locked"),
2623
- missing: z23.array(missingPrerequisiteSchema).min(1)
2821
+ z24.object({ kind: z24.literal("completed") }).strict(),
2822
+ z24.object({
2823
+ kind: z24.literal("locked"),
2824
+ missing: z24.array(missingPrerequisiteSchema).min(1)
2624
2825
  }).strict(),
2625
- z23.object({
2626
- kind: z23.literal("blocked"),
2627
- reason: z23.enum([
2826
+ z24.object({
2827
+ kind: z24.literal("blocked"),
2828
+ reason: z24.enum([
2628
2829
  "budget-exhausted",
2629
2830
  "connection-required",
2630
2831
  "wallet-required",
@@ -2633,140 +2834,144 @@ var questAvailabilitySchema = z23.discriminatedUnion("kind", [
2633
2834
  "enrollment-required"
2634
2835
  ]),
2635
2836
  /** Which window refused admission when `reason` is `outside-window`. */
2636
- window: z23.enum(["tracker", "quest"]).optional(),
2637
- resetsAt: z23.number().int().safe().optional()
2837
+ window: z24.enum(["tracker", "quest"]).optional(),
2838
+ resetsAt: z24.number().int().safe().optional()
2638
2839
  }).strict(),
2639
- z23.object({ kind: z23.literal("staff-required") }).strict(),
2640
- z23.object({ kind: z23.literal("automatic") }).strict(),
2641
- z23.object({ kind: z23.literal("checking"), attempt: identifier }).strict(),
2642
- z23.object({ kind: z23.literal("needs-review"), attempt: identifier }).strict(),
2643
- z23.object({ kind: z23.literal("retryable"), attempt: identifier }).strict()
2840
+ z24.object({ kind: z24.literal("staff-required") }).strict(),
2841
+ z24.object({ kind: z24.literal("automatic") }).strict(),
2842
+ z24.object({ kind: z24.literal("checking"), attempt: identifier }).strict(),
2843
+ z24.object({ kind: z24.literal("needs-review"), attempt: identifier }).strict(),
2844
+ z24.object({ kind: z24.literal("retryable"), attempt: identifier }).strict()
2644
2845
  ]);
2645
- var questAvailabilityResponseSchema = z23.union(
2846
+ var questAvailabilityResponseSchema = z24.union(
2646
2847
  questAvailabilitySchema.options.map((option) => option.strip())
2647
2848
  );
2648
- var questBudgetViewSchema = z23.object({
2849
+ var questBudgetViewSchema = z24.object({
2649
2850
  id: identifier,
2650
- scope: z23.enum(["member", "project"]),
2651
- period: z23.enum(["day", "week", "month", "lifetime"]),
2652
- remaining: z23.number().int().safe().nonnegative(),
2653
- resetsAt: z23.number().int().safe().nullable()
2654
- });
2655
- var memberProgressSchema = z23.object({
2656
- member: identifier,
2657
- quests: z23.array(
2658
- z23.object({
2659
- quest: identifier,
2660
- key: identifier.optional(),
2661
- release: identifier.optional(),
2662
- title: z23.string(),
2663
- presentation: questPresentationSchema.default({}),
2664
- connections: z23.array(authProviderSchema).default([]),
2665
- trigger: triggerResponseSchema,
2666
- availability: questAvailabilityResponseSchema,
2667
- completed: z23.boolean(),
2668
- completion: completionPolicySchema.default({ kind: "once" }),
2669
- streak: streakProgressSchema.nullable().optional(),
2670
- counter: counterProgressSchema.nullable().optional(),
2671
- /** Latest attempt's committed evaluator progress, while it remains deferred/evaluating. */
2672
- progress: evaluatorProgressSchema.nullable().default(null),
2673
- completionCount: z23.number().int().nonnegative().default(0),
2674
- visibility: z23.enum(["visible", "hidden"]).default("visible"),
2675
- missing: z23.array(missingPrerequisiteSchema),
2676
- campaign: campaignViewSchema.nullable().default(null),
2677
- window: availabilityWindowSchema.nullable().default(null),
2678
- budgets: z23.array(questBudgetViewSchema).default([]),
2679
- attempt: attemptSchema.nullable()
2680
- })
2681
- ),
2682
- entitlements: z23.array(entitlementSchema)
2683
- });
2684
- var snapshotSchema = z23.object({
2685
- releases: z23.array(publishedReleaseSchema),
2686
- completions: z23.array(completionRecordSchema),
2687
- entitlements: z23.array(entitlementSchema),
2688
- attempts: z23.array(attemptSchema),
2689
- balances: z23.array(
2690
- z23.object({
2691
- member: z23.string(),
2692
- balance: z23.string(),
2693
- earned: z23.number(),
2694
- held: z23.number(),
2695
- available: z23.number()
2696
- })
2697
- ),
2698
- events: z23.array(eventSchema)
2851
+ scope: z24.enum(["member", "project"]),
2852
+ period: z24.enum(["day", "week", "month", "lifetime"]),
2853
+ remaining: z24.number().int().safe().nonnegative(),
2854
+ resetsAt: z24.number().int().safe().nullable()
2699
2855
  });
2700
- var evidenceSchema = z23.object({
2856
+ var memberProgressSchema = responseShape(
2857
+ z24.object({
2858
+ member: identifier,
2859
+ quests: z24.array(
2860
+ z24.object({
2861
+ quest: identifier,
2862
+ key: identifier.optional(),
2863
+ release: identifier.optional(),
2864
+ title: z24.string(),
2865
+ presentation: questPresentationSchema.default({}),
2866
+ connections: z24.array(authProviderSchema).default([]),
2867
+ trigger: triggerResponseSchema,
2868
+ availability: questAvailabilityResponseSchema,
2869
+ completed: z24.boolean(),
2870
+ completion: completionPolicySchema.default({ kind: "once" }),
2871
+ streak: streakProgressSchema.nullable().optional(),
2872
+ counter: counterProgressSchema.nullable().optional(),
2873
+ /** Latest attempt's committed evaluator progress, while it remains deferred/evaluating. */
2874
+ progress: evaluatorProgressSchema.nullable().default(null),
2875
+ completionCount: z24.number().int().nonnegative().default(0),
2876
+ visibility: z24.enum(["visible", "hidden"]).default("visible"),
2877
+ missing: z24.array(missingPrerequisiteSchema),
2878
+ campaign: campaignViewSchema.nullable().default(null),
2879
+ window: availabilityWindowSchema.nullable().default(null),
2880
+ budgets: z24.array(questBudgetViewSchema).default([]),
2881
+ attempt: attemptSchema.nullable()
2882
+ })
2883
+ ),
2884
+ entitlements: z24.array(entitlementSchema)
2885
+ })
2886
+ );
2887
+ var snapshotSchema = responseShape(
2888
+ z24.object({
2889
+ releases: z24.array(publishedReleaseSchema),
2890
+ completions: z24.array(completionRecordSchema),
2891
+ entitlements: z24.array(entitlementSchema),
2892
+ attempts: z24.array(attemptSchema),
2893
+ balances: z24.array(
2894
+ z24.object({
2895
+ member: z24.string(),
2896
+ balance: z24.string(),
2897
+ earned: z24.number(),
2898
+ held: z24.number(),
2899
+ available: z24.number()
2900
+ })
2901
+ ),
2902
+ events: z24.array(eventSchema)
2903
+ })
2904
+ );
2905
+ var evidenceSchema = z24.object({
2701
2906
  id: identifier,
2702
2907
  member: identifier,
2703
- type: z23.enum(["image/jpeg", "image/png"]),
2704
- size: z23.number()
2908
+ type: z24.enum(["image/jpeg", "image/png"]),
2909
+ size: z24.number()
2705
2910
  });
2706
- var errorSchema = z23.object({
2707
- error: z23.string(),
2708
- code: z23.string().optional(),
2911
+ var errorSchema = z24.object({
2912
+ error: z24.string(),
2913
+ code: z24.string().optional(),
2709
2914
  /** Which window refused admission when `code` is `outside-window`. */
2710
- window: z23.enum(["tracker", "quest"]).optional(),
2711
- missing: z23.array(missingPrerequisiteSchema).optional()
2915
+ window: z24.enum(["tracker", "quest"]).optional(),
2916
+ missing: z24.array(missingPrerequisiteSchema).optional()
2712
2917
  });
2713
- var staffDecisionSchema = z23.object({
2918
+ var staffDecisionSchema = z24.object({
2714
2919
  actionId: identifier,
2715
- generation: z23.number().int().nonnegative(),
2716
- decision: z23.enum(["accept", "reject"]),
2717
- reason: z23.string().trim().min(1).max(2e3)
2920
+ generation: z24.number().int().nonnegative(),
2921
+ decision: z24.enum(["accept", "reject"]),
2922
+ reason: z24.string().trim().min(1).max(2e3)
2718
2923
  }).strict();
2719
- var stockSchema = z23.object({ item: identifier, quantity: z23.number().int().min(0).max(1e4) }).strict();
2720
- var reservationSchema = z23.object({
2924
+ var stockSchema = z24.object({ item: identifier, quantity: z24.number().int().min(0).max(1e4) }).strict();
2925
+ var reservationSchema = z24.object({
2721
2926
  actionId: identifier,
2722
2927
  member: identifier,
2723
2928
  item: identifier,
2724
2929
  balance: identifier,
2725
- price: z23.number().int().positive().max(1e4)
2930
+ price: z24.number().int().positive().max(1e4)
2726
2931
  }).strict();
2727
2932
  var pageOptions = {
2728
- limit: z23.number().int().min(1).max(100).default(25),
2729
- cursor: z23.string().min(1).max(4096).optional()
2933
+ limit: z24.number().int().min(1).max(100).default(25),
2934
+ cursor: z24.string().min(1).max(4096).optional()
2730
2935
  };
2731
- var reviewListSchema = z23.object({
2936
+ var reviewListSchema = z24.object({
2732
2937
  ...pageOptions,
2733
2938
  member: identifier.optional(),
2734
2939
  quest: identifier.optional()
2735
2940
  }).strict();
2736
- var memberListSchema = z23.object({
2941
+ var memberListSchema = z24.object({
2737
2942
  ...pageOptions,
2738
2943
  prefix: identifier.optional()
2739
2944
  }).strict();
2740
- var reviewItemSchema = z23.object({
2945
+ var reviewItemSchema = z24.object({
2741
2946
  attempt: attemptSchema,
2742
- title: z23.string(),
2743
- checks: z23.array(
2744
- z23.object({ criteria: z23.string(), result: photoResultSchema })
2947
+ title: z24.string(),
2948
+ checks: z24.array(
2949
+ z24.object({ criteria: z24.string(), result: photoResultSchema })
2745
2950
  )
2746
2951
  });
2747
- var reviewPageSchema = z23.object({
2748
- items: z23.array(reviewItemSchema).max(100),
2749
- nextCursor: z23.string().nullable()
2952
+ var reviewPageSchema = z24.object({
2953
+ items: z24.array(reviewItemSchema).max(100),
2954
+ nextCursor: z24.string().nullable()
2750
2955
  });
2751
- var memberPageSchema = z23.object({
2752
- items: z23.array(z23.object({ member: identifier })).max(100),
2753
- nextCursor: z23.string().nullable()
2956
+ var memberPageSchema = z24.object({
2957
+ items: z24.array(z24.object({ member: identifier })).max(100),
2958
+ nextCursor: z24.string().nullable()
2754
2959
  });
2755
- var createStockItemSchema = z23.object({ actionId: identifier, name: z23.string().trim().min(1).max(80) }).strict();
2756
- var stockItemSchema = z23.object({ id: identifier, name: z23.string() });
2757
- var contentPerformanceSnapshotSchema = z23.strictObject({
2960
+ var createStockItemSchema = z24.object({ actionId: identifier, name: z24.string().trim().min(1).max(80) }).strict();
2961
+ var stockItemSchema = z24.object({ id: identifier, name: z24.string() });
2962
+ var contentPerformanceSnapshotSchema = z24.strictObject({
2758
2963
  contentAttempt: identifier,
2759
2964
  observation: identifier,
2760
- observedAt: z23.number().int().safe().nonnegative(),
2965
+ observedAt: z24.number().int().safe().nonnegative(),
2761
2966
  metrics: contentMetricsSchema,
2762
2967
  rewards: rewardBundleSchema
2763
2968
  });
2764
2969
  var contentPerformanceQuerySchema = contentQualificationQuerySchema.extend({
2765
- content: z23.string().min(1).max(256)
2970
+ content: z24.string().min(1).max(256)
2766
2971
  });
2767
- var contentPerformancePageSchema = z23.strictObject({
2768
- current: z23.strictObject({
2769
- state: z23.enum([
2972
+ var contentPerformancePageSchema = z24.strictObject({
2973
+ current: z24.strictObject({
2974
+ state: z24.enum([
2770
2975
  "content-pending",
2771
2976
  "content-unqualified",
2772
2977
  "waiting",
@@ -2777,19 +2982,19 @@ var contentPerformancePageSchema = z23.strictObject({
2777
2982
  "failed",
2778
2983
  "superseded"
2779
2984
  ]),
2780
- reason: z23.string().nullable(),
2985
+ reason: z24.string().nullable(),
2781
2986
  contentAttempt: identifier,
2782
2987
  attempt: identifier.nullable(),
2783
2988
  reward: contentQualificationSchema.shape.reward
2784
2989
  }),
2785
- items: z23.array(
2786
- z23.strictObject({
2990
+ items: z24.array(
2991
+ z24.strictObject({
2787
2992
  attempt: identifier,
2788
2993
  contentAttempt: identifier,
2789
2994
  observation: identifier,
2790
- observedAt: z23.number(),
2995
+ observedAt: z24.number(),
2791
2996
  metrics: contentMetricsSchema,
2792
- state: z23.enum([
2997
+ state: z24.enum([
2793
2998
  "pending",
2794
2999
  "qualified",
2795
3000
  "unqualified",
@@ -2797,13 +3002,18 @@ var contentPerformancePageSchema = z23.strictObject({
2797
3002
  "failed",
2798
3003
  "superseded"
2799
3004
  ]),
2800
- reason: z23.string().nullable()
3005
+ reason: z24.string().nullable()
2801
3006
  })
2802
3007
  ),
2803
3008
  nextCursor: pageCursorSchema.nullable()
2804
3009
  });
2805
3010
 
2806
3011
  export {
3012
+ markResponseSchema,
3013
+ responseShape,
3014
+ knownResponse,
3015
+ responseSchema,
3016
+ responseListSchema,
2807
3017
  pageCursorSchema,
2808
3018
  pageQuerySchema,
2809
3019
  authProviderSchema,