@vapi-network/core 0.15.2 → 0.16.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 (65) hide show
  1. package/README.md +6 -2
  2. package/dist/index.js +45 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/router-client.js +31 -5
  5. package/dist/router-client.js.map +1 -1
  6. package/dist/support-report.d.ts +1 -1
  7. package/dist/tasks/actions.d.ts +1 -0
  8. package/dist/tasks/actions.d.ts.map +1 -1
  9. package/dist/tasks/ballots.d.ts +43 -0
  10. package/dist/tasks/ballots.d.ts.map +1 -0
  11. package/dist/tasks/chain-port.d.ts +26 -0
  12. package/dist/tasks/chain-port.d.ts.map +1 -1
  13. package/dist/tasks/chain.d.ts +5 -0
  14. package/dist/tasks/chain.d.ts.map +1 -1
  15. package/dist/tasks/client.d.ts +33 -3
  16. package/dist/tasks/client.d.ts.map +1 -1
  17. package/dist/tasks/funding-attempts.d.ts +58 -0
  18. package/dist/tasks/funding-attempts.d.ts.map +1 -0
  19. package/dist/tasks/funding-intent.d.ts +11 -0
  20. package/dist/tasks/funding-intent.d.ts.map +1 -0
  21. package/dist/tasks/index.d.ts +13 -2
  22. package/dist/tasks/index.d.ts.map +1 -1
  23. package/dist/tasks/money.d.ts +2 -0
  24. package/dist/tasks/money.d.ts.map +1 -1
  25. package/dist/tasks/operation-support.d.ts +10 -2
  26. package/dist/tasks/operation-support.d.ts.map +1 -1
  27. package/dist/tasks/operations.d.ts +651 -13
  28. package/dist/tasks/operations.d.ts.map +1 -1
  29. package/dist/tasks/pending-transactions.d.ts +11 -0
  30. package/dist/tasks/pending-transactions.d.ts.map +1 -1
  31. package/dist/tasks/post-options.d.ts +144 -0
  32. package/dist/tasks/post-options.d.ts.map +1 -0
  33. package/dist/tasks/types.d.ts +5505 -74
  34. package/dist/tasks/types.d.ts.map +1 -1
  35. package/dist/tasks/v2-abi.d.ts +12 -0
  36. package/dist/tasks/v2-abi.d.ts.map +1 -0
  37. package/dist/tasks/v2-abi.generated.d.ts +5966 -0
  38. package/dist/tasks/v2-abi.generated.d.ts.map +1 -0
  39. package/dist/tasks/v2-events.d.ts +6460 -0
  40. package/dist/tasks/v2-events.d.ts.map +1 -0
  41. package/dist/tasks/v2-execution.d.ts +1070 -0
  42. package/dist/tasks/v2-execution.d.ts.map +1 -0
  43. package/dist/tasks/v2-jury.d.ts +863 -0
  44. package/dist/tasks/v2-jury.d.ts.map +1 -0
  45. package/dist/tasks/v2-plan-guard.d.ts +100 -0
  46. package/dist/tasks/v2-plan-guard.d.ts.map +1 -0
  47. package/dist/tasks/v2-public.d.ts +154 -0
  48. package/dist/tasks/v2-public.d.ts.map +1 -0
  49. package/dist/tasks/v2-trust.d.ts +27 -0
  50. package/dist/tasks/v2-trust.d.ts.map +1 -0
  51. package/dist/tasks/v2-write.d.ts +886 -0
  52. package/dist/tasks/v2-write.d.ts.map +1 -0
  53. package/dist/tasks/v2.d.ts +847 -0
  54. package/dist/tasks/v2.d.ts.map +1 -0
  55. package/dist/tasks/verbs.d.ts +1 -1
  56. package/dist/tasks/verbs.d.ts.map +1 -1
  57. package/dist/tasks/x402-funding.d.ts +49 -0
  58. package/dist/tasks/x402-funding.d.ts.map +1 -0
  59. package/dist/tasks.js +17039 -3750
  60. package/dist/tasks.js.map +3 -3
  61. package/dist/x402-pay.d.ts +11 -1
  62. package/dist/x402-pay.d.ts.map +1 -1
  63. package/dist/x402.d.ts +6 -0
  64. package/dist/x402.d.ts.map +1 -1
  65. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- export { PENDING_SERVER_ROUTES, TASK_LIMITS, TASK_WATCH_STATES, TaskInputError, TaskOperationError, cachedMoneyClient, fundingRefusalReason, isMissingTaskEntity, nextTaskEvents, orderReceipts, parseTaskDuration, proposalTerms, publicNotFoundFetch, readTaskFile, resolveTaskBearer, taskEventState, taskMoneySnapshot, taskPolicyForWallet, taskRequest, taskStateMatches, validTaskBrief, } from "./operation-support.js";
1
+ export { PENDING_SERVER_ROUTES, TASK_LIMITS, TASK_WATCH_STATES, TaskInputError, TaskOperationError, cachedMoneyClient, fundingRefusalReason, isMissingTaskEntity, nextTaskEvents, orderReceipts, parseTaskDuration, proposalTerms, publicNotFoundFetch, readTaskFile, resolveTaskBearer, taskEventState, taskEventLine, taskMoneySnapshot, taskPolicyForWallet, taskRequest, requireTaskMethod, taskStateMatches, validTaskBrief, } from "./operation-support.js";
2
2
  export type { MoneySnapshot, ProposalTerms, TaskOperationContext, TaskPolicy, TaskRoute, TaskUnlock, } from "./operation-support.js";
3
3
  import { type Address } from "viem";
4
4
  import { signScope, type SignScopeActionResult, type TaskDeliveryFile, type TaskFundingApproval } from "./actions.js";
@@ -32,7 +32,7 @@ export declare function searchTasks(context: TaskOperationContext, input: {
32
32
  deadlineAt: string | null;
33
33
  durationSeconds: number | null;
34
34
  createdAt: string;
35
- state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
35
+ state: "paid" | "expired" | "open" | "refunded" | "disputed" | "funded" | "delivered" | "awarded" | "closed";
36
36
  poster: {
37
37
  [x: string]: unknown;
38
38
  address: string;
@@ -54,6 +54,153 @@ export declare function searchTasks(context: TaskOperationContext, input: {
54
54
  proofKinds: string[];
55
55
  audience: string;
56
56
  receiptUrl: string | null;
57
+ terms?: {
58
+ [x: string]: unknown;
59
+ shape: "task" | "bounty" | "pool";
60
+ liveness?: {
61
+ [x: string]: unknown;
62
+ nextDueAt?: string | null | undefined;
63
+ stalledAt?: string | null | undefined;
64
+ } | undefined;
65
+ milestones?: {
66
+ index: number;
67
+ amountBaseUnits: string;
68
+ acceptance: string;
69
+ deadlineAt: string;
70
+ }[] | undefined;
71
+ proofSpec?: ({
72
+ preset: "link";
73
+ mustContain?: string | undefined;
74
+ label?: string | undefined;
75
+ } | {
76
+ preset: "file";
77
+ label?: string | undefined;
78
+ } | {
79
+ preset: "x-post";
80
+ holdForSeconds?: number | undefined;
81
+ mustContain?: string | undefined;
82
+ label?: string | undefined;
83
+ } | {
84
+ preset: "onchain-tx";
85
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
86
+ label?: string | undefined;
87
+ } | {
88
+ preset: "pr";
89
+ mustContain?: string | undefined;
90
+ label?: string | undefined;
91
+ } | {
92
+ preset: "text";
93
+ minLength?: number | undefined;
94
+ label?: string | undefined;
95
+ } | {
96
+ kinds: ("photo" | "video")[];
97
+ preset: "media";
98
+ maxSizeMb?: number | undefined;
99
+ window?: {
100
+ fromIso: string;
101
+ toIso: string;
102
+ } | undefined;
103
+ geofence?: {
104
+ lat: number;
105
+ lng: number;
106
+ radiusKm: number;
107
+ } | undefined;
108
+ label?: string | undefined;
109
+ })[] | {
110
+ items: ({
111
+ preset: "link";
112
+ mustContain?: string | undefined;
113
+ label?: string | undefined;
114
+ } | {
115
+ preset: "file";
116
+ label?: string | undefined;
117
+ } | {
118
+ preset: "x-post";
119
+ holdForSeconds?: number | undefined;
120
+ mustContain?: string | undefined;
121
+ label?: string | undefined;
122
+ } | {
123
+ preset: "onchain-tx";
124
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
125
+ label?: string | undefined;
126
+ } | {
127
+ preset: "pr";
128
+ mustContain?: string | undefined;
129
+ label?: string | undefined;
130
+ } | {
131
+ preset: "text";
132
+ minLength?: number | undefined;
133
+ label?: string | undefined;
134
+ } | {
135
+ kinds: ("photo" | "video")[];
136
+ preset: "media";
137
+ maxSizeMb?: number | undefined;
138
+ window?: {
139
+ fromIso: string;
140
+ toIso: string;
141
+ } | undefined;
142
+ geofence?: {
143
+ lat: number;
144
+ lng: number;
145
+ radiusKm: number;
146
+ } | undefined;
147
+ label?: string | undefined;
148
+ })[];
149
+ anyOf?: boolean | undefined;
150
+ } | undefined;
151
+ checkin?: "none" | "6h" | "24h" | "72h" | "7d" | undefined;
152
+ workerBondBp?: number | undefined;
153
+ bounty?: {
154
+ winners: number;
155
+ rewardPerWinnerBaseUnits: string;
156
+ deadlineAt: string;
157
+ choiceWindowSeconds?: number | undefined;
158
+ } | undefined;
159
+ pool?: {
160
+ rewardPerClaimBaseUnits: string;
161
+ budgetBaseUnits: string;
162
+ gate?: "open" | "proven" | undefined;
163
+ verifier?: "vapi" | "poster" | undefined;
164
+ openCheck?: "allowlist" | "invite" | "x-age" | "phone" | undefined;
165
+ } | undefined;
166
+ } | undefined;
167
+ lifecycle?: {
168
+ [x: string]: unknown;
169
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
170
+ milestones: {
171
+ [x: string]: unknown;
172
+ id: string;
173
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
174
+ amountBaseUnits: string;
175
+ dueAt?: string | undefined;
176
+ cause?: number | undefined;
177
+ disputed?: boolean | undefined;
178
+ disputeWinner?: number | undefined;
179
+ summary?: string | undefined;
180
+ }[];
181
+ shape: "task";
182
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
183
+ cause?: number | undefined;
184
+ disputed?: boolean | undefined;
185
+ disputeWinner?: number | undefined;
186
+ summary?: string | undefined;
187
+ } | {
188
+ [x: string]: unknown;
189
+ shape: "bounty";
190
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
191
+ amountBaseUnits?: string | undefined;
192
+ dueAt?: string | undefined;
193
+ } | {
194
+ [x: string]: unknown;
195
+ shape: "pool";
196
+ state: "Draft" | "Open" | "Paused" | "Closed";
197
+ } | null | undefined;
198
+ nextAction?: {
199
+ [x: string]: unknown;
200
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
201
+ amountBaseUnits?: string | undefined;
202
+ dueAt?: string | undefined;
203
+ } | undefined;
57
204
  }[];
58
205
  pinned: {
59
206
  [x: string]: unknown;
@@ -72,7 +219,7 @@ export declare function searchTasks(context: TaskOperationContext, input: {
72
219
  deadlineAt: string | null;
73
220
  durationSeconds: number | null;
74
221
  createdAt: string;
75
- state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
222
+ state: "paid" | "expired" | "open" | "refunded" | "disputed" | "funded" | "delivered" | "awarded" | "closed";
76
223
  poster: {
77
224
  [x: string]: unknown;
78
225
  address: string;
@@ -94,6 +241,153 @@ export declare function searchTasks(context: TaskOperationContext, input: {
94
241
  proofKinds: string[];
95
242
  audience: string;
96
243
  receiptUrl: string | null;
244
+ terms?: {
245
+ [x: string]: unknown;
246
+ shape: "task" | "bounty" | "pool";
247
+ liveness?: {
248
+ [x: string]: unknown;
249
+ nextDueAt?: string | null | undefined;
250
+ stalledAt?: string | null | undefined;
251
+ } | undefined;
252
+ milestones?: {
253
+ index: number;
254
+ amountBaseUnits: string;
255
+ acceptance: string;
256
+ deadlineAt: string;
257
+ }[] | undefined;
258
+ proofSpec?: ({
259
+ preset: "link";
260
+ mustContain?: string | undefined;
261
+ label?: string | undefined;
262
+ } | {
263
+ preset: "file";
264
+ label?: string | undefined;
265
+ } | {
266
+ preset: "x-post";
267
+ holdForSeconds?: number | undefined;
268
+ mustContain?: string | undefined;
269
+ label?: string | undefined;
270
+ } | {
271
+ preset: "onchain-tx";
272
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
273
+ label?: string | undefined;
274
+ } | {
275
+ preset: "pr";
276
+ mustContain?: string | undefined;
277
+ label?: string | undefined;
278
+ } | {
279
+ preset: "text";
280
+ minLength?: number | undefined;
281
+ label?: string | undefined;
282
+ } | {
283
+ kinds: ("photo" | "video")[];
284
+ preset: "media";
285
+ maxSizeMb?: number | undefined;
286
+ window?: {
287
+ fromIso: string;
288
+ toIso: string;
289
+ } | undefined;
290
+ geofence?: {
291
+ lat: number;
292
+ lng: number;
293
+ radiusKm: number;
294
+ } | undefined;
295
+ label?: string | undefined;
296
+ })[] | {
297
+ items: ({
298
+ preset: "link";
299
+ mustContain?: string | undefined;
300
+ label?: string | undefined;
301
+ } | {
302
+ preset: "file";
303
+ label?: string | undefined;
304
+ } | {
305
+ preset: "x-post";
306
+ holdForSeconds?: number | undefined;
307
+ mustContain?: string | undefined;
308
+ label?: string | undefined;
309
+ } | {
310
+ preset: "onchain-tx";
311
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
312
+ label?: string | undefined;
313
+ } | {
314
+ preset: "pr";
315
+ mustContain?: string | undefined;
316
+ label?: string | undefined;
317
+ } | {
318
+ preset: "text";
319
+ minLength?: number | undefined;
320
+ label?: string | undefined;
321
+ } | {
322
+ kinds: ("photo" | "video")[];
323
+ preset: "media";
324
+ maxSizeMb?: number | undefined;
325
+ window?: {
326
+ fromIso: string;
327
+ toIso: string;
328
+ } | undefined;
329
+ geofence?: {
330
+ lat: number;
331
+ lng: number;
332
+ radiusKm: number;
333
+ } | undefined;
334
+ label?: string | undefined;
335
+ })[];
336
+ anyOf?: boolean | undefined;
337
+ } | undefined;
338
+ checkin?: "none" | "6h" | "24h" | "72h" | "7d" | undefined;
339
+ workerBondBp?: number | undefined;
340
+ bounty?: {
341
+ winners: number;
342
+ rewardPerWinnerBaseUnits: string;
343
+ deadlineAt: string;
344
+ choiceWindowSeconds?: number | undefined;
345
+ } | undefined;
346
+ pool?: {
347
+ rewardPerClaimBaseUnits: string;
348
+ budgetBaseUnits: string;
349
+ gate?: "open" | "proven" | undefined;
350
+ verifier?: "vapi" | "poster" | undefined;
351
+ openCheck?: "allowlist" | "invite" | "x-age" | "phone" | undefined;
352
+ } | undefined;
353
+ } | undefined;
354
+ lifecycle?: {
355
+ [x: string]: unknown;
356
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
357
+ milestones: {
358
+ [x: string]: unknown;
359
+ id: string;
360
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
361
+ amountBaseUnits: string;
362
+ dueAt?: string | undefined;
363
+ cause?: number | undefined;
364
+ disputed?: boolean | undefined;
365
+ disputeWinner?: number | undefined;
366
+ summary?: string | undefined;
367
+ }[];
368
+ shape: "task";
369
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
370
+ cause?: number | undefined;
371
+ disputed?: boolean | undefined;
372
+ disputeWinner?: number | undefined;
373
+ summary?: string | undefined;
374
+ } | {
375
+ [x: string]: unknown;
376
+ shape: "bounty";
377
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
378
+ amountBaseUnits?: string | undefined;
379
+ dueAt?: string | undefined;
380
+ } | {
381
+ [x: string]: unknown;
382
+ shape: "pool";
383
+ state: "Draft" | "Open" | "Paused" | "Closed";
384
+ } | null | undefined;
385
+ nextAction?: {
386
+ [x: string]: unknown;
387
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
388
+ amountBaseUnits?: string | undefined;
389
+ dueAt?: string | undefined;
390
+ } | undefined;
97
391
  } | null;
98
392
  numbers: {
99
393
  [x: string]: unknown;
@@ -120,6 +414,7 @@ export declare function postTask(context: TaskOperationContext, input: {
120
414
  deadlineAt: string;
121
415
  webhook?: string;
122
416
  onFeeUnavailable?: () => void;
417
+ fund?: boolean;
123
418
  }): Promise<{
124
419
  result: CreateOrderResponse & {
125
420
  webhook?: Awaited<ReturnType<TasksClient["configureWebhook"]>>;
@@ -128,6 +423,12 @@ export declare function postTask(context: TaskOperationContext, input: {
128
423
  feeUnavailable: boolean;
129
424
  unsupportedFields: string[];
130
425
  postingMovesMoney: false;
426
+ fundingIdempotencyKey?: string;
427
+ funding?: {
428
+ error?: string;
429
+ kind?: "eip712" | "transaction";
430
+ [key: string]: unknown;
431
+ };
131
432
  }>;
132
433
  export declare function proposeTask(context: TaskOperationContext, input: {
133
434
  id: string;
@@ -141,16 +442,23 @@ export declare function submitTask(context: TaskOperationContext, input: {
141
442
  proof: SubmissionProof[];
142
443
  files: UploadFileInput[];
143
444
  unlock: TaskUnlock;
445
+ withdraw?: boolean;
446
+ proposalId?: string;
447
+ address?: string;
144
448
  }): Promise<SubmitResponse>;
145
449
  export type PrivateTaskView = GetOrderResponse & {
146
450
  receipts: ReturnType<typeof orderReceipts>;
147
451
  receiptUrl?: string;
148
452
  receiptUrlSource?: "escrow";
453
+ lifecycle: import("./v2.js").TaskLifecycle | null;
454
+ nextAction: import("./v2.js").TaskNextAction;
149
455
  };
150
456
  export type PublicTaskView = {
151
457
  task: NonNullable<Awaited<ReturnType<TasksClient["publicTask"]>>>;
152
458
  receiptUrl?: string;
153
459
  receiptUrlSource?: "server";
460
+ lifecycle: import("./v2.js").TaskLifecycle | null;
461
+ nextAction: import("./v2.js").TaskNextAction;
154
462
  };
155
463
  export declare function showTask(context: TaskOperationContext, input: {
156
464
  id: string;
@@ -186,7 +494,7 @@ export declare function taskStatus(context: TaskOperationContext, input: {
186
494
  } | {
187
495
  [x: string]: unknown;
188
496
  status: "confirmed";
189
- state: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved";
497
+ state: "created" | "expired" | "submitted" | "disputed" | "locked" | "resolved";
190
498
  resolution: "split" | "released" | "refunded" | null;
191
499
  offerDeadlineAt: string | null;
192
500
  workDeadlineAt: string | null;
@@ -200,7 +508,7 @@ export declare function taskStatus(context: TaskOperationContext, input: {
200
508
  } | {
201
509
  [x: string]: unknown;
202
510
  status: "mirror";
203
- state: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved";
511
+ state: "created" | "expired" | "submitted" | "disputed" | "locked" | "resolved";
204
512
  } | {
205
513
  [x: string]: unknown;
206
514
  status: "unavailable";
@@ -238,7 +546,7 @@ export declare function taskStatus(context: TaskOperationContext, input: {
238
546
  deadlineAt: string | null;
239
547
  durationSeconds: number | null;
240
548
  createdAt: string;
241
- state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
549
+ state: "paid" | "expired" | "open" | "refunded" | "disputed" | "funded" | "delivered" | "awarded" | "closed";
242
550
  poster: {
243
551
  [x: string]: unknown;
244
552
  address: string;
@@ -279,13 +587,194 @@ export declare function taskStatus(context: TaskOperationContext, input: {
279
587
  verifiedWorker: boolean;
280
588
  };
281
589
  };
282
- state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
590
+ state: "paid" | "expired" | "open" | "refunded" | "disputed" | "funded" | "delivered" | "awarded" | "closed";
283
591
  receiptUrl: string | null;
284
592
  }[];
593
+ terms?: {
594
+ [x: string]: unknown;
595
+ shape: "task" | "bounty" | "pool";
596
+ liveness?: {
597
+ [x: string]: unknown;
598
+ nextDueAt?: string | null | undefined;
599
+ stalledAt?: string | null | undefined;
600
+ } | undefined;
601
+ milestones?: {
602
+ index: number;
603
+ amountBaseUnits: string;
604
+ acceptance: string;
605
+ deadlineAt: string;
606
+ }[] | undefined;
607
+ proofSpec?: ({
608
+ preset: "link";
609
+ mustContain?: string | undefined;
610
+ label?: string | undefined;
611
+ } | {
612
+ preset: "file";
613
+ label?: string | undefined;
614
+ } | {
615
+ preset: "x-post";
616
+ holdForSeconds?: number | undefined;
617
+ mustContain?: string | undefined;
618
+ label?: string | undefined;
619
+ } | {
620
+ preset: "onchain-tx";
621
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
622
+ label?: string | undefined;
623
+ } | {
624
+ preset: "pr";
625
+ mustContain?: string | undefined;
626
+ label?: string | undefined;
627
+ } | {
628
+ preset: "text";
629
+ minLength?: number | undefined;
630
+ label?: string | undefined;
631
+ } | {
632
+ kinds: ("photo" | "video")[];
633
+ preset: "media";
634
+ maxSizeMb?: number | undefined;
635
+ window?: {
636
+ fromIso: string;
637
+ toIso: string;
638
+ } | undefined;
639
+ geofence?: {
640
+ lat: number;
641
+ lng: number;
642
+ radiusKm: number;
643
+ } | undefined;
644
+ label?: string | undefined;
645
+ })[] | {
646
+ items: ({
647
+ preset: "link";
648
+ mustContain?: string | undefined;
649
+ label?: string | undefined;
650
+ } | {
651
+ preset: "file";
652
+ label?: string | undefined;
653
+ } | {
654
+ preset: "x-post";
655
+ holdForSeconds?: number | undefined;
656
+ mustContain?: string | undefined;
657
+ label?: string | undefined;
658
+ } | {
659
+ preset: "onchain-tx";
660
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
661
+ label?: string | undefined;
662
+ } | {
663
+ preset: "pr";
664
+ mustContain?: string | undefined;
665
+ label?: string | undefined;
666
+ } | {
667
+ preset: "text";
668
+ minLength?: number | undefined;
669
+ label?: string | undefined;
670
+ } | {
671
+ kinds: ("photo" | "video")[];
672
+ preset: "media";
673
+ maxSizeMb?: number | undefined;
674
+ window?: {
675
+ fromIso: string;
676
+ toIso: string;
677
+ } | undefined;
678
+ geofence?: {
679
+ lat: number;
680
+ lng: number;
681
+ radiusKm: number;
682
+ } | undefined;
683
+ label?: string | undefined;
684
+ })[];
685
+ anyOf?: boolean | undefined;
686
+ } | undefined;
687
+ checkin?: "none" | "6h" | "24h" | "72h" | "7d" | undefined;
688
+ workerBondBp?: number | undefined;
689
+ bounty?: {
690
+ winners: number;
691
+ rewardPerWinnerBaseUnits: string;
692
+ deadlineAt: string;
693
+ choiceWindowSeconds?: number | undefined;
694
+ } | undefined;
695
+ pool?: {
696
+ rewardPerClaimBaseUnits: string;
697
+ budgetBaseUnits: string;
698
+ gate?: "open" | "proven" | undefined;
699
+ verifier?: "vapi" | "poster" | undefined;
700
+ openCheck?: "allowlist" | "invite" | "x-age" | "phone" | undefined;
701
+ } | undefined;
702
+ } | undefined;
703
+ lifecycle?: {
704
+ [x: string]: unknown;
705
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
706
+ milestones: {
707
+ [x: string]: unknown;
708
+ id: string;
709
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
710
+ amountBaseUnits: string;
711
+ dueAt?: string | undefined;
712
+ cause?: number | undefined;
713
+ disputed?: boolean | undefined;
714
+ disputeWinner?: number | undefined;
715
+ summary?: string | undefined;
716
+ }[];
717
+ shape: "task";
718
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
719
+ cause?: number | undefined;
720
+ disputed?: boolean | undefined;
721
+ disputeWinner?: number | undefined;
722
+ summary?: string | undefined;
723
+ } | {
724
+ [x: string]: unknown;
725
+ shape: "bounty";
726
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
727
+ amountBaseUnits?: string | undefined;
728
+ dueAt?: string | undefined;
729
+ } | {
730
+ [x: string]: unknown;
731
+ shape: "pool";
732
+ state: "Draft" | "Open" | "Paused" | "Closed";
733
+ } | null | undefined;
734
+ nextAction?: {
735
+ [x: string]: unknown;
736
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
737
+ amountBaseUnits?: string | undefined;
738
+ dueAt?: string | undefined;
739
+ } | undefined;
740
+ };
741
+ lifecycle: {
742
+ [x: string]: unknown;
743
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
744
+ milestones: {
745
+ [x: string]: unknown;
746
+ id: string;
747
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
748
+ amountBaseUnits: string;
749
+ dueAt?: string | undefined;
750
+ cause?: number | undefined;
751
+ disputed?: boolean | undefined;
752
+ disputeWinner?: number | undefined;
753
+ summary?: string | undefined;
754
+ }[];
755
+ shape: "task";
756
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
757
+ cause?: number | undefined;
758
+ disputed?: boolean | undefined;
759
+ disputeWinner?: number | undefined;
760
+ summary?: string | undefined;
761
+ } | {
762
+ [x: string]: unknown;
763
+ shape: "bounty";
764
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
765
+ amountBaseUnits?: string | undefined;
766
+ dueAt?: string | undefined;
767
+ } | {
768
+ [x: string]: unknown;
769
+ shape: "pool";
770
+ state: "Draft" | "Open" | "Paused" | "Closed";
771
+ } | null;
772
+ nextAction: {
773
+ [x: string]: unknown;
774
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
775
+ amountBaseUnits?: string | undefined;
776
+ dueAt?: string | undefined;
285
777
  };
286
- chainState?: undefined;
287
- events?: undefined;
288
- nextAfter?: undefined;
289
778
  }>;
290
779
  export declare function awardTask(context: TaskOperationContext, input: {
291
780
  id: string;
@@ -312,7 +801,7 @@ export declare function awardTask(context: TaskOperationContext, input: {
312
801
  id: string;
313
802
  workOrderId: string;
314
803
  providerAddress: `0x${string}`;
315
- state: "pending" | "rejected" | "accepted";
804
+ state: "pending" | "rejected" | "accepted" | "withdrawn";
316
805
  signedPayload: {
317
806
  [x: string]: unknown;
318
807
  version: "work-proposal-v1";
@@ -383,7 +872,7 @@ export declare function awardTask(context: TaskOperationContext, input: {
383
872
  id: string;
384
873
  workOrderId: string;
385
874
  ordinal: number;
386
- state: "released" | "agreed" | "funding" | "funded" | "delivering" | "delivered" | "evaluating" | "refunded";
875
+ state: "released" | "refunded" | "agreed" | "funding" | "funded" | "delivering" | "delivered" | "evaluating";
387
876
  terms: {
388
877
  version: "work-milestone-terms-v1";
389
878
  title: string;
@@ -412,7 +901,7 @@ export declare function awardTask(context: TaskOperationContext, input: {
412
901
  amountBaseUnits: string;
413
902
  escrowProtocol: "escrow-v1";
414
903
  escrowContract: `0x${string}`;
415
- escrowState: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved" | null;
904
+ escrowState: "created" | "expired" | "submitted" | "disputed" | "locked" | "resolved" | null;
416
905
  resolution: "split" | "release" | "refund" | null;
417
906
  offerDeadlineAt: string | null;
418
907
  workDeadlineAt: string | null;
@@ -522,6 +1011,153 @@ export declare function awardTask(context: TaskOperationContext, input: {
522
1011
  completedAt: string | null;
523
1012
  createdAt: string;
524
1013
  updatedAt: string;
1014
+ terms?: {
1015
+ [x: string]: unknown;
1016
+ shape: "task" | "bounty" | "pool";
1017
+ liveness?: {
1018
+ [x: string]: unknown;
1019
+ nextDueAt?: string | null | undefined;
1020
+ stalledAt?: string | null | undefined;
1021
+ } | undefined;
1022
+ milestones?: {
1023
+ index: number;
1024
+ amountBaseUnits: string;
1025
+ acceptance: string;
1026
+ deadlineAt: string;
1027
+ }[] | undefined;
1028
+ proofSpec?: ({
1029
+ preset: "link";
1030
+ mustContain?: string | undefined;
1031
+ label?: string | undefined;
1032
+ } | {
1033
+ preset: "file";
1034
+ label?: string | undefined;
1035
+ } | {
1036
+ preset: "x-post";
1037
+ holdForSeconds?: number | undefined;
1038
+ mustContain?: string | undefined;
1039
+ label?: string | undefined;
1040
+ } | {
1041
+ preset: "onchain-tx";
1042
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
1043
+ label?: string | undefined;
1044
+ } | {
1045
+ preset: "pr";
1046
+ mustContain?: string | undefined;
1047
+ label?: string | undefined;
1048
+ } | {
1049
+ preset: "text";
1050
+ minLength?: number | undefined;
1051
+ label?: string | undefined;
1052
+ } | {
1053
+ kinds: ("photo" | "video")[];
1054
+ preset: "media";
1055
+ maxSizeMb?: number | undefined;
1056
+ window?: {
1057
+ fromIso: string;
1058
+ toIso: string;
1059
+ } | undefined;
1060
+ geofence?: {
1061
+ lat: number;
1062
+ lng: number;
1063
+ radiusKm: number;
1064
+ } | undefined;
1065
+ label?: string | undefined;
1066
+ })[] | {
1067
+ items: ({
1068
+ preset: "link";
1069
+ mustContain?: string | undefined;
1070
+ label?: string | undefined;
1071
+ } | {
1072
+ preset: "file";
1073
+ label?: string | undefined;
1074
+ } | {
1075
+ preset: "x-post";
1076
+ holdForSeconds?: number | undefined;
1077
+ mustContain?: string | undefined;
1078
+ label?: string | undefined;
1079
+ } | {
1080
+ preset: "onchain-tx";
1081
+ chain?: "base" | "solana" | "base-sepolia" | undefined;
1082
+ label?: string | undefined;
1083
+ } | {
1084
+ preset: "pr";
1085
+ mustContain?: string | undefined;
1086
+ label?: string | undefined;
1087
+ } | {
1088
+ preset: "text";
1089
+ minLength?: number | undefined;
1090
+ label?: string | undefined;
1091
+ } | {
1092
+ kinds: ("photo" | "video")[];
1093
+ preset: "media";
1094
+ maxSizeMb?: number | undefined;
1095
+ window?: {
1096
+ fromIso: string;
1097
+ toIso: string;
1098
+ } | undefined;
1099
+ geofence?: {
1100
+ lat: number;
1101
+ lng: number;
1102
+ radiusKm: number;
1103
+ } | undefined;
1104
+ label?: string | undefined;
1105
+ })[];
1106
+ anyOf?: boolean | undefined;
1107
+ } | undefined;
1108
+ checkin?: "none" | "6h" | "24h" | "72h" | "7d" | undefined;
1109
+ workerBondBp?: number | undefined;
1110
+ bounty?: {
1111
+ winners: number;
1112
+ rewardPerWinnerBaseUnits: string;
1113
+ deadlineAt: string;
1114
+ choiceWindowSeconds?: number | undefined;
1115
+ } | undefined;
1116
+ pool?: {
1117
+ rewardPerClaimBaseUnits: string;
1118
+ budgetBaseUnits: string;
1119
+ gate?: "open" | "proven" | undefined;
1120
+ verifier?: "vapi" | "poster" | undefined;
1121
+ openCheck?: "allowlist" | "invite" | "x-age" | "phone" | undefined;
1122
+ } | undefined;
1123
+ } | undefined;
1124
+ lifecycle?: {
1125
+ [x: string]: unknown;
1126
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
1127
+ milestones: {
1128
+ [x: string]: unknown;
1129
+ id: string;
1130
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
1131
+ amountBaseUnits: string;
1132
+ dueAt?: string | undefined;
1133
+ cause?: number | undefined;
1134
+ disputed?: boolean | undefined;
1135
+ disputeWinner?: number | undefined;
1136
+ summary?: string | undefined;
1137
+ }[];
1138
+ shape: "task";
1139
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
1140
+ cause?: number | undefined;
1141
+ disputed?: boolean | undefined;
1142
+ disputeWinner?: number | undefined;
1143
+ summary?: string | undefined;
1144
+ } | {
1145
+ [x: string]: unknown;
1146
+ shape: "bounty";
1147
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
1148
+ amountBaseUnits?: string | undefined;
1149
+ dueAt?: string | undefined;
1150
+ } | {
1151
+ [x: string]: unknown;
1152
+ shape: "pool";
1153
+ state: "Draft" | "Open" | "Paused" | "Closed";
1154
+ } | null | undefined;
1155
+ nextAction?: {
1156
+ [x: string]: unknown;
1157
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
1158
+ amountBaseUnits?: string | undefined;
1159
+ dueAt?: string | undefined;
1160
+ } | undefined;
525
1161
  };
526
1162
  } | {
527
1163
  [x: string]: unknown;
@@ -622,6 +1258,8 @@ export declare function fundTaskOperation(context: TaskOperationContext & {
622
1258
  approval?: TaskFundingApproval;
623
1259
  idempotencyKey?: () => string;
624
1260
  beforeChainFund?: () => void;
1261
+ fundingIntent?: unknown;
1262
+ expectedGrossBaseUnits?: bigint;
625
1263
  counterparty?: string;
626
1264
  }): Promise<{
627
1265
  ok: false;