@domino-sdk/relay 1.0.0-next.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +1 -1
  2. package/dist/activity-DeKJsRry.d.ts +9112 -0
  3. package/dist/authoring.d.ts +1027 -233
  4. package/dist/authoring.js +478 -277
  5. package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser-DFe7sWSN.d.ts +4154 -0
  8. package/dist/browser.d.ts +11 -2613
  9. package/dist/browser.js +8 -6
  10. package/dist/{integrations-Ba5TtqTv.d.ts → capability-error-DNMwKmlL.d.ts} +124 -76
  11. package/dist/{chunk-PHU5VDLR.js → chunk-36HTX2BM.js} +389 -169
  12. package/dist/chunk-6QJ3LADK.js +112 -0
  13. package/dist/{chunk-4LBUTHD6.js → chunk-BGGKNIRP.js} +1 -1
  14. package/dist/chunk-EYH5RDIE.js +496 -0
  15. package/dist/chunk-GQKYAQM6.js +84 -0
  16. package/dist/chunk-GUP7YRR4.js +42 -0
  17. package/dist/{chunk-X2F2RAR3.js → chunk-GZ6FJAXN.js} +380 -128
  18. package/dist/chunk-JON5SESL.js +2986 -0
  19. package/dist/chunk-MC6V6VMG.js +49 -0
  20. package/dist/chunk-NPGENI7K.js +37 -0
  21. package/dist/chunk-VFHHLN6A.js +284 -0
  22. package/dist/chunk-WJSSJ7AF.js +151 -0
  23. package/dist/{chunk-7Q4BGGT6.js → chunk-XFMSUPNS.js} +1 -1
  24. package/dist/{chunk-P6FK43GG.js → chunk-ZVIRG24J.js} +145 -42
  25. package/dist/{client-CT4-S5vc.d.ts → client-XiuFnug_.d.ts} +2161 -615
  26. package/dist/{submission-input-0OOGaq8c.d.ts → groups-Ck-OxzjD.d.ts} +916 -1139
  27. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  28. package/dist/images-Dv-P5VBw.d.ts +234 -0
  29. package/dist/index.d.ts +13 -9
  30. package/dist/index.js +17 -6
  31. package/dist/internal.d.ts +82 -44
  32. package/dist/internal.js +43 -89
  33. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  34. package/dist/{pages-D3titw5B.d.ts → outcomes-kVB-Juzs.d.ts} +2157 -1448
  35. package/dist/pages-BBYD21IE.d.ts +359 -0
  36. package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
  37. package/dist/portal-proxy.js +22 -4
  38. package/dist/{profiles-DDMFBRKe.d.ts → profiles-D2aFcOxu.d.ts} +15 -15
  39. package/dist/react/index.d.ts +3038 -1029
  40. package/dist/react/index.js +1627 -779
  41. package/dist/request-error-DWduJCGV.d.ts +62 -0
  42. package/dist/schema-DfJzH2ci.d.ts +5644 -0
  43. package/dist/schema.d.ts +15 -4168
  44. package/dist/schema.js +310 -81
  45. package/dist/server/index.d.ts +81498 -0
  46. package/dist/server/index.js +2520 -0
  47. package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
  48. package/dist/submission-input-BZkm6ohU.d.ts +290 -0
  49. package/dist/vite.d.ts +1 -1
  50. package/dist/vite.js +1 -0
  51. package/dist/{wallet-BGOfFkG9.d.ts → wallet-YssWxGg8.d.ts} +35 -38
  52. package/package.json +8 -2
  53. package/dist/chunk-QR7ZA2BJ.js +0 -257
  54. package/dist/chunk-YYD4QUBO.js +0 -2348
  55. package/dist/chunk-ZWY3R6B3.js +0 -26
  56. package/dist/collection-BGneJ6Bk.d.ts +0 -114
  57. package/dist/images-BTgk6OmC.d.ts +0 -1564
  58. package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
  59. package/dist/schema-Di3aLSiK.d.ts +0 -3532
@@ -1,1564 +0,0 @@
1
- import { z } from 'zod';
2
- import { P as PhotoResult } from './schema-Di3aLSiK.js';
3
-
4
- /**
5
- * Which record observations fire a tracker trigger. `"new-record"`: the first observation of each
6
- * record this tracker collects. `"new-observation"`: every observation that becomes its record's
7
- * current one (a new record, or a later `observedAt`). `"data-changed"`: a new record, or a current
8
- * observation whose `data` differs from the record's previous one.
9
- */
10
- declare const trackerTriggerModeSchema: z.ZodEnum<{
11
- "new-record": "new-record";
12
- "new-observation": "new-observation";
13
- "data-changed": "data-changed";
14
- }>;
15
- type TrackerTriggerMode = z.infer<typeof trackerTriggerModeSchema>;
16
- /** X trackers fire on discoveries; custom trackers on every new sample. */
17
- declare function defaultTriggerMode(source: "x-search" | "custom"): TrackerTriggerMode;
18
- /** A bound in a tracker trigger filter: a number, or the quest's integer setting of that name. */
19
- declare const trackerBoundSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
20
- setting: z.ZodString;
21
- }, z.core.$strict>]>;
22
- type TrackerBound = z.infer<typeof trackerBoundSchema>;
23
- /**
24
- * Which firing observations a tracker trigger admits, judged on the record's `data` before any
25
- * attribution. `equals` matches a string, number or boolean exactly. `gt`, `gte`, `lt` and `lte`
26
- * compare a number, or an integer string such as a base-unit balance, and all must hold.
27
- * Observations that do not match are not trigger events: they record no outcome.
28
- */
29
- declare const trackerConditionSchema: z.ZodUnion<readonly [z.ZodObject<{
30
- path: z.ZodString;
31
- equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
32
- }, z.core.$strict>, z.ZodObject<{
33
- path: z.ZodString;
34
- gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
35
- setting: z.ZodString;
36
- }, z.core.$strict>]>>;
37
- gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
38
- setting: z.ZodString;
39
- }, z.core.$strict>]>>;
40
- lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
41
- setting: z.ZodString;
42
- }, z.core.$strict>]>>;
43
- lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
44
- setting: z.ZodString;
45
- }, z.core.$strict>]>>;
46
- }, z.core.$strict>]>;
47
- type TrackerCondition = z.infer<typeof trackerConditionSchema>;
48
- /** One condition, or a list of conditions that must all hold. */
49
- declare const trackerWhereSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
50
- path: z.ZodString;
51
- equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
52
- }, z.core.$strict>, z.ZodObject<{
53
- path: z.ZodString;
54
- gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
55
- setting: z.ZodString;
56
- }, z.core.$strict>]>>;
57
- gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
58
- setting: z.ZodString;
59
- }, z.core.$strict>]>>;
60
- lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
61
- setting: z.ZodString;
62
- }, z.core.$strict>]>>;
63
- lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
64
- setting: z.ZodString;
65
- }, z.core.$strict>]>>;
66
- }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
67
- path: z.ZodString;
68
- equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
69
- }, z.core.$strict>, z.ZodObject<{
70
- path: z.ZodString;
71
- gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
72
- setting: z.ZodString;
73
- }, z.core.$strict>]>>;
74
- gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
75
- setting: z.ZodString;
76
- }, z.core.$strict>]>>;
77
- lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
78
- setting: z.ZodString;
79
- }, z.core.$strict>]>>;
80
- lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
81
- setting: z.ZodString;
82
- }, z.core.$strict>]>>;
83
- }, z.core.$strict>]>>]>;
84
- type TrackerWhere = z.infer<typeof trackerWhereSchema>;
85
- /** The conditions of a filter, as a list. */
86
- declare function whereConditions(where: TrackerWhere | undefined): TrackerCondition[];
87
- /** The settings a filter compares with. */
88
- declare function whereSettings(where: TrackerWhere | undefined): string[];
89
- type Scalar = string | number | boolean;
90
- type Lower = [never, 0, 1, 2, 3, 4];
91
- /** The declared string keys of an object type, leaving out index signatures. */
92
- type KnownKeys<D> = keyof {
93
- [K in keyof D as string extends K ? never : number extends K ? never : K extends string ? K : never]: 0;
94
- };
95
- type LeafEntries<K extends string, V, N extends number> = unknown extends V ? {
96
- path: K | `${K}.${string}`;
97
- value: Scalar;
98
- } : ([Extract<V, Scalar>] extends [never] ? never : {
99
- path: K;
100
- value: Extract<V, Scalar>;
101
- }) | (DataLeaves<Exclude<V, Scalar | null | undefined>, Lower[N]> extends infer E ? E extends {
102
- path: infer P extends string;
103
- value: infer T;
104
- } ? {
105
- path: `${K}.${P}`;
106
- value: T;
107
- } : never : never);
108
- /**
109
- * Every dot-separated path into `D` that ends at a string, number or boolean, with the value
110
- * there, to five levels deep. A record (`z.record`) takes any key; an object with declared keys
111
- * takes only those. Arrays end a path: filters do not index into them.
112
- */
113
- type DataLeaves<D, N extends number = 5> = [N] extends [never] ? never : D extends readonly unknown[] ? never : D extends object ? [KnownKeys<D>] extends [never] ? string extends keyof D ? LeafEntries<string, D[string & keyof D], N> : never : {
114
- [K in KnownKeys<D> & keyof D]-?: LeafEntries<K & string, D[K], N>;
115
- }[KnownKeys<D> & keyof D] : never;
116
- /** A filter bound: a number, or the quest's integer setting `S`. */
117
- type Bound<S extends string = string> = number | {
118
- setting: S;
119
- };
120
- type Comparison<S extends string> = {
121
- equals?: never;
122
- gt?: Bound<S>;
123
- gte?: Bound<S>;
124
- lt?: Bound<S>;
125
- lte?: Bound<S>;
126
- };
127
- /**
128
- * One filter condition on records whose `data` is `D`: `path` names a field, `equals` takes a
129
- * value that field can hold, and comparisons need a number or string (integer string) field.
130
- * Untyped data takes any path.
131
- */
132
- type Condition<D, S extends string = string> = unknown extends D ? TrackerCondition : DataLeaves<D> extends infer E ? E extends {
133
- path: infer P;
134
- value: infer V;
135
- } ? {
136
- path: P;
137
- equals: V;
138
- gt?: never;
139
- gte?: never;
140
- lt?: never;
141
- lte?: never;
142
- } | ([Extract<V, number | string>] extends [never] ? never : {
143
- path: P;
144
- } & Comparison<S>) : never : never;
145
- /** A typed filter: one condition, or a list of at most 10 conditions that must all hold. */
146
- type Where<D, S extends string = string> = Condition<D, S> | readonly [Condition<D, S>, ...Condition<D, S>[]];
147
- type BoundSetting<B> = B extends {
148
- setting: infer S extends string;
149
- } ? S : never;
150
- /** The setting names a filter compares with. */
151
- type WhereSetting<W> = W extends readonly (infer C)[] ? WhereSetting<C> : W extends object ? {
152
- [K in "gt" | "gte" | "lt" | "lte"]: K extends keyof W ? BoundSetting<W[K]> : never;
153
- }["gt" | "gte" | "lt" | "lte"] : never;
154
- /**
155
- * A quest's tracker trigger as published: bound to the tracker's stable ID at publication. Keys
156
- * that equal their default are left out, so a policy without `where` or a non-default `on` keeps
157
- * the shape SDKs before 0.28 read.
158
- */
159
- declare const trackerTriggerPolicySchema: z.ZodObject<{
160
- /** The tracker's authoring key; publication binds it to the tracker's stable ID. */
161
- tracker: z.ZodString;
162
- source: z.ZodEnum<{
163
- custom: "custom";
164
- "x-search": "x-search";
165
- }>;
166
- /** Which observations fire; absent means the source's default (`defaultTriggerMode`). */
167
- on: z.ZodOptional<z.ZodEnum<{
168
- "new-record": "new-record";
169
- "new-observation": "new-observation";
170
- "data-changed": "data-changed";
171
- }>>;
172
- where: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
173
- path: z.ZodString;
174
- equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
175
- }, z.core.$strict>, z.ZodObject<{
176
- path: z.ZodString;
177
- gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
178
- setting: z.ZodString;
179
- }, z.core.$strict>]>>;
180
- gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
181
- setting: z.ZodString;
182
- }, z.core.$strict>]>>;
183
- lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
184
- setting: z.ZodString;
185
- }, z.core.$strict>]>>;
186
- lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
187
- setting: z.ZodString;
188
- }, z.core.$strict>]>>;
189
- }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
190
- path: z.ZodString;
191
- equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
192
- }, z.core.$strict>, z.ZodObject<{
193
- path: z.ZodString;
194
- gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
195
- setting: z.ZodString;
196
- }, z.core.$strict>]>>;
197
- gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
198
- setting: z.ZodString;
199
- }, z.core.$strict>]>>;
200
- lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
201
- setting: z.ZodString;
202
- }, z.core.$strict>]>>;
203
- lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
204
- setting: z.ZodString;
205
- }, z.core.$strict>]>>;
206
- }, z.core.$strict>]>>]>>;
207
- /**
208
- * The record account the quest pays: `author`, `inReplyTo` for an X post, or a named account of
209
- * a custom record. Relay attributes it through verified links; evaluators cannot redirect it.
210
- * Releases published before account roles store `"replied-to"` for `inReplyTo`.
211
- */
212
- beneficiary: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"replied-to">]>;
213
- }, z.core.$strict>;
214
- type TrackerTriggerPolicy = z.infer<typeof trackerTriggerPolicySchema>;
215
- /** The firing mode a published policy uses: its `on`, or its source's default. */
216
- declare function triggerMode(policy: Pick<TrackerTriggerPolicy, "on" | "source">): TrackerTriggerMode;
217
- /** The record role a published policy pays. A stored `"replied-to"` is the `inReplyTo` role. */
218
- declare function beneficiaryRole(policy: Pick<TrackerTriggerPolicy, "beneficiary">): AccountRole;
219
- /** Who the record pays and through which verified link, captured at admission. */
220
- declare const trackerAttributionSchema: z.ZodObject<{
221
- member: z.ZodString;
222
- capturedAt: z.ZodNumber;
223
- account: z.ZodDiscriminatedUnion<[z.ZodObject<{
224
- provider: z.ZodLiteral<"wallet">;
225
- /** Canonical CAIP-10 account ID, as the record names it. */
226
- id: z.ZodString;
227
- /** The wallet link's revision. */
228
- revision: z.ZodNumber;
229
- /** When the member verified the wallet. */
230
- linkedAt: z.ZodNullable<z.ZodNumber>;
231
- }, z.core.$strict>, z.ZodObject<{
232
- issuer: z.ZodString;
233
- /** The account's stable user ID. */
234
- subject: z.ZodString;
235
- /** The member's account selection revision. */
236
- revision: z.ZodNumber;
237
- /** When the member linked the account; null when unknown. */
238
- linkedAt: z.ZodNullable<z.ZodNumber>;
239
- provider: z.ZodLiteral<"x">;
240
- }, z.core.$strict>, z.ZodObject<{
241
- issuer: z.ZodString;
242
- /** The account's stable user ID. */
243
- subject: z.ZodString;
244
- /** The member's account selection revision. */
245
- revision: z.ZodNumber;
246
- /** When the member linked the account; null when unknown. */
247
- linkedAt: z.ZodNullable<z.ZodNumber>;
248
- provider: z.ZodLiteral<"discord">;
249
- }, z.core.$strict>, z.ZodObject<{
250
- provider: z.ZodLiteral<"member">;
251
- /** The member ID the record names. */
252
- id: z.ZodString;
253
- }, z.core.$strict>], "provider">;
254
- }, z.core.$strict>;
255
- type TrackerAttribution = z.infer<typeof trackerAttributionSchema>;
256
- /** The record observation that triggered the attempt, as stored. */
257
- declare const trackerTriggerRecordSchema: z.ZodObject<{
258
- id: z.ZodString;
259
- source: z.ZodString;
260
- occurredAt: z.ZodNumber;
261
- observedAt: z.ZodNumber;
262
- firstSeenAt: z.ZodNumber;
263
- author: z.ZodNullable<z.ZodObject<{
264
- id: z.ZodString;
265
- verified: z.ZodNullable<z.ZodBoolean>;
266
- kind: z.ZodOptional<z.ZodEnum<{
267
- x: "x";
268
- discord: "discord";
269
- member: "member";
270
- wallet: "wallet";
271
- }>>;
272
- }, z.core.$strict>>;
273
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
274
- kind: z.ZodOptional<z.ZodEnum<{
275
- x: "x";
276
- discord: "discord";
277
- member: "member";
278
- wallet: "wallet";
279
- }>>;
280
- id: z.ZodString;
281
- }, z.core.$strict>>>;
282
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
283
- removed: z.ZodBoolean;
284
- }, z.core.$strict>;
285
- /** Immutable admission input of a tracker-triggered attempt: the pinned observation and who it pays. */
286
- declare const trackerTriggerContextSchema: z.ZodObject<{
287
- /** The tracker's stable ID. */
288
- tracker: z.ZodString;
289
- /** The tracker's authoring key. */
290
- key: z.ZodString;
291
- /**
292
- * The record account the attempt pays, as the quest's release names it. Releases published
293
- * before account roles name `inReplyTo` `"replied-to"`, which their bundled evaluators expect.
294
- */
295
- beneficiary: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"replied-to">]>;
296
- record: z.ZodObject<{
297
- id: z.ZodString;
298
- source: z.ZodString;
299
- occurredAt: z.ZodNumber;
300
- observedAt: z.ZodNumber;
301
- firstSeenAt: z.ZodNumber;
302
- author: z.ZodNullable<z.ZodObject<{
303
- id: z.ZodString;
304
- verified: z.ZodNullable<z.ZodBoolean>;
305
- kind: z.ZodOptional<z.ZodEnum<{
306
- x: "x";
307
- discord: "discord";
308
- member: "member";
309
- wallet: "wallet";
310
- }>>;
311
- }, z.core.$strict>>;
312
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
313
- kind: z.ZodOptional<z.ZodEnum<{
314
- x: "x";
315
- discord: "discord";
316
- member: "member";
317
- wallet: "wallet";
318
- }>>;
319
- id: z.ZodString;
320
- }, z.core.$strict>>>;
321
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
322
- removed: z.ZodBoolean;
323
- }, z.core.$strict>;
324
- /** The captured X post of this observation; null for custom trackers. */
325
- x: z.ZodNullable<z.ZodObject<{
326
- evidence: z.ZodObject<{
327
- contentRevision: z.ZodString;
328
- observation: z.ZodString;
329
- }, z.core.$strict>;
330
- content: z.ZodObject<{
331
- version: z.ZodLiteral<1>;
332
- id: z.ZodString;
333
- authorId: z.ZodString;
334
- publishedAt: z.ZodNumber;
335
- text: z.ZodString;
336
- isReply: z.ZodBoolean;
337
- isRetweet: z.ZodBoolean;
338
- isQuoteTweet: z.ZodBoolean;
339
- media: z.ZodNullable<z.ZodArray<z.ZodObject<{
340
- type: z.ZodString;
341
- url: z.ZodString;
342
- }, z.core.$strict>>>;
343
- mentionedAuthorIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
344
- videoLengthSeconds: z.ZodNullable<z.ZodNumber>;
345
- references: z.ZodObject<{
346
- replyId: z.ZodNullable<z.ZodString>;
347
- replyAuthorId: z.ZodNullable<z.ZodString>;
348
- quoteId: z.ZodNullable<z.ZodString>;
349
- quoteAuthorId: z.ZodNullable<z.ZodString>;
350
- repostId: z.ZodNullable<z.ZodString>;
351
- repostAuthorId: z.ZodNullable<z.ZodString>;
352
- }, z.core.$strict>;
353
- }, z.core.$strict>;
354
- }, z.core.$strict>>;
355
- attribution: z.ZodObject<{
356
- member: z.ZodString;
357
- capturedAt: z.ZodNumber;
358
- account: z.ZodDiscriminatedUnion<[z.ZodObject<{
359
- provider: z.ZodLiteral<"wallet">;
360
- /** Canonical CAIP-10 account ID, as the record names it. */
361
- id: z.ZodString;
362
- /** The wallet link's revision. */
363
- revision: z.ZodNumber;
364
- /** When the member verified the wallet. */
365
- linkedAt: z.ZodNullable<z.ZodNumber>;
366
- }, z.core.$strict>, z.ZodObject<{
367
- issuer: z.ZodString;
368
- /** The account's stable user ID. */
369
- subject: z.ZodString;
370
- /** The member's account selection revision. */
371
- revision: z.ZodNumber;
372
- /** When the member linked the account; null when unknown. */
373
- linkedAt: z.ZodNullable<z.ZodNumber>;
374
- provider: z.ZodLiteral<"x">;
375
- }, z.core.$strict>, z.ZodObject<{
376
- issuer: z.ZodString;
377
- /** The account's stable user ID. */
378
- subject: z.ZodString;
379
- /** The member's account selection revision. */
380
- revision: z.ZodNumber;
381
- /** When the member linked the account; null when unknown. */
382
- linkedAt: z.ZodNullable<z.ZodNumber>;
383
- provider: z.ZodLiteral<"discord">;
384
- }, z.core.$strict>, z.ZodObject<{
385
- provider: z.ZodLiteral<"member">;
386
- /** The member ID the record names. */
387
- id: z.ZodString;
388
- }, z.core.$strict>], "provider">;
389
- }, z.core.$strict>;
390
- }, z.core.$strict>;
391
- /**
392
- * The pinned observation of a tracker-triggered attempt. With a typed tracker, `record.data` has
393
- * the tracker's data type: ingestion validated it against the tracker's schema.
394
- */
395
- type TrackerTriggerContext<D = unknown> = unknown extends D ? z.infer<typeof trackerTriggerContextSchema> : Omit<z.infer<typeof trackerTriggerContextSchema>, "record"> & {
396
- record: Omit<z.infer<typeof trackerTriggerContextSchema>["record"], "data"> & {
397
- data: D;
398
- };
399
- };
400
-
401
- /**
402
- * The serializable form of a custom tracker's record `data` schema: a subset of JSON Schema
403
- * (draft 2020-12) that `customSource(namespace, { data })` derives from a zod schema. It is stored
404
- * with the tracker definition, and ingestion validates each record's `data` against it. The subset
405
- * leaves out string patterns and formats, whose regular expressions Relay would otherwise run on
406
- * every ingested record, and every keyword whose meaning needs references or evaluation state.
407
- */
408
- type TrackerDataSchema = {
409
- type?: "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
410
- properties?: Record<string, TrackerDataSchema>;
411
- required?: string[];
412
- additionalProperties?: boolean | TrackerDataSchema;
413
- propertyNames?: {
414
- type: "string";
415
- enum?: string[];
416
- };
417
- items?: TrackerDataSchema;
418
- minItems?: number;
419
- maxItems?: number;
420
- minLength?: number;
421
- maxLength?: number;
422
- minimum?: number;
423
- maximum?: number;
424
- exclusiveMinimum?: number;
425
- exclusiveMaximum?: number;
426
- enum?: (string | number | boolean | null)[];
427
- const?: string | number | boolean | null;
428
- anyOf?: TrackerDataSchema[];
429
- oneOf?: TrackerDataSchema[];
430
- allOf?: TrackerDataSchema[];
431
- };
432
- /** The most branches one union may list. */
433
- declare const trackerDataMaxBranches = 16;
434
- /** The most properties, `required` keys, enum values or allowed key names one schema node lists. */
435
- declare const trackerDataMaxEntries = 256;
436
- /**
437
- * A stored tracker data schema: an object schema in the supported subset, at most 32 KB and
438
- * nested at most 16 levels deep, whose unions list at most 16 branches and, inside another union's
439
- * branch, at most one branch with properties, items or unions of its own, and whose nodes list at
440
- * most 256 properties, `required` keys, enum values or allowed key names.
441
- */
442
- declare const trackerDataSchemaSchema: z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>;
443
- /**
444
- * Converts a zod object schema into the tracker data subset. Throws, naming the field, for types
445
- * JSON cannot carry (dates, bigints), for refinements and transforms, which Relay cannot run at
446
- * ingestion, and for string patterns and formats.
447
- */
448
- declare function trackerDataSchema(schema: z.ZodType): TrackerDataSchema;
449
- /**
450
- * Why a record's data does not match its tracker's schema. `too-complex` means validation spent
451
- * its step budget before deciding.
452
- */
453
- type TrackerDataIssue = {
454
- kind: "mismatch" | "too-complex";
455
- path: string;
456
- reason: string;
457
- };
458
- /**
459
- * Validation steps one record may use. Every unit of work costs a step: each schema node visited
460
- * for a value, each object key and `required` key checked, each literal property scanned, each enum
461
- * lookup. A step costs well under a microsecond, so one record stays within tens of milliseconds.
462
- */
463
- declare const trackerDataRecordSteps = 250000;
464
- /** Validation steps one ingest batch, or one page of records, may use across its records. */
465
- declare const trackerDataBatchSteps = 6000000;
466
- /** A step allowance that validation draws down; share one across a batch. */
467
- type TrackerDataBudget = {
468
- steps: number;
469
- };
470
- /**
471
- * The first way a record's `data` fails its tracker's schema, or null when it matches. Validation
472
- * draws on `budget`, which defaults to one record's allowance; when it runs out the result is a
473
- * `too-complex` issue rather than a decision.
474
- */
475
- declare function trackerDataIssue(schema: TrackerDataSchema, data: unknown, budget?: TrackerDataBudget): TrackerDataIssue | null;
476
- /**
477
- * Validates several records' data on one shared allowance: each record may use at most one
478
- * record's steps, and all of them together at most one batch's. Returns each record's issue, in
479
- * order; once the allowance is spent, every remaining record is `too-complex`.
480
- */
481
- declare function trackerDataIssues(schema: TrackerDataSchema, records: readonly unknown[]): (TrackerDataIssue | null)[];
482
- /**
483
- * The JSON types the value at a dot-separated `data` path can have under the schema, or null when
484
- * the schema declares no such path. A key must be a declared property, or fall under a record's or
485
- * loose object's value schema; an unconstrained value (`z.unknown()`) has every path and type.
486
- */
487
- declare function trackerDataPathTypes(schema: TrackerDataSchema, path: string): Set<string> | null;
488
- /**
489
- * Wraps a reader so `records(handle)` returns only records whose data matches the handle's data
490
- * schema, the one the quest's types come from, and counts the rest in `excluded`. Reads by key
491
- * string and of X trackers pass through.
492
- */
493
- declare function schemaCheckedReader(reader: TrackerReader): TrackerReader;
494
- /**
495
- * Why a filter cannot match records of a tracker's declared data schema, or null when it can: each
496
- * path must be declared, `equals` must name a value its field can hold, and a comparison needs a
497
- * number or string field.
498
- */
499
- declare function whereSchemaIssue(schema: TrackerDataSchema, where: TrackerWhere | undefined): string | null;
500
-
501
- /** Keep provider fields, including verification details, rather than projecting them away. */
502
- declare const xTweetSchema: z.ZodObject<{
503
- id: z.ZodString;
504
- userId: z.ZodString;
505
- content: z.ZodString;
506
- createdAt: z.ZodISODateTime;
507
- author: z.ZodObject<{
508
- id: z.ZodString;
509
- username: z.ZodString;
510
- name: z.ZodString;
511
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
512
- }, z.core.$loose>;
513
- likeCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
514
- replyCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
515
- retweetCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
516
- quoteCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
517
- viewCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
518
- bookmarkCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
519
- isReply: z.ZodBoolean;
520
- isRetweet: z.ZodBoolean;
521
- isQuoteTweet: z.ZodBoolean;
522
- }, z.core.$loose>;
523
- type XTweet = z.infer<typeof xTweetSchema>;
524
- /** Matches tracker_x_content_body_v1 in migration 0054. Version projection changes;
525
- * retained bodies must remain readable without rewriting their evidence identities. */
526
- declare const xContentBodySchema: z.ZodObject<{
527
- version: z.ZodLiteral<1>;
528
- id: z.ZodString;
529
- authorId: z.ZodString;
530
- publishedAt: z.ZodNumber;
531
- text: z.ZodString;
532
- isReply: z.ZodBoolean;
533
- isRetweet: z.ZodBoolean;
534
- isQuoteTweet: z.ZodBoolean;
535
- media: z.ZodNullable<z.ZodArray<z.ZodObject<{
536
- type: z.ZodString;
537
- url: z.ZodString;
538
- }, z.core.$strict>>>;
539
- mentionedAuthorIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
540
- videoLengthSeconds: z.ZodNullable<z.ZodNumber>;
541
- references: z.ZodObject<{
542
- replyId: z.ZodNullable<z.ZodString>;
543
- replyAuthorId: z.ZodNullable<z.ZodString>;
544
- quoteId: z.ZodNullable<z.ZodString>;
545
- quoteAuthorId: z.ZodNullable<z.ZodString>;
546
- repostId: z.ZodNullable<z.ZodString>;
547
- repostAuthorId: z.ZodNullable<z.ZodString>;
548
- }, z.core.$strict>;
549
- }, z.core.$strict>;
550
- declare const trackerContentQuerySchema: z.ZodObject<{
551
- id: z.ZodString;
552
- observation: z.ZodString;
553
- }, z.core.$strict>;
554
- type TrackerContentQuery = z.infer<typeof trackerContentQuerySchema>;
555
- declare const trackerContentReadSchema: z.ZodObject<{
556
- id: z.ZodString;
557
- observation: z.ZodString;
558
- member: z.ZodString;
559
- }, z.core.$strict>;
560
- declare const trackerEvidenceSchema: z.ZodObject<{
561
- contentRevision: z.ZodString;
562
- observation: z.ZodString;
563
- }, z.core.$strict>;
564
- declare const trackerContentSchema: z.ZodObject<{
565
- tracker: z.ZodString;
566
- source: z.ZodLiteral<"x">;
567
- evidence: z.ZodObject<{
568
- contentRevision: z.ZodString;
569
- observation: z.ZodString;
570
- }, z.core.$strict>;
571
- content: z.ZodObject<{
572
- version: z.ZodLiteral<1>;
573
- id: z.ZodString;
574
- authorId: z.ZodString;
575
- publishedAt: z.ZodNumber;
576
- text: z.ZodString;
577
- isReply: z.ZodBoolean;
578
- isRetweet: z.ZodBoolean;
579
- isQuoteTweet: z.ZodBoolean;
580
- media: z.ZodNullable<z.ZodArray<z.ZodObject<{
581
- type: z.ZodString;
582
- url: z.ZodString;
583
- }, z.core.$strict>>>;
584
- mentionedAuthorIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
585
- videoLengthSeconds: z.ZodNullable<z.ZodNumber>;
586
- references: z.ZodObject<{
587
- replyId: z.ZodNullable<z.ZodString>;
588
- replyAuthorId: z.ZodNullable<z.ZodString>;
589
- quoteId: z.ZodNullable<z.ZodString>;
590
- quoteAuthorId: z.ZodNullable<z.ZodString>;
591
- repostId: z.ZodNullable<z.ZodString>;
592
- repostAuthorId: z.ZodNullable<z.ZodString>;
593
- }, z.core.$strict>;
594
- }, z.core.$strict>;
595
- observedAt: z.ZodNumber;
596
- removed: z.ZodBoolean;
597
- attribution: z.ZodDiscriminatedUnion<[z.ZodObject<{
598
- kind: z.ZodLiteral<"linked">;
599
- account: z.ZodObject<{
600
- provider: z.ZodLiteral<"x">;
601
- issuer: z.ZodString;
602
- subject: z.ZodString;
603
- revision: z.ZodNumber;
604
- linkedAt: z.ZodNullable<z.ZodNumber>;
605
- }, z.core.$strict>;
606
- member: z.ZodString;
607
- capturedAt: z.ZodNumber;
608
- }, z.core.$strict>, z.ZodObject<{
609
- kind: z.ZodLiteral<"unlinked">;
610
- member: z.ZodString;
611
- capturedAt: z.ZodNumber;
612
- }, z.core.$strict>, z.ZodObject<{
613
- kind: z.ZodLiteral<"different-author">;
614
- member: z.ZodString;
615
- capturedAt: z.ZodNumber;
616
- }, z.core.$strict>], "kind">;
617
- }, z.core.$strict>;
618
- type TrackerContent = z.infer<typeof trackerContentSchema>;
619
- /**
620
- * The verified identities a custom tracker's record accounts can be. Relay attributes each to a
621
- * member through a verified link: `wallet` a canonical CAIP-10 account ID the member linked, `x`
622
- * and `discord` the stable user ID of the member's selected account, `member` a Domino member ID.
623
- */
624
- declare const identityKindSchema: z.ZodEnum<{
625
- x: "x";
626
- discord: "discord";
627
- member: "member";
628
- wallet: "wallet";
629
- }>;
630
- type IdentityKind = z.infer<typeof identityKindSchema>;
631
- /**
632
- * A named account on a record, such as `author` or `inReplyTo`. A tracker-triggered quest pays the
633
- * member behind one role, its `beneficiary`.
634
- */
635
- declare const accountRoleSchema: z.ZodString;
636
- type AccountRole = z.infer<typeof accountRoleSchema>;
637
- /** The roles an X post exposes: who wrote it, and whose post it replies to. */
638
- declare const xAccountRoles: readonly ["author", "inReplyTo"];
639
- declare const xSearchSourceSchema: z.ZodObject<{
640
- kind: z.ZodLiteral<"x-search">;
641
- query: z.ZodString;
642
- }, z.core.$strict>;
643
- declare const customSourceSchema: z.ZodObject<{
644
- kind: z.ZodLiteral<"custom">;
645
- namespace: z.ZodString;
646
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
647
- x: "x";
648
- discord: "discord";
649
- member: "member";
650
- wallet: "wallet";
651
- }>>>;
652
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
653
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
654
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
655
- }, z.core.$strict>;
656
- declare const trackerSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
657
- kind: z.ZodLiteral<"x-search">;
658
- query: z.ZodString;
659
- }, z.core.$strict>, z.ZodObject<{
660
- kind: z.ZodLiteral<"custom">;
661
- namespace: z.ZodString;
662
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
663
- x: "x";
664
- discord: "discord";
665
- member: "member";
666
- wallet: "wallet";
667
- }>>>;
668
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
669
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
670
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
671
- }, z.core.$strict>], "kind">;
672
- type TrackerSource = z.infer<typeof trackerSourceSchema>;
673
- /**
674
- * The identity kinds a source's record accounts are: `x` for an X tracker, a custom source's
675
- * `identities` (`["wallet"]` for one stored with `authors: "wallet"`), or undefined when a custom
676
- * source's authors are opaque IDs.
677
- */
678
- declare function sourceIdentities(source: TrackerSource): IdentityKind[] | undefined;
679
- /**
680
- * Type-only marker for the `data` a source's records carry. It never exists at runtime: sources
681
- * and trackers stay plain, serializable definitions.
682
- */
683
- declare const recordData: unique symbol;
684
- /** A source or tracker whose records carry `data` of type `D`. */
685
- type WithRecordData<D> = {
686
- readonly [recordData]?: D;
687
- };
688
- /**
689
- * The record `data` type of a source or tracker: the provider payload for X, the declared schema's
690
- * input type for a custom source, or `unknown` for one that declares none.
691
- */
692
- type TrackerData<T> = T extends WithRecordData<infer D> ? unknown extends D ? unknown : D : unknown;
693
- declare const trackerDefinitionSchema: z.ZodObject<{
694
- key: z.ZodString;
695
- title: z.ZodString;
696
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
697
- kind: z.ZodLiteral<"x-search">;
698
- query: z.ZodString;
699
- }, z.core.$strict>, z.ZodObject<{
700
- kind: z.ZodLiteral<"custom">;
701
- namespace: z.ZodString;
702
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
703
- x: "x";
704
- discord: "discord";
705
- member: "member";
706
- wallet: "wallet";
707
- }>>>;
708
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
709
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
710
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
711
- }, z.core.$strict>], "kind">;
712
- window: z.ZodObject<{
713
- start: z.ZodNumber;
714
- end: z.ZodOptional<z.ZodNumber>;
715
- }, z.core.$strict>;
716
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
717
- maxPages: z.ZodDefault<z.ZodNumber>;
718
- }, z.core.$strict>;
719
- declare const trackerArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
720
- key: z.ZodString;
721
- title: z.ZodString;
722
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
723
- kind: z.ZodLiteral<"x-search">;
724
- query: z.ZodString;
725
- }, z.core.$strict>, z.ZodObject<{
726
- kind: z.ZodLiteral<"custom">;
727
- namespace: z.ZodString;
728
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
729
- x: "x";
730
- discord: "discord";
731
- member: "member";
732
- wallet: "wallet";
733
- }>>>;
734
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
735
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
736
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
737
- }, z.core.$strict>], "kind">;
738
- window: z.ZodObject<{
739
- start: z.ZodNumber;
740
- end: z.ZodOptional<z.ZodNumber>;
741
- }, z.core.$strict>;
742
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
743
- maxPages: z.ZodDefault<z.ZodNumber>;
744
- }, z.core.$strict>, z.ZodObject<{
745
- code: z.ZodString;
746
- }, z.core.$strict>]>;
747
- type TrackerDefinition = z.infer<typeof trackerDefinitionSchema>;
748
- /**
749
- * A tracker definition whose records carry `data` of type `D`. Quests reference it as a handle:
750
- * `where` paths and `ctx.tracker.record.data` follow from `D`.
751
- */
752
- type Tracker<D = unknown> = TrackerDefinition & WithRecordData<D>;
753
- declare const publishedTrackerSchema: z.ZodObject<{
754
- id: z.ZodString;
755
- version: z.ZodString;
756
- definition: z.ZodObject<{
757
- key: z.ZodString;
758
- title: z.ZodString;
759
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
760
- kind: z.ZodLiteral<"x-search">;
761
- query: z.ZodString;
762
- }, z.core.$strict>, z.ZodObject<{
763
- kind: z.ZodLiteral<"custom">;
764
- namespace: z.ZodString;
765
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
766
- x: "x";
767
- discord: "discord";
768
- member: "member";
769
- wallet: "wallet";
770
- }>>>;
771
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
772
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
773
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
774
- }, z.core.$strict>], "kind">;
775
- window: z.ZodObject<{
776
- start: z.ZodNumber;
777
- end: z.ZodOptional<z.ZodNumber>;
778
- }, z.core.$strict>;
779
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
780
- maxPages: z.ZodDefault<z.ZodNumber>;
781
- }, z.core.$strict>;
782
- publishedAt: z.ZodNumber;
783
- actor: z.ZodNullable<z.ZodString>;
784
- }, z.core.$strip>;
785
- declare const trackerStatusSchema: z.ZodObject<{
786
- published: z.ZodObject<{
787
- id: z.ZodString;
788
- version: z.ZodString;
789
- definition: z.ZodObject<{
790
- key: z.ZodString;
791
- title: z.ZodString;
792
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
793
- kind: z.ZodLiteral<"x-search">;
794
- query: z.ZodString;
795
- }, z.core.$strict>, z.ZodObject<{
796
- kind: z.ZodLiteral<"custom">;
797
- namespace: z.ZodString;
798
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
799
- x: "x";
800
- discord: "discord";
801
- member: "member";
802
- wallet: "wallet";
803
- }>>>;
804
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
805
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
806
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
807
- }, z.core.$strict>], "kind">;
808
- window: z.ZodObject<{
809
- start: z.ZodNumber;
810
- end: z.ZodOptional<z.ZodNumber>;
811
- }, z.core.$strict>;
812
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
813
- maxPages: z.ZodDefault<z.ZodNumber>;
814
- }, z.core.$strict>;
815
- publishedAt: z.ZodNumber;
816
- actor: z.ZodNullable<z.ZodString>;
817
- }, z.core.$strip>;
818
- paused: z.ZodBoolean;
819
- state: z.ZodEnum<{
820
- error: "error";
821
- idle: "idle";
822
- syncing: "syncing";
823
- complete: "complete";
824
- }>;
825
- lastStartedAt: z.ZodNullable<z.ZodNumber>;
826
- lastCompletedAt: z.ZodNullable<z.ZodNumber>;
827
- nextSyncAt: z.ZodNullable<z.ZodNumber>;
828
- coverage: z.ZodEnum<{
829
- unknown: "unknown";
830
- complete: "complete";
831
- partial: "partial";
832
- }>;
833
- error: z.ZodNullable<z.ZodString>;
834
- records: z.ZodNumber;
835
- }, z.core.$strip>;
836
- type TrackerStatus = z.infer<typeof trackerStatusSchema>;
837
- declare const trackerControlSchema: z.ZodObject<{
838
- actionId: z.ZodString;
839
- action: z.ZodEnum<{
840
- pause: "pause";
841
- resume: "resume";
842
- refresh: "refresh";
843
- }>;
844
- }, z.core.$strict>;
845
- /**
846
- * An account a record names, of one of its custom source's identity kinds. `kind` may be left out
847
- * when the source names exactly one.
848
- */
849
- declare const trackerAccountSchema: z.ZodObject<{
850
- kind: z.ZodOptional<z.ZodEnum<{
851
- x: "x";
852
- discord: "discord";
853
- member: "member";
854
- wallet: "wallet";
855
- }>>;
856
- id: z.ZodString;
857
- }, z.core.$strict>;
858
- type TrackerAccount = z.infer<typeof trackerAccountSchema>;
859
- declare const trackerRecordInputSchema: z.ZodObject<{
860
- id: z.ZodString;
861
- occurredAt: z.ZodNumber;
862
- observedAt: z.ZodNumber;
863
- author: z.ZodDefault<z.ZodNullable<z.ZodObject<{
864
- id: z.ZodString;
865
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
866
- kind: z.ZodOptional<z.ZodEnum<{
867
- x: "x";
868
- discord: "discord";
869
- member: "member";
870
- wallet: "wallet";
871
- }>>;
872
- }, z.core.$strict>>>;
873
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
874
- kind: z.ZodOptional<z.ZodEnum<{
875
- x: "x";
876
- discord: "discord";
877
- member: "member";
878
- wallet: "wallet";
879
- }>>;
880
- id: z.ZodString;
881
- }, z.core.$strict>>>;
882
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
883
- removed: z.ZodDefault<z.ZodBoolean>;
884
- }, z.core.$strict>;
885
- declare const trackerRecordSchema: z.ZodObject<{
886
- id: z.ZodString;
887
- occurredAt: z.ZodNumber;
888
- observedAt: z.ZodNumber;
889
- author: z.ZodDefault<z.ZodNullable<z.ZodObject<{
890
- id: z.ZodString;
891
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
892
- kind: z.ZodOptional<z.ZodEnum<{
893
- x: "x";
894
- discord: "discord";
895
- member: "member";
896
- wallet: "wallet";
897
- }>>;
898
- }, z.core.$strict>>>;
899
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
900
- kind: z.ZodOptional<z.ZodEnum<{
901
- x: "x";
902
- discord: "discord";
903
- member: "member";
904
- wallet: "wallet";
905
- }>>;
906
- id: z.ZodString;
907
- }, z.core.$strict>>>;
908
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
909
- removed: z.ZodDefault<z.ZodBoolean>;
910
- source: z.ZodString;
911
- firstSeenAt: z.ZodNumber;
912
- evidence: z.ZodOptional<z.ZodNullable<z.ZodObject<{
913
- contentRevision: z.ZodString;
914
- observation: z.ZodString;
915
- }, z.core.$strict>>>;
916
- }, z.core.$strict>;
917
- type TrackerRecord = z.infer<typeof trackerRecordSchema>;
918
- declare const trackerIngestSchema: z.ZodObject<{
919
- actionId: z.ZodString;
920
- records: z.ZodArray<z.ZodObject<{
921
- id: z.ZodString;
922
- occurredAt: z.ZodNumber;
923
- observedAt: z.ZodNumber;
924
- author: z.ZodDefault<z.ZodNullable<z.ZodObject<{
925
- id: z.ZodString;
926
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
927
- kind: z.ZodOptional<z.ZodEnum<{
928
- x: "x";
929
- discord: "discord";
930
- member: "member";
931
- wallet: "wallet";
932
- }>>;
933
- }, z.core.$strict>>>;
934
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
935
- kind: z.ZodOptional<z.ZodEnum<{
936
- x: "x";
937
- discord: "discord";
938
- member: "member";
939
- wallet: "wallet";
940
- }>>;
941
- id: z.ZodString;
942
- }, z.core.$strict>>>;
943
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
944
- removed: z.ZodDefault<z.ZodBoolean>;
945
- }, z.core.$strict>>;
946
- }, z.core.$strict>;
947
- declare const trackerIngestResultSchema: z.ZodObject<{
948
- stored: z.ZodNumber;
949
- admissions: z.ZodOptional<z.ZodObject<{
950
- admitted: z.ZodNumber;
951
- skipped: z.ZodNumber;
952
- filtered: z.ZodOptional<z.ZodNumber>;
953
- }, z.core.$strip>>;
954
- }, z.core.$strip>;
955
- /**
956
- * Why a tracker trigger skipped an observation, as a stable machine code. Relay applies the rules
957
- * in this order and records the first that fails. Later versions may add codes; treat an unknown
958
- * code as a skip whose `reason` explains it.
959
- */
960
- declare const trackerSkipCodes: readonly ["quest-paused", "before-activation", "record-removed", "invalid-record-data", "content-unavailable", "no-account", "beneficiary-is-author", "unlinked-account", "ambiguous-account", "not-joined", "prerequisites-incomplete"];
961
- type TrackerSkipCode = (typeof trackerSkipCodes)[number];
962
- /**
963
- * One tracker-trigger decision: a quest admitted an attempt for a record observation, or skipped
964
- * it with a code and reason. Operators read these to see why a quest did or did not run.
965
- */
966
- declare const trackerOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
967
- state: z.ZodLiteral<"admitted">;
968
- code: z.ZodNull;
969
- reason: z.ZodNull;
970
- /** The attributed member. */
971
- member: z.ZodString;
972
- /** The admitted attempt. Its evaluation, decision and rewards live on the attempt. */
973
- attempt: z.ZodString;
974
- /** Stable quest ID. */
975
- quest: z.ZodString;
976
- /** Stable tracker ID. */
977
- tracker: z.ZodString;
978
- record: z.ZodString;
979
- observedAt: z.ZodNumber;
980
- /** The release admitted, or the one active when the observation was skipped. */
981
- release: z.ZodString;
982
- /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
983
- account: z.ZodNullable<z.ZodString>;
984
- createdAt: z.ZodNumber;
985
- updatedAt: z.ZodNumber;
986
- /** Null for automatic decisions; the staff actor after a retry. */
987
- actor: z.ZodNullable<z.ZodString>;
988
- }, z.core.$strict>, z.ZodObject<{
989
- state: z.ZodLiteral<"skipped">;
990
- /** Why the observation was skipped, as one of `trackerSkipCodes`. */
991
- code: z.ZodString;
992
- /** Why the observation was skipped, for people. */
993
- reason: z.ZodString;
994
- /** The attributed member, when attribution got that far. */
995
- member: z.ZodNullable<z.ZodString>;
996
- attempt: z.ZodNullable<z.ZodString>;
997
- /** Stable quest ID. */
998
- quest: z.ZodString;
999
- /** Stable tracker ID. */
1000
- tracker: z.ZodString;
1001
- record: z.ZodString;
1002
- observedAt: z.ZodNumber;
1003
- /** The release admitted, or the one active when the observation was skipped. */
1004
- release: z.ZodString;
1005
- /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
1006
- account: z.ZodNullable<z.ZodString>;
1007
- createdAt: z.ZodNumber;
1008
- updatedAt: z.ZodNumber;
1009
- /** Null for automatic decisions; the staff actor after a retry. */
1010
- actor: z.ZodNullable<z.ZodString>;
1011
- }, z.core.$strict>], "state">;
1012
- type TrackerOutcome = z.infer<typeof trackerOutcomeSchema>;
1013
- declare const trackerOutcomeQuerySchema: z.ZodObject<{
1014
- /** Quest key or ID. */
1015
- quest: z.ZodOptional<z.ZodString>;
1016
- record: z.ZodOptional<z.ZodString>;
1017
- member: z.ZodOptional<z.ZodString>;
1018
- state: z.ZodOptional<z.ZodEnum<{
1019
- admitted: "admitted";
1020
- skipped: "skipped";
1021
- }>>;
1022
- /** Only skips with this code, such as `unlinked-account`. */
1023
- code: z.ZodOptional<z.ZodString>;
1024
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1025
- /** Opaque cursor from `next`: older outcomes. */
1026
- before: z.ZodOptional<z.ZodString>;
1027
- }, z.core.$strict>;
1028
- type TrackerOutcomeQuery = z.input<typeof trackerOutcomeQuerySchema>;
1029
- declare const trackerOutcomePageSchema: z.ZodObject<{
1030
- /** Newest first. */
1031
- items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1032
- state: z.ZodLiteral<"admitted">;
1033
- code: z.ZodNull;
1034
- reason: z.ZodNull;
1035
- /** The attributed member. */
1036
- member: z.ZodString;
1037
- /** The admitted attempt. Its evaluation, decision and rewards live on the attempt. */
1038
- attempt: z.ZodString;
1039
- /** Stable quest ID. */
1040
- quest: z.ZodString;
1041
- /** Stable tracker ID. */
1042
- tracker: z.ZodString;
1043
- record: z.ZodString;
1044
- observedAt: z.ZodNumber;
1045
- /** The release admitted, or the one active when the observation was skipped. */
1046
- release: z.ZodString;
1047
- /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
1048
- account: z.ZodNullable<z.ZodString>;
1049
- createdAt: z.ZodNumber;
1050
- updatedAt: z.ZodNumber;
1051
- /** Null for automatic decisions; the staff actor after a retry. */
1052
- actor: z.ZodNullable<z.ZodString>;
1053
- }, z.core.$strict>, z.ZodObject<{
1054
- state: z.ZodLiteral<"skipped">;
1055
- /** Why the observation was skipped, as one of `trackerSkipCodes`. */
1056
- code: z.ZodString;
1057
- /** Why the observation was skipped, for people. */
1058
- reason: z.ZodString;
1059
- /** The attributed member, when attribution got that far. */
1060
- member: z.ZodNullable<z.ZodString>;
1061
- attempt: z.ZodNullable<z.ZodString>;
1062
- /** Stable quest ID. */
1063
- quest: z.ZodString;
1064
- /** Stable tracker ID. */
1065
- tracker: z.ZodString;
1066
- record: z.ZodString;
1067
- observedAt: z.ZodNumber;
1068
- /** The release admitted, or the one active when the observation was skipped. */
1069
- release: z.ZodString;
1070
- /** The account attribution resolved or failed to resolve, such as a CAIP-10 wallet ID. */
1071
- account: z.ZodNullable<z.ZodString>;
1072
- createdAt: z.ZodNumber;
1073
- updatedAt: z.ZodNumber;
1074
- /** Null for automatic decisions; the staff actor after a retry. */
1075
- actor: z.ZodNullable<z.ZodString>;
1076
- }, z.core.$strict>], "state">>;
1077
- next: z.ZodNullable<z.ZodString>;
1078
- }, z.core.$strict>;
1079
- /** Re-runs admission for one skipped observation under the quest's current release and links. */
1080
- declare const trackerOutcomeRetrySchema: z.ZodObject<{
1081
- actionId: z.ZodString;
1082
- /** Quest key or ID. */
1083
- quest: z.ZodString;
1084
- record: z.ZodString;
1085
- observedAt: z.ZodNumber;
1086
- }, z.core.$strict>;
1087
- declare const trackerQuerySchema: z.ZodObject<{
1088
- author: z.ZodOptional<z.ZodString>;
1089
- member: z.ZodOptional<z.ZodString>;
1090
- verified: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{
1091
- true: "true";
1092
- false: "false";
1093
- }>, z.ZodTransform<boolean, "true" | "false">>]>>;
1094
- since: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1095
- until: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1096
- removed: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{
1097
- true: "true";
1098
- false: "false";
1099
- }>, z.ZodTransform<boolean, "true" | "false">>]>>;
1100
- minLikes: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1101
- minViews: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1102
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1103
- cursor: z.ZodOptional<z.ZodString>;
1104
- includeEvidence: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{
1105
- true: "true";
1106
- false: "false";
1107
- }>, z.ZodTransform<boolean, "true" | "false">>]>>;
1108
- }, z.core.$strict>;
1109
- type TrackerQuery = z.input<typeof trackerQuerySchema>;
1110
- declare const trackerPageSchema: z.ZodObject<{
1111
- tracker: z.ZodString;
1112
- items: z.ZodArray<z.ZodObject<{
1113
- id: z.ZodString;
1114
- occurredAt: z.ZodNumber;
1115
- observedAt: z.ZodNumber;
1116
- author: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1117
- id: z.ZodString;
1118
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
1119
- kind: z.ZodOptional<z.ZodEnum<{
1120
- x: "x";
1121
- discord: "discord";
1122
- member: "member";
1123
- wallet: "wallet";
1124
- }>>;
1125
- }, z.core.$strict>>>;
1126
- accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1127
- kind: z.ZodOptional<z.ZodEnum<{
1128
- x: "x";
1129
- discord: "discord";
1130
- member: "member";
1131
- wallet: "wallet";
1132
- }>>;
1133
- id: z.ZodString;
1134
- }, z.core.$strict>>>;
1135
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1136
- removed: z.ZodDefault<z.ZodBoolean>;
1137
- source: z.ZodString;
1138
- firstSeenAt: z.ZodNumber;
1139
- evidence: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1140
- contentRevision: z.ZodString;
1141
- observation: z.ZodString;
1142
- }, z.core.$strict>>>;
1143
- }, z.core.$strict>>;
1144
- nextCursor: z.ZodNullable<z.ZodString>;
1145
- total: z.ZodNumber;
1146
- status: z.ZodObject<{
1147
- published: z.ZodObject<{
1148
- id: z.ZodString;
1149
- version: z.ZodString;
1150
- definition: z.ZodObject<{
1151
- key: z.ZodString;
1152
- title: z.ZodString;
1153
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1154
- kind: z.ZodLiteral<"x-search">;
1155
- query: z.ZodString;
1156
- }, z.core.$strict>, z.ZodObject<{
1157
- kind: z.ZodLiteral<"custom">;
1158
- namespace: z.ZodString;
1159
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1160
- x: "x";
1161
- discord: "discord";
1162
- member: "member";
1163
- wallet: "wallet";
1164
- }>>>;
1165
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1166
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
1167
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
1168
- }, z.core.$strict>], "kind">;
1169
- window: z.ZodObject<{
1170
- start: z.ZodNumber;
1171
- end: z.ZodOptional<z.ZodNumber>;
1172
- }, z.core.$strict>;
1173
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
1174
- maxPages: z.ZodDefault<z.ZodNumber>;
1175
- }, z.core.$strict>;
1176
- publishedAt: z.ZodNumber;
1177
- actor: z.ZodNullable<z.ZodString>;
1178
- }, z.core.$strip>;
1179
- paused: z.ZodBoolean;
1180
- state: z.ZodEnum<{
1181
- error: "error";
1182
- idle: "idle";
1183
- syncing: "syncing";
1184
- complete: "complete";
1185
- }>;
1186
- lastStartedAt: z.ZodNullable<z.ZodNumber>;
1187
- lastCompletedAt: z.ZodNullable<z.ZodNumber>;
1188
- nextSyncAt: z.ZodNullable<z.ZodNumber>;
1189
- coverage: z.ZodEnum<{
1190
- unknown: "unknown";
1191
- complete: "complete";
1192
- partial: "partial";
1193
- }>;
1194
- error: z.ZodNullable<z.ZodString>;
1195
- records: z.ZodNumber;
1196
- }, z.core.$strip>;
1197
- }, z.core.$strip>;
1198
- declare const trackerSummarySchema: z.ZodObject<{
1199
- records: z.ZodNumber;
1200
- authors: z.ZodNumber;
1201
- metrics: z.ZodObject<{
1202
- likes: z.ZodNumber;
1203
- replies: z.ZodNumber;
1204
- reposts: z.ZodNumber;
1205
- quotes: z.ZodNumber;
1206
- views: z.ZodNumber;
1207
- bookmarks: z.ZodNumber;
1208
- }, z.core.$strip>;
1209
- missingMetrics: z.ZodNumber;
1210
- status: z.ZodObject<{
1211
- published: z.ZodObject<{
1212
- id: z.ZodString;
1213
- version: z.ZodString;
1214
- definition: z.ZodObject<{
1215
- key: z.ZodString;
1216
- title: z.ZodString;
1217
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1218
- kind: z.ZodLiteral<"x-search">;
1219
- query: z.ZodString;
1220
- }, z.core.$strict>, z.ZodObject<{
1221
- kind: z.ZodLiteral<"custom">;
1222
- namespace: z.ZodString;
1223
- identities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1224
- x: "x";
1225
- discord: "discord";
1226
- member: "member";
1227
- wallet: "wallet";
1228
- }>>>;
1229
- accounts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1230
- authors: z.ZodOptional<z.ZodLiteral<"wallet">>;
1231
- data: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodType<TrackerDataSchema, unknown, z.core.$ZodTypeInternals<TrackerDataSchema, unknown>>>>;
1232
- }, z.core.$strict>], "kind">;
1233
- window: z.ZodObject<{
1234
- start: z.ZodNumber;
1235
- end: z.ZodOptional<z.ZodNumber>;
1236
- }, z.core.$strict>;
1237
- refreshSeconds: z.ZodDefault<z.ZodNumber>;
1238
- maxPages: z.ZodDefault<z.ZodNumber>;
1239
- }, z.core.$strict>;
1240
- publishedAt: z.ZodNumber;
1241
- actor: z.ZodNullable<z.ZodString>;
1242
- }, z.core.$strip>;
1243
- paused: z.ZodBoolean;
1244
- state: z.ZodEnum<{
1245
- error: "error";
1246
- idle: "idle";
1247
- syncing: "syncing";
1248
- complete: "complete";
1249
- }>;
1250
- lastStartedAt: z.ZodNullable<z.ZodNumber>;
1251
- lastCompletedAt: z.ZodNullable<z.ZodNumber>;
1252
- nextSyncAt: z.ZodNullable<z.ZodNumber>;
1253
- coverage: z.ZodEnum<{
1254
- unknown: "unknown";
1255
- complete: "complete";
1256
- partial: "partial";
1257
- }>;
1258
- error: z.ZodNullable<z.ZodString>;
1259
- records: z.ZodNumber;
1260
- }, z.core.$strip>;
1261
- }, z.core.$strip>;
1262
- /** A record whose `data` has type `D`; untyped records keep JSON object data. */
1263
- type TypedTrackerRecord<D> = unknown extends D ? TrackerRecord : Omit<TrackerRecord, "data"> & {
1264
- data: D;
1265
- };
1266
- /**
1267
- * A page of tracker records whose `data` has type `D`. A page read with a typed tracker handle
1268
- * leaves out records whose data does not match the handle's schema, such as records stored before
1269
- * the schema changed, and counts them in `excluded`; `total` and the cursor still count every
1270
- * record.
1271
- */
1272
- type TrackerPage<D = unknown> = Omit<z.infer<typeof trackerPageSchema>, "items"> & (unknown extends D ? {
1273
- items: TrackerRecord[];
1274
- } : {
1275
- items: TypedTrackerRecord<D>[];
1276
- excluded: number;
1277
- });
1278
- /** Preview bounds: one sample, never stored, never a tracker. */
1279
- declare const trackerPreviewLimits: {
1280
- readonly pages: 3;
1281
- readonly posts: 100;
1282
- readonly days: 30;
1283
- };
1284
- /** A bounded X search sample for exploring a query before defining a tracker in code. */
1285
- declare const trackerPreviewInputSchema: z.ZodObject<{
1286
- query: z.ZodString;
1287
- since: z.ZodNumber;
1288
- }, z.core.$strict>;
1289
- type TrackerPreviewInput = z.input<typeof trackerPreviewInputSchema>;
1290
- declare const trackerPreviewSchema: z.ZodObject<{
1291
- query: z.ZodString;
1292
- since: z.ZodNumber;
1293
- fetchedAt: z.ZodNumber;
1294
- pages: z.ZodNumber;
1295
- posts: z.ZodArray<z.ZodObject<{
1296
- id: z.ZodString;
1297
- userId: z.ZodString;
1298
- content: z.ZodString;
1299
- createdAt: z.ZodISODateTime;
1300
- author: z.ZodObject<{
1301
- id: z.ZodString;
1302
- username: z.ZodString;
1303
- name: z.ZodString;
1304
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
1305
- }, z.core.$loose>;
1306
- likeCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1307
- replyCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1308
- retweetCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1309
- quoteCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1310
- viewCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1311
- bookmarkCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1312
- isReply: z.ZodBoolean;
1313
- isRetweet: z.ZodBoolean;
1314
- isQuoteTweet: z.ZodBoolean;
1315
- }, z.core.$loose>>;
1316
- more: z.ZodBoolean;
1317
- }, z.core.$strip>;
1318
- type TrackerPreview = z.infer<typeof trackerPreviewSchema>;
1319
- /** Read-only capabilities in hosted quest evaluation; results are captured for replay. */
1320
- type TrackerReader = {
1321
- /** Captures an X body and attribution to the evaluating member, with no live metrics. */
1322
- content(reference: string | {
1323
- key: string;
1324
- }, query: TrackerContentQuery): Promise<TrackerContent>;
1325
- /** A page of records; with a tracker handle, each record's `data` has the tracker's type. */
1326
- records<T extends string | {
1327
- key: string;
1328
- }>(reference: T, query?: TrackerQuery): Promise<TrackerPage<TrackerData<T>>>;
1329
- summary(reference: string | {
1330
- key: string;
1331
- }, query?: TrackerQuery): Promise<z.infer<typeof trackerSummarySchema>>;
1332
- };
1333
-
1334
- /**
1335
- * Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
1336
- * sandbox boundary, so a quest cannot make the platform fetch an arbitrary address.
1337
- */
1338
- declare const imageReferenceSchema: z.ZodUnion<readonly [z.ZodObject<{
1339
- evidence: z.ZodString;
1340
- }, z.core.$strict>, z.ZodObject<{
1341
- x: z.ZodLiteral<"profile">;
1342
- }, z.core.$strict>, z.ZodObject<{
1343
- x: z.ZodLiteral<"post">;
1344
- postId: z.ZodString;
1345
- index: z.ZodDefault<z.ZodNumber>;
1346
- }, z.core.$strict>, z.ZodObject<{
1347
- asset: z.ZodString;
1348
- }, z.core.$strict>]>;
1349
- type ImageReference = z.input<typeof imageReferenceSchema>;
1350
- declare const imageFieldSchema: z.ZodObject<{
1351
- type: z.ZodEnum<{
1352
- string: "string";
1353
- number: "number";
1354
- boolean: "boolean";
1355
- }>;
1356
- description: z.ZodString;
1357
- }, z.core.$strict>;
1358
- declare const imageFieldsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
1359
- type: z.ZodEnum<{
1360
- string: "string";
1361
- number: "number";
1362
- boolean: "boolean";
1363
- }>;
1364
- description: z.ZodString;
1365
- }, z.core.$strict>>;
1366
- type ImageFields = z.input<typeof imageFieldsSchema>;
1367
- declare const imageRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1368
- operation: z.ZodLiteral<"inspect">;
1369
- image: z.ZodUnion<readonly [z.ZodObject<{
1370
- evidence: z.ZodString;
1371
- }, z.core.$strict>, z.ZodObject<{
1372
- x: z.ZodLiteral<"profile">;
1373
- }, z.core.$strict>, z.ZodObject<{
1374
- x: z.ZodLiteral<"post">;
1375
- postId: z.ZodString;
1376
- index: z.ZodDefault<z.ZodNumber>;
1377
- }, z.core.$strict>, z.ZodObject<{
1378
- asset: z.ZodString;
1379
- }, z.core.$strict>]>;
1380
- }, z.core.$strict>, z.ZodObject<{
1381
- operation: z.ZodLiteral<"compare">;
1382
- images: z.ZodTuple<[z.ZodUnion<readonly [z.ZodObject<{
1383
- evidence: z.ZodString;
1384
- }, z.core.$strict>, z.ZodObject<{
1385
- x: z.ZodLiteral<"profile">;
1386
- }, z.core.$strict>, z.ZodObject<{
1387
- x: z.ZodLiteral<"post">;
1388
- postId: z.ZodString;
1389
- index: z.ZodDefault<z.ZodNumber>;
1390
- }, z.core.$strict>, z.ZodObject<{
1391
- asset: z.ZodString;
1392
- }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodObject<{
1393
- evidence: z.ZodString;
1394
- }, z.core.$strict>, z.ZodObject<{
1395
- x: z.ZodLiteral<"profile">;
1396
- }, z.core.$strict>, z.ZodObject<{
1397
- x: z.ZodLiteral<"post">;
1398
- postId: z.ZodString;
1399
- index: z.ZodDefault<z.ZodNumber>;
1400
- }, z.core.$strict>, z.ZodObject<{
1401
- asset: z.ZodString;
1402
- }, z.core.$strict>]>], null>;
1403
- }, z.core.$strict>, z.ZodObject<{
1404
- operation: z.ZodLiteral<"review">;
1405
- images: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1406
- evidence: z.ZodString;
1407
- }, z.core.$strict>, z.ZodObject<{
1408
- x: z.ZodLiteral<"profile">;
1409
- }, z.core.$strict>, z.ZodObject<{
1410
- x: z.ZodLiteral<"post">;
1411
- postId: z.ZodString;
1412
- index: z.ZodDefault<z.ZodNumber>;
1413
- }, z.core.$strict>, z.ZodObject<{
1414
- asset: z.ZodString;
1415
- }, z.core.$strict>]>>;
1416
- criteria: z.ZodString;
1417
- }, z.core.$strict>, z.ZodObject<{
1418
- operation: z.ZodLiteral<"extract">;
1419
- image: z.ZodUnion<readonly [z.ZodObject<{
1420
- evidence: z.ZodString;
1421
- }, z.core.$strict>, z.ZodObject<{
1422
- x: z.ZodLiteral<"profile">;
1423
- }, z.core.$strict>, z.ZodObject<{
1424
- x: z.ZodLiteral<"post">;
1425
- postId: z.ZodString;
1426
- index: z.ZodDefault<z.ZodNumber>;
1427
- }, z.core.$strict>, z.ZodObject<{
1428
- asset: z.ZodString;
1429
- }, z.core.$strict>]>;
1430
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
1431
- type: z.ZodEnum<{
1432
- string: "string";
1433
- number: "number";
1434
- boolean: "boolean";
1435
- }>;
1436
- description: z.ZodString;
1437
- }, z.core.$strict>>;
1438
- }, z.core.$strict>, z.ZodObject<{
1439
- operation: z.ZodLiteral<"seen">;
1440
- image: z.ZodUnion<readonly [z.ZodObject<{
1441
- evidence: z.ZodString;
1442
- }, z.core.$strict>, z.ZodObject<{
1443
- x: z.ZodLiteral<"profile">;
1444
- }, z.core.$strict>, z.ZodObject<{
1445
- x: z.ZodLiteral<"post">;
1446
- postId: z.ZodString;
1447
- index: z.ZodDefault<z.ZodNumber>;
1448
- }, z.core.$strict>, z.ZodObject<{
1449
- asset: z.ZodString;
1450
- }, z.core.$strict>]>;
1451
- maxDistance: z.ZodDefault<z.ZodNumber>;
1452
- }, z.core.$strict>], "operation">;
1453
- type ImageRequest = z.input<typeof imageRequestSchema>;
1454
- declare const imageInspectionSchema: z.ZodObject<{
1455
- width: z.ZodNumber;
1456
- height: z.ZodNumber;
1457
- format: z.ZodEnum<{
1458
- jpeg: "jpeg";
1459
- png: "png";
1460
- webp: "webp";
1461
- gif: "gif";
1462
- avif: "avif";
1463
- }>;
1464
- bytes: z.ZodNumber;
1465
- sha256: z.ZodString;
1466
- phash: z.ZodString;
1467
- dhash: z.ZodString;
1468
- }, z.core.$strict>;
1469
- type ImageInspection = z.infer<typeof imageInspectionSchema>;
1470
- declare const imageComparisonSchema: z.ZodObject<{
1471
- identical: z.ZodBoolean;
1472
- phashDistance: z.ZodNumber;
1473
- dhashDistance: z.ZodNumber;
1474
- }, z.core.$strict>;
1475
- type ImageComparison = z.infer<typeof imageComparisonSchema>;
1476
- declare const imageExtractionSchema: z.ZodObject<{
1477
- values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
1478
- reason: z.ZodString;
1479
- }, z.core.$strict>;
1480
- type ImageExtraction = z.infer<typeof imageExtractionSchema>;
1481
- declare const imageSightingsSchema: z.ZodObject<{
1482
- matches: z.ZodNumber;
1483
- closestDistance: z.ZodNullable<z.ZodNumber>;
1484
- firstSeenAt: z.ZodNullable<z.ZodNumber>;
1485
- }, z.core.$strict>;
1486
- type ImageSightings = z.infer<typeof imageSightingsSchema>;
1487
- /**
1488
- * One reference image in a deployment bundle: a reference, never the bytes. The CLI uploads each
1489
- * file to storage before the preview; a hosted build stages it. `path` is where the bundle found
1490
- * the file, relative to relay.json; the platform ignores it.
1491
- */
1492
- declare const imageAssetArtifactSchema: z.ZodObject<{
1493
- key: z.ZodString;
1494
- sha256: z.ZodString;
1495
- size: z.ZodNumber;
1496
- path: z.ZodOptional<z.ZodString>;
1497
- }, z.core.$strict>;
1498
- type ImageAssetArtifact = z.infer<typeof imageAssetArtifactSchema>;
1499
- /** Ask for upload URLs for images the project's storage does not hold yet. */
1500
- declare const imageUploadRequestSchema: z.ZodObject<{
1501
- images: z.ZodArray<z.ZodObject<{
1502
- sha256: z.ZodString;
1503
- size: z.ZodNumber;
1504
- type: z.ZodEnum<{
1505
- "image/jpeg": "image/jpeg";
1506
- "image/png": "image/png";
1507
- "image/webp": "image/webp";
1508
- }>;
1509
- }, z.core.$strict>>;
1510
- }, z.core.$strict>;
1511
- /** `upload` is null when the image is already stored; otherwise PUT the exact bytes before it expires. */
1512
- declare const imageUploadsSchema: z.ZodObject<{
1513
- images: z.ZodArray<z.ZodObject<{
1514
- sha256: z.ZodString;
1515
- upload: z.ZodNullable<z.ZodObject<{
1516
- url: z.ZodString;
1517
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
1518
- expiresAt: z.ZodNumber;
1519
- }, z.core.$strict>>;
1520
- }, z.core.$strict>>;
1521
- }, z.core.$strict>;
1522
- declare const publishedImageSchema: z.ZodObject<{
1523
- key: z.ZodString;
1524
- sha256: z.ZodString;
1525
- type: z.ZodEnum<{
1526
- "image/jpeg": "image/jpeg";
1527
- "image/png": "image/png";
1528
- "image/webp": "image/webp";
1529
- }>;
1530
- size: z.ZodNumber;
1531
- width: z.ZodNumber;
1532
- height: z.ZodNumber;
1533
- }, z.core.$strict>;
1534
- type PublishedImage = z.infer<typeof publishedImageSchema>;
1535
- type Extracted<F extends ImageFields> = {
1536
- [K in keyof F]: (F[K]["type"] extends "number" ? number : F[K]["type"] extends "boolean" ? boolean : string) | null;
1537
- };
1538
- /** Evaluator `ctx.images`. Each call uses one of the evaluation's eight capability calls. */
1539
- interface ImageReader {
1540
- inspect(image: ImageReference): Promise<ImageInspection>;
1541
- compare(a: ImageReference, b: ImageReference): Promise<ImageComparison>;
1542
- review(options: {
1543
- images: ImageReference[];
1544
- criteria: string;
1545
- }): Promise<PhotoResult>;
1546
- extract<const F extends ImageFields>(options: {
1547
- image: ImageReference;
1548
- fields: F;
1549
- }): Promise<{
1550
- values: Extracted<F>;
1551
- reason: string;
1552
- }>;
1553
- /**
1554
- * Records the image for this attempt, then counts other participants' recorded images within
1555
- * `maxDistance`. The record is written when `seen` runs, not when the attempt is decided, so it
1556
- * stays even if the attempt is rejected: concurrent submissions of one photo must see each
1557
- * other. Replays reuse the captured result.
1558
- */
1559
- seen(image: ImageReference, options?: {
1560
- maxDistance?: number;
1561
- }): Promise<ImageSightings>;
1562
- }
1563
-
1564
- export { defaultTriggerMode as $, type AccountRole as A, type Bound as B, type Condition as C, type DataLeaves as D, type TrackerAttribution as E, type TrackerBound as F, type TrackerCondition as G, type TrackerContent as H, type IdentityKind as I, type TrackerContentQuery as J, type TrackerDataIssue as K, type TrackerOutcome as L, type TrackerOutcomeQuery as M, type TrackerPreview as N, type TrackerPreviewInput as O, type PublishedImage as P, type TrackerQuery as Q, type TrackerRecord as R, type TrackerSkipCode as S, type TrackerDefinition as T, type TrackerStatus as U, type TrackerWhere as V, type WithRecordData as W, type XTweet as X, type TypedTrackerRecord as Y, accountRoleSchema as Z, beneficiaryRole as _, type TrackerSource as a, identityKindSchema as a0, imageAssetArtifactSchema as a1, imageComparisonSchema as a2, imageExtractionSchema as a3, imageFieldSchema as a4, imageFieldsSchema as a5, imageInspectionSchema as a6, imageReferenceSchema as a7, imageRequestSchema as a8, imageSightingsSchema as a9, trackerPreviewLimits as aA, trackerPreviewSchema as aB, trackerQuerySchema as aC, trackerRecordInputSchema as aD, trackerRecordSchema as aE, trackerSkipCodes as aF, trackerSourceSchema as aG, trackerStatusSchema as aH, trackerSummarySchema as aI, trackerTriggerModeSchema as aJ, trackerTriggerPolicySchema as aK, trackerTriggerRecordSchema as aL, trackerWhereSchema as aM, triggerMode as aN, whereConditions as aO, whereSettings as aP, xAccountRoles as aQ, xContentBodySchema as aR, xTweetSchema as aS, type TrackerDataBudget as aT, schemaCheckedReader as aU, trackerDataBatchSteps as aV, trackerDataIssue as aW, trackerDataIssues as aX, trackerDataPathTypes as aY, trackerDataRecordSteps as aZ, whereSchemaIssue as a_, imageUploadRequestSchema as aa, imageUploadsSchema as ab, publishedImageSchema as ac, publishedTrackerSchema as ad, sourceIdentities as ae, trackerAccountSchema as af, trackerArtifactSchema as ag, trackerAttributionSchema as ah, trackerBoundSchema as ai, trackerConditionSchema as aj, trackerContentQuerySchema as ak, trackerContentReadSchema as al, trackerContentSchema as am, trackerControlSchema as an, trackerDataMaxBranches as ao, trackerDataMaxEntries as ap, trackerDataSchemaSchema as aq, trackerEvidenceSchema as ar, trackerIngestResultSchema as as, trackerIngestSchema as at, trackerOutcomePageSchema as au, trackerOutcomeQuerySchema as av, trackerOutcomeRetrySchema as aw, trackerOutcomeSchema as ax, trackerPageSchema as ay, trackerPreviewInputSchema as az, type Tracker as b, customSourceSchema as c, type TrackerData as d, type TrackerTriggerContext as e, type TrackerTriggerPolicy as f, type TrackerReader as g, type ImageReader as h, type Where as i, type TrackerTriggerMode as j, type WhereSetting as k, type TrackerDataSchema as l, type TrackerPage as m, trackerDataSchema as n, trackerTriggerContextSchema as o, type ImageAssetArtifact as p, type ImageComparison as q, type ImageExtraction as r, type ImageFields as s, trackerDefinitionSchema as t, type ImageInspection as u, type ImageReference as v, type ImageRequest as w, xSearchSourceSchema as x, type ImageSightings as y, type TrackerAccount as z };