@vapi-network/core 0.15.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/agent-link.js +73 -7
- package/dist/agent-link.js.map +1 -1
- package/dist/atomic-file.d.ts +1 -0
- package/dist/atomic-file.d.ts.map +1 -1
- package/dist/backup.js +6 -4
- package/dist/backup.js.map +1 -1
- package/dist/cloud-backup.js +79 -11
- package/dist/cloud-backup.js.map +2 -2
- package/dist/index.js +126 -16
- package/dist/index.js.map +2 -2
- package/dist/net-guard.d.ts +17 -0
- package/dist/net-guard.d.ts.map +1 -1
- package/dist/router-client.js +110 -16
- package/dist/router-client.js.map +2 -2
- package/dist/secrets.js +19 -8
- package/dist/secrets.js.map +1 -1
- package/dist/support-report.d.ts +1 -1
- package/dist/tasks/actions.d.ts +1 -0
- package/dist/tasks/actions.d.ts.map +1 -1
- package/dist/tasks/ballots.d.ts +43 -0
- package/dist/tasks/ballots.d.ts.map +1 -0
- package/dist/tasks/chain-port.d.ts +26 -0
- package/dist/tasks/chain-port.d.ts.map +1 -1
- package/dist/tasks/chain.d.ts +5 -0
- package/dist/tasks/chain.d.ts.map +1 -1
- package/dist/tasks/client.d.ts +33 -3
- package/dist/tasks/client.d.ts.map +1 -1
- package/dist/tasks/funding-attempts.d.ts +58 -0
- package/dist/tasks/funding-attempts.d.ts.map +1 -0
- package/dist/tasks/funding-intent.d.ts +11 -0
- package/dist/tasks/funding-intent.d.ts.map +1 -0
- package/dist/tasks/index.d.ts +13 -2
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/money.d.ts +2 -0
- package/dist/tasks/money.d.ts.map +1 -1
- package/dist/tasks/operation-support.d.ts +10 -2
- package/dist/tasks/operation-support.d.ts.map +1 -1
- package/dist/tasks/operations.d.ts +651 -13
- package/dist/tasks/operations.d.ts.map +1 -1
- package/dist/tasks/pending-transactions.d.ts +11 -0
- package/dist/tasks/pending-transactions.d.ts.map +1 -1
- package/dist/tasks/post-options.d.ts +144 -0
- package/dist/tasks/post-options.d.ts.map +1 -0
- package/dist/tasks/types.d.ts +5505 -74
- package/dist/tasks/types.d.ts.map +1 -1
- package/dist/tasks/v2-abi.d.ts +12 -0
- package/dist/tasks/v2-abi.d.ts.map +1 -0
- package/dist/tasks/v2-abi.generated.d.ts +5966 -0
- package/dist/tasks/v2-abi.generated.d.ts.map +1 -0
- package/dist/tasks/v2-events.d.ts +6460 -0
- package/dist/tasks/v2-events.d.ts.map +1 -0
- package/dist/tasks/v2-execution.d.ts +1070 -0
- package/dist/tasks/v2-execution.d.ts.map +1 -0
- package/dist/tasks/v2-jury.d.ts +863 -0
- package/dist/tasks/v2-jury.d.ts.map +1 -0
- package/dist/tasks/v2-plan-guard.d.ts +100 -0
- package/dist/tasks/v2-plan-guard.d.ts.map +1 -0
- package/dist/tasks/v2-public.d.ts +154 -0
- package/dist/tasks/v2-public.d.ts.map +1 -0
- package/dist/tasks/v2-trust.d.ts +27 -0
- package/dist/tasks/v2-trust.d.ts.map +1 -0
- package/dist/tasks/v2-write.d.ts +886 -0
- package/dist/tasks/v2-write.d.ts.map +1 -0
- package/dist/tasks/v2.d.ts +847 -0
- package/dist/tasks/v2.d.ts.map +1 -0
- package/dist/tasks/verbs.d.ts +1 -1
- package/dist/tasks/verbs.d.ts.map +1 -1
- package/dist/tasks/x402-funding.d.ts +49 -0
- package/dist/tasks/x402-funding.d.ts.map +1 -0
- package/dist/tasks.js +17541 -4184
- package/dist/tasks.js.map +3 -3
- package/dist/x402-pay.d.ts +11 -1
- package/dist/x402-pay.d.ts.map +1 -1
- package/dist/x402.d.ts +6 -0
- package/dist/x402.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-jury.d.ts","sourceRoot":"","sources":["../../src/tasks/v2-jury.ts"],"names":[],"mappings":"AASA,OAAO,EASL,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBzE;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;kBAoB9B,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAqGpE;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,OAAO,GAAG,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA3BV,GAAG;gBAAU,GAAG;cAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6ErD;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,YAAY,CAAC;IAC1C,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;;;;;;;;;;;;;;;;;;;;GA0EA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type Abi, type Address, type Hex, type PublicClient } from "viem";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type TasksV2Deployment } from "./v2-trust.js";
|
|
4
|
+
import { taskV2IntentSchema, type TaskV2Action, type TaskV2Consent, type TaskV2Operation, type TaskV2Prepared } from "./v2-write.js";
|
|
5
|
+
import type { TasksChainOptions } from "./chain.js";
|
|
6
|
+
import type { GetOrderResponse } from "./types.js";
|
|
7
|
+
/** IEscrowV2.Terms as EscrowV2Base.terms() returns it and the factory takes it. */
|
|
8
|
+
declare const escrowTermsSchema: z.ZodObject<{
|
|
9
|
+
shape: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>, z.ZodNumber>;
|
|
10
|
+
poster: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
11
|
+
worker: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
12
|
+
termsHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
13
|
+
offerTtl: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
14
|
+
reviewWindow: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
15
|
+
choiceWindow: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
16
|
+
bountyDeadline: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
17
|
+
objectionWindow: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
18
|
+
workerBondBp: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>, z.ZodNumber>;
|
|
19
|
+
feeBp: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>, z.ZodNumber>;
|
|
20
|
+
winners: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>, z.ZodNumber>;
|
|
21
|
+
rewardPerWinner: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type V2EscrowTerms = z.output<typeof escrowTermsSchema>;
|
|
24
|
+
export declare const v2GuardFailure: (message: string) => never;
|
|
25
|
+
export declare function v2Read(rpc: PublicClient, contract: Address, abi: Abi, functionName: string, args?: readonly unknown[]): Promise<unknown>;
|
|
26
|
+
export type VerifiedV2Target = {
|
|
27
|
+
chainId: number;
|
|
28
|
+
pin: TasksV2Deployment;
|
|
29
|
+
rpc: PublicClient;
|
|
30
|
+
escrow: Address;
|
|
31
|
+
factory: Address;
|
|
32
|
+
pool: boolean;
|
|
33
|
+
/** A BountyEscrowV2 clone (task shape 1). */
|
|
34
|
+
bounty: boolean;
|
|
35
|
+
/** The clone ABI every participant step on this target decodes against. */
|
|
36
|
+
abi: Abi;
|
|
37
|
+
poster: Address;
|
|
38
|
+
worker?: Address;
|
|
39
|
+
total: bigint;
|
|
40
|
+
feeBp: number;
|
|
41
|
+
termsHash: Hex;
|
|
42
|
+
/** Verified escrow terms: the registered clone's terms(), or accepted creation terms. */
|
|
43
|
+
terms?: V2EscrowTerms;
|
|
44
|
+
milestones: Array<{
|
|
45
|
+
amount: bigint;
|
|
46
|
+
deadline: bigint;
|
|
47
|
+
status: number;
|
|
48
|
+
}>;
|
|
49
|
+
/** Exact factory prediction inputs (predictEscrow / predictBountyEscrow / predictPool). */
|
|
50
|
+
creationArgs?: readonly unknown[];
|
|
51
|
+
};
|
|
52
|
+
export declare function acceptedV2TermsHash(view: GetOrderResponse, pin: TasksV2Deployment, reviewWindow: bigint): `0x${string}`;
|
|
53
|
+
/** The API supplies candidates; only local pins and trusted RPC reads establish trust. */
|
|
54
|
+
export declare function verifyV2Target(options: TasksChainOptions,
|
|
55
|
+
/** A hosted response, or only the hosted chain ID before any plan exists (ballot sealing). */
|
|
56
|
+
current: TaskV2Prepared | {
|
|
57
|
+
chainId: number;
|
|
58
|
+
}, view: GetOrderResponse, action: TaskV2Action | TaskV2Consent, knownTarget?: Address): Promise<VerifiedV2Target>;
|
|
59
|
+
export declare function verifyV2TypedData(target: VerifiedV2Target, intent: z.infer<typeof taskV2IntentSchema>, action: TaskV2Action | TaskV2Consent, signer: Address, pays: bigint): Promise<undefined>;
|
|
60
|
+
export declare const V2_RESOLVER_ACTIONS: readonly ["open-jury", "draw-jury", "rearm-draw", "resolve", "commit-vote", "reveal-vote"];
|
|
61
|
+
export type TaskV2ResolverAction = Extract<TaskV2Action, {
|
|
62
|
+
action: (typeof V2_RESOLVER_ACTIONS)[number];
|
|
63
|
+
}>;
|
|
64
|
+
export declare function isV2ResolverAction(action: TaskV2Action | TaskV2Consent): action is TaskV2ResolverAction;
|
|
65
|
+
/**
|
|
66
|
+
* The resolver trust chain: DISPUTE_RESOLVER() is an immutable on the clone that
|
|
67
|
+
* verifyV2Target proved against the pinned factory. A local resolver pin must agree.
|
|
68
|
+
*/
|
|
69
|
+
export declare function verifiedV2Resolver(target: VerifiedV2Target): Promise<`0x${string}`>;
|
|
70
|
+
/**
|
|
71
|
+
* The agreed worker bond, exactly as EscrowV2.award collects it: the verified clone's
|
|
72
|
+
* totalPrincipal() × its terms().workerBondBp / 10,000. The on-chain rate must equal the
|
|
73
|
+
* accepted order terms; a hosted rate is never used.
|
|
74
|
+
*/
|
|
75
|
+
export declare function acceptedV2WorkerBond(target: VerifiedV2Target, view: GetOrderResponse): bigint;
|
|
76
|
+
/** Decode every step, bind selector/arguments/destination to the requested action. */
|
|
77
|
+
export declare function verifyV2Plan(target: VerifiedV2Target, op: TaskV2Operation, action: TaskV2Action | TaskV2Consent, pays: bigint, fundingAuthorization?: {
|
|
78
|
+
message: Record<string, unknown>;
|
|
79
|
+
signature: Hex;
|
|
80
|
+
}): Promise<void>;
|
|
81
|
+
/** The current round of a milestone's dispute, read from the verified escrow's own resolver. */
|
|
82
|
+
export declare function verifiedV2Case(target: VerifiedV2Target, i: number): Promise<{
|
|
83
|
+
resolver: `0x${string}`;
|
|
84
|
+
data: {
|
|
85
|
+
[x: string]: unknown;
|
|
86
|
+
state: number;
|
|
87
|
+
raisedBy: `0x${string}`;
|
|
88
|
+
evidenceDeadline: bigint;
|
|
89
|
+
commitDeadline: bigint;
|
|
90
|
+
revealDeadline: bigint;
|
|
91
|
+
drawBlock: bigint;
|
|
92
|
+
rearms: number;
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
95
|
+
export declare function verifyUnmatchedSettlement(target: VerifiedV2Target, i: number, dispute: unknown): Promise<{
|
|
96
|
+
gross: bigint;
|
|
97
|
+
toWorker: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=v2-plan-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-plan-guard.d.ts","sourceRoot":"","sources":["../../src/tasks/v2-plan-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,YAAY,EAGlB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EACL,kBAAkB,EAElB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY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AAM,EAAE,gBAAgB,EAAE,CAAC,EAAE,MAAM;;;;;;;;;;;;GAQvE;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,gBAAgB,EACxB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,OAAO;;;GAqBjB"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { TaskOperationError } from "./operation-support.js";
|
|
2
|
+
import type { TaskLifecycle, TaskNextAction } from "./v2.js";
|
|
3
|
+
import type { TaskV2Action, TaskV2Consent, TaskV2Operation } from "./v2-write.js";
|
|
4
|
+
/** Reveal calldata carries the vote and its salt; it is signed and broadcast, never echoed. */
|
|
5
|
+
export declare const TASK_V2_REDACTED_CALLDATA = "[redacted: reveal calldata]";
|
|
6
|
+
/** Steps whose hosted request or calldata is tied to a sealed ballot. */
|
|
7
|
+
export declare const TASK_V2_SECRET_STEPS: readonly string[];
|
|
8
|
+
export declare function isTaskV2SecretAction(action: Pick<TaskV2Action | TaskV2Consent, "action">): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The operation fields a caller may see. Reveal calldata is redacted by its step or by its
|
|
11
|
+
* selector, so a hosted operation that names another step still never shows a ballot.
|
|
12
|
+
*/
|
|
13
|
+
export declare function publicTaskV2Operation(op: TaskV2Operation, secret?: boolean): TaskV2Operation;
|
|
14
|
+
/** The public projection of an operation-shaped value, or undefined when it is not one. */
|
|
15
|
+
export declare function publicTaskV2OperationOf(value: unknown, secret?: boolean): {
|
|
16
|
+
id: string;
|
|
17
|
+
kind: "tasks-v2-write";
|
|
18
|
+
state: "confirmed" | "prepared" | "submitted" | "abandoned";
|
|
19
|
+
step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
|
|
20
|
+
expectedActor: `0x${string}`;
|
|
21
|
+
transactionHash: `0x${string}` | null;
|
|
22
|
+
plan: {
|
|
23
|
+
version: "work-transaction-plan-v2";
|
|
24
|
+
operationId: string;
|
|
25
|
+
step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
|
|
26
|
+
chainId: number;
|
|
27
|
+
network: string;
|
|
28
|
+
from: `0x${string}`;
|
|
29
|
+
to: `0x${string}`;
|
|
30
|
+
data: `0x${string}`;
|
|
31
|
+
value: "0";
|
|
32
|
+
};
|
|
33
|
+
} | undefined;
|
|
34
|
+
/** Hosted recovery and abandon responses, reduced to their documented fields. */
|
|
35
|
+
export declare function publicTaskV2Recovery(response: {
|
|
36
|
+
orderId: string;
|
|
37
|
+
operation?: TaskV2Operation | null;
|
|
38
|
+
recovered?: boolean;
|
|
39
|
+
scanComplete?: boolean;
|
|
40
|
+
outcome?: "abandoned" | "recovered" | "scanning";
|
|
41
|
+
}, step: string): {
|
|
42
|
+
outcome?: "recovered" | "abandoned" | "scanning" | undefined;
|
|
43
|
+
scanComplete?: boolean | undefined;
|
|
44
|
+
recovered?: boolean | undefined;
|
|
45
|
+
operation?: {
|
|
46
|
+
id: string;
|
|
47
|
+
kind: "tasks-v2-write";
|
|
48
|
+
state: "confirmed" | "prepared" | "submitted" | "abandoned";
|
|
49
|
+
step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
|
|
50
|
+
expectedActor: `0x${string}`;
|
|
51
|
+
transactionHash: `0x${string}` | null;
|
|
52
|
+
plan: {
|
|
53
|
+
version: "work-transaction-plan-v2";
|
|
54
|
+
operationId: string;
|
|
55
|
+
step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
|
|
56
|
+
chainId: number;
|
|
57
|
+
network: string;
|
|
58
|
+
from: `0x${string}`;
|
|
59
|
+
to: `0x${string}`;
|
|
60
|
+
data: `0x${string}`;
|
|
61
|
+
value: "0";
|
|
62
|
+
};
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
orderId: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The documented lifecycle fields (shape, state, substate, amount, due date and each
|
|
68
|
+
* milestone's id, status, amount and due date). Hosted lifecycle and next-action objects are
|
|
69
|
+
* loose on the wire, so a nested unknown field (for example an echoed `debug` with the
|
|
70
|
+
* ballot) would otherwise reach SDK results, CLI JSON and MCP results.
|
|
71
|
+
*/
|
|
72
|
+
export declare function publicTaskLifecycle(value: unknown): TaskLifecycle | null;
|
|
73
|
+
/** The documented next-action fields (action, amount, due date); nothing else is copied. */
|
|
74
|
+
export declare function publicTaskNextAction(value: unknown): TaskNextAction | null;
|
|
75
|
+
/** The public lifecycle and next action of a hosted order view. */
|
|
76
|
+
export declare function publicTaskV2Progress(view: {
|
|
77
|
+
lifecycle?: unknown;
|
|
78
|
+
nextAction?: unknown;
|
|
79
|
+
workOrder?: {
|
|
80
|
+
lifecycle?: unknown;
|
|
81
|
+
nextAction?: unknown;
|
|
82
|
+
};
|
|
83
|
+
}): {
|
|
84
|
+
lifecycle: {
|
|
85
|
+
[x: string]: unknown;
|
|
86
|
+
state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
|
|
87
|
+
milestones: {
|
|
88
|
+
[x: string]: unknown;
|
|
89
|
+
id: string;
|
|
90
|
+
status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
|
|
91
|
+
amountBaseUnits: string;
|
|
92
|
+
dueAt?: string | undefined;
|
|
93
|
+
cause?: number | undefined;
|
|
94
|
+
disputed?: boolean | undefined;
|
|
95
|
+
disputeWinner?: number | undefined;
|
|
96
|
+
summary?: string | undefined;
|
|
97
|
+
}[];
|
|
98
|
+
shape: "task";
|
|
99
|
+
substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
|
|
100
|
+
cause?: number | undefined;
|
|
101
|
+
disputed?: boolean | undefined;
|
|
102
|
+
disputeWinner?: number | undefined;
|
|
103
|
+
summary?: string | undefined;
|
|
104
|
+
} | {
|
|
105
|
+
[x: string]: unknown;
|
|
106
|
+
shape: "bounty";
|
|
107
|
+
state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
|
|
108
|
+
amountBaseUnits?: string | undefined;
|
|
109
|
+
dueAt?: string | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
[x: string]: unknown;
|
|
112
|
+
shape: "pool";
|
|
113
|
+
state: "Draft" | "Open" | "Paused" | "Closed";
|
|
114
|
+
} | null;
|
|
115
|
+
nextAction: {
|
|
116
|
+
[x: string]: unknown;
|
|
117
|
+
action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
|
|
118
|
+
amountBaseUnits?: string | undefined;
|
|
119
|
+
dueAt?: string | undefined;
|
|
120
|
+
} | null;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Every failure of a hosted call during recovery or abandon. The caller-supplied step does
|
|
124
|
+
* not decide sensitivity: the operation behind it may be a reveal whatever step is named, and
|
|
125
|
+
* a hosted error (or a transport error quoting the response) may echo the prepared request.
|
|
126
|
+
* Only the HTTP status survives; the code is fixed per path.
|
|
127
|
+
*/
|
|
128
|
+
export declare function taskV2RecoveryHostedError(error: unknown, step: string): TaskOperationError;
|
|
129
|
+
/**
|
|
130
|
+
* A hosted error on a vote step may echo the request, so neither its code nor its message is
|
|
131
|
+
* copied: the caller gets one fixed code and message, plus the HTTP status when there is one.
|
|
132
|
+
*/
|
|
133
|
+
export declare function taskV2VoteHostedError(error: unknown): TaskOperationError;
|
|
134
|
+
export declare const TASK_V2_REDACTED = "[redacted]";
|
|
135
|
+
/**
|
|
136
|
+
* A hosted read (plain `show` and `status`) with every unrevealed ballot removed, at any depth:
|
|
137
|
+
* - every `salt` key;
|
|
138
|
+
* - inside a commit or reveal vote step, operation or request, its calldata (`data`) and its
|
|
139
|
+
* ballot fields (outcome, toWorker, salt, vote, ballot), and any reveal calldata string;
|
|
140
|
+
* - outside the chain's `v2State`, any string that quotes a ballot key (it becomes
|
|
141
|
+
* `[redacted]`), and the outcome and toWorker of a ballot-shaped object.
|
|
142
|
+
* Revealed votes in `v2State` are public chain data and are kept; so is everything else,
|
|
143
|
+
* including ordinary 32-byte values such as transaction hashes.
|
|
144
|
+
*/
|
|
145
|
+
export declare function redactTaskV2Ballots<T>(value: T): T;
|
|
146
|
+
/**
|
|
147
|
+
* One hosted call of a plain `show` or `status` read. A hosted error, or a transport error
|
|
148
|
+
* quoting the response, may echo a prepared vote: a message with a 32-byte hex run or a ballot
|
|
149
|
+
* word (outcome, toWorker, ballot, salt, vote) is replaced by a fixed message with only the
|
|
150
|
+
* HTTP status, and a server code that is not short snake case is dropped (the caller then uses
|
|
151
|
+
* the fixed `http_<status>` code), before the usual error mapping runs on status and code.
|
|
152
|
+
*/
|
|
153
|
+
export declare function taskReadWithoutBallots<T>(verb: string, call: () => Promise<T>): Promise<T>;
|
|
154
|
+
//# sourceMappingURL=v2-public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-public.d.ts","sourceRoot":"","sources":["../../src/tasks/v2-public.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElF,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAAyC,CAAC;AAK5F,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,GAAG,aAAa,EAAE,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,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAuBlD;AAUD;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAuChG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
export type TasksV2Deployment = {
|
|
3
|
+
escrowFactoryV2: Address;
|
|
4
|
+
/** DisputeResolverV3 pin; jury plans must also match the verified clone's DISPUTE_RESOLVER(). */
|
|
5
|
+
disputeResolverV3: Address;
|
|
6
|
+
bountyPoolFactoryV1: Address;
|
|
7
|
+
usdc: Address;
|
|
8
|
+
usdcName: string;
|
|
9
|
+
usdcVersion: string;
|
|
10
|
+
offerTtlSeconds?: number;
|
|
11
|
+
reviewWindowSeconds?: number;
|
|
12
|
+
evidenceWindowSeconds?: number;
|
|
13
|
+
choiceWindowSeconds?: number;
|
|
14
|
+
};
|
|
15
|
+
export type TasksV2DeploymentOverrides = Partial<Record<number, TasksV2Deployment>>;
|
|
16
|
+
/** Verified Tasks V2 deployment on Base mainnet (chain 8453), audited at tasks-v2-audit-3.
|
|
17
|
+
* All SDK, CLI and MCP trust checks use this complete tuple. Other chains require
|
|
18
|
+
* an explicit local override. See docs/tasks.md for the deployed contracts.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TRUSTED_TASKS_V2_DEPLOYMENTS: Readonly<TasksV2DeploymentOverrides>;
|
|
21
|
+
/** All overrides are local operator decisions, never hosted readiness fields. */
|
|
22
|
+
export declare function getTrustedTasksV2Deployment(chainId: number, options?: {
|
|
23
|
+
overrides?: TasksV2DeploymentOverrides;
|
|
24
|
+
env?: NodeJS.ProcessEnv;
|
|
25
|
+
notice?: (message: string) => void;
|
|
26
|
+
}): TasksV2Deployment;
|
|
27
|
+
//# sourceMappingURL=v2-trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-trust.d.ts","sourceRoot":"","sources":["../../src/tasks/v2-trust.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAG7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,iGAAiG;IACjG,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,0BAA0B,CAa7E,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,0BAA0B,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,GACL,iBAAiB,CA2FnB"}
|