@oneshot-agent/sdk 0.16.2 → 0.18.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/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +68 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +30 -1052
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +235 -193
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1040 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,1049 +4,9 @@ export { EthersWalletProvider } from './providers/ethers';
|
|
|
4
4
|
export { CdpWalletProvider } from './providers/cdp';
|
|
5
5
|
export { getSwapQuote, executeSwap } from './swap';
|
|
6
6
|
export type { SwapQuote, SwapResult, UniswapAddresses } from './swap';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export declare class ToolError extends OneShotError {
|
|
11
|
-
readonly statusCode: number;
|
|
12
|
-
readonly responseBody: string;
|
|
13
|
-
constructor(message: string, statusCode: number, responseBody: string);
|
|
14
|
-
}
|
|
15
|
-
export declare class JobError extends OneShotError {
|
|
16
|
-
readonly jobId: string;
|
|
17
|
-
readonly jobError: string;
|
|
18
|
-
constructor(message: string, jobId: string, jobError: string);
|
|
19
|
-
}
|
|
20
|
-
export declare class JobTimeoutError extends OneShotError {
|
|
21
|
-
readonly jobId: string;
|
|
22
|
-
readonly elapsedMs: number;
|
|
23
|
-
constructor(jobId: string, elapsedMs: number);
|
|
24
|
-
}
|
|
25
|
-
export declare class ValidationError extends OneShotError {
|
|
26
|
-
readonly field: string;
|
|
27
|
-
constructor(message: string, field: string);
|
|
28
|
-
}
|
|
29
|
-
export declare class ContentBlockedError extends OneShotError {
|
|
30
|
-
readonly categories: string[];
|
|
31
|
-
constructor(message: string, categories: string[]);
|
|
32
|
-
}
|
|
33
|
-
export declare class EmergencyNumberError extends OneShotError {
|
|
34
|
-
readonly blockedNumber: string;
|
|
35
|
-
constructor(message: string, blockedNumber: string);
|
|
36
|
-
}
|
|
37
|
-
export interface TokenInfo {
|
|
38
|
-
address: string;
|
|
39
|
-
symbol: string;
|
|
40
|
-
decimals: number;
|
|
41
|
-
}
|
|
42
|
-
export interface PaymentInfo {
|
|
43
|
-
protocol: 'x402';
|
|
44
|
-
network: string;
|
|
45
|
-
payTo: string;
|
|
46
|
-
amount: string;
|
|
47
|
-
currency: string;
|
|
48
|
-
facilitator_url: string;
|
|
49
|
-
token: TokenInfo;
|
|
50
|
-
context?: Record<string, unknown>;
|
|
51
|
-
}
|
|
52
|
-
export interface PaymentRequirements {
|
|
53
|
-
scheme: string;
|
|
54
|
-
network: string;
|
|
55
|
-
amount: string;
|
|
56
|
-
asset: string;
|
|
57
|
-
payTo: string;
|
|
58
|
-
maxTimeoutSeconds: number;
|
|
59
|
-
extra?: Record<string, unknown>;
|
|
60
|
-
}
|
|
61
|
-
export interface PaymentAuthorization {
|
|
62
|
-
x402Version: 2;
|
|
63
|
-
resource?: {
|
|
64
|
-
url: string;
|
|
65
|
-
description?: string;
|
|
66
|
-
mimeType?: string;
|
|
67
|
-
};
|
|
68
|
-
extensions?: Record<string, unknown>;
|
|
69
|
-
accepted: PaymentRequirements;
|
|
70
|
-
payload: {
|
|
71
|
-
signature: string;
|
|
72
|
-
authorization: {
|
|
73
|
-
from: string;
|
|
74
|
-
to: string;
|
|
75
|
-
value: string;
|
|
76
|
-
validAfter: string;
|
|
77
|
-
validBefore: string;
|
|
78
|
-
nonce: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
export type LoggerFn = (message: string) => void;
|
|
83
|
-
export type StatusUpdateFn = (status: string, requestId: string) => void;
|
|
84
|
-
export interface OneShotConfig {
|
|
85
|
-
/** Option A: Raw private key (existing behavior) */
|
|
86
|
-
privateKey?: string;
|
|
87
|
-
/** Option B: Use Coinbase CDP Server Wallet (reads CDP_* env vars). Pass true or { address } to reuse existing. */
|
|
88
|
-
cdp?: boolean | {
|
|
89
|
-
address?: string;
|
|
90
|
-
};
|
|
91
|
-
/** Option C: Bring your own WalletProvider implementation */
|
|
92
|
-
walletProvider?: WalletProvider;
|
|
93
|
-
/** Override API URL */
|
|
94
|
-
baseUrl?: string;
|
|
95
|
-
/** Override RPC URL */
|
|
96
|
-
rpcUrl?: string;
|
|
97
|
-
/** Enable debug logging */
|
|
98
|
-
debug?: boolean;
|
|
99
|
-
/** Custom logger function */
|
|
100
|
-
logger?: LoggerFn;
|
|
101
|
-
/** Payment currency: "USDC" (default, no swap) or "ETH" (auto-swap via Uniswap V3) */
|
|
102
|
-
currency?: 'USDC' | 'ETH';
|
|
103
|
-
/** Slippage tolerance for ETH→USDC swaps (default: 0.01 = 1%). Only used when currency is "ETH". */
|
|
104
|
-
slippage?: number;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Structured decision context for a tool call. Machine-readable metadata
|
|
108
|
-
* that explains WHY this tool was called — consumed by auditor agents
|
|
109
|
-
* and programmatic oversight. Open schema: known fields are typed,
|
|
110
|
-
* extra keys are allowed.
|
|
111
|
-
*/
|
|
112
|
-
export interface DecisionContext {
|
|
113
|
-
/** Goal or objective this tool call serves */
|
|
114
|
-
goal?: string;
|
|
115
|
-
/** Compute goal ID if linked to an orchestrated goal */
|
|
116
|
-
goalId?: string;
|
|
117
|
-
/** Alternative tools/approaches that were considered */
|
|
118
|
-
alternatives?: string[];
|
|
119
|
-
/** Confidence in this being the right tool choice (0-1) */
|
|
120
|
-
confidence?: number;
|
|
121
|
-
/** Any additional context */
|
|
122
|
-
[key: string]: unknown;
|
|
123
|
-
}
|
|
124
|
-
export interface ToolOptions {
|
|
125
|
-
maxCost?: number;
|
|
126
|
-
timeout?: number;
|
|
127
|
-
signal?: AbortSignal;
|
|
128
|
-
onStatusUpdate?: StatusUpdateFn;
|
|
129
|
-
wait?: boolean;
|
|
130
|
-
/** Optional value tag for RoCS tracking — stored in the receipt at creation time */
|
|
131
|
-
valueTag?: {
|
|
132
|
-
type: string;
|
|
133
|
-
amount?: number;
|
|
134
|
-
label?: string;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Short human-readable reason for this tool call. Stored on the receipt
|
|
138
|
-
* for debugging and audit. Max 1000 chars. The SDK warns (does not error)
|
|
139
|
-
* if a paid tool is called without a memo.
|
|
140
|
-
*/
|
|
141
|
-
memo?: string;
|
|
142
|
-
/**
|
|
143
|
-
* Structured decision context — goal linkage, alternatives considered,
|
|
144
|
-
* confidence score. Machine-readable counterpart to memo. Stored alongside
|
|
145
|
-
* the receipt for programmatic auditing by supervisor agents.
|
|
146
|
-
*/
|
|
147
|
-
decisionContext?: DecisionContext;
|
|
148
|
-
/**
|
|
149
|
-
* Apollo phone-reveal opt-in. Apollo's phone numbers arrive asynchronously
|
|
150
|
-
* via a webhook minutes AFTER the initial enrichment completes. By default,
|
|
151
|
-
* the SDK returns as soon as the worker writes status=completed (phones=null,
|
|
152
|
-
* phones_pending=true). Set `waitForPhones: true` to keep polling at a slower
|
|
153
|
-
* cadence (every 5s) until phones land or `phoneTimeoutSec` expires (default
|
|
154
|
-
* 360s = 6 min — Apollo says "several minutes"). Only meaningful for tools
|
|
155
|
-
* that hit Apollo internally (research/person, enrich/profile, etc.). For
|
|
156
|
-
* other tools the flag is a no-op.
|
|
157
|
-
*/
|
|
158
|
-
waitForPhones?: boolean;
|
|
159
|
-
phoneTimeoutSec?: number;
|
|
160
|
-
}
|
|
161
|
-
export interface EmailToolOptions extends ToolOptions {
|
|
162
|
-
to: string | string[];
|
|
163
|
-
subject: string;
|
|
164
|
-
body: string;
|
|
165
|
-
from_domain?: string;
|
|
166
|
-
/** Sender mailbox / local-part. Defaults to `agent` (i.e. agent@from_domain). */
|
|
167
|
-
from_mailbox?: string;
|
|
168
|
-
/** Display name shown to the recipient, e.g. "Jane Doe" → "Jane Doe <jane@domain>". */
|
|
169
|
-
from_name?: string;
|
|
170
|
-
attachments?: Array<{
|
|
171
|
-
filename?: string;
|
|
172
|
-
content?: string;
|
|
173
|
-
url?: string;
|
|
174
|
-
content_type?: string;
|
|
175
|
-
}>;
|
|
176
|
-
}
|
|
177
|
-
export interface ResearchToolOptions extends ToolOptions {
|
|
178
|
-
topic: string;
|
|
179
|
-
depth?: 'deep' | 'quick';
|
|
180
|
-
}
|
|
181
|
-
export interface PeopleSearchOptions extends ToolOptions {
|
|
182
|
-
job_titles?: string[];
|
|
183
|
-
keywords?: string[];
|
|
184
|
-
companies?: string[];
|
|
185
|
-
company_domains?: string[];
|
|
186
|
-
location?: string[];
|
|
187
|
-
skills?: string[];
|
|
188
|
-
seniority?: string[];
|
|
189
|
-
industry?: string[];
|
|
190
|
-
company_size?: string;
|
|
191
|
-
limit?: number;
|
|
192
|
-
}
|
|
193
|
-
export interface EnrichProfileOptions extends ToolOptions {
|
|
194
|
-
linkedin_url?: string;
|
|
195
|
-
email?: string;
|
|
196
|
-
name?: string;
|
|
197
|
-
company_domain?: string;
|
|
198
|
-
}
|
|
199
|
-
export interface FindEmailOptions extends ToolOptions {
|
|
200
|
-
full_name?: string;
|
|
201
|
-
first_name?: string;
|
|
202
|
-
last_name?: string;
|
|
203
|
-
company_domain: string;
|
|
204
|
-
}
|
|
205
|
-
export interface VerifyEmailOptions extends ToolOptions {
|
|
206
|
-
email: string;
|
|
207
|
-
}
|
|
208
|
-
export interface DeepResearchPersonOptions extends ToolOptions {
|
|
209
|
-
email?: string;
|
|
210
|
-
social_media_url?: string;
|
|
211
|
-
name?: string;
|
|
212
|
-
company?: string;
|
|
213
|
-
}
|
|
214
|
-
export interface SocialProfilesOptions extends ToolOptions {
|
|
215
|
-
email?: string;
|
|
216
|
-
social_media_url?: string;
|
|
217
|
-
}
|
|
218
|
-
export interface ArticleSearchOptions extends ToolOptions {
|
|
219
|
-
name: string;
|
|
220
|
-
company: string;
|
|
221
|
-
sort?: 'recent' | 'popular';
|
|
222
|
-
limit?: number;
|
|
223
|
-
}
|
|
224
|
-
export interface PersonNewsfeedOptions extends ToolOptions {
|
|
225
|
-
social_media_url: string;
|
|
226
|
-
}
|
|
227
|
-
export interface PersonInterestsOptions extends ToolOptions {
|
|
228
|
-
email?: string;
|
|
229
|
-
phone?: string;
|
|
230
|
-
social_media_url?: string;
|
|
231
|
-
}
|
|
232
|
-
export interface PersonInteractionsOptions extends ToolOptions {
|
|
233
|
-
social_media_url: string;
|
|
234
|
-
type?: 'replies' | 'followers' | 'following' | 'followers,following';
|
|
235
|
-
max_results?: number;
|
|
236
|
-
}
|
|
237
|
-
export interface InboxListOptions {
|
|
238
|
-
since?: string;
|
|
239
|
-
limit?: number;
|
|
240
|
-
include_body?: boolean;
|
|
241
|
-
}
|
|
242
|
-
export interface ShippingAddress {
|
|
243
|
-
first_name: string;
|
|
244
|
-
last_name: string;
|
|
245
|
-
street: string;
|
|
246
|
-
street2?: string;
|
|
247
|
-
city: string;
|
|
248
|
-
state: string;
|
|
249
|
-
zip_code: string;
|
|
250
|
-
country?: string;
|
|
251
|
-
email?: string;
|
|
252
|
-
phone: string;
|
|
253
|
-
}
|
|
254
|
-
export interface CommerceBuyOptions extends ToolOptions {
|
|
255
|
-
product_url: string;
|
|
256
|
-
shipping_address: ShippingAddress;
|
|
257
|
-
quantity?: number;
|
|
258
|
-
variant_id?: string;
|
|
259
|
-
}
|
|
260
|
-
export interface CommerceSearchOptions extends ToolOptions {
|
|
261
|
-
query: string;
|
|
262
|
-
limit?: number;
|
|
263
|
-
}
|
|
264
|
-
export interface WebSearchOptions extends ToolOptions {
|
|
265
|
-
query: string;
|
|
266
|
-
max_results?: number;
|
|
267
|
-
}
|
|
268
|
-
export interface WebSearchResult {
|
|
269
|
-
query: string;
|
|
270
|
-
results: Array<{
|
|
271
|
-
url: string;
|
|
272
|
-
title: string;
|
|
273
|
-
description: string;
|
|
274
|
-
}>;
|
|
275
|
-
result_count: number;
|
|
276
|
-
memo?: string;
|
|
277
|
-
cost?: number;
|
|
278
|
-
}
|
|
279
|
-
export interface WebReadOptions extends ToolOptions {
|
|
280
|
-
/** URL of the web page to read */
|
|
281
|
-
url: string;
|
|
282
|
-
}
|
|
283
|
-
export interface WebReadResult {
|
|
284
|
-
request_id?: string;
|
|
285
|
-
url: string;
|
|
286
|
-
markdown: string;
|
|
287
|
-
screenshot_url?: string;
|
|
288
|
-
metadata?: {
|
|
289
|
-
title: string;
|
|
290
|
-
description: string;
|
|
291
|
-
statusCode?: number;
|
|
292
|
-
};
|
|
293
|
-
truncated?: boolean;
|
|
294
|
-
memo?: string;
|
|
295
|
-
cost?: number;
|
|
296
|
-
}
|
|
297
|
-
export interface VoiceCallOptions extends ToolOptions {
|
|
298
|
-
/** The objective of the call - what should the OneShot Agent accomplish */
|
|
299
|
-
objective: string;
|
|
300
|
-
/** Target phone number(s) in E.164 format. Array triggers conference mode analysis. */
|
|
301
|
-
target_number: string | string[];
|
|
302
|
-
/** Optional persona for the OneShot Agent caller */
|
|
303
|
-
caller_persona?: string;
|
|
304
|
-
/** Additional context about the call */
|
|
305
|
-
context?: string;
|
|
306
|
-
/** Maximum call duration in minutes (1-30) */
|
|
307
|
-
max_duration_minutes?: number;
|
|
308
|
-
}
|
|
309
|
-
export interface SmsOptions extends ToolOptions {
|
|
310
|
-
/** The SMS message body (max 1600 characters) */
|
|
311
|
-
message: string;
|
|
312
|
-
/** Target phone number(s) in E.164 format (max 10 recipients) */
|
|
313
|
-
to_number: string | string[];
|
|
314
|
-
}
|
|
315
|
-
export interface SmsInboxOptions {
|
|
316
|
-
/** Filter messages received after this ISO timestamp */
|
|
317
|
-
since?: string;
|
|
318
|
-
/** Maximum number of messages to return (default: 50, max: 100) */
|
|
319
|
-
limit?: number;
|
|
320
|
-
/** Filter by sender phone number */
|
|
321
|
-
from?: string;
|
|
322
|
-
}
|
|
323
|
-
export interface Experience {
|
|
324
|
-
company?: {
|
|
325
|
-
name?: string;
|
|
326
|
-
website?: string;
|
|
327
|
-
};
|
|
328
|
-
title?: {
|
|
329
|
-
name?: string;
|
|
330
|
-
};
|
|
331
|
-
start_date?: string;
|
|
332
|
-
end_date?: string;
|
|
333
|
-
is_primary?: boolean;
|
|
334
|
-
}
|
|
335
|
-
export interface Education {
|
|
336
|
-
school?: {
|
|
337
|
-
name?: string;
|
|
338
|
-
};
|
|
339
|
-
degrees?: string[];
|
|
340
|
-
majors?: string[];
|
|
341
|
-
start_date?: string;
|
|
342
|
-
end_date?: string;
|
|
343
|
-
}
|
|
344
|
-
export interface PersonResult {
|
|
345
|
-
full_name?: string;
|
|
346
|
-
first_name?: string;
|
|
347
|
-
last_name?: string;
|
|
348
|
-
title?: string;
|
|
349
|
-
company?: string;
|
|
350
|
-
company_domain?: string;
|
|
351
|
-
linkedin_url?: string;
|
|
352
|
-
location?: string;
|
|
353
|
-
email?: string;
|
|
354
|
-
phone?: string;
|
|
355
|
-
summary?: string;
|
|
356
|
-
skills?: string[];
|
|
357
|
-
experience?: Experience[];
|
|
358
|
-
education?: Education[];
|
|
359
|
-
fullphone?: Array<{
|
|
360
|
-
fullphone: string;
|
|
361
|
-
}>;
|
|
362
|
-
altemails?: string[];
|
|
363
|
-
best_work_email?: string | null;
|
|
364
|
-
best_personal_email?: string | null;
|
|
365
|
-
}
|
|
366
|
-
export interface PeopleSearchResult {
|
|
367
|
-
status: string;
|
|
368
|
-
results: PersonResult[];
|
|
369
|
-
total_found: number;
|
|
370
|
-
request_id?: string;
|
|
371
|
-
completed_at?: string;
|
|
372
|
-
filters?: Record<string, unknown>;
|
|
373
|
-
memo?: string;
|
|
374
|
-
cost?: number;
|
|
375
|
-
}
|
|
376
|
-
export interface ResearchResult {
|
|
377
|
-
request_id?: string;
|
|
378
|
-
report_content: string;
|
|
379
|
-
sources: Array<{
|
|
380
|
-
url: string;
|
|
381
|
-
title?: string;
|
|
382
|
-
}>;
|
|
383
|
-
sources_count: number;
|
|
384
|
-
topic: string;
|
|
385
|
-
depth: string;
|
|
386
|
-
workspace: string;
|
|
387
|
-
report_path: string;
|
|
388
|
-
completed_at: string;
|
|
389
|
-
report_gcs_uri: string;
|
|
390
|
-
memo?: string;
|
|
391
|
-
cost?: number;
|
|
392
|
-
}
|
|
393
|
-
export interface EmailResult {
|
|
394
|
-
request_id?: string;
|
|
395
|
-
status: string;
|
|
396
|
-
timeline?: Array<Record<string, unknown>>;
|
|
397
|
-
error?: string;
|
|
398
|
-
email?: {
|
|
399
|
-
id: string;
|
|
400
|
-
provider_message_id: string;
|
|
401
|
-
status: string;
|
|
402
|
-
};
|
|
403
|
-
domain?: {
|
|
404
|
-
domain: string;
|
|
405
|
-
status: string;
|
|
406
|
-
was_provisioned: boolean;
|
|
407
|
-
};
|
|
408
|
-
memo?: string;
|
|
409
|
-
cost?: number;
|
|
410
|
-
}
|
|
411
|
-
export interface EnrichProfileResult {
|
|
412
|
-
status: string;
|
|
413
|
-
profile: PersonResult;
|
|
414
|
-
request_id?: string;
|
|
415
|
-
completed_at?: string;
|
|
416
|
-
memo?: string;
|
|
417
|
-
cost?: number;
|
|
418
|
-
}
|
|
419
|
-
export interface FindEmailResult {
|
|
420
|
-
status: string;
|
|
421
|
-
email: string | null;
|
|
422
|
-
found: boolean;
|
|
423
|
-
full_name?: string;
|
|
424
|
-
company_domain?: string;
|
|
425
|
-
request_id?: string;
|
|
426
|
-
completed_at?: string;
|
|
427
|
-
memo?: string;
|
|
428
|
-
cost?: number;
|
|
429
|
-
}
|
|
430
|
-
export interface AsyncJobResult {
|
|
431
|
-
request_id: string;
|
|
432
|
-
status: string;
|
|
433
|
-
}
|
|
434
|
-
/** Enrichment data nested inside deep research and enrichment responses. */
|
|
435
|
-
export interface PersonEnrichment {
|
|
436
|
-
displayname?: string;
|
|
437
|
-
firstname?: string;
|
|
438
|
-
lastname?: string;
|
|
439
|
-
bio?: string;
|
|
440
|
-
location?: string;
|
|
441
|
-
altemails?: string[];
|
|
442
|
-
best_work_email?: string;
|
|
443
|
-
best_personal_email?: string;
|
|
444
|
-
fullphone?: Array<{
|
|
445
|
-
fullphone: string;
|
|
446
|
-
type: string;
|
|
447
|
-
}>;
|
|
448
|
-
organizations?: Array<{
|
|
449
|
-
name?: string;
|
|
450
|
-
title?: string;
|
|
451
|
-
startDate?: string;
|
|
452
|
-
endDate?: string;
|
|
453
|
-
endDate_formatted?: {
|
|
454
|
-
is_current: boolean;
|
|
455
|
-
};
|
|
456
|
-
}>;
|
|
457
|
-
schools_info?: Array<{
|
|
458
|
-
name?: string;
|
|
459
|
-
degree?: string;
|
|
460
|
-
title?: string;
|
|
461
|
-
}>;
|
|
462
|
-
social_profiles?: Record<string, {
|
|
463
|
-
url?: string;
|
|
464
|
-
username?: string;
|
|
465
|
-
followers?: number;
|
|
466
|
-
}>;
|
|
467
|
-
newsfeed?: Array<{
|
|
468
|
-
source?: string;
|
|
469
|
-
type?: string;
|
|
470
|
-
content?: string;
|
|
471
|
-
date_posted?: string;
|
|
472
|
-
engagement?: {
|
|
473
|
-
likes?: number;
|
|
474
|
-
replies?: number;
|
|
475
|
-
shares?: number;
|
|
476
|
-
};
|
|
477
|
-
}>;
|
|
478
|
-
}
|
|
479
|
-
export interface DeepResearchPersonResult {
|
|
480
|
-
status: string;
|
|
481
|
-
result: {
|
|
482
|
-
enrichment: PersonEnrichment;
|
|
483
|
-
following?: Record<string, unknown>[];
|
|
484
|
-
articles?: Array<{
|
|
485
|
-
title?: string;
|
|
486
|
-
url?: string;
|
|
487
|
-
source?: string;
|
|
488
|
-
published_date?: string;
|
|
489
|
-
snippet?: string;
|
|
490
|
-
}>;
|
|
491
|
-
dossier?: Record<string, unknown>;
|
|
492
|
-
};
|
|
493
|
-
request_id: string;
|
|
494
|
-
completed_at: string;
|
|
495
|
-
memo?: string;
|
|
496
|
-
cost?: number;
|
|
497
|
-
}
|
|
498
|
-
export interface SocialProfilesResult {
|
|
499
|
-
status: string;
|
|
500
|
-
result: Record<string, {
|
|
501
|
-
url?: string;
|
|
502
|
-
username?: string;
|
|
503
|
-
followers?: number;
|
|
504
|
-
bio?: string;
|
|
505
|
-
}>;
|
|
506
|
-
request_id: string;
|
|
507
|
-
completed_at: string;
|
|
508
|
-
memo?: string;
|
|
509
|
-
cost?: number;
|
|
510
|
-
}
|
|
511
|
-
export interface ArticleSearchResult {
|
|
512
|
-
status: string;
|
|
513
|
-
result: Array<{
|
|
514
|
-
title?: string;
|
|
515
|
-
url?: string;
|
|
516
|
-
source?: string;
|
|
517
|
-
published_date?: string;
|
|
518
|
-
snippet?: string;
|
|
519
|
-
}>;
|
|
520
|
-
request_id: string;
|
|
521
|
-
completed_at: string;
|
|
522
|
-
memo?: string;
|
|
523
|
-
cost?: number;
|
|
524
|
-
}
|
|
525
|
-
export interface PersonNewsfeedResult {
|
|
526
|
-
status: string;
|
|
527
|
-
result: Array<{
|
|
528
|
-
platform?: string;
|
|
529
|
-
content?: string;
|
|
530
|
-
url?: string;
|
|
531
|
-
posted_at?: string;
|
|
532
|
-
likes?: number;
|
|
533
|
-
replies?: number;
|
|
534
|
-
shares?: number;
|
|
535
|
-
}>;
|
|
536
|
-
request_id: string;
|
|
537
|
-
completed_at: string;
|
|
538
|
-
memo?: string;
|
|
539
|
-
cost?: number;
|
|
540
|
-
}
|
|
541
|
-
export interface PersonInterestsResult {
|
|
542
|
-
status: string;
|
|
543
|
-
result: Record<string, unknown>;
|
|
544
|
-
request_id: string;
|
|
545
|
-
completed_at: string;
|
|
546
|
-
memo?: string;
|
|
547
|
-
cost?: number;
|
|
548
|
-
}
|
|
549
|
-
export interface PersonInteractionsResult {
|
|
550
|
-
status: string;
|
|
551
|
-
result: {
|
|
552
|
-
followers?: Array<Record<string, unknown>>;
|
|
553
|
-
following?: Array<Record<string, unknown>>;
|
|
554
|
-
replies?: Array<Record<string, unknown>>;
|
|
555
|
-
};
|
|
556
|
-
request_id: string;
|
|
557
|
-
completed_at: string;
|
|
558
|
-
memo?: string;
|
|
559
|
-
cost?: number;
|
|
560
|
-
}
|
|
561
|
-
export interface VerifyEmailResult {
|
|
562
|
-
status: string;
|
|
563
|
-
email: string;
|
|
564
|
-
valid: boolean;
|
|
565
|
-
deliverable: boolean;
|
|
566
|
-
catch_all: boolean;
|
|
567
|
-
disposable: boolean;
|
|
568
|
-
request_id?: string;
|
|
569
|
-
completed_at?: string;
|
|
570
|
-
memo?: string;
|
|
571
|
-
cost?: number;
|
|
572
|
-
}
|
|
573
|
-
export interface InboxEmail {
|
|
574
|
-
id: string;
|
|
575
|
-
from: string;
|
|
576
|
-
subject: string;
|
|
577
|
-
received_at: string;
|
|
578
|
-
thread_id?: string;
|
|
579
|
-
body?: string;
|
|
580
|
-
body_html?: string;
|
|
581
|
-
attachments?: Array<{
|
|
582
|
-
filename: string;
|
|
583
|
-
content_type: string;
|
|
584
|
-
size: number;
|
|
585
|
-
content?: string;
|
|
586
|
-
}>;
|
|
587
|
-
}
|
|
588
|
-
export interface InboxListResult {
|
|
589
|
-
emails: InboxEmail[];
|
|
590
|
-
count: number;
|
|
591
|
-
has_more: boolean;
|
|
592
|
-
agent_id: string;
|
|
593
|
-
}
|
|
594
|
-
export interface CommerceQuote {
|
|
595
|
-
quote_id: string;
|
|
596
|
-
product_title: string;
|
|
597
|
-
subtotal: string;
|
|
598
|
-
shipping: string;
|
|
599
|
-
tax: string;
|
|
600
|
-
fee: string;
|
|
601
|
-
total: string;
|
|
602
|
-
}
|
|
603
|
-
export interface CommerceBuyResult {
|
|
604
|
-
request_id?: string;
|
|
605
|
-
status: string;
|
|
606
|
-
order_id: string;
|
|
607
|
-
order_status: string;
|
|
608
|
-
tracking_url?: string;
|
|
609
|
-
memo?: string;
|
|
610
|
-
cost?: number;
|
|
611
|
-
}
|
|
612
|
-
export interface CommerceSearchProduct {
|
|
613
|
-
product_url: string;
|
|
614
|
-
title: string;
|
|
615
|
-
price: number;
|
|
616
|
-
currency: string;
|
|
617
|
-
image_url?: string;
|
|
618
|
-
vendor?: string;
|
|
619
|
-
rating?: number;
|
|
620
|
-
review_count?: number;
|
|
621
|
-
in_stock?: boolean;
|
|
622
|
-
description?: string;
|
|
623
|
-
}
|
|
624
|
-
export interface CommerceSearchResult {
|
|
625
|
-
request_id?: string;
|
|
626
|
-
status: string;
|
|
627
|
-
query: string;
|
|
628
|
-
products: CommerceSearchProduct[];
|
|
629
|
-
count: number;
|
|
630
|
-
memo?: string;
|
|
631
|
-
cost?: number;
|
|
632
|
-
}
|
|
633
|
-
export interface VoiceQuote {
|
|
634
|
-
quote_id: string;
|
|
635
|
-
target_numbers: string[];
|
|
636
|
-
conference_mode: boolean;
|
|
637
|
-
objective_summary: string;
|
|
638
|
-
talking_points: string[];
|
|
639
|
-
success_criteria: string[];
|
|
640
|
-
estimated_duration_minutes: number;
|
|
641
|
-
complexity_score: number;
|
|
642
|
-
pipeline_fee: string;
|
|
643
|
-
phone_registration_fee: string;
|
|
644
|
-
estimated_call_cost: string;
|
|
645
|
-
total: string;
|
|
646
|
-
needs_phone_registration: boolean;
|
|
647
|
-
expires_at: string;
|
|
648
|
-
}
|
|
649
|
-
export interface VoiceCallResult {
|
|
650
|
-
request_id?: string;
|
|
651
|
-
status: string;
|
|
652
|
-
ended_reason?: string;
|
|
653
|
-
duration_seconds?: number;
|
|
654
|
-
transcript?: string;
|
|
655
|
-
summary?: string;
|
|
656
|
-
success_evaluation?: string;
|
|
657
|
-
structured_data?: Record<string, unknown>;
|
|
658
|
-
memo?: string;
|
|
659
|
-
cost?: number;
|
|
660
|
-
credit_issued?: number;
|
|
661
|
-
}
|
|
662
|
-
export interface SmsQuote {
|
|
663
|
-
quote_id: string;
|
|
664
|
-
recipient_count: number;
|
|
665
|
-
message_length: number;
|
|
666
|
-
segment_count: number;
|
|
667
|
-
per_message_rate: string;
|
|
668
|
-
messaging_fee: string;
|
|
669
|
-
phone_registration_fee: string;
|
|
670
|
-
total: string;
|
|
671
|
-
needs_phone_registration: boolean;
|
|
672
|
-
expires_at: string;
|
|
673
|
-
}
|
|
674
|
-
export interface SmsSendResult {
|
|
675
|
-
request_id?: string;
|
|
676
|
-
status: string;
|
|
677
|
-
sent: number;
|
|
678
|
-
failed: number;
|
|
679
|
-
total: number;
|
|
680
|
-
details: Array<{
|
|
681
|
-
to: string;
|
|
682
|
-
from?: string;
|
|
683
|
-
status: string;
|
|
684
|
-
message_sid?: string;
|
|
685
|
-
error?: string;
|
|
686
|
-
}>;
|
|
687
|
-
memo?: string;
|
|
688
|
-
cost?: number;
|
|
689
|
-
}
|
|
690
|
-
export interface SmsInboxMessage {
|
|
691
|
-
id: string;
|
|
692
|
-
from: string;
|
|
693
|
-
to: string;
|
|
694
|
-
body: string;
|
|
695
|
-
num_media: number;
|
|
696
|
-
media_urls?: string[];
|
|
697
|
-
thread_id?: string;
|
|
698
|
-
related_outbound_id?: string;
|
|
699
|
-
received_at: string;
|
|
700
|
-
created_at: string;
|
|
701
|
-
}
|
|
702
|
-
export interface SmsInboxResult {
|
|
703
|
-
messages: SmsInboxMessage[];
|
|
704
|
-
count: number;
|
|
705
|
-
}
|
|
706
|
-
export interface Notification {
|
|
707
|
-
id: string;
|
|
708
|
-
agentId: string;
|
|
709
|
-
type: 'job_completed' | 'job_failed' | 'voice_completed' | 'sms_completed' | 'credit_issued' | 'domain_expiring' | 'phone_expiring';
|
|
710
|
-
title: string;
|
|
711
|
-
body?: string;
|
|
712
|
-
metadata?: Record<string, unknown>;
|
|
713
|
-
read: boolean;
|
|
714
|
-
createdAt: string;
|
|
715
|
-
}
|
|
716
|
-
export interface NotificationsListOptions {
|
|
717
|
-
/** Only return unread notifications */
|
|
718
|
-
unread?: boolean;
|
|
719
|
-
/** Maximum number of notifications to return (default: 50, max: 100) */
|
|
720
|
-
limit?: number;
|
|
721
|
-
}
|
|
722
|
-
export interface NotificationsResult {
|
|
723
|
-
notifications: Notification[];
|
|
724
|
-
count: number;
|
|
725
|
-
}
|
|
726
|
-
export interface BuildProduct {
|
|
727
|
-
/** Product or business name */
|
|
728
|
-
name: string;
|
|
729
|
-
/** Description of the product/service (min 10 chars) */
|
|
730
|
-
description: string;
|
|
731
|
-
/** Industry category */
|
|
732
|
-
industry?: string;
|
|
733
|
-
/** Pricing information to display */
|
|
734
|
-
pricing?: string;
|
|
735
|
-
}
|
|
736
|
-
export interface BuildLeadCapture {
|
|
737
|
-
/** Enable lead capture form */
|
|
738
|
-
enabled: boolean;
|
|
739
|
-
/** Email to receive leads (defaults to agent inbox) */
|
|
740
|
-
inbox_email?: string;
|
|
741
|
-
}
|
|
742
|
-
export interface BuildBrand {
|
|
743
|
-
/** Primary brand color (hex format, e.g., #FF5733) */
|
|
744
|
-
primary_color?: string;
|
|
745
|
-
/** Font family preference */
|
|
746
|
-
font?: string;
|
|
747
|
-
/** Brand tone */
|
|
748
|
-
tone?: 'professional' | 'playful' | 'bold' | 'minimal';
|
|
749
|
-
}
|
|
750
|
-
export interface BuildImages {
|
|
751
|
-
/** Hero image URL */
|
|
752
|
-
hero?: string;
|
|
753
|
-
/** Logo image URL */
|
|
754
|
-
logo?: string;
|
|
755
|
-
}
|
|
756
|
-
export interface BuildOptions extends ToolOptions {
|
|
757
|
-
/** Website type */
|
|
758
|
-
type?: 'saas' | 'portfolio' | 'agency' | 'personal' | 'product' | 'funnel' | 'restaurant' | 'event';
|
|
759
|
-
/** Product/business information */
|
|
760
|
-
product: BuildProduct;
|
|
761
|
-
/** URL to analyze for content/inspiration */
|
|
762
|
-
source_url?: string;
|
|
763
|
-
/** Specific sections to include */
|
|
764
|
-
sections?: string[];
|
|
765
|
-
/** Lead capture configuration */
|
|
766
|
-
lead_capture?: BuildLeadCapture;
|
|
767
|
-
/** Brand customization */
|
|
768
|
-
brand?: BuildBrand;
|
|
769
|
-
/** Image URLs to use */
|
|
770
|
-
images?: BuildImages;
|
|
771
|
-
/** Custom domain (e.g., mysite.com) */
|
|
772
|
-
domain?: string;
|
|
773
|
-
/** Existing build ID to update */
|
|
774
|
-
build_id?: string;
|
|
775
|
-
}
|
|
776
|
-
export interface BuildQuote {
|
|
777
|
-
quote_id: string;
|
|
778
|
-
type: string;
|
|
779
|
-
product_name: string;
|
|
780
|
-
analysis: {
|
|
781
|
-
inferred_type: string;
|
|
782
|
-
estimated_sections: number;
|
|
783
|
-
estimated_ai_images: number;
|
|
784
|
-
needs_lead_capture: boolean;
|
|
785
|
-
needs_video: boolean;
|
|
786
|
-
video_type?: string;
|
|
787
|
-
complexity_score: number;
|
|
788
|
-
reasoning: string;
|
|
789
|
-
};
|
|
790
|
-
pricing: {
|
|
791
|
-
base_price: string;
|
|
792
|
-
extra_sections_fee: string;
|
|
793
|
-
ai_images_fee: string;
|
|
794
|
-
video_embed_fee: string;
|
|
795
|
-
lead_capture_fee: string;
|
|
796
|
-
source_analysis_fee: string;
|
|
797
|
-
custom_domain_fee: string;
|
|
798
|
-
total: string;
|
|
799
|
-
};
|
|
800
|
-
expires_at: string;
|
|
801
|
-
}
|
|
802
|
-
export interface BuildResult {
|
|
803
|
-
request_id?: string;
|
|
804
|
-
status: string;
|
|
805
|
-
success: boolean;
|
|
806
|
-
production_url?: string;
|
|
807
|
-
preview_url?: string;
|
|
808
|
-
design_score?: number;
|
|
809
|
-
iterations?: number;
|
|
810
|
-
v0_chat_id?: string;
|
|
811
|
-
vercel_deployment_id?: string;
|
|
812
|
-
vercel_project_id?: string;
|
|
813
|
-
github_repo?: string;
|
|
814
|
-
error?: string;
|
|
815
|
-
memo?: string;
|
|
816
|
-
cost?: number;
|
|
817
|
-
}
|
|
818
|
-
export interface BrowserTaskOptions extends ToolOptions {
|
|
819
|
-
/** Natural language instruction for what to do in the browser (min 10 chars) */
|
|
820
|
-
task: string;
|
|
821
|
-
/** JSON schema for structured output extraction */
|
|
822
|
-
output_schema?: Record<string, unknown>;
|
|
823
|
-
/** Initial URL to navigate to */
|
|
824
|
-
start_url?: string;
|
|
825
|
-
/** Restrict browsing to specific domains */
|
|
826
|
-
allowed_domains?: string[];
|
|
827
|
-
/** Reuse an existing browser session */
|
|
828
|
-
session_id?: string;
|
|
829
|
-
/** Persistent browser profile ID for reusing cookies/localStorage across sessions */
|
|
830
|
-
profile_id?: string;
|
|
831
|
-
/** Domain-scoped credentials for auto-login, e.g. { "github.com": "user:token" } */
|
|
832
|
-
secrets?: Record<string, string>;
|
|
833
|
-
/** Maximum browser steps (default: 50, max: 100) */
|
|
834
|
-
max_steps?: number;
|
|
835
|
-
}
|
|
836
|
-
export interface BrowserProfile {
|
|
837
|
-
id: string;
|
|
838
|
-
name: string;
|
|
839
|
-
}
|
|
840
|
-
export interface BrowserQuote {
|
|
841
|
-
quote_id: string;
|
|
842
|
-
task_preview: string;
|
|
843
|
-
estimated_steps: number;
|
|
844
|
-
max_steps: number;
|
|
845
|
-
estimated_cost: string;
|
|
846
|
-
has_output_schema: boolean;
|
|
847
|
-
start_url: string | null;
|
|
848
|
-
expires_at: string;
|
|
849
|
-
}
|
|
850
|
-
export interface BrowserResult {
|
|
851
|
-
request_id?: string;
|
|
852
|
-
output?: string | Record<string, unknown>;
|
|
853
|
-
steps?: Array<{
|
|
854
|
-
number: number;
|
|
855
|
-
goal: string;
|
|
856
|
-
url: string;
|
|
857
|
-
}>;
|
|
858
|
-
memo?: string;
|
|
859
|
-
cost?: number;
|
|
860
|
-
output_files?: string[];
|
|
861
|
-
browser_task_id?: string;
|
|
862
|
-
session_id?: string;
|
|
863
|
-
}
|
|
864
|
-
export interface UpdateBuildOptions extends ToolOptions {
|
|
865
|
-
/** Existing build ID to update (required) */
|
|
866
|
-
build_id: string;
|
|
867
|
-
/** Updated product/business information */
|
|
868
|
-
product: BuildProduct;
|
|
869
|
-
/** Website type (optional, defaults to existing) */
|
|
870
|
-
type?: 'saas' | 'portfolio' | 'agency' | 'personal' | 'product' | 'funnel' | 'restaurant' | 'event';
|
|
871
|
-
/** URL to analyze for content/inspiration */
|
|
872
|
-
source_url?: string;
|
|
873
|
-
/** Specific sections to include */
|
|
874
|
-
sections?: string[];
|
|
875
|
-
/** Lead capture configuration */
|
|
876
|
-
lead_capture?: BuildLeadCapture;
|
|
877
|
-
/** Brand customization */
|
|
878
|
-
brand?: BuildBrand;
|
|
879
|
-
/** Image URLs to use */
|
|
880
|
-
images?: BuildImages;
|
|
881
|
-
/** Custom domain */
|
|
882
|
-
domain?: string;
|
|
883
|
-
}
|
|
884
|
-
export interface SpendCategory {
|
|
885
|
-
category: string;
|
|
886
|
-
total: string;
|
|
887
|
-
count: number;
|
|
888
|
-
pct: number;
|
|
889
|
-
}
|
|
890
|
-
export interface SpendBreakdown {
|
|
891
|
-
categories: SpendCategory[];
|
|
892
|
-
total: string;
|
|
893
|
-
period_days: number;
|
|
894
|
-
}
|
|
895
|
-
export interface RoCSResult {
|
|
896
|
-
rocs: number;
|
|
897
|
-
total_spend: string;
|
|
898
|
-
total_value: string;
|
|
899
|
-
period_days: number;
|
|
900
|
-
}
|
|
901
|
-
export interface Receipt {
|
|
902
|
-
id: string;
|
|
903
|
-
receipt_id: string;
|
|
904
|
-
category: string;
|
|
905
|
-
subcategory: string;
|
|
906
|
-
amount_usdc: string;
|
|
907
|
-
service_fee: string;
|
|
908
|
-
provider_cost: string;
|
|
909
|
-
status: string;
|
|
910
|
-
settlement_tx: string | null;
|
|
911
|
-
value_tag: {
|
|
912
|
-
type: string;
|
|
913
|
-
amount?: number;
|
|
914
|
-
label?: string;
|
|
915
|
-
} | null;
|
|
916
|
-
job_id: string | null;
|
|
917
|
-
metadata: Record<string, unknown> | null;
|
|
918
|
-
created_at: string;
|
|
919
|
-
settled_at: string | null;
|
|
920
|
-
}
|
|
921
|
-
export interface ReceiptsListResult {
|
|
922
|
-
receipts: Receipt[];
|
|
923
|
-
count: number;
|
|
924
|
-
has_more: boolean;
|
|
925
|
-
}
|
|
926
|
-
export interface UnifiedBalance {
|
|
927
|
-
on_chain_balance: string;
|
|
928
|
-
credits_balance: string;
|
|
929
|
-
currency: string;
|
|
930
|
-
address: string;
|
|
931
|
-
chain_id: number;
|
|
932
|
-
}
|
|
933
|
-
export interface ComputeSchedule {
|
|
934
|
-
/** Cron expression (UTC). Minimum interval: 15 minutes. */
|
|
935
|
-
cron: string;
|
|
936
|
-
/** USDC budget per run */
|
|
937
|
-
budget_per_run: number;
|
|
938
|
-
/** Maximum number of runs (optional — runs indefinitely if omitted) */
|
|
939
|
-
max_runs?: number;
|
|
940
|
-
}
|
|
941
|
-
export interface ComputeOptions extends ToolOptions {
|
|
942
|
-
/** Natural language objective for the orchestrator */
|
|
943
|
-
objective: string;
|
|
944
|
-
/** Additional parameters / constraints */
|
|
945
|
-
params?: Record<string, unknown>;
|
|
946
|
-
/** Suggested budget in USDC (server will estimate if omitted) */
|
|
947
|
-
budget_usdc?: number;
|
|
948
|
-
/** ISO deadline for completion */
|
|
949
|
-
deadline?: string;
|
|
950
|
-
/** Route to a specific Soul agent */
|
|
951
|
-
soul_slug?: string;
|
|
952
|
-
/** Route to a specific Soul service */
|
|
953
|
-
soul_service_slug?: string;
|
|
954
|
-
/** Make this a recurring goal */
|
|
955
|
-
schedule?: ComputeSchedule;
|
|
956
|
-
}
|
|
957
|
-
export interface ComputeQuote {
|
|
958
|
-
quote_id: string;
|
|
959
|
-
objective_summary: string;
|
|
960
|
-
estimated_phases: number;
|
|
961
|
-
estimated_tasks: number;
|
|
962
|
-
estimated_duration_days: number;
|
|
963
|
-
budget_breakdown: Record<string, string>;
|
|
964
|
-
total_budget: string;
|
|
965
|
-
expires_at: string;
|
|
966
|
-
schedule_cron?: string;
|
|
967
|
-
budget_per_run?: number;
|
|
968
|
-
max_runs?: number;
|
|
969
|
-
projected_runs?: number;
|
|
970
|
-
}
|
|
971
|
-
export interface ComputeGoalResult {
|
|
972
|
-
goal_id: string;
|
|
973
|
-
request_id: string;
|
|
974
|
-
receipt_id?: string;
|
|
975
|
-
status: string;
|
|
976
|
-
message: string;
|
|
977
|
-
memo?: string;
|
|
978
|
-
cost?: number;
|
|
979
|
-
goal: {
|
|
980
|
-
objective: string;
|
|
981
|
-
budget_usdc: string;
|
|
982
|
-
deadline?: string;
|
|
983
|
-
schedule_cron?: string;
|
|
984
|
-
budget_per_run?: number;
|
|
985
|
-
max_runs?: number;
|
|
986
|
-
next_run_at?: string;
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
export interface ComputeGoalStatus {
|
|
990
|
-
id: string;
|
|
991
|
-
status: string;
|
|
992
|
-
name: string;
|
|
993
|
-
objective: string;
|
|
994
|
-
current_phase: number | null;
|
|
995
|
-
plan: unknown;
|
|
996
|
-
budget: {
|
|
997
|
-
total: string;
|
|
998
|
-
spent: string;
|
|
999
|
-
reserved: string;
|
|
1000
|
-
remaining: string;
|
|
1001
|
-
} | null;
|
|
1002
|
-
soul_agent_id: string | null;
|
|
1003
|
-
deadline: string | null;
|
|
1004
|
-
started_at: string | null;
|
|
1005
|
-
completed_at: string | null;
|
|
1006
|
-
last_wake_at: string | null;
|
|
1007
|
-
next_wake_at: string | null;
|
|
1008
|
-
created_at: string;
|
|
1009
|
-
schedule?: {
|
|
1010
|
-
cron: string;
|
|
1011
|
-
budget_per_run: string;
|
|
1012
|
-
max_runs: number | null;
|
|
1013
|
-
run_count: number;
|
|
1014
|
-
last_run_at: string | null;
|
|
1015
|
-
next_run_at: string | null;
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
export interface ComputeTask {
|
|
1019
|
-
id: string;
|
|
1020
|
-
task_type: string;
|
|
1021
|
-
tool: string | null;
|
|
1022
|
-
description: string;
|
|
1023
|
-
status: string;
|
|
1024
|
-
phase: number | null;
|
|
1025
|
-
sequence: number | null;
|
|
1026
|
-
progress_pct: number | null;
|
|
1027
|
-
progress_message: string | null;
|
|
1028
|
-
result: unknown;
|
|
1029
|
-
quoted_usdc: string | null;
|
|
1030
|
-
actual_usdc: string | null;
|
|
1031
|
-
run_number: number | null;
|
|
1032
|
-
started_at: string | null;
|
|
1033
|
-
completed_at: string | null;
|
|
1034
|
-
created_at: string;
|
|
1035
|
-
}
|
|
1036
|
-
export interface ComputeBudgetStatus {
|
|
1037
|
-
budgetId: string;
|
|
1038
|
-
goalId: string;
|
|
1039
|
-
totalBudgetUsdc: string;
|
|
1040
|
-
spentUsdc: string;
|
|
1041
|
-
reservedUsdc: string;
|
|
1042
|
-
remainingUsdc: string;
|
|
1043
|
-
spend_entries: Array<{
|
|
1044
|
-
category: string;
|
|
1045
|
-
amount_usdc: string;
|
|
1046
|
-
description: string;
|
|
1047
|
-
created_at: string;
|
|
1048
|
-
}>;
|
|
1049
|
-
}
|
|
7
|
+
export * from './errors';
|
|
8
|
+
export * from './types';
|
|
9
|
+
import type { OneShotConfig, ToolOptions, EmailToolOptions, ResearchToolOptions, PeopleSearchOptions, EnrichProfileOptions, FindEmailOptions, VerifyEmailOptions, DeepResearchPersonOptions, SocialProfilesOptions, ArticleSearchOptions, PersonNewsfeedOptions, PersonInterestsOptions, PersonInteractionsOptions, InboxListOptions, CommerceBuyOptions, CommerceSearchOptions, WebSearchOptions, WebSearchResult, WebReadOptions, WebReadResult, VoiceCallOptions, SmsOptions, SmsInboxOptions, PeopleSearchResult, ResearchResult, EmailResult, EnrichProfileResult, FindEmailResult, DeepResearchPersonResult, SocialProfilesResult, ArticleSearchResult, PersonNewsfeedResult, PersonInterestsResult, PersonInteractionsResult, VerifyEmailResult, InboxEmail, InboxListResult, CommerceBuyResult, CommerceSearchResult, VoiceCallResult, SmsSendResult, SmsInboxMessage, SmsInboxResult, NotificationsListOptions, NotificationsResult, BuildOptions, BuildResult, BrowserTaskOptions, BrowserProfile, BrowserResult, UpdateBuildOptions, SpendBreakdown, RoCSResult, ReceiptsListResult, UnifiedBalance, ComputeOptions, ComputeGoalResult, ComputeGoalStatus, ComputeTask, ComputeBudgetStatus, DomainPoolListResult, DomainPoolStatusResult } from './types';
|
|
1050
10
|
/**
|
|
1051
11
|
* OneShot Agent SDK - Execute commercial transactions with automatic x402 payments.
|
|
1052
12
|
*
|
|
@@ -1090,6 +50,12 @@ export declare class OneShot {
|
|
|
1090
50
|
get slippage(): number;
|
|
1091
51
|
tool<T = unknown>(toolName: string, options: ToolOptions & Record<string, unknown>): Promise<T>;
|
|
1092
52
|
email(options: EmailToolOptions): Promise<EmailResult>;
|
|
53
|
+
/** List the caller's domain pool with warmup and rotation metadata. */
|
|
54
|
+
listDomains(): Promise<DomainPoolListResult>;
|
|
55
|
+
/** Take a domain out of rotation without releasing it. */
|
|
56
|
+
pauseDomain(domain: string): Promise<DomainPoolStatusResult>;
|
|
57
|
+
/** Put a paused domain back into rotation. */
|
|
58
|
+
resumeDomain(domain: string): Promise<DomainPoolStatusResult>;
|
|
1093
59
|
research(options: ResearchToolOptions): Promise<ResearchResult>;
|
|
1094
60
|
peopleSearch(options: PeopleSearchOptions): Promise<PeopleSearchResult>;
|
|
1095
61
|
enrichProfile(options: EnrichProfileOptions): Promise<EnrichProfileResult>;
|
|
@@ -1374,7 +340,10 @@ export declare class OneShot {
|
|
|
1374
340
|
run_count: number;
|
|
1375
341
|
}>;
|
|
1376
342
|
/**
|
|
1377
|
-
* Top up budget for a recurring compute goal
|
|
343
|
+
* Top up budget for a recurring compute goal.
|
|
344
|
+
*
|
|
345
|
+
* Uses the quote-then-pay flow: the first call gets a 402 with the top-up price,
|
|
346
|
+
* the second call (with payment) credits the budget. The amount IS the price.
|
|
1378
347
|
*
|
|
1379
348
|
* @example
|
|
1380
349
|
* ```typescript
|
|
@@ -1447,12 +416,20 @@ export declare class OneShot {
|
|
|
1447
416
|
private log;
|
|
1448
417
|
private validate;
|
|
1449
418
|
private headers;
|
|
419
|
+
/**
|
|
420
|
+
* Header that asks the API to reject the request when the computed quote
|
|
421
|
+
* exceeds the caller-supplied cap (commit 8f328a7). The SDK still does its
|
|
422
|
+
* own local `quote.total > maxCost` check after the 402 returns — this is
|
|
423
|
+
* a server-side enforcement layer so non-SDK callers (MCP server, custom
|
|
424
|
+
* integrations) can't ignore the cap.
|
|
425
|
+
*/
|
|
426
|
+
private maxCostHeader;
|
|
1450
427
|
private executeToolRequest;
|
|
1451
428
|
private pollJob;
|
|
1452
429
|
/**
|
|
1453
|
-
* Detects whether a job result is still waiting for
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
430
|
+
* Detects whether a job result is still waiting for an async phone reveal.
|
|
431
|
+
* The worker sets `result.phones_pending=true` when the upstream enrichment
|
|
432
|
+
* has a pending async webhook and the webhook URL is configured; the webhook
|
|
1456
433
|
* handler flips it to false (or removes it) once phones arrive.
|
|
1457
434
|
*
|
|
1458
435
|
* Tolerates two shapes: the unwrapped result `{phones_pending}` and the
|
|
@@ -1460,11 +437,12 @@ export declare class OneShot {
|
|
|
1460
437
|
*/
|
|
1461
438
|
private _isPhonesPending;
|
|
1462
439
|
/**
|
|
1463
|
-
* Slow poll loop that waits for
|
|
1464
|
-
*
|
|
1465
|
-
*
|
|
1466
|
-
* a tight loop wastes API calls. Returns the
|
|
1467
|
-
* not phones arrived (consumer can re-check
|
|
440
|
+
* Slow poll loop that waits for async phone-reveal callbacks to arrive via
|
|
441
|
+
* the webhook handler (which UPDATEs jobs.result_data.result.phones). Polls
|
|
442
|
+
* GET /v1/requests/{id} every 5s — the upstream provider can take several
|
|
443
|
+
* minutes to deliver, so a tight loop just wastes API calls. Returns the
|
|
444
|
+
* latest snapshot whether or not phones arrived (consumer can re-check
|
|
445
|
+
* `phones_pending`).
|
|
1468
446
|
*/
|
|
1469
447
|
private _pollForPhones;
|
|
1470
448
|
private waitViaWebSocket;
|