@vapi-network/core 0.8.0 → 0.9.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 (89) hide show
  1. package/README.md +14 -1
  2. package/dist/agent-link.d.ts.map +1 -1
  3. package/dist/agent-link.js +6 -1
  4. package/dist/agent-link.js.map +1 -1
  5. package/dist/agent-profile.d.ts +4 -0
  6. package/dist/agent-profile.d.ts.map +1 -1
  7. package/dist/api-key.js +47 -0
  8. package/dist/api-key.js.map +1 -1
  9. package/dist/backup.d.ts +2 -0
  10. package/dist/backup.d.ts.map +1 -1
  11. package/dist/backup.js +65 -0
  12. package/dist/backup.js.map +1 -1
  13. package/dist/call-contracts-wire.d.ts +48 -12
  14. package/dist/call-contracts-wire.d.ts.map +1 -1
  15. package/dist/call-contracts.d.ts +7 -1
  16. package/dist/call-contracts.d.ts.map +1 -1
  17. package/dist/cloud-backup.js +71 -1
  18. package/dist/cloud-backup.js.map +1 -1
  19. package/dist/config.d.ts +9 -0
  20. package/dist/config.d.ts.map +1 -1
  21. package/dist/docs.d.ts +40 -0
  22. package/dist/docs.d.ts.map +1 -0
  23. package/dist/funding-policy.d.ts +29 -0
  24. package/dist/funding-policy.d.ts.map +1 -0
  25. package/dist/index.d.ts +5 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1521 -795
  28. package/dist/index.js.map +3 -3
  29. package/dist/marketplace-contracts.d.ts +22 -10
  30. package/dist/marketplace-contracts.d.ts.map +1 -1
  31. package/dist/router-client.js +230 -33
  32. package/dist/router-client.js.map +2 -2
  33. package/dist/searches.d.ts +1 -0
  34. package/dist/searches.d.ts.map +1 -1
  35. package/dist/secrets.js +29 -1
  36. package/dist/secrets.js.map +1 -1
  37. package/dist/spend-policy.d.ts +41 -7
  38. package/dist/spend-policy.d.ts.map +1 -1
  39. package/dist/support-report.d.ts +1 -1
  40. package/dist/tasks/actions.d.ts +152 -0
  41. package/dist/tasks/actions.d.ts.map +1 -0
  42. package/dist/tasks/canonical-json.d.ts +6 -0
  43. package/dist/tasks/canonical-json.d.ts.map +1 -0
  44. package/dist/tasks/chain-error.d.ts +6 -0
  45. package/dist/tasks/chain-error.d.ts.map +1 -0
  46. package/dist/tasks/chain-port.d.ts +90 -0
  47. package/dist/tasks/chain-port.d.ts.map +1 -0
  48. package/dist/tasks/chain-verification.d.ts +36 -0
  49. package/dist/tasks/chain-verification.d.ts.map +1 -0
  50. package/dist/tasks/chain.d.ts +22 -0
  51. package/dist/tasks/chain.d.ts.map +1 -0
  52. package/dist/tasks/client.d.ts +76 -0
  53. package/dist/tasks/client.d.ts.map +1 -0
  54. package/dist/tasks/delivery-manifest.d.ts +24 -0
  55. package/dist/tasks/delivery-manifest.d.ts.map +1 -0
  56. package/dist/tasks/dispute-fee.d.ts +4 -0
  57. package/dist/tasks/dispute-fee.d.ts.map +1 -0
  58. package/dist/tasks/index.d.ts +23 -0
  59. package/dist/tasks/index.d.ts.map +1 -0
  60. package/dist/tasks/money.d.ts +17 -0
  61. package/dist/tasks/money.d.ts.map +1 -0
  62. package/dist/tasks/operation-support.d.ts +127 -0
  63. package/dist/tasks/operation-support.d.ts.map +1 -0
  64. package/dist/tasks/operations.d.ts +777 -0
  65. package/dist/tasks/operations.d.ts.map +1 -0
  66. package/dist/tasks/pending-transactions.d.ts +52 -0
  67. package/dist/tasks/pending-transactions.d.ts.map +1 -0
  68. package/dist/tasks/plan-guard.d.ts +326 -0
  69. package/dist/tasks/plan-guard.d.ts.map +1 -0
  70. package/dist/tasks/rpc.d.ts +8 -0
  71. package/dist/tasks/rpc.d.ts.map +1 -0
  72. package/dist/tasks/scope-bindings.d.ts +20 -0
  73. package/dist/tasks/scope-bindings.d.ts.map +1 -0
  74. package/dist/tasks/scope-terms.d.ts +75 -0
  75. package/dist/tasks/scope-terms.d.ts.map +1 -0
  76. package/dist/tasks/trusted-deployments.d.ts +14 -0
  77. package/dist/tasks/trusted-deployments.d.ts.map +1 -0
  78. package/dist/tasks/types.d.ts +4439 -0
  79. package/dist/tasks/types.d.ts.map +1 -0
  80. package/dist/tasks/verbs.d.ts +4 -0
  81. package/dist/tasks/verbs.d.ts.map +1 -0
  82. package/dist/tasks/wait.d.ts +18 -0
  83. package/dist/tasks/wait.d.ts.map +1 -0
  84. package/dist/tasks.js +44108 -0
  85. package/dist/tasks.js.map +6 -0
  86. package/dist/transfer.d.ts.map +1 -1
  87. package/dist/x402-networks.d.ts +1 -0
  88. package/dist/x402-networks.d.ts.map +1 -1
  89. package/package.json +5 -1
@@ -0,0 +1,777 @@
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";
2
+ export type { MoneySnapshot, ProposalTerms, TaskOperationContext, TaskPolicy, TaskRoute, TaskUnlock, } from "./operation-support.js";
3
+ import { type Address } from "viem";
4
+ import { signScope, type SignScopeActionResult, type TaskDeliveryFile, type TaskFundingApproval } from "./actions.js";
5
+ import { type TasksClient } from "./client.js";
6
+ import type { PendingTransactions } from "./pending-transactions.js";
7
+ import { type TaskMoney } from "./money.js";
8
+ import { orderReceipts, type MoneySnapshot, type TaskOperationContext, type TaskPolicy, type TaskUnlock } from "./operation-support.js";
9
+ import type { BoardQuery, CreateOrderInput, CreateOrderResponse, GetOrderResponse, ProposeResponse, SubmissionProof, SubmitResponse, UploadFileInput } from "./types.js";
10
+ import type { SpendCaps } from "../config.js";
11
+ import type { WalletName } from "../wallet-name.js";
12
+ export declare function searchTasks(context: TaskOperationContext, input: {
13
+ tab?: BoardQuery["tab"];
14
+ limit?: number;
15
+ open?: boolean;
16
+ min?: bigint;
17
+ }): Promise<{
18
+ cards: {
19
+ [x: string]: unknown;
20
+ id: string;
21
+ title: string;
22
+ brief: string;
23
+ shape: "task" | "open-bounty";
24
+ amount: {
25
+ [x: string]: unknown;
26
+ gross: string;
27
+ fee: string | null;
28
+ net: string | null;
29
+ asset: "USDC";
30
+ feeBp: number | null;
31
+ } | null;
32
+ deadlineAt: string | null;
33
+ durationSeconds: number | null;
34
+ createdAt: string;
35
+ state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
36
+ poster: {
37
+ [x: string]: unknown;
38
+ address: string;
39
+ badge: {
40
+ [x: string]: unknown;
41
+ kind: "agent" | "human";
42
+ source: "none" | "agent-link" | "erc8004";
43
+ owner: {
44
+ [x: string]: unknown;
45
+ profileId: string;
46
+ label: string;
47
+ } | null;
48
+ verifiedWorker: boolean;
49
+ };
50
+ };
51
+ takers: number;
52
+ awards: number;
53
+ maxAwards: number;
54
+ proofKinds: string[];
55
+ audience: string;
56
+ receiptUrl: string | null;
57
+ }[];
58
+ pinned: {
59
+ [x: string]: unknown;
60
+ id: string;
61
+ title: string;
62
+ brief: string;
63
+ shape: "task" | "open-bounty";
64
+ amount: {
65
+ [x: string]: unknown;
66
+ gross: string;
67
+ fee: string | null;
68
+ net: string | null;
69
+ asset: "USDC";
70
+ feeBp: number | null;
71
+ } | null;
72
+ deadlineAt: string | null;
73
+ durationSeconds: number | null;
74
+ createdAt: string;
75
+ state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
76
+ poster: {
77
+ [x: string]: unknown;
78
+ address: string;
79
+ badge: {
80
+ [x: string]: unknown;
81
+ kind: "agent" | "human";
82
+ source: "none" | "agent-link" | "erc8004";
83
+ owner: {
84
+ [x: string]: unknown;
85
+ profileId: string;
86
+ label: string;
87
+ } | null;
88
+ verifiedWorker: boolean;
89
+ };
90
+ };
91
+ takers: number;
92
+ awards: number;
93
+ maxAwards: number;
94
+ proofKinds: string[];
95
+ audience: string;
96
+ receiptUrl: string | null;
97
+ } | null;
98
+ numbers: {
99
+ [x: string]: unknown;
100
+ escrowedNow: string;
101
+ paidOutAllTime: string;
102
+ tasksSettled: number;
103
+ agentsActive30d: number;
104
+ feeBp: number | null;
105
+ call?: {
106
+ [x: string]: unknown;
107
+ routedThroughVapi30d: number;
108
+ paymentsOnBase30d: number;
109
+ volumeUsdOnBase30d: string;
110
+ asOf: string;
111
+ } | null | undefined;
112
+ };
113
+ nextCursor: string | null;
114
+ }>;
115
+ export declare function postTask(context: TaskOperationContext, input: {
116
+ order: CreateOrderInput;
117
+ amount: bigint;
118
+ intake?: "proposals" | "submissions";
119
+ maxAwards?: number;
120
+ deadlineAt: string;
121
+ webhook?: string;
122
+ onFeeUnavailable?: () => void;
123
+ }): Promise<{
124
+ result: CreateOrderResponse & {
125
+ webhook?: Awaited<ReturnType<TasksClient["configureWebhook"]>>;
126
+ };
127
+ money: TaskMoney;
128
+ feeUnavailable: boolean;
129
+ unsupportedFields: string[];
130
+ postingMovesMoney: false;
131
+ }>;
132
+ export declare function proposeTask(context: TaskOperationContext, input: {
133
+ id: string;
134
+ price: bigint;
135
+ durationSeconds: number;
136
+ note: string;
137
+ unlock: TaskUnlock;
138
+ }): Promise<ProposeResponse>;
139
+ export declare function submitTask(context: TaskOperationContext, input: {
140
+ id: string;
141
+ proof: SubmissionProof[];
142
+ files: UploadFileInput[];
143
+ unlock: TaskUnlock;
144
+ }): Promise<SubmitResponse>;
145
+ export type PrivateTaskView = GetOrderResponse & {
146
+ receipts: ReturnType<typeof orderReceipts>;
147
+ receiptUrl?: string;
148
+ receiptUrlSource?: "escrow";
149
+ };
150
+ export type PublicTaskView = {
151
+ task: NonNullable<Awaited<ReturnType<TasksClient["publicTask"]>>>;
152
+ receiptUrl?: string;
153
+ receiptUrlSource?: "server";
154
+ };
155
+ export declare function showTask(context: TaskOperationContext, input: {
156
+ id: string;
157
+ signedIn: true;
158
+ }): Promise<PrivateTaskView>;
159
+ export declare function showTask(context: TaskOperationContext, input: {
160
+ id: string;
161
+ signedIn: false;
162
+ }): Promise<PublicTaskView>;
163
+ export declare function showTask(context: TaskOperationContext, input: {
164
+ id: string;
165
+ signedIn: boolean;
166
+ }): Promise<PrivateTaskView | PublicTaskView>;
167
+ export declare function taskStatus(context: TaskOperationContext, input: {
168
+ id: string;
169
+ signedIn: boolean;
170
+ }): Promise<{
171
+ task: {
172
+ id: string;
173
+ };
174
+ chainState: {
175
+ [x: string]: unknown;
176
+ workOrderId: string;
177
+ milestones: {
178
+ [x: string]: unknown;
179
+ milestoneId: string;
180
+ network: `eip155:${string}`;
181
+ escrowAddress: `0x${string}`;
182
+ explorerUrl: string | null;
183
+ read: {
184
+ [x: string]: unknown;
185
+ status: "pending";
186
+ } | {
187
+ [x: string]: unknown;
188
+ status: "confirmed";
189
+ state: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved";
190
+ resolution: "split" | "released" | "refunded" | null;
191
+ offerDeadlineAt: string | null;
192
+ workDeadlineAt: string | null;
193
+ reviewDeadlineAt: string | null;
194
+ amountBaseUnits?: string | undefined;
195
+ token?: `0x${string}` | undefined;
196
+ buyer?: `0x${string}` | undefined;
197
+ seller?: `0x${string}` | undefined;
198
+ termsHash?: `0x${string}` | undefined;
199
+ deliveryHash?: `0x${string}` | undefined;
200
+ } | {
201
+ [x: string]: unknown;
202
+ status: "mirror";
203
+ state: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved";
204
+ } | {
205
+ [x: string]: unknown;
206
+ status: "unavailable";
207
+ reason: "rpc" | "unsupported-network" | "invalid-escrow" | "frozen-terms-mismatch";
208
+ };
209
+ }[];
210
+ observedAt: string;
211
+ };
212
+ events: {
213
+ [x: string]: unknown;
214
+ sequence: number;
215
+ type: string;
216
+ at: string;
217
+ actor: string;
218
+ payload: Record<string, unknown>;
219
+ }[] | null;
220
+ nextAfter: number | null;
221
+ } | {
222
+ receiptUrl?: string | undefined;
223
+ receiptUrlSource?: "server" | undefined;
224
+ task: {
225
+ [x: string]: unknown;
226
+ id: string;
227
+ title: string;
228
+ brief: string;
229
+ shape: "task" | "open-bounty";
230
+ amount: {
231
+ [x: string]: unknown;
232
+ gross: string;
233
+ fee: string | null;
234
+ net: string | null;
235
+ asset: "USDC";
236
+ feeBp: number | null;
237
+ } | null;
238
+ deadlineAt: string | null;
239
+ durationSeconds: number | null;
240
+ createdAt: string;
241
+ state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
242
+ poster: {
243
+ [x: string]: unknown;
244
+ address: string;
245
+ badge: {
246
+ [x: string]: unknown;
247
+ kind: "agent" | "human";
248
+ source: "none" | "agent-link" | "erc8004";
249
+ owner: {
250
+ [x: string]: unknown;
251
+ profileId: string;
252
+ label: string;
253
+ } | null;
254
+ verifiedWorker: boolean;
255
+ };
256
+ };
257
+ takers: number;
258
+ awards: number;
259
+ maxAwards: number;
260
+ proofKinds: string[];
261
+ audience: string;
262
+ receiptUrl: string | null;
263
+ briefFull: string;
264
+ children: {
265
+ [x: string]: unknown;
266
+ orderId: string;
267
+ worker: {
268
+ [x: string]: unknown;
269
+ address: string;
270
+ badge: {
271
+ [x: string]: unknown;
272
+ kind: "agent" | "human";
273
+ source: "none" | "agent-link" | "erc8004";
274
+ owner: {
275
+ [x: string]: unknown;
276
+ profileId: string;
277
+ label: string;
278
+ } | null;
279
+ verifiedWorker: boolean;
280
+ };
281
+ };
282
+ state: "paid" | "expired" | "open" | "disputed" | "funded" | "delivered" | "refunded" | "awarded" | "closed";
283
+ receiptUrl: string | null;
284
+ }[];
285
+ };
286
+ chainState?: undefined;
287
+ events?: undefined;
288
+ nextAfter?: undefined;
289
+ }>;
290
+ export declare function awardTask(context: TaskOperationContext, input: {
291
+ id: string;
292
+ proposalId: string;
293
+ }): Promise<{
294
+ [x: string]: unknown;
295
+ workOrder: {
296
+ [x: string]: unknown;
297
+ version: "work-order-view-v1";
298
+ id: string;
299
+ state: "cancelled" | "open" | "awarded" | "completed";
300
+ title: string;
301
+ description: string;
302
+ policyFamily: "general-digital" | "software-api" | "research-data" | "design-content";
303
+ listingDeliveryTimeSeconds: number | null;
304
+ clientAddress: `0x${string}`;
305
+ invitedProviderAddress: `0x${string}` | null;
306
+ acceptedProposalId: string | null;
307
+ threadId: string | null;
308
+ role: "client" | "provider" | "proposer";
309
+ canFinalize: boolean;
310
+ proposals: {
311
+ [x: string]: unknown;
312
+ id: string;
313
+ workOrderId: string;
314
+ providerAddress: `0x${string}`;
315
+ state: "pending" | "rejected" | "accepted";
316
+ signedPayload: {
317
+ [x: string]: unknown;
318
+ version: "work-proposal-v1";
319
+ workOrderId: string;
320
+ providerAddress: `0x${string}`;
321
+ pricingModel: "fixed";
322
+ milestones: {
323
+ version: "work-milestone-terms-v1";
324
+ title: string;
325
+ description: string;
326
+ acceptanceCriteria: string[];
327
+ acceptanceWindowSeconds: number;
328
+ escrow: {
329
+ protocol: "escrow-v1";
330
+ contract: `0x${string}`;
331
+ };
332
+ evidenceRules: {
333
+ acceptedInputs: ("text" | "private-file" | "git-commit")[];
334
+ exactCommitRequired: boolean;
335
+ };
336
+ budget: {
337
+ network: `eip155:${number}`;
338
+ asset: string;
339
+ amountBaseUnits: string;
340
+ };
341
+ workDurationSeconds?: number | undefined;
342
+ }[];
343
+ kind?: "proposal" | "submission" | undefined;
344
+ proof?: ({
345
+ kind: "url";
346
+ value: string;
347
+ label?: string | undefined;
348
+ } | {
349
+ kind: "file";
350
+ value: string;
351
+ label?: string | undefined;
352
+ })[] | undefined;
353
+ };
354
+ signature: string;
355
+ signatureHash: `0x${string}`;
356
+ proposedMilestones: {
357
+ version: "work-milestone-terms-v1";
358
+ title: string;
359
+ description: string;
360
+ acceptanceCriteria: string[];
361
+ acceptanceWindowSeconds: number;
362
+ escrow: {
363
+ protocol: "escrow-v1";
364
+ contract: `0x${string}`;
365
+ };
366
+ evidenceRules: {
367
+ acceptedInputs: ("text" | "private-file" | "git-commit")[];
368
+ exactCommitRequired: boolean;
369
+ };
370
+ budget: {
371
+ network: `eip155:${number}`;
372
+ asset: string;
373
+ amountBaseUnits: string;
374
+ };
375
+ workDurationSeconds?: number | undefined;
376
+ }[];
377
+ acceptedAt: string | null;
378
+ createdAt: string;
379
+ updatedAt: string;
380
+ }[];
381
+ milestones: {
382
+ [x: string]: unknown;
383
+ id: string;
384
+ workOrderId: string;
385
+ ordinal: number;
386
+ state: "released" | "agreed" | "funding" | "funded" | "delivering" | "delivered" | "evaluating" | "refunded";
387
+ terms: {
388
+ version: "work-milestone-terms-v1";
389
+ title: string;
390
+ description: string;
391
+ acceptanceCriteria: string[];
392
+ acceptanceWindowSeconds: number;
393
+ escrow: {
394
+ protocol: "escrow-v1";
395
+ contract: `0x${string}`;
396
+ };
397
+ evidenceRules: {
398
+ acceptedInputs: ("text" | "private-file" | "git-commit")[];
399
+ exactCommitRequired: boolean;
400
+ };
401
+ budget: {
402
+ network: `eip155:${number}`;
403
+ asset: string;
404
+ amountBaseUnits: string;
405
+ };
406
+ workDurationSeconds?: number | undefined;
407
+ };
408
+ termsHash: `0x${string}`;
409
+ termsFrozenAt: string;
410
+ network: `eip155:${number}`;
411
+ asset: string;
412
+ amountBaseUnits: string;
413
+ escrowProtocol: "escrow-v1";
414
+ escrowContract: `0x${string}`;
415
+ escrowState: "created" | "expired" | "submitted" | "locked" | "disputed" | "resolved" | null;
416
+ resolution: "split" | "release" | "refund" | null;
417
+ offerDeadlineAt: string | null;
418
+ workDeadlineAt: string | null;
419
+ acceptanceDeadlineAt: string | null;
420
+ dispute: {
421
+ [x: string]: unknown;
422
+ id: string;
423
+ state: "evidence" | "open" | "resolvable" | "executed";
424
+ network: string;
425
+ escrowAddress: `0x${string}`;
426
+ raisedByRole: "client" | "vendor";
427
+ raisedByAddress: `0x${string}`;
428
+ evidenceHash: `0x${string}`;
429
+ evidenceDeadlineAt: string;
430
+ reviewers: {
431
+ [x: string]: unknown;
432
+ address: `0x${string}`;
433
+ vote: {
434
+ [x: string]: unknown;
435
+ outcome: "split" | "release" | "refund";
436
+ txHash: `0x${string}`;
437
+ votedAt: string;
438
+ } | null;
439
+ }[];
440
+ outcome: "split" | "release" | "refund" | null;
441
+ executedTxHash: `0x${string}` | null;
442
+ resolvedAt: string | null;
443
+ } | null;
444
+ chainOperation: {
445
+ [x: string]: unknown;
446
+ id: string;
447
+ kind: "escrow-funding" | "escrow-create" | "escrow-delivery" | "escrow-release" | "escrow-dispute" | "escrow-counter-evidence" | "escrow-unmatched-resolution" | "escrow-vote" | "escrow-finalize" | "vendor-credential-mint";
448
+ state: "confirmed" | "prepared" | "submitted";
449
+ step: "create-escrow" | "approve-usdc" | "deposit-funds" | "fund-with-authorization" | "submit-delivery" | "release-funds" | "refund-buyer" | "raise-dispute" | "submit-counter-evidence" | "resolve-unmatched-dispute" | "timeout-refund" | "finalize" | "vote-dispute" | "mint-vendor-credential";
450
+ expectedActor: `0x${string}` | null;
451
+ transactionHash: `0x${string}` | null;
452
+ plan: {
453
+ [x: string]: unknown;
454
+ version: "work-transaction-plan-v2";
455
+ operationId: string;
456
+ step: "create-escrow" | "approve-usdc" | "deposit-funds" | "fund-with-authorization" | "submit-delivery" | "release-funds" | "refund-buyer" | "raise-dispute" | "submit-counter-evidence" | "resolve-unmatched-dispute" | "timeout-refund" | "finalize" | "vote-dispute" | "mint-vendor-credential" | "register-erc8004";
457
+ chainId: number;
458
+ network: `eip155:${string}`;
459
+ from: `0x${string}`;
460
+ to: `0x${string}`;
461
+ data: `0x${string}`;
462
+ value: "0";
463
+ } | null;
464
+ } | null;
465
+ artifact: {
466
+ [x: string]: unknown;
467
+ digest: `0x${string}`;
468
+ } | null;
469
+ fundingTxHash: `0x${string}` | null;
470
+ settlementTxHash: `0x${string}` | null;
471
+ fundedAt: string | null;
472
+ deliveredAt: string | null;
473
+ settledAt: string | null;
474
+ createdAt: string;
475
+ updatedAt: string;
476
+ delivery?: {
477
+ [x: string]: unknown;
478
+ id: string;
479
+ version: number;
480
+ note: string;
481
+ manifest: {
482
+ [x: string]: unknown;
483
+ files: {
484
+ [x: string]: unknown;
485
+ fileId: string;
486
+ fileName: string;
487
+ sha256: string;
488
+ sizeBytes: number;
489
+ }[];
490
+ noteSha256: string;
491
+ };
492
+ manifestHash: `0x${string}`;
493
+ submittedAt: string;
494
+ } | null | undefined;
495
+ }[];
496
+ events: {
497
+ [x: string]: unknown;
498
+ id: string;
499
+ sequence: number;
500
+ type: string;
501
+ actor: string;
502
+ milestoneId: string | null;
503
+ payload: import("zod").JSONType;
504
+ txHash: `0x${string}` | null;
505
+ createdAt: string;
506
+ }[];
507
+ review: {
508
+ [x: string]: unknown;
509
+ id: string;
510
+ workOrderId: string;
511
+ clientAddress: `0x${string}`;
512
+ vendorProfileId: string;
513
+ rating: number;
514
+ body: string;
515
+ subRatings: import("zod").JSONType;
516
+ vendorResponse: string | null;
517
+ vendorRespondedAt: string | null;
518
+ createdAt: string;
519
+ updatedAt: string;
520
+ } | null;
521
+ publishedAt: string | null;
522
+ completedAt: string | null;
523
+ createdAt: string;
524
+ updatedAt: string;
525
+ };
526
+ } | {
527
+ [x: string]: unknown;
528
+ childOrderId: string;
529
+ awards: number;
530
+ maxAwards: number;
531
+ parentState: "open" | "completed";
532
+ }>;
533
+ export declare function messageTask(context: TaskOperationContext, input: {
534
+ id: string;
535
+ body: string;
536
+ }): Promise<{
537
+ [x: string]: unknown;
538
+ message: {
539
+ [x: string]: unknown;
540
+ id: string;
541
+ threadId: string;
542
+ senderProfileId: string;
543
+ senderRole: "client" | "provider" | "reviewer";
544
+ kind: "text" | "system" | "order-pin" | "scope-pin" | "delivery-pin";
545
+ body: string;
546
+ refType: string | null;
547
+ refId: string | null;
548
+ workOrderId: string | null;
549
+ orderId: string;
550
+ seq: number;
551
+ createdAt: string;
552
+ attachments: {
553
+ [x: string]: unknown;
554
+ id: string;
555
+ fileName: string;
556
+ mimeType: string;
557
+ sizeBytes: number;
558
+ }[];
559
+ };
560
+ }>;
561
+ export declare function threadTask(context: TaskOperationContext, input: {
562
+ id: string;
563
+ cursor?: number;
564
+ }): Promise<{
565
+ [x: string]: unknown;
566
+ messages: {
567
+ [x: string]: unknown;
568
+ id: string;
569
+ threadId: string;
570
+ senderProfileId: string;
571
+ senderRole: "client" | "provider" | "reviewer";
572
+ kind: "text" | "system" | "order-pin" | "scope-pin" | "delivery-pin";
573
+ body: string;
574
+ refType: string | null;
575
+ refId: string | null;
576
+ workOrderId: string | null;
577
+ orderId: string;
578
+ seq: number;
579
+ createdAt: string;
580
+ attachments: {
581
+ [x: string]: unknown;
582
+ id: string;
583
+ fileName: string;
584
+ mimeType: string;
585
+ sizeBytes: number;
586
+ }[];
587
+ }[];
588
+ page: {
589
+ [x: string]: unknown;
590
+ nextBeforeSeq: number | null;
591
+ };
592
+ }>;
593
+ export declare function signTaskScope(context: TaskOperationContext, input: {
594
+ id: string;
595
+ counterparty?: string;
596
+ signerAddress?: Address;
597
+ signMessage: (message: string) => Promise<`0x${string}`>;
598
+ bindings?: Parameters<typeof signScope>[0]["bindings"];
599
+ onTerms?: Parameters<typeof signScope>[0]["onTerms"];
600
+ }): Promise<SignScopeActionResult>;
601
+ export declare function deliverTaskOperation(context: TaskOperationContext, input: {
602
+ id: string;
603
+ files: TaskDeliveryFile[];
604
+ counterparty?: string;
605
+ note: string;
606
+ onPrepared?: (manifestHash: `0x${string}`) => void;
607
+ }): Promise<{
608
+ ok: true;
609
+ manifestHash: `0x${string}`;
610
+ result: import("./chain-port.js").TasksChainResult;
611
+ }>;
612
+ export declare function fundTaskOperation(context: TaskOperationContext & {
613
+ pending?: PendingTransactions;
614
+ }, input: {
615
+ id: string;
616
+ snapshot?: MoneySnapshot;
617
+ policy: TaskPolicy;
618
+ caps: SpendCaps;
619
+ wallet: WalletName;
620
+ ledgerPath: string;
621
+ now: () => Date;
622
+ approval?: TaskFundingApproval;
623
+ idempotencyKey?: () => string;
624
+ beforeChainFund?: () => void;
625
+ counterparty?: string;
626
+ }): Promise<{
627
+ ok: false;
628
+ reason: "policy.perTask" | "policy.perDay";
629
+ money: TaskMoney;
630
+ policySource: "defaults" | "agent-profile";
631
+ policyDecision: "policy.perTask" | "policy.perDay";
632
+ approval?: undefined;
633
+ declined?: undefined;
634
+ result?: undefined;
635
+ } | {
636
+ ok: false;
637
+ approval: true;
638
+ money: TaskMoney;
639
+ policySource: "defaults" | "agent-profile";
640
+ policyDecision: "approval";
641
+ reason?: undefined;
642
+ declined?: undefined;
643
+ result?: undefined;
644
+ } | {
645
+ ok: false;
646
+ declined: true;
647
+ money: TaskMoney;
648
+ policySource: "defaults" | "agent-profile";
649
+ policyDecision: "declined";
650
+ reason?: undefined;
651
+ approval?: undefined;
652
+ result?: undefined;
653
+ } | {
654
+ ok: true;
655
+ money: TaskMoney;
656
+ policySource: "defaults" | "agent-profile";
657
+ policyDecision: "ok";
658
+ result: import("./chain-port.js").TasksChainResult;
659
+ reason?: undefined;
660
+ approval?: undefined;
661
+ declined?: undefined;
662
+ }>;
663
+ export declare function releaseTaskOperation(context: TaskOperationContext, input: {
664
+ id: string;
665
+ snapshot?: MoneySnapshot;
666
+ escrowId?: string;
667
+ counterparty?: string;
668
+ }): Promise<import("./actions.js").TaskMoneyResult>;
669
+ export declare function refundTaskOperation(context: TaskOperationContext, input: {
670
+ id: string;
671
+ snapshot?: MoneySnapshot;
672
+ escrowId?: string;
673
+ counterparty?: string;
674
+ }): Promise<import("./actions.js").TaskMoneyResult>;
675
+ export type TaskFeeOperationInput = {
676
+ id: string;
677
+ snapshot?: MoneySnapshot;
678
+ escrowId?: string;
679
+ counterparty?: string;
680
+ evidenceHash: string;
681
+ policy: TaskPolicy;
682
+ caps: SpendCaps;
683
+ wallet: WalletName;
684
+ ledgerPath: string;
685
+ now: () => Date;
686
+ approval?: TaskFundingApproval;
687
+ onFee?: (fee: bigint) => void;
688
+ };
689
+ export declare function disputeTaskOperation(context: TaskOperationContext, input: TaskFeeOperationInput): Promise<{
690
+ ok: false;
691
+ reason: "policy.perTask" | "policy.perDay";
692
+ money: TaskMoney;
693
+ disputeFee: import("./money.js").TaskMoneyAmount;
694
+ policySource: "defaults" | "agent-profile";
695
+ policyDecision: "policy.perTask" | "policy.perDay";
696
+ } | {
697
+ ok: false;
698
+ approval: true;
699
+ policyDecision: "approval";
700
+ money: TaskMoney;
701
+ disputeFee: {
702
+ baseUnits: string;
703
+ usd: string;
704
+ };
705
+ policySource: "defaults" | "agent-profile";
706
+ reason?: undefined;
707
+ } | {
708
+ ok: false;
709
+ declined: true;
710
+ policyDecision: "declined";
711
+ money: TaskMoney;
712
+ disputeFee: {
713
+ baseUnits: string;
714
+ usd: string;
715
+ };
716
+ policySource: "defaults" | "agent-profile";
717
+ reason?: undefined;
718
+ } | {
719
+ ok: true;
720
+ result: import("./chain-port.js").TasksChainResult;
721
+ policyDecision: "ok";
722
+ money: TaskMoney;
723
+ disputeFee: {
724
+ baseUnits: string;
725
+ usd: string;
726
+ };
727
+ policySource: "defaults" | "agent-profile";
728
+ reason?: undefined;
729
+ }>;
730
+ export declare function counterEvidenceTaskOperation(context: TaskOperationContext, input: TaskFeeOperationInput): Promise<{
731
+ ok: false;
732
+ reason: "policy.perTask" | "policy.perDay";
733
+ money: TaskMoney;
734
+ disputeFee: import("./money.js").TaskMoneyAmount;
735
+ policySource: "defaults" | "agent-profile";
736
+ policyDecision: "policy.perTask" | "policy.perDay";
737
+ } | {
738
+ ok: false;
739
+ approval: true;
740
+ policyDecision: "approval";
741
+ money: TaskMoney;
742
+ disputeFee: {
743
+ baseUnits: string;
744
+ usd: string;
745
+ };
746
+ policySource: "defaults" | "agent-profile";
747
+ reason?: undefined;
748
+ } | {
749
+ ok: false;
750
+ declined: true;
751
+ policyDecision: "declined";
752
+ money: TaskMoney;
753
+ disputeFee: {
754
+ baseUnits: string;
755
+ usd: string;
756
+ };
757
+ policySource: "defaults" | "agent-profile";
758
+ reason?: undefined;
759
+ } | {
760
+ ok: true;
761
+ result: import("./chain-port.js").TasksChainResult;
762
+ policyDecision: "ok";
763
+ money: TaskMoney;
764
+ disputeFee: {
765
+ baseUnits: string;
766
+ usd: string;
767
+ };
768
+ policySource: "defaults" | "agent-profile";
769
+ reason?: undefined;
770
+ }>;
771
+ export declare function resolveUnmatchedTaskOperation(context: TaskOperationContext, input: {
772
+ id: string;
773
+ snapshot?: MoneySnapshot;
774
+ escrowId?: string;
775
+ counterparty?: string;
776
+ }): Promise<import("./actions.js").TaskMoneyResult>;
777
+ //# sourceMappingURL=operations.d.ts.map