@50heads/mcp 2026.925.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.
@@ -0,0 +1,1735 @@
1
+ import { type JSONRPCMessage, type Transport, type TransportSendOptions } from "@modelcontextprotocol/server";
2
+ /**
3
+ * The stdio server: the same tools, resources, prompts and tasks as the hosted server, run
4
+ * in-process against the 50heads API with an API key or the `login` token.
5
+ */
6
+ export type StdioOptions = {
7
+ apiUrl: string;
8
+ portalUrl: string;
9
+ webUrl: string;
10
+ /** Resolves the bearer token for each API call (refreshes OAuth tokens as they expire). */
11
+ token: () => Promise<string | null>;
12
+ /** A stable token for idempotency derivation (the API key, or the OAuth client id). */
13
+ principalSeed: string | null;
14
+ };
15
+ /** Wraps a transport so tasks/* requests are answered here, everything else by the SDK. */
16
+ export declare class TaskInterceptingTransport implements Transport {
17
+ onclose?: () => void;
18
+ onerror?: (error: Error) => void;
19
+ onmessage?: Transport["onmessage"];
20
+ sessionId?: string;
21
+ private readonly inner;
22
+ private readonly handle;
23
+ constructor(inner: Transport, handle: TaskInterceptingTransport["handle"]);
24
+ start(): Promise<void>;
25
+ send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
26
+ close(): Promise<void>;
27
+ }
28
+ export declare function makeApi(opts: StdioOptions): (tool: string, client?: string, protocol?: string) => {
29
+ config: () => Promise<{
30
+ rates: Record<"GBP" | "USD" | "EUR" | "CAD", number>;
31
+ ratesDate: string;
32
+ countries: Record<string, {
33
+ payMultiplier: number;
34
+ minWithdrawalPence: number;
35
+ payoutRails: string[];
36
+ otpChannel: "sms" | "whatsapp";
37
+ taxFields: string[];
38
+ tier2Available: boolean;
39
+ currency: "GBP" | "USD" | "EUR" | "CAD";
40
+ wiseFields?: {
41
+ key: string;
42
+ label: string;
43
+ example?: string | undefined;
44
+ pattern?: string | undefined;
45
+ }[] | undefined;
46
+ }>;
47
+ defaultCountry: {
48
+ payMultiplier: number;
49
+ minWithdrawalPence: number;
50
+ payoutRails: string[];
51
+ otpChannel: "sms" | "whatsapp";
52
+ taxFields: string[];
53
+ tier2Available: boolean;
54
+ currency: "GBP" | "USD" | "EUR" | "CAD";
55
+ wiseFields?: {
56
+ key: string;
57
+ label: string;
58
+ example?: string | undefined;
59
+ pattern?: string | undefined;
60
+ }[] | undefined;
61
+ };
62
+ questionLanguages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
63
+ reverifyDays: number;
64
+ tier1PayPence: number;
65
+ tier2PayMultiplier: number;
66
+ answeringCountries?: string[] | undefined;
67
+ webTopUpStorefronts?: string[] | undefined;
68
+ }>;
69
+ estimate: (input: import("@50heads/shared").EstimateInput) => Promise<{
70
+ estimate: import("@50heads/shared").Estimate;
71
+ line: string;
72
+ }>;
73
+ auth: {
74
+ email: {
75
+ start: (input: import("@50heads/shared").EmailStartInput) => Promise<{
76
+ ok: true;
77
+ resendAfterSeconds: number;
78
+ }>;
79
+ verify: <T extends import("@50heads/shared").Session | import("@50heads/shared").AppSession = {
80
+ token: string;
81
+ expiresAt: string;
82
+ user: {
83
+ id: string;
84
+ email: string;
85
+ name: string | null;
86
+ tier: 0 | 1 | 2 | 3;
87
+ country: string | null;
88
+ phone: string | null;
89
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
90
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
91
+ locale: string | null;
92
+ creditsPence: number;
93
+ earningsPence: number;
94
+ pendingPence: number;
95
+ providers: ("apple" | "google" | "email")[];
96
+ createdAt: string;
97
+ };
98
+ isNew: boolean;
99
+ }>(input: import("@50heads/shared").EmailVerifyInput) => Promise<T>;
100
+ };
101
+ apple: (input: import("@50heads/shared").AppleAuthInput) => Promise<{
102
+ accessToken: string;
103
+ accessExpiresAt: string;
104
+ refreshToken: string;
105
+ refreshExpiresAt: string;
106
+ user: {
107
+ id: string;
108
+ email: string;
109
+ name: string | null;
110
+ tier: 0 | 1 | 2 | 3;
111
+ country: string | null;
112
+ phone: string | null;
113
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
114
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
115
+ locale: string | null;
116
+ creditsPence: number;
117
+ earningsPence: number;
118
+ pendingPence: number;
119
+ providers: ("apple" | "google" | "email")[];
120
+ createdAt: string;
121
+ };
122
+ isNew: boolean;
123
+ newDevice: boolean;
124
+ }>;
125
+ appleWebUrl: (deviceId?: string) => string;
126
+ appleTicket: (input: import("@50heads/shared").AppleTicketInput) => Promise<{
127
+ accessToken: string;
128
+ accessExpiresAt: string;
129
+ refreshToken: string;
130
+ refreshExpiresAt: string;
131
+ user: {
132
+ id: string;
133
+ email: string;
134
+ name: string | null;
135
+ tier: 0 | 1 | 2 | 3;
136
+ country: string | null;
137
+ phone: string | null;
138
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
139
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
140
+ locale: string | null;
141
+ creditsPence: number;
142
+ earningsPence: number;
143
+ pendingPence: number;
144
+ providers: ("apple" | "google" | "email")[];
145
+ createdAt: string;
146
+ };
147
+ isNew: boolean;
148
+ newDevice: boolean;
149
+ }>;
150
+ google: (input: import("@50heads/shared").GoogleAuthInput) => Promise<{
151
+ accessToken: string;
152
+ accessExpiresAt: string;
153
+ refreshToken: string;
154
+ refreshExpiresAt: string;
155
+ user: {
156
+ id: string;
157
+ email: string;
158
+ name: string | null;
159
+ tier: 0 | 1 | 2 | 3;
160
+ country: string | null;
161
+ phone: string | null;
162
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
163
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
164
+ locale: string | null;
165
+ creditsPence: number;
166
+ earningsPence: number;
167
+ pendingPence: number;
168
+ providers: ("apple" | "google" | "email")[];
169
+ createdAt: string;
170
+ };
171
+ isNew: boolean;
172
+ newDevice: boolean;
173
+ }>;
174
+ link: <T extends import("@50heads/shared").Session | import("@50heads/shared").AppSession = {
175
+ accessToken: string;
176
+ accessExpiresAt: string;
177
+ refreshToken: string;
178
+ refreshExpiresAt: string;
179
+ user: {
180
+ id: string;
181
+ email: string;
182
+ name: string | null;
183
+ tier: 0 | 1 | 2 | 3;
184
+ country: string | null;
185
+ phone: string | null;
186
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
187
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
188
+ locale: string | null;
189
+ creditsPence: number;
190
+ earningsPence: number;
191
+ pendingPence: number;
192
+ providers: ("apple" | "google" | "email")[];
193
+ createdAt: string;
194
+ };
195
+ isNew: boolean;
196
+ newDevice: boolean;
197
+ }>(input: import("@50heads/shared").LinkInput) => Promise<T>;
198
+ refresh: (refreshToken: string) => Promise<{
199
+ accessToken: string;
200
+ accessExpiresAt: string;
201
+ refreshToken: string;
202
+ refreshExpiresAt: string;
203
+ user: {
204
+ id: string;
205
+ email: string;
206
+ name: string | null;
207
+ tier: 0 | 1 | 2 | 3;
208
+ country: string | null;
209
+ phone: string | null;
210
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
211
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
212
+ locale: string | null;
213
+ creditsPence: number;
214
+ earningsPence: number;
215
+ pendingPence: number;
216
+ providers: ("apple" | "google" | "email")[];
217
+ createdAt: string;
218
+ };
219
+ isNew: boolean;
220
+ newDevice: boolean;
221
+ }>;
222
+ signOut: (refreshToken?: string) => Promise<{
223
+ ok: true;
224
+ }>;
225
+ googleWeb: (input: import("zod").infer<typeof import("@50heads/shared").GoogleWebAuthInput>) => Promise<{
226
+ token: string;
227
+ expiresAt: string;
228
+ user: {
229
+ id: string;
230
+ email: string;
231
+ name: string | null;
232
+ tier: 0 | 1 | 2 | 3;
233
+ country: string | null;
234
+ phone: string | null;
235
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
236
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
237
+ locale: string | null;
238
+ creditsPence: number;
239
+ earningsPence: number;
240
+ pendingPence: number;
241
+ providers: ("apple" | "google" | "email")[];
242
+ createdAt: string;
243
+ };
244
+ isNew: boolean;
245
+ }>;
246
+ appleWebNonce: () => Promise<{
247
+ nonce: string;
248
+ state: string;
249
+ }>;
250
+ appleWeb: (input: import("zod").infer<typeof import("@50heads/shared").AppleWebAuthInput>) => Promise<{
251
+ token: string;
252
+ expiresAt: string;
253
+ user: {
254
+ id: string;
255
+ email: string;
256
+ name: string | null;
257
+ tier: 0 | 1 | 2 | 3;
258
+ country: string | null;
259
+ phone: string | null;
260
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
261
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
262
+ locale: string | null;
263
+ creditsPence: number;
264
+ earningsPence: number;
265
+ pendingPence: number;
266
+ providers: ("apple" | "google" | "email")[];
267
+ createdAt: string;
268
+ };
269
+ isNew: boolean;
270
+ }>;
271
+ reauthEmail: () => Promise<{
272
+ ok: true;
273
+ }>;
274
+ passkey: {
275
+ options: () => Promise<{
276
+ challengeId: string;
277
+ options: Record<string, unknown>;
278
+ }>;
279
+ signIn: <T extends import("@50heads/shared").Session | import("@50heads/shared").AppSession = {
280
+ token: string;
281
+ expiresAt: string;
282
+ user: {
283
+ id: string;
284
+ email: string;
285
+ name: string | null;
286
+ tier: 0 | 1 | 2 | 3;
287
+ country: string | null;
288
+ phone: string | null;
289
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
290
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
291
+ locale: string | null;
292
+ creditsPence: number;
293
+ earningsPence: number;
294
+ pendingPence: number;
295
+ providers: ("apple" | "google" | "email")[];
296
+ createdAt: string;
297
+ };
298
+ isNew: boolean;
299
+ }>(input: import("@50heads/shared").PasskeySignInInput) => Promise<T>;
300
+ };
301
+ passkeys: {
302
+ list: () => Promise<{
303
+ passkeys: import("@50heads/shared").Passkey[];
304
+ }>;
305
+ registerOptions: (reauthToken: string) => Promise<{
306
+ challengeId: string;
307
+ options: Record<string, unknown>;
308
+ }>;
309
+ register: (input: import("@50heads/shared").PasskeyRegisterInput) => Promise<{
310
+ passkey: import("@50heads/shared").Passkey;
311
+ }>;
312
+ rename: (id: string, name: string) => Promise<{
313
+ passkey: import("@50heads/shared").Passkey;
314
+ }>;
315
+ remove: (id: string, reauthToken: string) => Promise<{
316
+ ok: true;
317
+ status: import("@50heads/shared").MfaStatus;
318
+ }>;
319
+ reauthOptions: () => Promise<{
320
+ challengeId: string;
321
+ options: Record<string, unknown>;
322
+ }>;
323
+ };
324
+ mfa: {
325
+ verify: <T extends import("@50heads/shared").Session | import("@50heads/shared").AppSession = {
326
+ token: string;
327
+ expiresAt: string;
328
+ user: {
329
+ id: string;
330
+ email: string;
331
+ name: string | null;
332
+ tier: 0 | 1 | 2 | 3;
333
+ country: string | null;
334
+ phone: string | null;
335
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
336
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
337
+ locale: string | null;
338
+ creditsPence: number;
339
+ earningsPence: number;
340
+ pendingPence: number;
341
+ providers: ("apple" | "google" | "email")[];
342
+ createdAt: string;
343
+ };
344
+ isNew: boolean;
345
+ rememberToken?: string | undefined;
346
+ rememberExpiresAt?: string | undefined;
347
+ }>(input: import("@50heads/shared").MfaVerifyInput) => Promise<T>;
348
+ passkeyOptions: (mfaToken: string) => Promise<{
349
+ challengeId: string;
350
+ options: Record<string, unknown>;
351
+ }>;
352
+ status: () => Promise<{
353
+ enabled: boolean;
354
+ enabledAt: string | null;
355
+ totp: boolean;
356
+ totpAddedAt: string | null;
357
+ passkeys: number;
358
+ recoveryCodesLeft: number;
359
+ rememberedDevices: number;
360
+ }>;
361
+ totpSetup: (reauthToken: string) => Promise<{
362
+ secret: string;
363
+ otpauthUri: string;
364
+ issuer: string;
365
+ account: string;
366
+ }>;
367
+ totpConfirm: (code: string) => Promise<{
368
+ status: {
369
+ enabled: boolean;
370
+ enabledAt: string | null;
371
+ totp: boolean;
372
+ totpAddedAt: string | null;
373
+ passkeys: number;
374
+ recoveryCodesLeft: number;
375
+ rememberedDevices: number;
376
+ };
377
+ recoveryCodes?: string[] | undefined;
378
+ }>;
379
+ totpRemove: (reauthToken: string) => Promise<{
380
+ status: import("@50heads/shared").MfaStatus;
381
+ }>;
382
+ enable: (reauthToken: string) => Promise<{
383
+ status: {
384
+ enabled: boolean;
385
+ enabledAt: string | null;
386
+ totp: boolean;
387
+ totpAddedAt: string | null;
388
+ passkeys: number;
389
+ recoveryCodesLeft: number;
390
+ rememberedDevices: number;
391
+ };
392
+ recoveryCodes?: string[] | undefined;
393
+ }>;
394
+ disable: (reauthToken: string) => Promise<{
395
+ status: import("@50heads/shared").MfaStatus;
396
+ }>;
397
+ recoveryCodes: (reauthToken: string) => Promise<{
398
+ recoveryCodes: string[];
399
+ }>;
400
+ forgetDevices: () => Promise<{
401
+ ok: true;
402
+ forgotten: number;
403
+ }>;
404
+ reauth: (input: import("@50heads/shared").MfaReauthInput) => Promise<{
405
+ reauthToken: string;
406
+ expiresAt: string;
407
+ strength: "basic" | "mfa";
408
+ }>;
409
+ };
410
+ };
411
+ me: () => Promise<{
412
+ user: import("@50heads/shared").User;
413
+ }>;
414
+ deleteAccount: (reauth: import("@50heads/shared").Reauth) => Promise<{
415
+ ok: true;
416
+ erasesAt: string;
417
+ }>;
418
+ reauthEmail: () => Promise<{
419
+ ok: true;
420
+ }>;
421
+ addIdentity: (input: import("@50heads/shared").AddIdentityInput) => Promise<{
422
+ user: import("@50heads/shared").User;
423
+ }>;
424
+ questions: {
425
+ ask: (input: import("@50heads/shared").AskInput, idempotencyKey?: string) => Promise<{
426
+ question: import("@50heads/shared").Question;
427
+ }>;
428
+ list: () => Promise<{
429
+ questions: import("@50heads/shared").Question[];
430
+ }>;
431
+ get: (id: string) => Promise<{
432
+ question: import("@50heads/shared").Question;
433
+ }>;
434
+ result: (id: string) => Promise<{
435
+ result: import("@50heads/shared").Result;
436
+ }>;
437
+ wait: (id: string, seconds?: number) => Promise<{
438
+ result: import("@50heads/shared").Result;
439
+ done: boolean;
440
+ }>;
441
+ cancel: (id: string) => Promise<{
442
+ question: import("@50heads/shared").Question;
443
+ }>;
444
+ };
445
+ worker: {
446
+ state: () => Promise<{
447
+ user: {
448
+ id: string;
449
+ email: string;
450
+ name: string | null;
451
+ tier: 0 | 1 | 2 | 3;
452
+ country: string | null;
453
+ phone: string | null;
454
+ displayCurrency: "GBP" | "USD" | "EUR" | "CAD" | null;
455
+ languages: ("en" | "fr" | "es" | "pt" | "it" | "de" | "nl" | "pl")[];
456
+ locale: string | null;
457
+ creditsPence: number;
458
+ earningsPence: number;
459
+ pendingPence: number;
460
+ providers: ("apple" | "google" | "email")[];
461
+ createdAt: string;
462
+ };
463
+ reverifyDue: boolean;
464
+ warmup: {
465
+ total: number;
466
+ answered: number;
467
+ };
468
+ }>;
469
+ update: (input: import("@50heads/shared").WorkerUpdateInput) => Promise<{
470
+ user: import("@50heads/shared").User;
471
+ }>;
472
+ feed: () => Promise<{
473
+ questions: import("@50heads/shared").FeedItem[];
474
+ }>;
475
+ say: (questionId: string, input: import("@50heads/shared").SayInput, idempotencyKey: string) => Promise<{
476
+ earnedPence: number;
477
+ pending: boolean;
478
+ user: import("@50heads/shared").User;
479
+ }>;
480
+ warmup: () => Promise<{
481
+ total: number;
482
+ answered: number;
483
+ next: {
484
+ id: string;
485
+ position: number;
486
+ prompt: string;
487
+ options: string[];
488
+ payPence: number;
489
+ } | null;
490
+ }>;
491
+ warmupAnswer: (questionId: string, optionIndex: number, idempotencyKey: string) => Promise<{
492
+ earnedPence: number;
493
+ pending: boolean;
494
+ state: import("@50heads/shared").WarmupState;
495
+ }>;
496
+ phoneStart: (input: import("@50heads/shared").PhoneStartInput) => Promise<{
497
+ channel: "sms" | "whatsapp";
498
+ phone: string;
499
+ resendAfterSeconds: number;
500
+ }>;
501
+ phoneVerify: (input: import("@50heads/shared").PhoneVerifyInput) => Promise<{
502
+ user: import("@50heads/shared").User;
503
+ }>;
504
+ earnings: (cursor?: string) => Promise<{
505
+ availablePence: number;
506
+ pendingPence: number;
507
+ entries: {
508
+ id: string;
509
+ kind: string;
510
+ amountPence: number;
511
+ ref: string | null;
512
+ createdAt: string;
513
+ }[];
514
+ nextCursor: string | null;
515
+ }>;
516
+ withdrawQuote: () => Promise<{
517
+ availablePence: number;
518
+ minimumPence: number;
519
+ currency: "GBP" | "USD" | "EUR" | "CAD";
520
+ receiveAmount: number | null;
521
+ rails: string[];
522
+ available: boolean;
523
+ reason: string | null;
524
+ receiveCurrency?: string | undefined;
525
+ }>;
526
+ pushToken: (token: string, timezone?: string) => Promise<{
527
+ ok: true;
528
+ }>;
529
+ };
530
+ keys: {
531
+ list: () => Promise<{
532
+ keys: import("@50heads/shared").ApiKey[];
533
+ }>;
534
+ create: (name: string) => Promise<{
535
+ key: import("@50heads/shared").ApiKey;
536
+ secret: string;
537
+ }>;
538
+ revoke: (id: string) => Promise<{
539
+ ok: true;
540
+ }>;
541
+ };
542
+ public: {
543
+ stats: () => Promise<{
544
+ headsOnlineNow: number;
545
+ answersThisWeek: number;
546
+ medianMinutesTo50: number;
547
+ headEarningsPerHour: {
548
+ low: number;
549
+ high: number;
550
+ };
551
+ updatedAt: string;
552
+ }>;
553
+ results: (code: string) => Promise<{
554
+ question: import("@50heads/shared").QuestionV2;
555
+ result: import("@50heads/shared").ResultV2;
556
+ }>;
557
+ shared: (token: string) => Promise<{
558
+ question: {
559
+ type: "single_choice" | "multi_choice" | "ab_image" | "pairwise" | "scale_1_5" | "ranking" | "yes_mostly_no" | "click_test" | "reaction" | "free_text";
560
+ text: string;
561
+ language: string;
562
+ options: {
563
+ label: string;
564
+ imageUrl?: string | undefined;
565
+ }[];
566
+ neither: boolean;
567
+ n: number;
568
+ tier: 1 | 2 | 3;
569
+ rush: boolean;
570
+ publicResults: boolean;
571
+ reason: "off" | "optional" | "required";
572
+ id: string;
573
+ status: "cancelled" | "draft" | "scheduled" | "live" | "complete" | "underfilled" | "refused";
574
+ source: "app" | "portal" | "api" | "mcp";
575
+ answered: number;
576
+ creditsPerAnswer: number;
577
+ creditsReserved: number;
578
+ creditsSpent: number;
579
+ etaMinutes: number;
580
+ leaderLine: string | null;
581
+ refusedCategory: string | null;
582
+ publicCode: string | null;
583
+ createdAt: string;
584
+ liveAt: string | null;
585
+ closedAt: string | null;
586
+ context?: string | undefined;
587
+ stimulus?: {
588
+ imageUrl?: string | undefined;
589
+ audioUrl?: string | undefined;
590
+ text?: string | undefined;
591
+ exposureMs?: number | undefined;
592
+ } | undefined;
593
+ targeting?: {
594
+ countries: string[];
595
+ tags: string[];
596
+ ageBands?: ("18-24" | "25-34" | "35-44" | "45-54" | "55-64" | "65+")[] | undefined;
597
+ genders?: ("woman" | "man" | "non_binary")[] | undefined;
598
+ verifiedAge?: boolean | undefined;
599
+ } | undefined;
600
+ clickTest?: {
601
+ maxTaps: number;
602
+ } | undefined;
603
+ scheduledFor?: string | undefined;
604
+ contentFlag?: "medical" | "violence" | "distressing" | "alcohol_gambling" | "political" | "none" | undefined;
605
+ teamId?: string | null | undefined;
606
+ askedBy?: {
607
+ id: string;
608
+ name: string | null;
609
+ } | null | undefined;
610
+ projectId?: string | null | undefined;
611
+ labels?: string[] | undefined;
612
+ archived?: boolean | undefined;
613
+ bookmarked?: boolean | undefined;
614
+ externalRef?: string | null | undefined;
615
+ };
616
+ result: {
617
+ questionId: string;
618
+ status: "cancelled" | "complete" | "underfilled" | "in_progress";
619
+ nRequested: number;
620
+ nAccepted: number;
621
+ distribution: {
622
+ option: string;
623
+ count: number;
624
+ share: number;
625
+ averageRank?: number | undefined;
626
+ appearances?: number | undefined;
627
+ strength?: number | undefined;
628
+ rank?: number | undefined;
629
+ }[];
630
+ mean: number | null;
631
+ summary: {
632
+ winner: string | null;
633
+ margin: number | null;
634
+ confidence: "low" | "medium" | "high" | null;
635
+ note: string;
636
+ suggestedFollowUp: string | null;
637
+ };
638
+ tier: number;
639
+ language: string;
640
+ verificationLine: string;
641
+ medianSeconds: number | null;
642
+ creditsSpent: number;
643
+ answers: {
644
+ option: string | null;
645
+ text: string | null;
646
+ tier: number;
647
+ attestationRef: string;
648
+ answeredAt: string;
649
+ translatedText?: string | null | undefined;
650
+ reason?: string | null | undefined;
651
+ translatedReason?: string | null | undefined;
652
+ pinned?: boolean | undefined;
653
+ flag?: {
654
+ reason: "automated" | "off_topic" | "low_effort" | "abusive";
655
+ status: "open" | "upheld" | "dismissed";
656
+ refundCredits: number;
657
+ createdAt: string;
658
+ decidedAt: string | null;
659
+ } | null | undefined;
660
+ taps?: {
661
+ x: number;
662
+ y: number;
663
+ }[] | undefined;
664
+ }[];
665
+ refundCredits: number;
666
+ breakdown?: {
667
+ tagId: string;
668
+ label: string;
669
+ n: number;
670
+ distribution: {
671
+ option: string;
672
+ count: number;
673
+ share: number;
674
+ averageRank?: number | undefined;
675
+ appearances?: number | undefined;
676
+ strength?: number | undefined;
677
+ rank?: number | undefined;
678
+ }[];
679
+ }[] | undefined;
680
+ breakdowns?: {
681
+ dimension: "country" | "tier" | "gender" | "age_band" | "tag";
682
+ segments: {
683
+ label: string;
684
+ n: number;
685
+ distribution: {
686
+ option: string;
687
+ count: number;
688
+ share: number;
689
+ averageRank?: number | undefined;
690
+ appearances?: number | undefined;
691
+ strength?: number | undefined;
692
+ rank?: number | undefined;
693
+ }[];
694
+ }[];
695
+ }[] | undefined;
696
+ clicks?: {
697
+ imageUrl: string | null;
698
+ taps: number;
699
+ points: {
700
+ x: number;
701
+ y: number;
702
+ }[];
703
+ grid: number[];
704
+ gridSize: number;
705
+ hotspots: {
706
+ x: number;
707
+ y: number;
708
+ w: number;
709
+ h: number;
710
+ count: number;
711
+ share: number;
712
+ }[];
713
+ heatmapUrl: string | null;
714
+ } | undefined;
715
+ sentiment?: {
716
+ positive: number;
717
+ neutral: number;
718
+ negative: number;
719
+ } | undefined;
720
+ translationLanguage?: string | null | undefined;
721
+ insights?: {
722
+ questionId: string;
723
+ language: string;
724
+ sourceLanguage: string;
725
+ takeaway: string;
726
+ themes: {
727
+ label: string;
728
+ count: number;
729
+ share: number;
730
+ sentiment: "positive" | "neutral" | "negative";
731
+ option: string | null;
732
+ quotes: string[];
733
+ }[];
734
+ sentiment: {
735
+ positive: number;
736
+ neutral: number;
737
+ negative: number;
738
+ };
739
+ basedOn: number;
740
+ answersAtTime: number;
741
+ original: {
742
+ takeaway: string;
743
+ themes: {
744
+ label: string;
745
+ quotes: string[];
746
+ }[];
747
+ } | null;
748
+ kind: "interim" | "final";
749
+ generatedAt: string;
750
+ refreshAfter: string | null;
751
+ engine: string;
752
+ } | null | undefined;
753
+ filter?: {
754
+ option?: number | undefined;
755
+ tier?: number | undefined;
756
+ country?: string | undefined;
757
+ ageBand?: string | undefined;
758
+ gender?: "woman" | "man" | "non_binary" | undefined;
759
+ q?: string | undefined;
760
+ } | undefined;
761
+ nUnfiltered?: number | undefined;
762
+ suppressed?: boolean | undefined;
763
+ facets?: {
764
+ tiers: {
765
+ tier: number;
766
+ n: number;
767
+ }[];
768
+ countries: {
769
+ code: string;
770
+ label: string;
771
+ n: number;
772
+ }[];
773
+ ageBands: {
774
+ band: string;
775
+ n: number;
776
+ }[];
777
+ genders?: {
778
+ gender: string;
779
+ n: number;
780
+ }[] | undefined;
781
+ } | undefined;
782
+ };
783
+ expiresAt: string;
784
+ }>;
785
+ templates: () => Promise<{
786
+ templates: import("@50heads/shared").Template[];
787
+ }>;
788
+ tags: () => Promise<{
789
+ groups: {
790
+ id: "life_stage" | "household" | "income" | "education" | "occupation" | "interests" | "habits" | "shopping" | "health" | "media" | "pets" | "tech";
791
+ label: string;
792
+ why: string;
793
+ max: number;
794
+ }[];
795
+ tags: {
796
+ id: string;
797
+ group: "life_stage" | "household" | "income" | "education" | "occupation" | "interests" | "habits" | "shopping" | "health" | "media" | "pets" | "tech";
798
+ label: string;
799
+ }[];
800
+ }>;
801
+ countries: () => Promise<{
802
+ countries: import("@50heads/shared").CountryAvailability[];
803
+ updatedAt: string;
804
+ }>;
805
+ };
806
+ quote: (draft: import("@50heads/shared").QuestionDraftInput, surface?: "app" | "web") => Promise<import("@50heads/shared").Quote & {
807
+ poolSize: number | null;
808
+ price?: {
809
+ amount: number;
810
+ currency: string;
811
+ };
812
+ }>;
813
+ events: (input: import("zod").infer<typeof import("@50heads/shared").EventsInput>) => Promise<{
814
+ ok: true;
815
+ }>;
816
+ account: {
817
+ profile: () => Promise<{
818
+ firstName: string | null;
819
+ initial: string;
820
+ avatarUrl: string | null;
821
+ headSince: string;
822
+ answers: number;
823
+ autoPayout: boolean;
824
+ }>;
825
+ update: (input: {
826
+ name?: string;
827
+ locale?: string;
828
+ displayCurrency?: string;
829
+ languages?: import("@50heads/shared").QuestionLanguage[];
830
+ }) => Promise<{
831
+ user: import("@50heads/shared").User;
832
+ }>;
833
+ notifications: () => Promise<{
834
+ questionsWaiting: boolean;
835
+ money: boolean;
836
+ results: boolean;
837
+ tips: boolean;
838
+ activeHours: {
839
+ from: number;
840
+ to: number;
841
+ };
842
+ emailResults: boolean;
843
+ emailLowCredits: boolean;
844
+ emailWeeklyDigest: boolean;
845
+ emailExpiringCredits?: boolean | undefined;
846
+ }>;
847
+ setNotifications: (prefs: import("@50heads/shared").NotificationPrefs) => Promise<{
848
+ questionsWaiting: boolean;
849
+ money: boolean;
850
+ results: boolean;
851
+ tips: boolean;
852
+ activeHours: {
853
+ from: number;
854
+ to: number;
855
+ };
856
+ emailResults: boolean;
857
+ emailLowCredits: boolean;
858
+ emailWeeklyDigest: boolean;
859
+ emailExpiringCredits?: boolean | undefined;
860
+ }>;
861
+ prompts: () => Promise<{
862
+ due: ("verify_phone" | "verify_id" | "rating_first_payout" | "rating_tier2" | "rating_milestone_100" | "rating_milestone_500" | "rating_first_result" | "notifications" | "add_tags" | "invite_friend" | "set_payout_method" | "feed_first" | "feed_tier2_pays")[];
863
+ }>;
864
+ promptEvent: (input: import("zod").infer<typeof import("@50heads/shared").PromptEvent>) => Promise<{
865
+ ok: true;
866
+ }>;
867
+ referral: () => Promise<{
868
+ code: string;
869
+ link: string;
870
+ termsLine: string;
871
+ friends: {
872
+ name: string;
873
+ state: "tier1" | "tier2" | "installed";
874
+ paidPence: number;
875
+ says?: number | undefined;
876
+ outcome?: "paid" | "expired" | "waiting" | "not_eligible" | undefined;
877
+ }[];
878
+ bonusPence?: number | undefined;
879
+ refereePence?: number | undefined;
880
+ saysNeeded?: number | undefined;
881
+ withinDays?: number | undefined;
882
+ }>;
883
+ applyInvite: (code: string) => Promise<{
884
+ ok: true;
885
+ }>;
886
+ sessions: () => Promise<{
887
+ sessions: import("zod").infer<typeof import("@50heads/shared").SessionInfo>[];
888
+ }>;
889
+ revokeSession: (id: string) => Promise<{
890
+ ok: true;
891
+ }>;
892
+ reauth: (input: import("@50heads/shared").Reauth) => Promise<{
893
+ reauthToken: string;
894
+ expiresAt: string;
895
+ }>;
896
+ support: (input: {
897
+ subject: string;
898
+ body: string;
899
+ appVersion?: string;
900
+ }) => Promise<{
901
+ ticketId: string;
902
+ }>;
903
+ tickets: () => Promise<{
904
+ tickets: import("@50heads/shared").SupportTicket[];
905
+ }>;
906
+ ticket: (id: string) => Promise<{
907
+ ticket: import("@50heads/shared").SupportTicket;
908
+ }>;
909
+ replyTicket: (id: string, body: string) => Promise<{
910
+ ticket: import("@50heads/shared").SupportTicket;
911
+ }>;
912
+ dataExport: () => Promise<{
913
+ ok: true;
914
+ }>;
915
+ signOutEverywhere: () => Promise<{
916
+ ok: true;
917
+ revoked: number;
918
+ }>;
919
+ };
920
+ attest: {
921
+ nonce: () => Promise<import("@50heads/shared").AttestNonce>;
922
+ verify: (input: import("@50heads/shared").AttestRequest) => Promise<{
923
+ ok: true;
924
+ }>;
925
+ rotateKey: (input: import("zod").input<typeof import("@50heads/shared").DeviceKeyRotateInput>) => Promise<{
926
+ ok: true;
927
+ }>;
928
+ };
929
+ uploads: {
930
+ create: (input: {
931
+ kind: "image" | "audio";
932
+ contentType: string;
933
+ bytes: number;
934
+ }) => Promise<{
935
+ uploadUrl: string;
936
+ publicUrl: string;
937
+ headers: Record<string, string>;
938
+ }>;
939
+ put: (uploadUrl: string, bytes: Uint8Array, contentType: string) => Promise<{
940
+ ok: true;
941
+ publicUrl: string;
942
+ width: number | null;
943
+ height: number | null;
944
+ } & {
945
+ error?: {
946
+ code: string;
947
+ message: string;
948
+ };
949
+ }>;
950
+ importUrl: (url: string) => Promise<{
951
+ publicUrl: string;
952
+ width: number | null;
953
+ height: number | null;
954
+ }>;
955
+ };
956
+ drafts: {
957
+ list: () => Promise<{
958
+ drafts: import("@50heads/shared").Draft[];
959
+ }>;
960
+ save: (draft: Partial<import("@50heads/shared").QuestionDraftInput> & {
961
+ type: import("@50heads/shared").QuestionDraftInput["type"];
962
+ }, id?: string) => Promise<{
963
+ id: string;
964
+ draft: {
965
+ type: "single_choice" | "multi_choice" | "ab_image" | "pairwise" | "scale_1_5" | "ranking" | "yes_mostly_no" | "click_test" | "reaction" | "free_text";
966
+ text?: string | undefined;
967
+ context?: string | undefined;
968
+ language?: string | undefined;
969
+ options?: {
970
+ label: string;
971
+ imageUrl?: string | undefined;
972
+ }[] | undefined;
973
+ neither?: boolean | undefined;
974
+ stimulus?: {
975
+ imageUrl?: string | undefined;
976
+ audioUrl?: string | undefined;
977
+ text?: string | undefined;
978
+ exposureMs?: number | undefined;
979
+ } | undefined;
980
+ n?: number | undefined;
981
+ tier?: 1 | 2 | 3 | undefined;
982
+ rush?: boolean | undefined;
983
+ targeting?: {
984
+ countries: string[];
985
+ tags: string[];
986
+ ageBands?: ("18-24" | "25-34" | "35-44" | "45-54" | "55-64" | "65+")[] | undefined;
987
+ genders?: ("woman" | "man" | "non_binary")[] | undefined;
988
+ verifiedAge?: boolean | undefined;
989
+ } | undefined;
990
+ clickTest?: {
991
+ maxTaps: number;
992
+ } | undefined;
993
+ scheduledFor?: string | undefined;
994
+ publicResults?: boolean | undefined;
995
+ reason?: "off" | "optional" | "required" | undefined;
996
+ contentFlag?: "medical" | "violence" | "distressing" | "alcohol_gambling" | "political" | "none" | undefined;
997
+ };
998
+ updatedAt: string;
999
+ }>;
1000
+ remove: (id: string) => Promise<{
1001
+ ok: true;
1002
+ }>;
1003
+ };
1004
+ asks: {
1005
+ create: (draft: import("@50heads/shared").QuestionDraftInput, idempotencyKey: string, fromDraftId?: string) => Promise<{
1006
+ question: import("@50heads/shared").QuestionV2;
1007
+ }>;
1008
+ list: (filter?: {
1009
+ status?: import("@50heads/shared").QuestionStatusV2;
1010
+ since?: string;
1011
+ limit?: number;
1012
+ cursor?: string;
1013
+ } & import("zod").input<typeof import("@50heads/shared").QuestionListFilter>) => Promise<{
1014
+ questions: import("@50heads/shared").QuestionV2[];
1015
+ nextCursor: string | null;
1016
+ }>;
1017
+ get: (id: string) => Promise<{
1018
+ question: import("@50heads/shared").QuestionV2;
1019
+ }>;
1020
+ result: (id: string, filter?: import("@50heads/shared").ResultFilterInput) => Promise<{
1021
+ result: import("@50heads/shared").ResultV2;
1022
+ }>;
1023
+ answers: (id: string, filter?: import("@50heads/shared").ResultFilterInput, page?: {
1024
+ limit?: number;
1025
+ cursor?: string | null;
1026
+ }) => Promise<{
1027
+ questionId: string;
1028
+ filter: {
1029
+ option?: number | undefined;
1030
+ tier?: number | undefined;
1031
+ country?: string | undefined;
1032
+ ageBand?: string | undefined;
1033
+ gender?: "woman" | "man" | "non_binary" | undefined;
1034
+ q?: string | undefined;
1035
+ };
1036
+ total: number;
1037
+ nUnfiltered: number;
1038
+ suppressed: boolean;
1039
+ answers: {
1040
+ option: string | null;
1041
+ text: string | null;
1042
+ tier: number;
1043
+ attestationRef: string;
1044
+ answeredAt: string;
1045
+ translatedText?: string | null | undefined;
1046
+ reason?: string | null | undefined;
1047
+ translatedReason?: string | null | undefined;
1048
+ pinned?: boolean | undefined;
1049
+ flag?: {
1050
+ reason: "automated" | "off_topic" | "low_effort" | "abusive";
1051
+ status: "open" | "upheld" | "dismissed";
1052
+ refundCredits: number;
1053
+ createdAt: string;
1054
+ decidedAt: string | null;
1055
+ } | null | undefined;
1056
+ taps?: {
1057
+ x: number;
1058
+ y: number;
1059
+ }[] | undefined;
1060
+ }[];
1061
+ translationLanguage: string | null;
1062
+ nextCursor: string | null;
1063
+ }>;
1064
+ insights: (id: string) => Promise<{
1065
+ insights: import("@50heads/shared").ResultInsights | null;
1066
+ }>;
1067
+ summarise: (id: string) => Promise<{
1068
+ insights: import("@50heads/shared").ResultInsights | null;
1069
+ }>;
1070
+ wait: (id: string, seconds?: number, minAnswers?: number) => Promise<{
1071
+ result: import("@50heads/shared").ResultV2;
1072
+ done: boolean;
1073
+ }>;
1074
+ cancel: (id: string) => Promise<{
1075
+ question: import("@50heads/shared").QuestionV2;
1076
+ refundCredits: number;
1077
+ }>;
1078
+ dispute: (id: string, reason: string) => Promise<{
1079
+ ok: true;
1080
+ }>;
1081
+ share: (id: string, isPublic: boolean) => Promise<{
1082
+ publicCode: string | null;
1083
+ url: string | null;
1084
+ }>;
1085
+ exportCsvUrl: (id: string, filter?: import("@50heads/shared").ResultFilterInput) => string;
1086
+ heatmapUrl: (id: string) => string;
1087
+ rate: (id: string, usefulness: number) => Promise<{
1088
+ ok: true;
1089
+ }>;
1090
+ createWith: (draft: import("@50heads/shared").QuestionDraftInput, idempotencyKey: string, extras: import("@50heads/shared").AskExtrasInput) => Promise<{
1091
+ question: import("@50heads/shared").QuestionV2;
1092
+ }>;
1093
+ update: (id: string, input: import("@50heads/shared").QuestionUpdateInput) => Promise<{
1094
+ question: import("@50heads/shared").QuestionV2;
1095
+ }>;
1096
+ flagAnswer: (id: string, attestationRef: string, input: import("@50heads/shared").AnswerFlagInput) => Promise<{
1097
+ flag: import("@50heads/shared").AnswerFlagState & {
1098
+ id: string;
1099
+ attestationRef: string;
1100
+ };
1101
+ }>;
1102
+ pinAnswer: (id: string, attestationRef: string, pinned: boolean) => Promise<{
1103
+ pinned: boolean;
1104
+ }>;
1105
+ quoteAddHeads: (id: string, n: number) => Promise<{
1106
+ quote: import("@50heads/shared").AddHeadsQuote;
1107
+ }>;
1108
+ addHeads: (id: string, n: number, idempotencyKey: string) => Promise<{
1109
+ question: import("@50heads/shared").QuestionV2;
1110
+ quote: import("@50heads/shared").AddHeadsQuote;
1111
+ creditsReserved: number;
1112
+ }>;
1113
+ export: (id: string, input: import("@50heads/shared").ExportInput) => Promise<{
1114
+ export: import("@50heads/shared").ExportLink;
1115
+ }>;
1116
+ shareLinks: {
1117
+ list: (id: string) => Promise<{
1118
+ links: import("@50heads/shared").ShareLink[];
1119
+ }>;
1120
+ create: (id: string, input?: import("@50heads/shared").ShareLinkInput) => Promise<{
1121
+ link: import("@50heads/shared").ShareLink;
1122
+ }>;
1123
+ revoke: (id: string, linkId: string) => Promise<{
1124
+ link: import("@50heads/shared").ShareLink;
1125
+ }>;
1126
+ };
1127
+ exportUrl: (id: string, format: import("@50heads/shared/client").ExportFormat, params?: Record<string, string | number | undefined>) => string;
1128
+ labels: () => Promise<{
1129
+ labels: {
1130
+ label: string;
1131
+ count: number;
1132
+ }[];
1133
+ }>;
1134
+ };
1135
+ projects: {
1136
+ list: (filter?: {
1137
+ archived?: boolean;
1138
+ }) => Promise<{
1139
+ projects: import("@50heads/shared").Project[];
1140
+ }>;
1141
+ create: (input: import("zod").input<typeof import("@50heads/shared").ProjectInput>) => Promise<{
1142
+ project: import("@50heads/shared").Project;
1143
+ }>;
1144
+ update: (id: string, input: import("zod").input<typeof import("@50heads/shared").ProjectUpdateInput>) => Promise<{
1145
+ project: import("@50heads/shared").Project;
1146
+ }>;
1147
+ remove: (id: string) => Promise<{
1148
+ ok: true;
1149
+ }>;
1150
+ };
1151
+ billing: {
1152
+ balance: () => Promise<{
1153
+ credits: number;
1154
+ reserved: number;
1155
+ expiring: {
1156
+ credits: number;
1157
+ expiresAt: string;
1158
+ }[];
1159
+ currency: "GBP" | "USD" | "EUR" | "CAD";
1160
+ capRemaining: number | null;
1161
+ freeQuestionToday: boolean;
1162
+ }>;
1163
+ packs: (currency: string) => Promise<{
1164
+ packs: {
1165
+ id: string;
1166
+ credits: number;
1167
+ bonusCredits: number;
1168
+ price: number;
1169
+ currency: string;
1170
+ bankTransfer: boolean;
1171
+ }[];
1172
+ }>;
1173
+ checkout: (input: import("zod").infer<typeof import("@50heads/shared").CheckoutInput>) => Promise<{
1174
+ method: "card";
1175
+ url: string;
1176
+ sessionId: string;
1177
+ } | {
1178
+ method: "bank_transfer";
1179
+ reference: string;
1180
+ amount: number;
1181
+ currency: "GBP" | "USD" | "EUR" | "CAD";
1182
+ details: Record<string, string>;
1183
+ expiresAt: string;
1184
+ }>;
1185
+ autoTopUp: () => Promise<{
1186
+ enabled: boolean;
1187
+ thresholdCredits: number;
1188
+ pack: string;
1189
+ paymentMethodLast4: string | null;
1190
+ }>;
1191
+ setAutoTopUp: (input: import("zod").infer<typeof import("@50heads/shared").AutoTopUp>) => Promise<{
1192
+ enabled: boolean;
1193
+ thresholdCredits: number;
1194
+ pack: string;
1195
+ paymentMethodLast4: string | null;
1196
+ }>;
1197
+ invoices: () => Promise<{
1198
+ invoices: import("@50heads/shared").Invoice[];
1199
+ }>;
1200
+ profile: () => Promise<{
1201
+ legalName: string | null;
1202
+ address: string | null;
1203
+ country: string | null;
1204
+ vatNumber: string | null;
1205
+ vatValid: boolean | null;
1206
+ }>;
1207
+ setProfile: (input: Partial<import("zod").infer<typeof import("@50heads/shared").BillingProfile>>) => Promise<{
1208
+ legalName: string | null;
1209
+ address: string | null;
1210
+ country: string | null;
1211
+ vatNumber: string | null;
1212
+ vatValid: boolean | null;
1213
+ }>;
1214
+ ledger: (cursor?: string) => Promise<{
1215
+ rows: import("@50heads/shared").LedgerRow[];
1216
+ nextCursor: string | null;
1217
+ }>;
1218
+ statements: () => Promise<{
1219
+ statements: import("zod").infer<typeof import("@50heads/shared").Statement>[];
1220
+ }>;
1221
+ transfers: () => Promise<{
1222
+ transfers: import("@50heads/shared").BankTransfer[];
1223
+ }>;
1224
+ invoiceTerms: () => Promise<{
1225
+ status: "none" | "pending" | "approved" | "declined";
1226
+ termsDays: number | null;
1227
+ decidedAt: string | null;
1228
+ }>;
1229
+ requestInvoiceTerms: (input: import("zod").infer<typeof import("@50heads/shared").InvoiceTermsInput>) => Promise<{
1230
+ status: "none" | "pending" | "approved" | "declined";
1231
+ termsDays: number | null;
1232
+ decidedAt: string | null;
1233
+ }>;
1234
+ disputes: () => Promise<{
1235
+ disputes: import("@50heads/shared").Dispute[];
1236
+ }>;
1237
+ };
1238
+ audiences: {
1239
+ list: () => Promise<{
1240
+ audiences: import("@50heads/shared").SavedAudience[];
1241
+ }>;
1242
+ save: (input: import("zod").infer<typeof import("@50heads/shared").SavedAudienceInput>) => Promise<{
1243
+ audience: import("@50heads/shared").SavedAudience;
1244
+ }>;
1245
+ remove: (id: string) => Promise<{
1246
+ ok: true;
1247
+ }>;
1248
+ };
1249
+ file: (url: string) => Promise<Response>;
1250
+ earn: {
1251
+ queue: () => Promise<{
1252
+ summary: import("@50heads/shared").QueueSummary;
1253
+ items: import("@50heads/shared").FeedItemV2[];
1254
+ }>;
1255
+ say: (questionId: string, input: import("@50heads/shared").SayInputV2, idempotencyKey: string) => Promise<{
1256
+ earnedPence: number;
1257
+ pending: boolean;
1258
+ summary: import("@50heads/shared").QueueSummary;
1259
+ }>;
1260
+ skip: (questionId: string, input: {
1261
+ dwellMs: number;
1262
+ reason: "skip" | "close" | "stale" | "warning";
1263
+ flag?: "unclear" | "media_broken" | "offensive" | "not_for_me";
1264
+ }) => Promise<{
1265
+ ok: true;
1266
+ }>;
1267
+ earnings: () => Promise<{
1268
+ available: number;
1269
+ pending: number;
1270
+ pendingClearsInDays: number;
1271
+ thisMonth: number;
1272
+ minimumWithdrawal: number;
1273
+ autoPayout: {
1274
+ enabled: boolean;
1275
+ nextRunAt: string | null;
1276
+ };
1277
+ recent: {
1278
+ id: string;
1279
+ at: string;
1280
+ kind: "clawback" | "not_paid" | "say" | "ask" | "purchase" | "refund" | "bonus" | "referral" | "payout" | "payout_returned" | "fee" | "expiry" | "adjustment" | "tier2_fee";
1281
+ title: string;
1282
+ state: "not_paid" | "available" | "pending" | "in_flight" | "paid" | "reversed";
1283
+ amount: number;
1284
+ ref: string | null;
1285
+ notPaid?: {
1286
+ id: string;
1287
+ source: "rejected" | "clawback";
1288
+ reason: "too_fast" | "repeat" | "check_question" | "automated" | "linked_accounts" | "shared_payout_method" | "confirmed_fraud";
1289
+ amount: number;
1290
+ status: "not_paid" | "appealed" | "upheld" | "not_upheld";
1291
+ appealBy: string | null;
1292
+ decisionBy: string | null;
1293
+ } | null | undefined;
1294
+ by?: string | null | undefined;
1295
+ releaseAt?: string | null | undefined;
1296
+ }[];
1297
+ nextCursor: string | null;
1298
+ pendingClearsInHours?: number | undefined;
1299
+ nextReleaseAt?: string | null | undefined;
1300
+ founding?: {
1301
+ holdHours: number;
1302
+ until: string;
1303
+ weeklyCapPence?: number | undefined;
1304
+ weeklyLeftPence?: number | undefined;
1305
+ } | null | undefined;
1306
+ welcomeBonus?: {
1307
+ amountPence: number;
1308
+ saysNeeded: number;
1309
+ saysDone: number;
1310
+ state: "in_progress" | "paid" | "closed";
1311
+ } | null | undefined;
1312
+ accepted?: {
1313
+ rate: number | null;
1314
+ accepted: number;
1315
+ total: number;
1316
+ days: number;
1317
+ } | undefined;
1318
+ answering?: {
1319
+ today: {
1320
+ earned: number;
1321
+ seconds: number;
1322
+ };
1323
+ week: {
1324
+ earned: number;
1325
+ seconds: number;
1326
+ };
1327
+ } | undefined;
1328
+ country?: {
1329
+ country: string | null;
1330
+ open: boolean;
1331
+ notify: boolean;
1332
+ heldPence: number;
1333
+ } | undefined;
1334
+ }>;
1335
+ ledger: (filter?: {
1336
+ cursor?: string;
1337
+ month?: string;
1338
+ }) => Promise<{
1339
+ rows: import("@50heads/shared").LedgerRow[];
1340
+ nextCursor: string | null;
1341
+ }>;
1342
+ ledgerCsvUrl: (month?: string) => string;
1343
+ withdrawQuote: (input?: {
1344
+ amount?: number;
1345
+ methodId?: string;
1346
+ }) => Promise<{
1347
+ amount: number;
1348
+ available: number;
1349
+ minimum: number;
1350
+ maximum: number;
1351
+ methodId: string | null;
1352
+ fee: number;
1353
+ feeLabel: string;
1354
+ fx: {
1355
+ from: string;
1356
+ to: string;
1357
+ rate: number;
1358
+ validUntil: string;
1359
+ } | null;
1360
+ receive: {
1361
+ amount: number;
1362
+ currency: string;
1363
+ };
1364
+ arrives: string;
1365
+ blocker: "tax_details_required" | "no_method" | "below_minimum" | "reverify_required" | "frozen" | "method_cooling_off" | null;
1366
+ quoteId: string;
1367
+ usableFrom?: string | null | undefined;
1368
+ }>;
1369
+ withdraw: (quoteId: string, idempotencyKey: string) => Promise<{
1370
+ withdrawal: import("@50heads/shared").Withdrawal;
1371
+ }>;
1372
+ withdrawals: () => Promise<{
1373
+ withdrawals: import("@50heads/shared").Withdrawal[];
1374
+ }>;
1375
+ payoutMethods: () => Promise<{
1376
+ methods: import("@50heads/shared").PayoutMethod[];
1377
+ available: string[];
1378
+ }>;
1379
+ addPayoutMethod: (input: import("@50heads/shared").AddPayoutMethodInput, reauthToken: string) => Promise<{
1380
+ method: import("@50heads/shared").PayoutMethod;
1381
+ }>;
1382
+ confirmPayoutMethod: (id: string, code: string) => Promise<{
1383
+ method: import("@50heads/shared").PayoutMethod;
1384
+ }>;
1385
+ setDefaultPayoutMethod: (id: string) => Promise<{
1386
+ ok: true;
1387
+ }>;
1388
+ removePayoutMethod: (id: string, reauthToken: string) => Promise<{
1389
+ ok: true;
1390
+ }>;
1391
+ setAutoPayout: (enabled: boolean) => Promise<{
1392
+ ok: true;
1393
+ }>;
1394
+ taxStatus: () => Promise<{
1395
+ required: boolean;
1396
+ complete: boolean;
1397
+ fields: string[];
1398
+ reason: string;
1399
+ saved: Record<string, string> | null;
1400
+ authority?: string | undefined;
1401
+ selfBilling?: {
1402
+ required: boolean;
1403
+ acceptedAt: string | null;
1404
+ renewBy: string | null;
1405
+ } | undefined;
1406
+ w9?: {
1407
+ classification: "individual" | "single_member_llc";
1408
+ tinType: "ssn" | "ein";
1409
+ certifiedAt: string;
1410
+ signature: string;
1411
+ version: string;
1412
+ } | null | undefined;
1413
+ forms1099?: {
1414
+ year: number;
1415
+ amountCents: number;
1416
+ pdfUrl: string;
1417
+ }[] | undefined;
1418
+ }>;
1419
+ setTax: (input: import("@50heads/shared").TaxDetails, reauthToken: string) => Promise<{
1420
+ required: boolean;
1421
+ complete: boolean;
1422
+ fields: string[];
1423
+ reason: string;
1424
+ saved: Record<string, string> | null;
1425
+ authority?: string | undefined;
1426
+ selfBilling?: {
1427
+ required: boolean;
1428
+ acceptedAt: string | null;
1429
+ renewBy: string | null;
1430
+ } | undefined;
1431
+ w9?: {
1432
+ classification: "individual" | "single_member_llc";
1433
+ tinType: "ssn" | "ein";
1434
+ certifiedAt: string;
1435
+ signature: string;
1436
+ version: string;
1437
+ } | null | undefined;
1438
+ forms1099?: {
1439
+ year: number;
1440
+ amountCents: number;
1441
+ pdfUrl: string;
1442
+ }[] | undefined;
1443
+ }>;
1444
+ statements: () => Promise<{
1445
+ statements: import("zod").infer<typeof import("@50heads/shared").Statement>[];
1446
+ }>;
1447
+ tier: () => Promise<{
1448
+ tier: number;
1449
+ label: string;
1450
+ progress: number;
1451
+ nextStep: {
1452
+ action: "verify_phone" | "verify_id" | "keep_answering";
1453
+ line: string;
1454
+ payMultiple: number;
1455
+ } | null;
1456
+ tier2Available: boolean;
1457
+ verification: {
1458
+ status: "approved" | "declined" | "not_started" | "checking" | "resubmit";
1459
+ updatedAt: string;
1460
+ } | null;
1461
+ }>;
1462
+ startTier2: (input: import("zod").infer<typeof import("@50heads/shared").Tier2Consent>) => Promise<{
1463
+ vendor: "stripe_identity" | "veriff" | "onfido";
1464
+ sessionId: string;
1465
+ clientSecret: string;
1466
+ url: string | null;
1467
+ kind: "tier2" | "recheck";
1468
+ feePence: number;
1469
+ }>;
1470
+ startRecheck: () => Promise<{
1471
+ vendor: "stripe_identity" | "veriff" | "onfido";
1472
+ sessionId: string;
1473
+ clientSecret: string;
1474
+ url: string | null;
1475
+ kind: "tier2" | "recheck";
1476
+ feePence: number;
1477
+ }>;
1478
+ tags: () => Promise<{
1479
+ tagIds: string[];
1480
+ ageBand: string | null;
1481
+ declaredAgeBand?: "18-24" | "25-34" | "35-44" | "45-54" | "55-64" | "65+" | null | undefined;
1482
+ gender?: "woman" | "man" | "non_binary" | null | undefined;
1483
+ }>;
1484
+ setTags: (tagIds: string[], about?: Omit<import("@50heads/shared").MyTagsInput, "tagIds">) => Promise<{
1485
+ tagIds: string[];
1486
+ ageBand: string | null;
1487
+ declaredAgeBand?: "18-24" | "25-34" | "35-44" | "45-54" | "55-64" | "65+" | null | undefined;
1488
+ gender?: "woman" | "man" | "non_binary" | null | undefined;
1489
+ }>;
1490
+ appeals: () => Promise<{
1491
+ appeals: import("@50heads/shared").Appeal[];
1492
+ canAppeal: boolean;
1493
+ nextAllowedAt: string | null;
1494
+ }>;
1495
+ appeal: (text: string) => Promise<{
1496
+ appeal: import("@50heads/shared").Appeal;
1497
+ }>;
1498
+ appealNotPaid: (notPaidId: string, text: string) => Promise<{
1499
+ appeal: import("@50heads/shared").Appeal;
1500
+ }>;
1501
+ answering: () => Promise<{
1502
+ country: string | null;
1503
+ open: boolean;
1504
+ notify: boolean;
1505
+ heldPence: number;
1506
+ }>;
1507
+ setAnsweringNotify: (notify: boolean) => Promise<{
1508
+ country: string | null;
1509
+ open: boolean;
1510
+ notify: boolean;
1511
+ heldPence: number;
1512
+ }>;
1513
+ contentPrefs: () => Promise<{
1514
+ optedIn: ("medical" | "violence" | "distressing" | "alcohol_gambling" | "political")[];
1515
+ }>;
1516
+ setContentPrefs: (input: import("@50heads/shared").ContentPrefs) => Promise<{
1517
+ optedIn: ("medical" | "violence" | "distressing" | "alcohol_gambling" | "political")[];
1518
+ }>;
1519
+ };
1520
+ developer: {
1521
+ keys: () => Promise<{
1522
+ keys: import("@50heads/shared").ApiKeyV2[];
1523
+ }>;
1524
+ createKey: (input: import("zod").infer<typeof import("@50heads/shared").CreateApiKeyInput>, reauthToken: string) => Promise<{
1525
+ key: import("@50heads/shared").ApiKeyV2;
1526
+ secret: string;
1527
+ }>;
1528
+ updateKey: (id: string, input: import("zod").infer<typeof import("@50heads/shared").UpdateApiKeyInput>) => Promise<{
1529
+ key: import("@50heads/shared").ApiKeyV2;
1530
+ }>;
1531
+ rotateKey: (id: string, reauthToken: string) => Promise<{
1532
+ key: import("@50heads/shared").ApiKeyV2;
1533
+ secret: string;
1534
+ }>;
1535
+ revokeKey: (id: string) => Promise<{
1536
+ ok: true;
1537
+ }>;
1538
+ connections: () => Promise<{
1539
+ connections: import("@50heads/shared").Connection[];
1540
+ }>;
1541
+ connection: (id: string) => Promise<{
1542
+ connection: import("@50heads/shared").Connection;
1543
+ }>;
1544
+ updateConnection: (id: string, input: import("zod").infer<typeof import("@50heads/shared").UpdateConnectionInput>) => Promise<{
1545
+ connection: import("@50heads/shared").Connection;
1546
+ }>;
1547
+ revokeConnection: (id: string) => Promise<{
1548
+ ok: true;
1549
+ }>;
1550
+ revokeAllConnections: () => Promise<{
1551
+ ok: true;
1552
+ }>;
1553
+ usage: (days?: number) => Promise<{
1554
+ days: {
1555
+ date: string;
1556
+ tool: string;
1557
+ calls: number;
1558
+ credits: number;
1559
+ errors: number;
1560
+ }[];
1561
+ }>;
1562
+ logs: (filter?: {
1563
+ connectionId?: string;
1564
+ cursor?: string;
1565
+ }) => Promise<{
1566
+ calls: import("zod").infer<typeof import("@50heads/shared").McpCallLog>[];
1567
+ nextCursor: string | null;
1568
+ }>;
1569
+ webhooks: () => Promise<{
1570
+ endpoints: import("zod").infer<typeof import("@50heads/shared").WebhookEndpoint>[];
1571
+ }>;
1572
+ createWebhook: (input: import("zod").infer<typeof import("@50heads/shared").CreateWebhookInput>) => Promise<{
1573
+ endpoint: import("zod").infer<typeof import("@50heads/shared").WebhookEndpoint>;
1574
+ }>;
1575
+ deleteWebhook: (id: string) => Promise<{
1576
+ ok: true;
1577
+ }>;
1578
+ deliveries: (endpointId?: string) => Promise<{
1579
+ deliveries: import("zod").infer<typeof import("@50heads/shared").WebhookDelivery>[];
1580
+ }>;
1581
+ replay: (deliveryId: string) => Promise<{
1582
+ ok: true;
1583
+ }>;
1584
+ testToken: () => Promise<{
1585
+ token: string;
1586
+ expiresAt: string;
1587
+ }>;
1588
+ updateWebhook: (id: string, input: import("zod").infer<typeof import("@50heads/shared").UpdateWebhookInput>) => Promise<{
1589
+ endpoint: import("zod").infer<typeof import("@50heads/shared").WebhookEndpoint>;
1590
+ }>;
1591
+ rotateWebhookSecret: (id: string) => Promise<{
1592
+ endpoint: import("zod").infer<typeof import("@50heads/shared").WebhookEndpoint>;
1593
+ }>;
1594
+ deliveryAttempts: (deliveryId: string) => Promise<{
1595
+ attempts: import("zod").infer<typeof import("@50heads/shared").WebhookAttempt>[];
1596
+ }>;
1597
+ usageCsvUrl: (days?: number) => string;
1598
+ alerts: () => Promise<{
1599
+ capWarning: boolean;
1600
+ errorSpike: boolean;
1601
+ newClient: boolean;
1602
+ }>;
1603
+ setAlerts: (input: import("@50heads/shared").DeveloperAlerts) => Promise<{
1604
+ capWarning: boolean;
1605
+ errorSpike: boolean;
1606
+ newClient: boolean;
1607
+ }>;
1608
+ limits: () => Promise<{
1609
+ perMinute: number;
1610
+ usedThisMinute: number;
1611
+ askPerMinute: number;
1612
+ askUsedThisMinute: number;
1613
+ limitedLastDay: number;
1614
+ }>;
1615
+ currentConnection: () => Promise<{
1616
+ connection: import("@50heads/shared").Connection;
1617
+ }>;
1618
+ };
1619
+ mcp: {
1620
+ logCalls: (input: import("zod").infer<typeof import("@50heads/shared").McpCallsInput>) => Promise<{
1621
+ ok: true;
1622
+ }>;
1623
+ platformConfig: () => Promise<{
1624
+ killSwitch: import("zod").infer<typeof import("@50heads/shared").KillSwitch>;
1625
+ appVersions: {
1626
+ minimumIos: string;
1627
+ minimumAndroid: string;
1628
+ };
1629
+ mcp: {
1630
+ pauseAsk: boolean;
1631
+ pausedClients: string[];
1632
+ minProtocolVersion: string | null;
1633
+ message: string | null;
1634
+ };
1635
+ flags: Record<string, unknown>;
1636
+ }>;
1637
+ connection: () => Promise<{
1638
+ connection: import("@50heads/shared").Connection;
1639
+ }>;
1640
+ };
1641
+ support: {
1642
+ create: (input: import("zod").infer<typeof import("@50heads/shared").SupportTicketInput>) => Promise<{
1643
+ ticketId: string;
1644
+ }>;
1645
+ list: () => Promise<{
1646
+ tickets: import("@50heads/shared").SupportTicket[];
1647
+ }>;
1648
+ get: (id: string) => Promise<{
1649
+ ticket: import("@50heads/shared").SupportTicket;
1650
+ }>;
1651
+ reply: (id: string, body: string) => Promise<{
1652
+ ticket: import("@50heads/shared").SupportTicket;
1653
+ }>;
1654
+ };
1655
+ team: {
1656
+ get: () => Promise<{
1657
+ team: import("@50heads/shared").Team | null;
1658
+ memberships: import("@50heads/shared").Team[];
1659
+ }>;
1660
+ create: (input: import("zod").infer<typeof import("@50heads/shared").CreateTeamInput>) => Promise<{
1661
+ team: import("@50heads/shared").Team;
1662
+ }>;
1663
+ rename: (input: import("zod").infer<typeof import("@50heads/shared").CreateTeamInput>) => Promise<{
1664
+ team: import("@50heads/shared").Team;
1665
+ }>;
1666
+ invite: (input: import("zod").infer<typeof import("@50heads/shared").TeamInviteInput>) => Promise<{
1667
+ team: import("@50heads/shared").Team;
1668
+ }>;
1669
+ accept: (token: string) => Promise<{
1670
+ team: import("@50heads/shared").Team;
1671
+ }>;
1672
+ setRole: (memberId: string, input: import("zod").infer<typeof import("@50heads/shared").TeamRoleInput>) => Promise<{
1673
+ team: import("@50heads/shared").Team;
1674
+ }>;
1675
+ remove: (memberId: string) => Promise<{
1676
+ team: import("@50heads/shared").Team | null;
1677
+ }>;
1678
+ accounts: () => Promise<{
1679
+ accounts: import("@50heads/shared").WorkspaceAccount[];
1680
+ }>;
1681
+ setCap: (memberId: string, input: import("zod").infer<typeof import("@50heads/shared").TeamMemberCapInput>) => Promise<{
1682
+ team: import("@50heads/shared").Team;
1683
+ }>;
1684
+ usage: (month?: string) => Promise<{
1685
+ teamId: string;
1686
+ month: string;
1687
+ totalSpentPence: number;
1688
+ totalQuestions: number;
1689
+ members: {
1690
+ memberId: string;
1691
+ userId: string | null;
1692
+ name: string | null;
1693
+ email: string;
1694
+ role: "owner" | "admin" | "member" | "viewer" | "billing";
1695
+ questions: number;
1696
+ spentPence: number;
1697
+ monthlyCapPence: number | null;
1698
+ }[];
1699
+ }>;
1700
+ audit: (cursor?: string) => Promise<{
1701
+ rows: import("@50heads/shared").TeamAuditRow[];
1702
+ nextCursor: string | null;
1703
+ }>;
1704
+ };
1705
+ oauth: {
1706
+ request: (id: string) => Promise<{
1707
+ id: string;
1708
+ clientName: string;
1709
+ clientId: string;
1710
+ clientUri: string | null;
1711
+ logoUri: string | null;
1712
+ redirectHost: string;
1713
+ scopes: ("questions:read" | "questions:write" | "templates:read" | "account:read")[];
1714
+ scopeLines: string[];
1715
+ defaultCapDailyPence: number;
1716
+ grantedScopes?: ("questions:read" | "questions:write" | "templates:read" | "account:read")[] | undefined;
1717
+ teams?: {
1718
+ id: string;
1719
+ name: string;
1720
+ }[] | undefined;
1721
+ applicationType?: "web" | "native" | undefined;
1722
+ verified?: boolean | undefined;
1723
+ defaultCapPerQuestionPence?: number | undefined;
1724
+ defaultCapMonthlyPence?: number | undefined;
1725
+ expiresAt?: string | undefined;
1726
+ }>;
1727
+ approve: (id: string, input: import("zod").infer<typeof import("@50heads/shared").OAuthApproveInput>) => Promise<{
1728
+ redirectTo: string;
1729
+ }>;
1730
+ deny: (id: string) => Promise<{
1731
+ redirectTo: string;
1732
+ }>;
1733
+ };
1734
+ };
1735
+ export declare function runStdio(opts: StdioOptions): Promise<void>;