@vapi-network/core 0.7.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.
- package/README.md +14 -1
- package/dist/account-add.d.ts +8 -1
- package/dist/account-add.d.ts.map +1 -1
- package/dist/account-movement-lock.d.ts +10 -0
- package/dist/account-movement-lock.d.ts.map +1 -0
- package/dist/agent-link.d.ts +1 -0
- package/dist/agent-link.d.ts.map +1 -1
- package/dist/agent-link.js +27 -11
- package/dist/agent-link.js.map +1 -1
- package/dist/agent-profile.d.ts +18 -2
- package/dist/agent-profile.d.ts.map +1 -1
- package/dist/agent-run.d.ts +12 -0
- package/dist/agent-run.d.ts.map +1 -0
- package/dist/allocation.d.ts +35 -4
- package/dist/allocation.d.ts.map +1 -1
- package/dist/api-key.js +47 -0
- package/dist/api-key.js.map +1 -1
- package/dist/atomic-file.d.ts +23 -0
- package/dist/atomic-file.d.ts.map +1 -0
- package/dist/audit.d.ts +4 -1
- package/dist/audit.d.ts.map +1 -1
- package/dist/backup.d.ts +155 -32
- package/dist/backup.d.ts.map +1 -1
- package/dist/backup.js +2600 -139
- package/dist/backup.js.map +3 -3
- package/dist/call-contracts-wire.d.ts +12 -12
- package/dist/ceiling.d.ts +8 -0
- package/dist/ceiling.d.ts.map +1 -1
- package/dist/cloud-backup.d.ts +8 -10
- package/dist/cloud-backup.d.ts.map +1 -1
- package/dist/cloud-backup.js +2876 -381
- package/dist/cloud-backup.js.map +3 -3
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/distribute.d.ts +9 -1
- package/dist/distribute.d.ts.map +1 -1
- package/dist/docs.d.ts +40 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/funding-policy.d.ts +29 -0
- package/dist/funding-policy.d.ts.map +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5832 -1213
- package/dist/index.js.map +3 -3
- package/dist/marketplace-contracts.d.ts +14 -14
- package/dist/member-bundle.d.ts +110 -0
- package/dist/member-bundle.d.ts.map +1 -0
- package/dist/movement-open.d.ts +10 -0
- package/dist/movement-open.d.ts.map +1 -0
- package/dist/movement.d.ts +77 -7
- package/dist/movement.d.ts.map +1 -1
- package/dist/receipts.d.ts +9 -0
- package/dist/receipts.d.ts.map +1 -1
- package/dist/router-client.d.ts +9 -1
- package/dist/router-client.d.ts.map +1 -1
- package/dist/router-client.js +2272 -609
- package/dist/router-client.js.map +3 -3
- package/dist/run-budget.d.ts +17 -0
- package/dist/run-budget.d.ts.map +1 -0
- package/dist/secret-store.d.ts +6 -0
- package/dist/secret-store.d.ts.map +1 -1
- package/dist/secrets.d.ts +2 -1
- package/dist/secrets.d.ts.map +1 -1
- package/dist/secrets.js +912 -48
- package/dist/secrets.js.map +3 -3
- package/dist/spend-policy.d.ts +41 -7
- package/dist/spend-policy.d.ts.map +1 -1
- package/dist/support-report.d.ts +1 -1
- package/dist/swarm-capital.d.ts +147 -0
- package/dist/swarm-capital.d.ts.map +1 -0
- package/dist/swarm.d.ts +224 -0
- package/dist/swarm.d.ts.map +1 -0
- package/dist/tasks/actions.d.ts +152 -0
- package/dist/tasks/actions.d.ts.map +1 -0
- package/dist/tasks/canonical-json.d.ts +6 -0
- package/dist/tasks/canonical-json.d.ts.map +1 -0
- package/dist/tasks/chain-error.d.ts +6 -0
- package/dist/tasks/chain-error.d.ts.map +1 -0
- package/dist/tasks/chain-port.d.ts +88 -0
- package/dist/tasks/chain-port.d.ts.map +1 -0
- package/dist/tasks/chain-verification.d.ts +36 -0
- package/dist/tasks/chain-verification.d.ts.map +1 -0
- package/dist/tasks/chain.d.ts +22 -0
- package/dist/tasks/chain.d.ts.map +1 -0
- package/dist/tasks/client.d.ts +76 -0
- package/dist/tasks/client.d.ts.map +1 -0
- package/dist/tasks/delivery-manifest.d.ts +24 -0
- package/dist/tasks/delivery-manifest.d.ts.map +1 -0
- package/dist/tasks/dispute-fee.d.ts +4 -0
- package/dist/tasks/dispute-fee.d.ts.map +1 -0
- package/dist/tasks/index.d.ts +22 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/money.d.ts +17 -0
- package/dist/tasks/money.d.ts.map +1 -0
- package/dist/tasks/operation-support.d.ts +127 -0
- package/dist/tasks/operation-support.d.ts.map +1 -0
- package/dist/tasks/operations.d.ts +722 -0
- package/dist/tasks/operations.d.ts.map +1 -0
- package/dist/tasks/pending-transactions.d.ts +52 -0
- package/dist/tasks/pending-transactions.d.ts.map +1 -0
- package/dist/tasks/plan-guard.d.ts +326 -0
- package/dist/tasks/plan-guard.d.ts.map +1 -0
- package/dist/tasks/rpc.d.ts +8 -0
- package/dist/tasks/rpc.d.ts.map +1 -0
- package/dist/tasks/scope-bindings.d.ts +20 -0
- package/dist/tasks/scope-bindings.d.ts.map +1 -0
- package/dist/tasks/scope-terms.d.ts +75 -0
- package/dist/tasks/scope-terms.d.ts.map +1 -0
- package/dist/tasks/trusted-deployments.d.ts +14 -0
- package/dist/tasks/trusted-deployments.d.ts.map +1 -0
- package/dist/tasks/types.d.ts +4439 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/verbs.d.ts +4 -0
- package/dist/tasks/verbs.d.ts.map +1 -0
- package/dist/tasks.js +43906 -0
- package/dist/tasks.js.map +6 -0
- package/dist/transfer-journal.d.ts +11 -0
- package/dist/transfer-journal.d.ts.map +1 -0
- package/dist/transfer.d.ts +4 -1
- package/dist/transfer.d.ts.map +1 -1
- package/dist/vault.d.ts +11 -0
- package/dist/vault.d.ts.map +1 -1
- package/dist/wallet-store.d.ts +19 -8
- package/dist/wallet-store.d.ts.map +1 -1
- package/dist/x402-pay.d.ts +7 -0
- package/dist/x402-pay.d.ts.map +1 -1
- package/dist/x402.d.ts +3 -0
- package/dist/x402.d.ts.map +1 -1
- package/package.json +5 -1
package/dist/spend-policy.d.ts
CHANGED
|
@@ -6,31 +6,65 @@ declare const ledgerSchema: z.ZodObject<{
|
|
|
6
6
|
spentAtomic: z.ZodString;
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
export type SpendLedger = z.infer<typeof ledgerSchema>;
|
|
9
|
+
export type SpendKind = "payment" | "escrow-funding" | "dispute-fee";
|
|
9
10
|
export type SpendLedgerRow = SpendLedger & {
|
|
10
11
|
wallet: WalletName;
|
|
11
12
|
};
|
|
12
13
|
export declare class SpendCapError extends Error {
|
|
13
|
-
readonly code: "per_call_cap_exceeded" | "per_day_cap_exceeded";
|
|
14
|
-
constructor(code: "per_call_cap_exceeded" | "per_day_cap_exceeded", message: string);
|
|
14
|
+
readonly code: "per_call_cap_exceeded" | "per_task_cap_exceeded" | "per_day_cap_exceeded";
|
|
15
|
+
constructor(code: "per_call_cap_exceeded" | "per_task_cap_exceeded" | "per_day_cap_exceeded", message: string);
|
|
15
16
|
}
|
|
16
17
|
export declare function utcDateKey(now?: Date): string;
|
|
17
18
|
/** Today's spend for one wallet. Other wallets and older days read as zero. */
|
|
18
19
|
export declare function readSpendLedger(path?: string, now?: Date, wallet?: WalletName): Promise<SpendLedger>;
|
|
20
|
+
/** Read-only funding headroom; never creates directories, writes, or takes a lock. */
|
|
21
|
+
export declare function escrowFundingDayRemainingAtomic(input: {
|
|
22
|
+
caps: SpendCaps;
|
|
23
|
+
ledgerPath: string;
|
|
24
|
+
now: Date;
|
|
25
|
+
wallet: WalletName;
|
|
26
|
+
reservationId?: string;
|
|
27
|
+
}): Promise<bigint>;
|
|
28
|
+
/** Read-only task spend across all stored days, excluding a reservation being retried. */
|
|
29
|
+
export declare function taskReservedAtomic(input: {
|
|
30
|
+
ledgerPath: string;
|
|
31
|
+
wallet: WalletName;
|
|
32
|
+
taskKey: string;
|
|
33
|
+
now: Date;
|
|
34
|
+
excludeReservationId?: string;
|
|
35
|
+
}): Promise<bigint>;
|
|
19
36
|
/** Today's spend of every wallet that has spent today. */
|
|
20
37
|
export declare function readSpendLedgerRows(path?: string, now?: Date): Promise<SpendLedgerRow[]>;
|
|
21
38
|
/**
|
|
22
|
-
* Reserves one payment against the caps of one wallet.
|
|
23
|
-
* per wallet, so an agent wallet cannot spend the
|
|
39
|
+
* Reserves one payment or escrow funding against the caps of one wallet.
|
|
40
|
+
* Per-day totals are kept per wallet, so an agent wallet cannot spend the
|
|
41
|
+
* owner's daily allowance.
|
|
42
|
+
* Task-linked calls without a reservation id return a generated id for rollback.
|
|
24
43
|
*/
|
|
25
44
|
export declare function reserveSpend(amountAtomic: bigint, caps: SpendCaps, options?: {
|
|
26
45
|
ledgerPath?: string;
|
|
27
46
|
now?: Date;
|
|
28
47
|
wallet?: WalletName;
|
|
29
48
|
reservationId?: string;
|
|
30
|
-
|
|
49
|
+
kind?: SpendKind;
|
|
50
|
+
taskKey?: string;
|
|
51
|
+
maxPerTaskAtomic?: bigint;
|
|
52
|
+
reuseExistingEscrowReservation?: boolean;
|
|
53
|
+
resumeEscrowReservation?: {
|
|
54
|
+
id: string;
|
|
55
|
+
wallet: WalletName;
|
|
56
|
+
amountAtomic: string;
|
|
57
|
+
date: string;
|
|
58
|
+
exposed?: boolean;
|
|
59
|
+
invalidated?: boolean;
|
|
60
|
+
};
|
|
61
|
+
}): Promise<SpendLedger & {
|
|
62
|
+
reservationReused?: boolean;
|
|
63
|
+
reservationId?: string;
|
|
64
|
+
}>;
|
|
31
65
|
/**
|
|
32
|
-
* Releases
|
|
33
|
-
*
|
|
66
|
+
* Releases an identified reservation on its original UTC day, including task
|
|
67
|
+
* accounting. Unidentified releases only affect today's daily budget.
|
|
34
68
|
*/
|
|
35
69
|
export declare function releaseSpend(amountAtomic: bigint, options: {
|
|
36
70
|
reservedOn: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spend-policy.d.ts","sourceRoot":"","sources":["../src/spend-policy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAyC,K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ACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA,OAAO,CAAC,WAAW,CAAC,CAsDtB"}
|
package/dist/support-report.d.ts
CHANGED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CeilingSweepResult } from "./ceiling.js";
|
|
3
|
+
import { type VapiConfig } from "./config.js";
|
|
4
|
+
import { type MovementDependencies } from "./movement.js";
|
|
5
|
+
import { type RunBudget } from "./run-budget.js";
|
|
6
|
+
import { type SwarmBalanceReader } from "./swarm.js";
|
|
7
|
+
import { type TransferNetwork } from "./transfer.js";
|
|
8
|
+
import { type WalletName } from "./wallet-name.js";
|
|
9
|
+
export type SwarmCapitalDeps = MovementDependencies & {
|
|
10
|
+
balanceReader?: SwarmBalanceReader;
|
|
11
|
+
config?: VapiConfig;
|
|
12
|
+
reconcileCeilingSweep?: (account: WalletName) => Promise<CeilingSweepResult>;
|
|
13
|
+
};
|
|
14
|
+
export type SwarmLegResult = {
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
amountUsd: string;
|
|
18
|
+
purpose: "send" | "sweep";
|
|
19
|
+
status: "planned" | "sent" | "failed" | "unknown" | "cancelled";
|
|
20
|
+
txHash?: string;
|
|
21
|
+
reason?: string;
|
|
22
|
+
};
|
|
23
|
+
export type SwarmMovementResult = {
|
|
24
|
+
movementId: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
resumed: boolean;
|
|
27
|
+
legs: SwarmLegResult[];
|
|
28
|
+
complete: boolean;
|
|
29
|
+
};
|
|
30
|
+
type SwarmSkippedMember = {
|
|
31
|
+
account: string;
|
|
32
|
+
reason: string;
|
|
33
|
+
};
|
|
34
|
+
type SwarmBlockedLeg = {
|
|
35
|
+
to: string;
|
|
36
|
+
amountUsd: string;
|
|
37
|
+
reason: string;
|
|
38
|
+
};
|
|
39
|
+
declare const delegationRecordSchema: z.ZodObject<{
|
|
40
|
+
v: z.ZodLiteral<1>;
|
|
41
|
+
movementId: z.ZodString;
|
|
42
|
+
requestId: z.ZodString;
|
|
43
|
+
swarm: z.ZodString;
|
|
44
|
+
member: z.ZodString;
|
|
45
|
+
budgetUsd: z.ZodString;
|
|
46
|
+
childRunId: z.ZodString;
|
|
47
|
+
startedAt: z.ZodISODateTime;
|
|
48
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
50
|
+
answer: z.ZodNullable<z.ZodString>;
|
|
51
|
+
stoppedBecause: z.ZodNullable<z.ZodObject<{
|
|
52
|
+
reason: z.ZodString;
|
|
53
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
spentUsd: z.ZodNumber;
|
|
56
|
+
budgetUsd: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
export type DelegationRecord = z.infer<typeof delegationRecordSchema>;
|
|
60
|
+
export type SwarmFundResult = {
|
|
61
|
+
status: "sent" | "incomplete" | "waiting_for_owner" | "resumed";
|
|
62
|
+
treasury: {
|
|
63
|
+
account: string;
|
|
64
|
+
address: string;
|
|
65
|
+
};
|
|
66
|
+
network: TransferNetwork;
|
|
67
|
+
amountUsd: string;
|
|
68
|
+
fund?: SwarmMovementResult;
|
|
69
|
+
policy?: SwarmMovementResult | SwarmRebalanceResult;
|
|
70
|
+
blocked: SwarmBlockedLeg[];
|
|
71
|
+
skipped: SwarmSkippedMember[];
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
export type SwarmFundOptions = {
|
|
75
|
+
name: string;
|
|
76
|
+
amountUsd: string | number;
|
|
77
|
+
from: string;
|
|
78
|
+
setup: true;
|
|
79
|
+
} | {
|
|
80
|
+
name: string;
|
|
81
|
+
amountUsd: string | number;
|
|
82
|
+
from?: string;
|
|
83
|
+
setup?: undefined;
|
|
84
|
+
};
|
|
85
|
+
export type SwarmRebalanceResult = {
|
|
86
|
+
status: "sent" | "incomplete" | "balanced" | "resumed";
|
|
87
|
+
movement?: SwarmMovementResult;
|
|
88
|
+
blocked: SwarmBlockedLeg[];
|
|
89
|
+
skipped: SwarmSkippedMember[];
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
92
|
+
export type SwarmLeaveResult = {
|
|
93
|
+
status: "left" | "kept" | "resumed";
|
|
94
|
+
member: string;
|
|
95
|
+
movement?: SwarmMovementResult;
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
export type SwarmDissolveResult = {
|
|
99
|
+
status: "dissolved" | "incomplete" | "resumed";
|
|
100
|
+
movements: SwarmMovementResult[];
|
|
101
|
+
message: string;
|
|
102
|
+
};
|
|
103
|
+
export type AllocateFromTreasuryOptions = {
|
|
104
|
+
name: string;
|
|
105
|
+
member: string;
|
|
106
|
+
amountUsd: string | number;
|
|
107
|
+
reason: "allocate" | "delegate";
|
|
108
|
+
requestId?: string;
|
|
109
|
+
draw?: RunBudget;
|
|
110
|
+
};
|
|
111
|
+
export type AllocateFromTreasuryResult = {
|
|
112
|
+
status: "sent" | "incomplete" | "blocked" | "resumed";
|
|
113
|
+
movementId: string | null;
|
|
114
|
+
requestedUsd: string;
|
|
115
|
+
sentUsd: string;
|
|
116
|
+
unknownUsd: string;
|
|
117
|
+
blocked: Array<{
|
|
118
|
+
to: string;
|
|
119
|
+
amountUsd: string;
|
|
120
|
+
reason: string;
|
|
121
|
+
}>;
|
|
122
|
+
movement?: SwarmMovementResult;
|
|
123
|
+
message: string;
|
|
124
|
+
};
|
|
125
|
+
export declare function treasuryRequestMovementId(swarm: string, requestId: string): string;
|
|
126
|
+
/**
|
|
127
|
+
* Moves treasury capital for one intent. Reusing a requestId returns a finished result or resumes
|
|
128
|
+
* its unfinished movement; changing its member, amount, or reason is a request conflict. Different
|
|
129
|
+
* requestIds are distinct intents, bounded only by the run draw and treasury caps.
|
|
130
|
+
*/
|
|
131
|
+
export declare function allocateFromTreasury(opts: AllocateFromTreasuryOptions, deps: SwarmCapitalDeps): Promise<AllocateFromTreasuryResult>;
|
|
132
|
+
export declare function fundSwarm(opts: SwarmFundOptions, deps: SwarmCapitalDeps): Promise<SwarmFundResult>;
|
|
133
|
+
export declare function rebalanceSwarm(opts: {
|
|
134
|
+
name: string;
|
|
135
|
+
targetsUsd?: Record<string, string | number>;
|
|
136
|
+
}, deps: SwarmCapitalDeps): Promise<SwarmRebalanceResult>;
|
|
137
|
+
export declare function leaveSwarm(opts: {
|
|
138
|
+
name: string;
|
|
139
|
+
member: string;
|
|
140
|
+
}, deps: SwarmCapitalDeps): Promise<SwarmLeaveResult>;
|
|
141
|
+
export declare function dissolveSwarm(opts: {
|
|
142
|
+
name: string;
|
|
143
|
+
}, deps: SwarmCapitalDeps): Promise<SwarmDissolveResult>;
|
|
144
|
+
export declare function readDelegationRecord(home: string, movementId: string): Promise<DelegationRecord | undefined>;
|
|
145
|
+
export declare function writeDelegationRecord(home: string, record: DelegationRecord): Promise<void>;
|
|
146
|
+
export {};
|
|
147
|
+
//# sourceMappingURL=swarm-capital.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-capital.d.ts","sourceRoot":"","sources":["../src/swarm-capital.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAQL,KAAK,oBAAoB,EAG1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAQL,KAAK,kBAAkB,EAGxB,MAAM,YAAY,CAAC;AAEpB,OAAO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G1B;AAsPD,wBAAsB,cAAc,CAClC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAAE,EACpE,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,oBAAoB,CAAC,CAG/B;AAgHD,wBAAsB,UAAU,CAC9B,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACtC,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAG3B;AA0FD,wBAAsB,aAAa,CACjC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACtB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAG9B;AA8GD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAkBvC;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOjG"}
|
package/dist/swarm.d.ts
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type AccountLinkOutcome, type StartAccountLinkArgs } from "./account-add.js";
|
|
3
|
+
import { type AgentGrant } from "./agent-profile.js";
|
|
4
|
+
import { type VapiConfig } from "./config.js";
|
|
5
|
+
import { type MovementSummary } from "./movement.js";
|
|
6
|
+
import type { SecretStore } from "./secret-store.js";
|
|
7
|
+
import type { TransferNetwork } from "./transfer.js";
|
|
8
|
+
import { type WalletName } from "./wallet-name.js";
|
|
9
|
+
import type { WalletStore } from "./wallet-store.js";
|
|
10
|
+
import { type CanonicalX402UsdcNetwork } from "./x402-networks.js";
|
|
11
|
+
export declare const SWARM_NAME_PATTERN: RegExp;
|
|
12
|
+
export declare const SWARM_ROLE_PATTERN: RegExp;
|
|
13
|
+
export declare const DEFAULT_SWARM_MODEL = "venice/claude-sonnet-5";
|
|
14
|
+
export type SwarmStrategy = "targets" | "even" | "weights";
|
|
15
|
+
export declare const SWARM_TREASURY_CAPS: {
|
|
16
|
+
readonly perCallAtomic: "5000000";
|
|
17
|
+
readonly perDayAtomic: "20000000";
|
|
18
|
+
};
|
|
19
|
+
export declare const swarmFileSchema: z.ZodObject<{
|
|
20
|
+
v: z.ZodLiteral<1>;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
device: z.ZodString;
|
|
23
|
+
network: z.ZodEnum<{
|
|
24
|
+
"eip155:8453": "eip155:8453";
|
|
25
|
+
"eip155:5042": "eip155:5042";
|
|
26
|
+
}>;
|
|
27
|
+
createdAt: z.ZodISODateTime;
|
|
28
|
+
treasury: z.ZodObject<{
|
|
29
|
+
account: z.ZodString;
|
|
30
|
+
address: z.ZodOptional<z.ZodString>;
|
|
31
|
+
steps: z.ZodObject<{
|
|
32
|
+
creating: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
created: z.ZodBoolean;
|
|
34
|
+
capped: z.ZodBoolean;
|
|
35
|
+
linked: z.ZodBoolean;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
members: z.ZodArray<z.ZodObject<{
|
|
39
|
+
account: z.ZodString;
|
|
40
|
+
address: z.ZodOptional<z.ZodString>;
|
|
41
|
+
role: z.ZodString;
|
|
42
|
+
weight: z.ZodNumber;
|
|
43
|
+
targetAtomic: z.ZodString;
|
|
44
|
+
ceilingAtomic: z.ZodNullable<z.ZodString>;
|
|
45
|
+
steps: z.ZodObject<{
|
|
46
|
+
profiled: z.ZodBoolean;
|
|
47
|
+
creating: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
created: z.ZodBoolean;
|
|
49
|
+
capped: z.ZodBoolean;
|
|
50
|
+
linked: z.ZodBoolean;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
setupFunding: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
amountUsd: z.ZodString;
|
|
55
|
+
from: z.ZodString;
|
|
56
|
+
movementId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
status: z.ZodEnum<{
|
|
58
|
+
sent: "sent";
|
|
59
|
+
planned: "planned";
|
|
60
|
+
incomplete: "incomplete";
|
|
61
|
+
}>;
|
|
62
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
strategy: z.ZodEnum<{
|
|
64
|
+
even: "even";
|
|
65
|
+
weights: "weights";
|
|
66
|
+
targets: "targets";
|
|
67
|
+
}>;
|
|
68
|
+
movementId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
status: z.ZodEnum<{
|
|
70
|
+
sent: "sent";
|
|
71
|
+
planned: "planned";
|
|
72
|
+
incomplete: "incomplete";
|
|
73
|
+
}>;
|
|
74
|
+
blocked: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
to: z.ZodString;
|
|
76
|
+
amountUsd: z.ZodString;
|
|
77
|
+
reason: z.ZodString;
|
|
78
|
+
}, z.core.$strict>>>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
policy: z.ZodObject<{
|
|
82
|
+
strategy: z.ZodEnum<{
|
|
83
|
+
even: "even";
|
|
84
|
+
weights: "weights";
|
|
85
|
+
targets: "targets";
|
|
86
|
+
}>;
|
|
87
|
+
treasuryCaps: z.ZodObject<{
|
|
88
|
+
perCallAtomic: z.ZodString;
|
|
89
|
+
perDayAtomic: z.ZodString;
|
|
90
|
+
}, z.core.$strict>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export type SwarmFile = z.infer<typeof swarmFileSchema>;
|
|
94
|
+
export type SwarmMember = SwarmFile["members"][number];
|
|
95
|
+
export type SwarmErrorCode = "invalid_swarm" | "swarm_not_found" | "swarm_exists_different_shape" | "account_in_other_swarm" | "account_name_taken" | "name_too_long" | "treasury_refused" | "member_not_found" | "member_not_linked" | "draw_exceeded" | "request_conflict" | "movement_unfinished" | "ceiling_sweep_pending" | "account_address_mismatch" | "swarm_locked";
|
|
96
|
+
export declare class SwarmError extends Error {
|
|
97
|
+
readonly code: SwarmErrorCode;
|
|
98
|
+
constructor(code: SwarmErrorCode, message: string);
|
|
99
|
+
}
|
|
100
|
+
export declare function swarmsDirectory(home: string): string;
|
|
101
|
+
export declare function swarmFilePath(home: string, name: string): string;
|
|
102
|
+
export declare function readSwarm(home: string, name: string): Promise<SwarmFile>;
|
|
103
|
+
export declare function listSwarms(home: string): Promise<SwarmFile[]>;
|
|
104
|
+
export declare function writeSwarm(home: string, value: SwarmFile): Promise<void>;
|
|
105
|
+
export declare function deleteSwarmFile(home: string, name: string): Promise<void>;
|
|
106
|
+
export declare function withSwarmLock<T>(home: string, name: string, fn: () => Promise<T>): Promise<T>;
|
|
107
|
+
export declare function swarmAccountNames(swarm: SwarmFile): WalletName[];
|
|
108
|
+
export declare function swarmTreasuryName(name: string): WalletName;
|
|
109
|
+
export declare function swarmMemberName(name: string, role: string, n: number): WalletName;
|
|
110
|
+
export declare function roleDefaults(role: string): {
|
|
111
|
+
weight: number;
|
|
112
|
+
targetAtomic: string;
|
|
113
|
+
ceilingAtomic: string;
|
|
114
|
+
};
|
|
115
|
+
export declare function roleGrants(role: string): AgentGrant[];
|
|
116
|
+
export declare function swarmParentResolver(home: string): (account: WalletName) => Promise<{
|
|
117
|
+
account: WalletName;
|
|
118
|
+
address: `0x${string}`;
|
|
119
|
+
} | undefined>;
|
|
120
|
+
type LinkOptions = Pick<StartAccountLinkArgs, "fetchImpl" | "startDeviceLink" | "pollDeviceLink" | "saveAgentLink" | "sleep" | "signal" | "configPath" | "env" | "hostname" | "awaitApproval">;
|
|
121
|
+
export type SetupSwarmOptions = LinkOptions & {
|
|
122
|
+
home?: string;
|
|
123
|
+
store: WalletStore;
|
|
124
|
+
secrets: SecretStore;
|
|
125
|
+
apiBase: string;
|
|
126
|
+
name: string;
|
|
127
|
+
agents?: number;
|
|
128
|
+
roles?: string[];
|
|
129
|
+
strategy?: SwarmStrategy;
|
|
130
|
+
targetsUsd?: Record<string, string | number>;
|
|
131
|
+
weights?: Record<string, number>;
|
|
132
|
+
ceilingsUsd?: Record<string, string | number | null>;
|
|
133
|
+
caps?: {
|
|
134
|
+
perCallUsd: string | number;
|
|
135
|
+
perDayUsd: string | number;
|
|
136
|
+
};
|
|
137
|
+
treasuryCaps?: {
|
|
138
|
+
perCallUsd: string | number;
|
|
139
|
+
perDayUsd: string | number;
|
|
140
|
+
};
|
|
141
|
+
network?: TransferNetwork;
|
|
142
|
+
model?: string;
|
|
143
|
+
surface: "cli" | "mcp";
|
|
144
|
+
now?: () => Date;
|
|
145
|
+
};
|
|
146
|
+
export type AddSwarmMemberOptions = Omit<SetupSwarmOptions, "agents" | "roles" | "strategy" | "treasuryCaps" | "network"> & {
|
|
147
|
+
role: string;
|
|
148
|
+
targetUsd?: string | number;
|
|
149
|
+
weight?: number;
|
|
150
|
+
ceilingUsd?: string | number | null;
|
|
151
|
+
};
|
|
152
|
+
export type SwarmNextStep = {
|
|
153
|
+
kind: "link";
|
|
154
|
+
account: string;
|
|
155
|
+
userCode: string;
|
|
156
|
+
verificationUri: string;
|
|
157
|
+
verificationUriComplete: string;
|
|
158
|
+
expiresInSeconds: number;
|
|
159
|
+
} | {
|
|
160
|
+
kind: "caps";
|
|
161
|
+
account: string;
|
|
162
|
+
command: string;
|
|
163
|
+
};
|
|
164
|
+
export type SwarmMemberSetupStatus = {
|
|
165
|
+
account: string;
|
|
166
|
+
address: string;
|
|
167
|
+
role: string;
|
|
168
|
+
created: boolean;
|
|
169
|
+
capped: boolean;
|
|
170
|
+
profiled: boolean;
|
|
171
|
+
linked: boolean;
|
|
172
|
+
};
|
|
173
|
+
export type SwarmSetupResult = {
|
|
174
|
+
swarm: SwarmFile;
|
|
175
|
+
members: SwarmMemberSetupStatus[];
|
|
176
|
+
next: SwarmNextStep[];
|
|
177
|
+
completions: Map<string, Promise<AccountLinkOutcome>>;
|
|
178
|
+
};
|
|
179
|
+
export declare function setupSwarm(opts: SetupSwarmOptions): Promise<SwarmSetupResult>;
|
|
180
|
+
export declare function addSwarmMember(opts: AddSwarmMemberOptions): Promise<SwarmSetupResult>;
|
|
181
|
+
export type SwarmBalanceReader = (input: {
|
|
182
|
+
account: WalletName;
|
|
183
|
+
address: string;
|
|
184
|
+
network: CanonicalX402UsdcNetwork;
|
|
185
|
+
}) => Promise<bigint>;
|
|
186
|
+
export type SwarmStatusOptions = {
|
|
187
|
+
home?: string;
|
|
188
|
+
store: WalletStore;
|
|
189
|
+
name: string;
|
|
190
|
+
balanceReader?: SwarmBalanceReader;
|
|
191
|
+
config?: VapiConfig;
|
|
192
|
+
fetchImpl?: typeof fetch;
|
|
193
|
+
};
|
|
194
|
+
export type SwarmStatusResult = {
|
|
195
|
+
swarm: string;
|
|
196
|
+
network: TransferNetwork;
|
|
197
|
+
strategy: SwarmStrategy;
|
|
198
|
+
treasury: {
|
|
199
|
+
account: string;
|
|
200
|
+
address: string;
|
|
201
|
+
linked: boolean;
|
|
202
|
+
balanceAtomic: string;
|
|
203
|
+
balanceUsd: string;
|
|
204
|
+
};
|
|
205
|
+
members: Array<{
|
|
206
|
+
account: string;
|
|
207
|
+
address: string;
|
|
208
|
+
role: string;
|
|
209
|
+
weight: number;
|
|
210
|
+
targetUsd: string;
|
|
211
|
+
ceilingUsd: string | null;
|
|
212
|
+
linked: boolean;
|
|
213
|
+
profile: boolean;
|
|
214
|
+
balanceAtomic: string;
|
|
215
|
+
balanceUsd: string;
|
|
216
|
+
allocatedInUsd: string;
|
|
217
|
+
sweptOutUsd: string;
|
|
218
|
+
netUsd: string;
|
|
219
|
+
}>;
|
|
220
|
+
openMovements: MovementSummary[];
|
|
221
|
+
};
|
|
222
|
+
export declare function swarmStatus(opts: SwarmStatusOptions): Promise<SwarmStatusResult>;
|
|
223
|
+
export {};
|
|
224
|
+
//# sourceMappingURL=swarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../src/swarm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA0C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,kBAAkB,QAA2B,CAAC;AAC3D,eAAO,MAAM,kBAAkB,QAAyB,CAAC;AACzD,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAC3D,eAAO,MAAM,mBAAmB;;;CAAkE,CAAC;AA0DnG,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBzB,CAAC;AAEJ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC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,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,KAAK,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH,aAAa,EAAE,eAAe,EAAE,CAAC;CAClC,CAAC;AACF,wBAAsB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqGtF"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import { type SpendCaps } from "../config.js";
|
|
3
|
+
import { type ReleaseDecision } from "../funding-policy.js";
|
|
4
|
+
import type { WalletName } from "../wallet-name.js";
|
|
5
|
+
import { type TasksChain, type TasksChainResult } from "./chain-port.js";
|
|
6
|
+
import type { TasksClient } from "./client.js";
|
|
7
|
+
import type { PendingTransactions } from "./pending-transactions.js";
|
|
8
|
+
import { type FrozenDeliveryManifest } from "./delivery-manifest.js";
|
|
9
|
+
import { type TaskMoney } from "./money.js";
|
|
10
|
+
import { type ScopeBindings } from "./scope-bindings.js";
|
|
11
|
+
import { type SignScopeResponse, type UploadFileInput } from "./types.js";
|
|
12
|
+
/** A milestone ID selects a tranche within this order; no implicit selection across tranches. */
|
|
13
|
+
export type TaskTarget = {
|
|
14
|
+
orderId: string;
|
|
15
|
+
escrowId?: string;
|
|
16
|
+
counterparty?: string;
|
|
17
|
+
};
|
|
18
|
+
export type TaskActionInput = TaskTarget & {
|
|
19
|
+
client: TasksClient;
|
|
20
|
+
chain: TasksChain;
|
|
21
|
+
/** Retain one UUID across transport retries; reconcile an existing funding reservation separately. */
|
|
22
|
+
idempotencyKey?: () => string;
|
|
23
|
+
};
|
|
24
|
+
export type FundingSummary = {
|
|
25
|
+
money: TaskMoney;
|
|
26
|
+
dayRemainingUsd: number;
|
|
27
|
+
};
|
|
28
|
+
/** Without approval, an amount above the threshold returns approval_needed. */
|
|
29
|
+
export type TaskFundingApproval = {
|
|
30
|
+
granted: true;
|
|
31
|
+
} | {
|
|
32
|
+
granted: false;
|
|
33
|
+
} | {
|
|
34
|
+
ask: (summary: FundingSummary) => Promise<boolean>;
|
|
35
|
+
};
|
|
36
|
+
export type FundTaskInput = TaskActionInput & {
|
|
37
|
+
pending?: PendingTransactions;
|
|
38
|
+
policy: {
|
|
39
|
+
maxPerTaskUsd: number;
|
|
40
|
+
approveAboveUsd: number;
|
|
41
|
+
};
|
|
42
|
+
caps: SpendCaps;
|
|
43
|
+
wallet: WalletName;
|
|
44
|
+
ledgerPath: string;
|
|
45
|
+
now: () => Date;
|
|
46
|
+
approval?: TaskFundingApproval;
|
|
47
|
+
};
|
|
48
|
+
export type FundTaskOutcome = {
|
|
49
|
+
outcome: "refused";
|
|
50
|
+
reason: "policy.perTask" | "policy.perDay";
|
|
51
|
+
money: TaskMoney;
|
|
52
|
+
} | {
|
|
53
|
+
outcome: "approval_needed";
|
|
54
|
+
money: TaskMoney;
|
|
55
|
+
} | {
|
|
56
|
+
outcome: "declined";
|
|
57
|
+
money: TaskMoney;
|
|
58
|
+
} | {
|
|
59
|
+
outcome: "done";
|
|
60
|
+
money: TaskMoney;
|
|
61
|
+
result: TasksChainResult;
|
|
62
|
+
};
|
|
63
|
+
export declare function fundTask(input: FundTaskInput): Promise<FundTaskOutcome>;
|
|
64
|
+
export type TaskDeliveryFile = ({
|
|
65
|
+
path: string;
|
|
66
|
+
name?: never;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
path?: never;
|
|
70
|
+
}) & {
|
|
71
|
+
bytes: Uint8Array;
|
|
72
|
+
contentType: UploadFileInput["contentType"];
|
|
73
|
+
};
|
|
74
|
+
export type PrepareDeliveryInput = TaskTarget & {
|
|
75
|
+
client: TasksClient;
|
|
76
|
+
pending?: PendingTransactions;
|
|
77
|
+
files: TaskDeliveryFile[];
|
|
78
|
+
note: string;
|
|
79
|
+
};
|
|
80
|
+
export type PreparedTaskDelivery = {
|
|
81
|
+
orderId: string;
|
|
82
|
+
escrowId: string;
|
|
83
|
+
manifest: FrozenDeliveryManifest;
|
|
84
|
+
note: string;
|
|
85
|
+
};
|
|
86
|
+
export declare function prepareDelivery(input: PrepareDeliveryInput): Promise<PreparedTaskDelivery>;
|
|
87
|
+
export type DeliverTaskInput = PrepareDeliveryInput & Pick<TaskActionInput, "chain" | "idempotencyKey">;
|
|
88
|
+
export type DeliverTaskResult = PreparedTaskDelivery & {
|
|
89
|
+
manifestHash: `0x${string}`;
|
|
90
|
+
result: TasksChainResult;
|
|
91
|
+
};
|
|
92
|
+
export declare function deliverTask(input: DeliverTaskInput): Promise<DeliverTaskResult>;
|
|
93
|
+
export type TaskMoneyResult = {
|
|
94
|
+
money: TaskMoney;
|
|
95
|
+
result: TasksChainResult;
|
|
96
|
+
};
|
|
97
|
+
export declare function releaseTask(input: TaskActionInput): Promise<TaskMoneyResult>;
|
|
98
|
+
export declare function refundTask(input: TaskActionInput): Promise<TaskMoneyResult>;
|
|
99
|
+
export type DisputeTaskInput = FundTaskInput & {
|
|
100
|
+
evidenceHash: string;
|
|
101
|
+
};
|
|
102
|
+
export type DisputeTaskResult = FundTaskOutcome & {
|
|
103
|
+
disputeFee: {
|
|
104
|
+
baseUnits: string;
|
|
105
|
+
usd: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
export declare function disputeTask(input: DisputeTaskInput): Promise<DisputeTaskResult>;
|
|
109
|
+
export declare function counterEvidenceTask(input: DisputeTaskInput): Promise<DisputeTaskResult>;
|
|
110
|
+
export declare function resolveUnmatchedTask(input: TaskActionInput): Promise<TaskMoneyResult>;
|
|
111
|
+
export declare function autoReleaseDecision(input: {
|
|
112
|
+
amountUsd: number;
|
|
113
|
+
autoReleaseBelowUsd: number;
|
|
114
|
+
}): ReleaseDecision;
|
|
115
|
+
export type SignScopeActionInput = {
|
|
116
|
+
client: TasksClient;
|
|
117
|
+
chain: TasksChain;
|
|
118
|
+
orderId: string;
|
|
119
|
+
role: "poster" | "worker";
|
|
120
|
+
counterparty?: string;
|
|
121
|
+
bindings?: ScopeBindings;
|
|
122
|
+
onTerms?: (terms: SignedScopeTerms) => Promise<void> | void;
|
|
123
|
+
/** Local EIP-191 signer, invoked only after validating the current scope. */
|
|
124
|
+
signMessage?: (message: string) => Promise<`0x${string}`>;
|
|
125
|
+
idempotencyKey?: () => string;
|
|
126
|
+
};
|
|
127
|
+
export type SignedScopeTerms = {
|
|
128
|
+
role: "client" | "provider";
|
|
129
|
+
self: Address;
|
|
130
|
+
direction: "you fund escrow for the worker" | "you deliver work to the poster";
|
|
131
|
+
counterparty: Address;
|
|
132
|
+
amountBaseUnits: string;
|
|
133
|
+
asset: string;
|
|
134
|
+
network: `eip155:${number}`;
|
|
135
|
+
deadline: string;
|
|
136
|
+
deliverables: string[];
|
|
137
|
+
title: string;
|
|
138
|
+
};
|
|
139
|
+
export type SignScopeAcceptance = SignScopeResponse & {
|
|
140
|
+
terms: SignedScopeTerms;
|
|
141
|
+
};
|
|
142
|
+
export type SignScopeActionResult = SignScopeAcceptance & {
|
|
143
|
+
escrowCreation: TasksChainResult | null;
|
|
144
|
+
};
|
|
145
|
+
/** The acceptance response arrived; inspect it before retrying a follow-up separately. */
|
|
146
|
+
export declare class TasksScopeCreationError extends Error {
|
|
147
|
+
readonly acceptance: SignScopeAcceptance;
|
|
148
|
+
readonly broadcast: boolean;
|
|
149
|
+
constructor(acceptance: SignScopeAcceptance, cause: unknown);
|
|
150
|
+
}
|
|
151
|
+
export declare function signScope(input: SignScopeActionInput): Promise<SignScopeActionResult>;
|
|
152
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/tasks/actions.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,MAAM,CAAC;AAGd,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAgC,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvF,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,iGAAiG;AACjG,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvF,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IACzC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,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EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,gCAAgC,GAAG,gCAAgC,CAAC;IAC/E,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,UAAU,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IAAE,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAClF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG;IACxD,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,0FAA0F;AAC1F,qBAAa,uBAAwB,SAAQ,KAAK;IAI9C,QAAQ,CAAC,UAAU,EAAE,mBAAmB;IAH1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;gBAGjB,UAAU,EAAE,mBAAmB,EACxC,KAAK,EAAE,OAAO;CAMjB;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6R3F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
2
|
+
[key: string]: JsonValue;
|
|
3
|
+
};
|
|
4
|
+
export declare function canonicalizeJson(value: unknown): JsonValue;
|
|
5
|
+
export declare function canonicalJson(value: unknown): string;
|
|
6
|
+
//# sourceMappingURL=canonical-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../src/tasks/canonical-json.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACnB,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEhF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAyB1D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TasksChainError } from "./chain-port.js";
|
|
2
|
+
/** Local diagnostics may cross the CLI/MCP boundary. RPC/server errors never retain their original cause. */
|
|
3
|
+
export declare class TasksValidationError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export declare function safeTasksChainError(cause: unknown, broadcast: boolean, authorizationExposed: boolean, txHash?: `0x${string}`): TasksChainError;
|
|
6
|
+
//# sourceMappingURL=chain-error.d.ts.map
|