@vapi-network/core 0.15.2 → 0.16.2

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 (86) hide show
  1. package/README.md +6 -2
  2. package/dist/agent-profile.d.ts +7 -0
  3. package/dist/agent-profile.d.ts.map +1 -1
  4. package/dist/api-key.js +4 -0
  5. package/dist/api-key.js.map +1 -1
  6. package/dist/backup.js +8 -1
  7. package/dist/backup.js.map +1 -1
  8. package/dist/cloud-backup.js +8 -1
  9. package/dist/cloud-backup.js.map +1 -1
  10. package/dist/config.d.ts +10 -0
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/index.js +109 -9
  13. package/dist/index.js.map +2 -2
  14. package/dist/router-client.js +37 -5
  15. package/dist/router-client.js.map +1 -1
  16. package/dist/secret-backend.d.ts +5 -1
  17. package/dist/secret-backend.d.ts.map +1 -1
  18. package/dist/secrets.js +6 -1
  19. package/dist/secrets.js.map +1 -1
  20. package/dist/support-report.d.ts +1 -1
  21. package/dist/swarm.d.ts.map +1 -1
  22. package/dist/tasks/actions.d.ts +1 -0
  23. package/dist/tasks/actions.d.ts.map +1 -1
  24. package/dist/tasks/availability.d.ts +21 -0
  25. package/dist/tasks/availability.d.ts.map +1 -0
  26. package/dist/tasks/ballots.d.ts +43 -0
  27. package/dist/tasks/ballots.d.ts.map +1 -0
  28. package/dist/tasks/chain-port.d.ts +26 -0
  29. package/dist/tasks/chain-port.d.ts.map +1 -1
  30. package/dist/tasks/chain.d.ts +5 -0
  31. package/dist/tasks/chain.d.ts.map +1 -1
  32. package/dist/tasks/client.d.ts +33 -3
  33. package/dist/tasks/client.d.ts.map +1 -1
  34. package/dist/tasks/funding-attempts.d.ts +58 -0
  35. package/dist/tasks/funding-attempts.d.ts.map +1 -0
  36. package/dist/tasks/funding-intent.d.ts +11 -0
  37. package/dist/tasks/funding-intent.d.ts.map +1 -0
  38. package/dist/tasks/index.d.ts +15 -2
  39. package/dist/tasks/index.d.ts.map +1 -1
  40. package/dist/tasks/money.d.ts +2 -0
  41. package/dist/tasks/money.d.ts.map +1 -1
  42. package/dist/tasks/operation-support.d.ts +21 -3
  43. package/dist/tasks/operation-support.d.ts.map +1 -1
  44. package/dist/tasks/operations.d.ts +663 -25
  45. package/dist/tasks/operations.d.ts.map +1 -1
  46. package/dist/tasks/pending-transactions.d.ts +14 -0
  47. package/dist/tasks/pending-transactions.d.ts.map +1 -1
  48. package/dist/tasks/post-options.d.ts +154 -0
  49. package/dist/tasks/post-options.d.ts.map +1 -0
  50. package/dist/tasks/types.d.ts +5505 -74
  51. package/dist/tasks/types.d.ts.map +1 -1
  52. package/dist/tasks/v2-abi.d.ts +12 -0
  53. package/dist/tasks/v2-abi.d.ts.map +1 -0
  54. package/dist/tasks/v2-abi.generated.d.ts +5966 -0
  55. package/dist/tasks/v2-abi.generated.d.ts.map +1 -0
  56. package/dist/tasks/v2-events.d.ts +6460 -0
  57. package/dist/tasks/v2-events.d.ts.map +1 -0
  58. package/dist/tasks/v2-execution.d.ts +1070 -0
  59. package/dist/tasks/v2-execution.d.ts.map +1 -0
  60. package/dist/tasks/v2-jury.d.ts +863 -0
  61. package/dist/tasks/v2-jury.d.ts.map +1 -0
  62. package/dist/tasks/v2-limits.d.ts +30 -0
  63. package/dist/tasks/v2-limits.d.ts.map +1 -0
  64. package/dist/tasks/v2-plan-guard.d.ts +102 -0
  65. package/dist/tasks/v2-plan-guard.d.ts.map +1 -0
  66. package/dist/tasks/v2-public.d.ts +154 -0
  67. package/dist/tasks/v2-public.d.ts.map +1 -0
  68. package/dist/tasks/v2-trust.d.ts +27 -0
  69. package/dist/tasks/v2-trust.d.ts.map +1 -0
  70. package/dist/tasks/v2-write.d.ts +887 -0
  71. package/dist/tasks/v2-write.d.ts.map +1 -0
  72. package/dist/tasks/v2.d.ts +847 -0
  73. package/dist/tasks/v2.d.ts.map +1 -0
  74. package/dist/tasks/verbs.d.ts +1 -1
  75. package/dist/tasks/verbs.d.ts.map +1 -1
  76. package/dist/tasks/x402-funding.d.ts +49 -0
  77. package/dist/tasks/x402-funding.d.ts.map +1 -0
  78. package/dist/tasks.js +18430 -4842
  79. package/dist/tasks.js.map +3 -3
  80. package/dist/wallet-store.d.ts +14 -1
  81. package/dist/wallet-store.d.ts.map +1 -1
  82. package/dist/x402-pay.d.ts +11 -1
  83. package/dist/x402-pay.d.ts.map +1 -1
  84. package/dist/x402.d.ts +6 -0
  85. package/dist/x402.d.ts.map +1 -1
  86. 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,12 +1258,14 @@ 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;
628
1266
  reason: "policy.perTask" | "policy.perDay";
629
1267
  money: TaskMoney;
630
- policySource: "defaults" | "agent-profile";
1268
+ policySource: "account" | "defaults" | "agent-profile";
631
1269
  policyDecision: "policy.perTask" | "policy.perDay";
632
1270
  approval?: undefined;
633
1271
  declined?: undefined;
@@ -636,7 +1274,7 @@ export declare function fundTaskOperation(context: TaskOperationContext & {
636
1274
  ok: false;
637
1275
  approval: true;
638
1276
  money: TaskMoney;
639
- policySource: "defaults" | "agent-profile";
1277
+ policySource: "account" | "defaults" | "agent-profile";
640
1278
  policyDecision: "approval";
641
1279
  reason?: undefined;
642
1280
  declined?: undefined;
@@ -645,7 +1283,7 @@ export declare function fundTaskOperation(context: TaskOperationContext & {
645
1283
  ok: false;
646
1284
  declined: true;
647
1285
  money: TaskMoney;
648
- policySource: "defaults" | "agent-profile";
1286
+ policySource: "account" | "defaults" | "agent-profile";
649
1287
  policyDecision: "declined";
650
1288
  reason?: undefined;
651
1289
  approval?: undefined;
@@ -653,7 +1291,7 @@ export declare function fundTaskOperation(context: TaskOperationContext & {
653
1291
  } | {
654
1292
  ok: true;
655
1293
  money: TaskMoney;
656
- policySource: "defaults" | "agent-profile";
1294
+ policySource: "account" | "defaults" | "agent-profile";
657
1295
  policyDecision: "ok";
658
1296
  result: import("./chain-port.js").TasksChainResult;
659
1297
  reason?: undefined;
@@ -691,7 +1329,7 @@ export declare function disputeTaskOperation(context: TaskOperationContext, inpu
691
1329
  reason: "policy.perTask" | "policy.perDay";
692
1330
  money: TaskMoney;
693
1331
  disputeFee: import("./money.js").TaskMoneyAmount;
694
- policySource: "defaults" | "agent-profile";
1332
+ policySource: "account" | "defaults" | "agent-profile";
695
1333
  policyDecision: "policy.perTask" | "policy.perDay";
696
1334
  } | {
697
1335
  ok: false;
@@ -702,7 +1340,7 @@ export declare function disputeTaskOperation(context: TaskOperationContext, inpu
702
1340
  baseUnits: string;
703
1341
  usd: string;
704
1342
  };
705
- policySource: "defaults" | "agent-profile";
1343
+ policySource: "account" | "defaults" | "agent-profile";
706
1344
  reason?: undefined;
707
1345
  } | {
708
1346
  ok: false;
@@ -713,7 +1351,7 @@ export declare function disputeTaskOperation(context: TaskOperationContext, inpu
713
1351
  baseUnits: string;
714
1352
  usd: string;
715
1353
  };
716
- policySource: "defaults" | "agent-profile";
1354
+ policySource: "account" | "defaults" | "agent-profile";
717
1355
  reason?: undefined;
718
1356
  } | {
719
1357
  ok: true;
@@ -724,7 +1362,7 @@ export declare function disputeTaskOperation(context: TaskOperationContext, inpu
724
1362
  baseUnits: string;
725
1363
  usd: string;
726
1364
  };
727
- policySource: "defaults" | "agent-profile";
1365
+ policySource: "account" | "defaults" | "agent-profile";
728
1366
  reason?: undefined;
729
1367
  }>;
730
1368
  export declare function counterEvidenceTaskOperation(context: TaskOperationContext, input: TaskFeeOperationInput): Promise<{
@@ -732,7 +1370,7 @@ export declare function counterEvidenceTaskOperation(context: TaskOperationConte
732
1370
  reason: "policy.perTask" | "policy.perDay";
733
1371
  money: TaskMoney;
734
1372
  disputeFee: import("./money.js").TaskMoneyAmount;
735
- policySource: "defaults" | "agent-profile";
1373
+ policySource: "account" | "defaults" | "agent-profile";
736
1374
  policyDecision: "policy.perTask" | "policy.perDay";
737
1375
  } | {
738
1376
  ok: false;
@@ -743,7 +1381,7 @@ export declare function counterEvidenceTaskOperation(context: TaskOperationConte
743
1381
  baseUnits: string;
744
1382
  usd: string;
745
1383
  };
746
- policySource: "defaults" | "agent-profile";
1384
+ policySource: "account" | "defaults" | "agent-profile";
747
1385
  reason?: undefined;
748
1386
  } | {
749
1387
  ok: false;
@@ -754,7 +1392,7 @@ export declare function counterEvidenceTaskOperation(context: TaskOperationConte
754
1392
  baseUnits: string;
755
1393
  usd: string;
756
1394
  };
757
- policySource: "defaults" | "agent-profile";
1395
+ policySource: "account" | "defaults" | "agent-profile";
758
1396
  reason?: undefined;
759
1397
  } | {
760
1398
  ok: true;
@@ -765,7 +1403,7 @@ export declare function counterEvidenceTaskOperation(context: TaskOperationConte
765
1403
  baseUnits: string;
766
1404
  usd: string;
767
1405
  };
768
- policySource: "defaults" | "agent-profile";
1406
+ policySource: "account" | "defaults" | "agent-profile";
769
1407
  reason?: undefined;
770
1408
  }>;
771
1409
  export declare function resolveUnmatchedTaskOperation(context: TaskOperationContext, input: {