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