@agirails/sdk 2.5.2 → 2.5.4
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/dist/ACTPClient.d.ts +18 -0
- package/dist/ACTPClient.d.ts.map +1 -1
- package/dist/ACTPClient.js +67 -22
- package/dist/ACTPClient.js.map +1 -1
- package/dist/adapters/BasicAdapter.d.ts +12 -0
- package/dist/adapters/BasicAdapter.d.ts.map +1 -1
- package/dist/adapters/BasicAdapter.js +30 -4
- package/dist/adapters/BasicAdapter.js.map +1 -1
- package/dist/adapters/StandardAdapter.d.ts +20 -3
- package/dist/adapters/StandardAdapter.d.ts.map +1 -1
- package/dist/adapters/StandardAdapter.js +45 -11
- package/dist/adapters/StandardAdapter.js.map +1 -1
- package/dist/cli/commands/publish.js +16 -4
- package/dist/cli/commands/publish.js.map +1 -1
- package/dist/cli/commands/register.js +16 -4
- package/dist/cli/commands/register.js.map +1 -1
- package/dist/cli/commands/tx.js +31 -3
- package/dist/cli/commands/tx.js.map +1 -1
- package/dist/cli/utils/client.d.ts.map +1 -1
- package/dist/cli/utils/client.js +1 -0
- package/dist/cli/utils/client.js.map +1 -1
- package/dist/config/networks.d.ts +2 -2
- package/dist/config/networks.d.ts.map +1 -1
- package/dist/config/networks.js +27 -22
- package/dist/config/networks.js.map +1 -1
- package/dist/level0/request.d.ts.map +1 -1
- package/dist/level0/request.js +2 -1
- package/dist/level0/request.js.map +1 -1
- package/dist/runtime/BlockchainRuntime.d.ts.map +1 -1
- package/dist/runtime/BlockchainRuntime.js +11 -5
- package/dist/runtime/BlockchainRuntime.js.map +1 -1
- package/dist/runtime/MockStateManager.d.ts.map +1 -1
- package/dist/runtime/MockStateManager.js +2 -1
- package/dist/runtime/MockStateManager.js.map +1 -1
- package/dist/utils/IPFSClient.d.ts +3 -1
- package/dist/utils/IPFSClient.d.ts.map +1 -1
- package/dist/utils/IPFSClient.js +27 -7
- package/dist/utils/IPFSClient.js.map +1 -1
- package/dist/wallet/AutoWalletProvider.d.ts.map +1 -1
- package/dist/wallet/AutoWalletProvider.js +52 -18
- package/dist/wallet/AutoWalletProvider.js.map +1 -1
- package/dist/wallet/SmartWalletRouter.d.ts +116 -0
- package/dist/wallet/SmartWalletRouter.d.ts.map +1 -0
- package/dist/wallet/SmartWalletRouter.js +212 -0
- package/dist/wallet/SmartWalletRouter.js.map +1 -0
- package/dist/wallet/aa/DualNonceManager.d.ts +19 -0
- package/dist/wallet/aa/DualNonceManager.d.ts.map +1 -1
- package/dist/wallet/aa/DualNonceManager.js +100 -5
- package/dist/wallet/aa/DualNonceManager.js.map +1 -1
- package/package.json +3 -6
- package/src/ACTPClient.ts +0 -1579
- package/src/abi/ACTPKernel.json +0 -1356
- package/src/abi/AgentRegistry.json +0 -915
- package/src/abi/ERC20.json +0 -40
- package/src/abi/EscrowVault.json +0 -134
- package/src/abi/IdentityRegistry.json +0 -316
- package/src/adapters/AdapterRegistry.ts +0 -173
- package/src/adapters/AdapterRouter.ts +0 -416
- package/src/adapters/BaseAdapter.ts +0 -498
- package/src/adapters/BasicAdapter.ts +0 -514
- package/src/adapters/IAdapter.ts +0 -292
- package/src/adapters/StandardAdapter.ts +0 -555
- package/src/adapters/X402Adapter.ts +0 -731
- package/src/adapters/index.ts +0 -60
- package/src/builders/DeliveryProofBuilder.ts +0 -327
- package/src/builders/QuoteBuilder.ts +0 -483
- package/src/builders/index.ts +0 -17
- package/src/cli/commands/balance.ts +0 -110
- package/src/cli/commands/batch.ts +0 -487
- package/src/cli/commands/config.ts +0 -231
- package/src/cli/commands/deploy-check.ts +0 -364
- package/src/cli/commands/deploy-env.ts +0 -120
- package/src/cli/commands/diff.ts +0 -141
- package/src/cli/commands/init.ts +0 -469
- package/src/cli/commands/mint.ts +0 -116
- package/src/cli/commands/pay.ts +0 -113
- package/src/cli/commands/publish.ts +0 -475
- package/src/cli/commands/pull.ts +0 -124
- package/src/cli/commands/register.ts +0 -247
- package/src/cli/commands/simulate.ts +0 -345
- package/src/cli/commands/time.ts +0 -302
- package/src/cli/commands/tx.ts +0 -448
- package/src/cli/commands/watch.ts +0 -211
- package/src/cli/index.ts +0 -134
- package/src/cli/utils/client.ts +0 -251
- package/src/cli/utils/config.ts +0 -389
- package/src/cli/utils/output.ts +0 -465
- package/src/cli/utils/wallet.ts +0 -109
- package/src/config/agirailsmd.ts +0 -262
- package/src/config/networks.ts +0 -275
- package/src/config/pendingPublish.ts +0 -237
- package/src/config/publishPipeline.ts +0 -359
- package/src/config/syncOperations.ts +0 -279
- package/src/erc8004/ERC8004Bridge.ts +0 -462
- package/src/erc8004/ReputationReporter.ts +0 -468
- package/src/erc8004/index.ts +0 -61
- package/src/errors/index.ts +0 -427
- package/src/index.ts +0 -364
- package/src/level0/Provider.ts +0 -117
- package/src/level0/ServiceDirectory.ts +0 -131
- package/src/level0/index.ts +0 -10
- package/src/level0/provide.ts +0 -132
- package/src/level0/request.ts +0 -432
- package/src/level1/Agent.ts +0 -1426
- package/src/level1/index.ts +0 -10
- package/src/level1/pricing/PriceCalculator.ts +0 -255
- package/src/level1/pricing/PricingStrategy.ts +0 -198
- package/src/level1/types/Job.ts +0 -179
- package/src/level1/types/Options.ts +0 -291
- package/src/level1/types/index.ts +0 -8
- package/src/protocol/ACTPKernel.ts +0 -808
- package/src/protocol/AgentRegistry.ts +0 -559
- package/src/protocol/DIDManager.ts +0 -629
- package/src/protocol/DIDResolver.ts +0 -554
- package/src/protocol/EASHelper.ts +0 -378
- package/src/protocol/EscrowVault.ts +0 -255
- package/src/protocol/EventMonitor.ts +0 -204
- package/src/protocol/MessageSigner.ts +0 -510
- package/src/protocol/ProofGenerator.ts +0 -339
- package/src/protocol/QuoteBuilder.ts +0 -15
- package/src/registry/AgentRegistryClient.ts +0 -202
- package/src/runtime/BlockchainRuntime.ts +0 -1015
- package/src/runtime/IACTPRuntime.ts +0 -306
- package/src/runtime/MockRuntime.ts +0 -1298
- package/src/runtime/MockStateManager.ts +0 -576
- package/src/runtime/index.ts +0 -25
- package/src/runtime/types/MockState.ts +0 -237
- package/src/storage/ArchiveBundleBuilder.ts +0 -561
- package/src/storage/ArweaveClient.ts +0 -946
- package/src/storage/FilebaseClient.ts +0 -790
- package/src/storage/index.ts +0 -96
- package/src/storage/types.ts +0 -348
- package/src/types/adapter.ts +0 -310
- package/src/types/agent.ts +0 -79
- package/src/types/did.ts +0 -223
- package/src/types/eip712.ts +0 -175
- package/src/types/erc8004.ts +0 -293
- package/src/types/escrow.ts +0 -27
- package/src/types/index.ts +0 -17
- package/src/types/message.ts +0 -145
- package/src/types/state.ts +0 -87
- package/src/types/transaction.ts +0 -69
- package/src/types/x402.ts +0 -251
- package/src/utils/ErrorRecoveryGuide.ts +0 -676
- package/src/utils/Helpers.ts +0 -688
- package/src/utils/IPFSClient.ts +0 -368
- package/src/utils/Logger.ts +0 -484
- package/src/utils/NonceManager.ts +0 -591
- package/src/utils/RateLimiter.ts +0 -534
- package/src/utils/ReceivedNonceTracker.ts +0 -567
- package/src/utils/SDKLifecycle.ts +0 -416
- package/src/utils/SecureNonce.ts +0 -78
- package/src/utils/Semaphore.ts +0 -276
- package/src/utils/UsedAttestationTracker.ts +0 -385
- package/src/utils/canonicalJson.ts +0 -38
- package/src/utils/circuitBreaker.ts +0 -324
- package/src/utils/computeTypeHash.ts +0 -48
- package/src/utils/fsSafe.ts +0 -80
- package/src/utils/index.ts +0 -80
- package/src/utils/retry.ts +0 -364
- package/src/utils/security.ts +0 -418
- package/src/utils/validation.ts +0 -540
- package/src/wallet/AutoWalletProvider.ts +0 -299
- package/src/wallet/EOAWalletProvider.ts +0 -69
- package/src/wallet/IWalletProvider.ts +0 -135
- package/src/wallet/aa/BundlerClient.ts +0 -274
- package/src/wallet/aa/DualNonceManager.ts +0 -173
- package/src/wallet/aa/PaymasterClient.ts +0 -174
- package/src/wallet/aa/TransactionBatcher.ts +0 -353
- package/src/wallet/aa/UserOpBuilder.ts +0 -246
- package/src/wallet/aa/constants.ts +0 -60
- package/src/wallet/keystore.ts +0 -240
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for Basic and Standard APIs
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { Job } from './Job';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Wallet configuration options
|
|
11
|
-
*/
|
|
12
|
-
export type WalletOption =
|
|
13
|
-
| 'auto' // SDK generates managed wallet
|
|
14
|
-
| 'connect' // Browser wallet popup (future)
|
|
15
|
-
| string // Private key directly
|
|
16
|
-
| { privateKey: string }; // Private key in object form
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Network options
|
|
20
|
-
*/
|
|
21
|
-
export type NetworkOption = 'mock' | 'testnet' | 'mainnet';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Options for provide() function (Basic API)
|
|
25
|
-
*/
|
|
26
|
-
export interface ProvideOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Wallet configuration
|
|
29
|
-
*
|
|
30
|
-
* - 'auto': SDK generates and manages a wallet automatically
|
|
31
|
-
* - 'connect': Open browser wallet connection (MetaMask, etc.) - FUTURE
|
|
32
|
-
* - string: Private key (0x-prefixed hex)
|
|
33
|
-
* - object: { privateKey: string }
|
|
34
|
-
*
|
|
35
|
-
* @default 'auto'
|
|
36
|
-
*/
|
|
37
|
-
wallet?: WalletOption;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Job filtering criteria
|
|
41
|
-
*
|
|
42
|
-
* Only accept jobs matching these filters.
|
|
43
|
-
*/
|
|
44
|
-
filter?: {
|
|
45
|
-
/**
|
|
46
|
-
* Minimum budget in USDC
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* filter: { minBudget: 5 } // Only accept jobs with budget >= $5
|
|
50
|
-
*/
|
|
51
|
-
minBudget?: number;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Maximum budget in USDC
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* filter: { maxBudget: 100 } // Only accept jobs with budget <= $100
|
|
58
|
-
*/
|
|
59
|
-
maxBudget?: number;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Auto-accept policy
|
|
64
|
-
*
|
|
65
|
-
* - true: Automatically accept all jobs matching filter
|
|
66
|
-
* - false: Require manual acceptance
|
|
67
|
-
* - function: Custom logic to decide whether to accept
|
|
68
|
-
*
|
|
69
|
-
* @default true
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* // Auto-accept if budget >= 10
|
|
74
|
-
* autoAccept: (job) => job.budget >= 10
|
|
75
|
-
*
|
|
76
|
-
* // Auto-accept high-priority jobs
|
|
77
|
-
* autoAccept: (job) => job.metadata?.priority === 'high'
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
autoAccept?: boolean | ((job: Job) => boolean | Promise<boolean>);
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Network to operate on
|
|
84
|
-
*
|
|
85
|
-
* @default 'mock'
|
|
86
|
-
*/
|
|
87
|
-
network?: NetworkOption;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* RPC URL for blockchain connection (required for testnet/mainnet)
|
|
91
|
-
*
|
|
92
|
-
* If not provided, defaults to public RPC from network config:
|
|
93
|
-
* - testnet: https://sepolia.base.org
|
|
94
|
-
* - mainnet: https://mainnet.base.org
|
|
95
|
-
*
|
|
96
|
-
* For production, consider using a dedicated RPC provider (Alchemy, Infura, etc.)
|
|
97
|
-
* for better reliability and rate limits.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* rpcUrl: 'https://base-sepolia.g.alchemy.com/v2/YOUR_API_KEY'
|
|
101
|
-
*/
|
|
102
|
-
rpcUrl?: string;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* State directory for mock mode
|
|
106
|
-
*
|
|
107
|
-
* Where to store mock state file.
|
|
108
|
-
* Only used when network is 'mock'.
|
|
109
|
-
*
|
|
110
|
-
* @default process.cwd()
|
|
111
|
-
*/
|
|
112
|
-
stateDirectory?: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Request status updates
|
|
117
|
-
*/
|
|
118
|
-
export interface RequestStatus {
|
|
119
|
-
/**
|
|
120
|
-
* Current state of the request
|
|
121
|
-
*/
|
|
122
|
-
state: 'initiated' | 'quoted' | 'committed' | 'in_progress' | 'delivered' | 'settled' | 'disputed' | 'cancelled';
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Progress percentage (0-100) if provider is reporting progress
|
|
126
|
-
*/
|
|
127
|
-
progress?: number;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Progress message if available
|
|
131
|
-
*/
|
|
132
|
-
message?: string;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Estimated time to completion (seconds)
|
|
136
|
-
*/
|
|
137
|
-
eta?: number;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Options for request() function (Basic API)
|
|
142
|
-
*/
|
|
143
|
-
export interface RequestOptions {
|
|
144
|
-
/**
|
|
145
|
-
* Input data to send to the service
|
|
146
|
-
*/
|
|
147
|
-
input: any;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Budget in USDC (decimal format)
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* budget: 10 // $10.00
|
|
154
|
-
*/
|
|
155
|
-
budget: number;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Wallet configuration (same as ProvideOptions)
|
|
159
|
-
*
|
|
160
|
-
* @default 'auto'
|
|
161
|
-
*/
|
|
162
|
-
wallet?: WalletOption;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Network to operate on
|
|
166
|
-
*
|
|
167
|
-
* @default 'mock'
|
|
168
|
-
*/
|
|
169
|
-
network?: NetworkOption;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Timeout in milliseconds
|
|
173
|
-
*
|
|
174
|
-
* @default 300000 (5 minutes)
|
|
175
|
-
*/
|
|
176
|
-
timeout?: number;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Deadline for job completion
|
|
180
|
-
*
|
|
181
|
-
* Can be a timestamp (seconds) or Date object.
|
|
182
|
-
* If not specified, defaults to now + timeout.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* deadline: Math.floor(Date.now() / 1000) + 3600 // 1 hour from now
|
|
186
|
-
* deadline: new Date('2025-12-14T12:00:00Z')
|
|
187
|
-
*/
|
|
188
|
-
deadline?: number | Date;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Provider selection strategy
|
|
192
|
-
*
|
|
193
|
-
* - string: Specific provider address
|
|
194
|
-
* - 'any': First available provider
|
|
195
|
-
* - 'best': Provider with highest reputation
|
|
196
|
-
* - 'cheapest': Provider with lowest price
|
|
197
|
-
*
|
|
198
|
-
* @default 'any'
|
|
199
|
-
*/
|
|
200
|
-
provider?: string | 'any' | 'best' | 'cheapest';
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Progress callback
|
|
204
|
-
*
|
|
205
|
-
* Called when provider reports progress updates.
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* onProgress: (status) => {
|
|
210
|
-
* console.log(`${status.state}: ${status.progress}% - ${status.message}`);
|
|
211
|
-
* }
|
|
212
|
-
* ```
|
|
213
|
-
*/
|
|
214
|
-
onProgress?: (status: RequestStatus) => void;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* State directory for mock mode
|
|
218
|
-
*
|
|
219
|
-
* @default process.cwd()
|
|
220
|
-
*/
|
|
221
|
-
stateDirectory?: string;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* RPC URL for blockchain connection (required for testnet/mainnet)
|
|
225
|
-
*
|
|
226
|
-
* If not provided, defaults to public RPC from network config:
|
|
227
|
-
* - testnet: https://sepolia.base.org
|
|
228
|
-
* - mainnet: https://mainnet.base.org
|
|
229
|
-
*
|
|
230
|
-
* For production, consider using a dedicated RPC provider (Alchemy, Infura, etc.)
|
|
231
|
-
* for better reliability and rate limits.
|
|
232
|
-
*
|
|
233
|
-
* @example
|
|
234
|
-
* rpcUrl: 'https://base-sepolia.g.alchemy.com/v2/YOUR_API_KEY'
|
|
235
|
-
*/
|
|
236
|
-
rpcUrl?: string;
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Dispute window duration in seconds
|
|
240
|
-
*
|
|
241
|
-
* Time after delivery during which requester can dispute.
|
|
242
|
-
*
|
|
243
|
-
* @default 172800 (2 days)
|
|
244
|
-
*/
|
|
245
|
-
disputeWindow?: number;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Result of request() function
|
|
250
|
-
*/
|
|
251
|
-
export interface RequestResult {
|
|
252
|
-
/**
|
|
253
|
-
* The result returned by the provider's handler
|
|
254
|
-
*/
|
|
255
|
-
result: any;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Transaction metadata
|
|
259
|
-
*/
|
|
260
|
-
transaction: {
|
|
261
|
-
/**
|
|
262
|
-
* Transaction ID (ACTP protocol)
|
|
263
|
-
*/
|
|
264
|
-
id: string;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Provider address
|
|
268
|
-
*/
|
|
269
|
-
provider: string;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Amount paid (USDC)
|
|
273
|
-
*/
|
|
274
|
-
amount: number;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Platform fee (USDC)
|
|
278
|
-
*/
|
|
279
|
-
fee: number;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Job duration (milliseconds)
|
|
283
|
-
*/
|
|
284
|
-
duration: number;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Delivery proof hash
|
|
288
|
-
*/
|
|
289
|
-
proof: string;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standard API Types - Job, Options, and related interfaces
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export { Job, JobHandler, JobContext } from './Job';
|
|
8
|
-
export { ProvideOptions, RequestOptions, RequestResult, RequestStatus, WalletOption, NetworkOption } from './Options';
|