@oneshot-agent/sdk 0.60.0 → 0.62.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/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { UntrustedContent } from './untrusted-content';
1
2
  import type { WalletProvider } from './wallet-provider';
2
3
  export interface TokenInfo {
3
4
  address: string;
@@ -53,17 +54,17 @@ export type LoggerFn = (message: string) => void;
53
54
  */
54
55
  export type StatusUpdateFn = (status: string, requestId: string) => void;
55
56
  export interface OneShotConfig {
56
- /** Option A: Raw private key (existing behavior) */
57
+ /** Raw private key for wallet authentication. */
57
58
  privateKey?: string;
58
- /** Option B: Use Coinbase CDP Server Wallet (reads CDP_* env vars). Pass true or { address } to reuse existing. */
59
+ /** Use Coinbase CDP Server Wallet (reads CDP_* env vars). Pass true or { address } to reuse existing. */
59
60
  cdp?: boolean | {
60
61
  address?: string;
61
62
  };
62
- /** Option C: Bring your own WalletProvider implementation */
63
+ /** Bring your own WalletProvider implementation */
63
64
  walletProvider?: WalletProvider;
64
65
  /**
65
- * Option D: an agent access token (`oneshot_<64 hex>`), for code that runs
66
- * where the wallet key cannot be — hosted MCP clients, cloud runners. The
66
+ * An agent access token (`oneshot_<64 hex>`), for code that runs
67
+ * where the wallet key cannot be - hosted MCP clients, cloud runners. The
67
68
  * session identifies the agent with the token, pays every call from the
68
69
  * agent's prepaid credit balance, and never signs x402: a shortfall throws
69
70
  * `InsufficientCreditsError`. Budgets are read-only in this mode (set them
@@ -92,7 +93,7 @@ export interface OneShotConfig {
92
93
  /**
93
94
  * Payment currency: "USDC" (default, no swap) or "ETH". In ETH mode the SDK
94
95
  * checks the wallet's USDC before each payment and only swaps ETH→USDC (Uniswap
95
- * V3, Base mainnet) when it does not cover the charge — buying a buffer so one
96
+ * V3, Base mainnet) when it does not cover the charge - buying a buffer so one
96
97
  * swap covers many calls. See `swapBufferMultiplier`.
97
98
  */
98
99
  currency?: 'USDC' | 'ETH';
@@ -110,7 +111,7 @@ export interface OneShotConfig {
110
111
  swapBufferMultiplier?: number;
111
112
  /**
112
113
  * Spend budget for this agent. Synced to the server once, before the first
113
- * paid call, and enforced there against the receipts ledger — so the daily
114
+ * paid call, and enforced there against the receipts ledger - so the daily
114
115
  * figure is a real per-agent total, shared across every process and restart
115
116
  * running this wallet, not a per-instance counter.
116
117
  *
@@ -169,7 +170,7 @@ export interface AgentBudgetStatus {
169
170
  }
170
171
  /**
171
172
  * Structured decision context for a tool call. Machine-readable metadata
172
- * that explains WHY this tool was called — consumed by auditor agents
173
+ * that explains WHY this tool was called - consumed by auditor agents
173
174
  * and programmatic oversight. Open schema: known fields are typed,
174
175
  * extra keys are allowed.
175
176
  */
@@ -218,11 +219,12 @@ export interface ToolOptions {
218
219
  idempotencyKey?: string;
219
220
  }) => void;
220
221
  maxCost?: number;
222
+ /** Polling limit in seconds. Overrides a tool's manifest timeout or its existing default. */
221
223
  timeout?: number;
222
224
  signal?: AbortSignal;
223
225
  onStatusUpdate?: StatusUpdateFn;
224
226
  wait?: boolean;
225
- /** Optional value tag for RoCS tracking — stored in the receipt at creation time */
227
+ /** Optional value tag for RoCS tracking - stored in the receipt at creation time */
226
228
  valueTag?: {
227
229
  type: string;
228
230
  amount?: number;
@@ -235,7 +237,7 @@ export interface ToolOptions {
235
237
  */
236
238
  memo?: string;
237
239
  /**
238
- * Structured decision context — goal linkage, alternatives considered,
240
+ * Structured decision context - goal linkage, alternatives considered,
239
241
  * confidence score. Machine-readable counterpart to memo. Stored alongside
240
242
  * the receipt for programmatic auditing by supervisor agents.
241
243
  */
@@ -263,9 +265,9 @@ export interface ToolOptions {
263
265
  * is optional with a 24h cached-response replay window; personProfile /
264
266
  * personEmail / personEmailStatus are honored when durable enrichment is enabled
265
267
  * on the server AND the session authenticates with a wallet, not an
266
- * `accessToken` — an access-token session skips the durable-replay check
268
+ * `accessToken` - an access-token session skips the durable-replay check
267
269
  * on these three routes entirely and always dispatches a fresh job, even
268
- * with durable enrichment on (no expiry otherwise — backed by a durable
270
+ * with durable enrichment on (no expiry otherwise - backed by a durable
269
271
  * row, not a cache); physical-mail/send is mandatory and likewise never
270
272
  * expires. Save the key before submission.
271
273
  */
@@ -287,37 +289,37 @@ export interface EmailToolOptions extends ToolOptions {
287
289
  from_domain?: string;
288
290
  /**
289
291
  * Sender mailbox / local-part. Defaults to `agent` (i.e. agent@from_domain).
290
- * Requires `from_domain` to be set — pinning `from_mailbox` alone throws a
292
+ * Requires `from_domain` to be set - pinning `from_mailbox` alone throws a
291
293
  * `ValidationError` (there is no default domain to attach it to). You may
292
- * use any local-part — a new address is auto-provisioned on first use
294
+ * use any local-part - a new address is auto-provisioned on first use
293
295
  * (and starts unwarmed, building reputation over time). See the email
294
296
  * "list domains" tool for each domain's `default_from` and existing `addresses`.
295
297
  */
296
298
  from_mailbox?: string;
297
299
  /**
298
300
  * How this domain sends (provider-neutral):
299
- * - `'relay'` (default) — header/relay send; any from-address works with nothing
301
+ * - `'relay'` (default) - header/relay send; any from-address works with nothing
300
302
  * provisioned per address (no mailbox fee).
301
- * - `'mailbox'` — a real per-address mailbox; each new from-address provisions +
303
+ * - `'mailbox'` - a real per-address mailbox; each new from-address provisions +
302
304
  * warms a dedicated mailbox (one-time `mailbox_provisioning_fee` on the quote).
303
- * Only honored when the domain is first set up — an already-provisioned domain
305
+ * Only honored when the domain is first set up - an already-provisioned domain
304
306
  * keeps the mode it was created with. Use `'mailbox'` on a new `from_domain`.
305
307
  *
306
308
  * Which means omitting this is NOT a way to avoid the fee: a domain created in
307
309
  * mailbox mode bills `mailbox_provisioning_fee` for every address that isn't
308
- * already `active` on it — the default `agent@` included — whatever you pass
310
+ * already `active` on it - the default `agent@` included - whatever you pass
309
311
  * here, and `from_mailbox` doesn't change that either. Read `mailbox_mode` per
310
312
  * domain from `listDomains()` to see which of yours charge.
311
313
  */
312
314
  mailbox_mode?: 'relay' | 'mailbox';
313
315
  /**
314
316
  * Only meaningful when `from_domain` is a domain the agent doesn't own yet.
315
- * A call with such a `from_domain` always stops after quoting — no charge,
316
- * no send — and returns `status: 'confirmation_required'` with the exact
317
+ * A call with such a `from_domain` always stops after quoting - no charge,
318
+ * no send - and returns `status: 'confirmation_required'` with the exact
317
319
  * total and its `quote_id`. Pass that `quote_id` here on the repeat call to
318
320
  * register the domain, pay exactly that quote's total, and send in one call:
319
321
  * the SDK sends against the stored quote instead of quoting again, so the
320
- * amount charged is the amount shown (#1070). A bare `true` names no amount
322
+ * amount charged is the amount shown. A bare `true` names no amount
321
323
  * and only re-quotes. An expired or used quote is refused by the server.
322
324
  */
323
325
  confirmNewDomain?: string;
@@ -330,11 +332,28 @@ export interface EmailToolOptions extends ToolOptions {
330
332
  content_type?: string;
331
333
  }>;
332
334
  }
335
+ /**
336
+ * The shared lookup cache's bypass. Every person, company and business lookup is served from
337
+ * OneShot's store when the same subject (or the same search) was looked up within its freshness window
338
+ * (profiles, dossiers, social accounts, email finds, company profiles and resolves 30 days; email status
339
+ * and searches 7 days; posts, articles, followers and interests 3 days); a stored record costs the same.
340
+ */
341
+ export interface FreshLookupOption {
342
+ /** Look the record up again instead of using OneShot's stored copy, and refresh that copy. Off by default. */
343
+ fresh?: boolean;
344
+ }
345
+ /** What a person, company or business result says about where it came from. */
346
+ export interface CachedRecordFields {
347
+ /** True when the record came from OneShot's store of earlier lookups. */
348
+ cached?: boolean;
349
+ /** When the record was obtained from its source, ISO 8601 UTC. */
350
+ fetched_at?: string;
351
+ }
333
352
  export interface ResearchToolOptions extends ToolOptions {
334
353
  topic: string;
335
354
  depth?: 'deep' | 'quick';
336
355
  }
337
- export interface PersonFindOptions extends ToolOptions {
356
+ export interface PersonFindOptions extends ToolOptions, FreshLookupOption {
338
357
  /** Off by default. Adds the per-person add-on on the pricing page × requested limit (default 100) for up to that many people; no phone hit guaranteed. */
339
358
  includePhone?: boolean;
340
359
  job_titles?: string[];
@@ -353,7 +372,7 @@ export interface PersonFindOptions extends ToolOptions {
353
372
  /** Max rows to return, 1-500 (server default 100). Large requests are
354
373
  * paginated server-side, so one response can hold up to `limit` rows.
355
374
  * The search runs under a time limit: if it is reached, the response holds
356
- * the rows found so far (possibly fewer than `limit`) — continue with
375
+ * the rows found so far (possibly fewer than `limit`) - continue with
357
376
  * `offset`. With `include_phone`, every row reports its `phone_lookup`
358
377
  * outcome (see `PersonResult.phone_lookup`); a row whose lookup did not
359
378
  * finish in time is `not_attempted` or `unavailable`, never silently empty. */
@@ -365,7 +384,7 @@ export interface PersonFindOptions extends ToolOptions {
365
384
  offset?: number;
366
385
  }
367
386
  /**
368
- * What a caller knows about one person (#1899). Every single-person tool takes
387
+ * What a caller knows about one person. Every single-person tool takes
369
388
  * these same optional fields; at least one of `name`, `email`, `phone` or
370
389
  * `profile_url` is required. The API resolves the rest (a LinkedIn URL from a
371
390
  * name and company or an email, the other handles, the employer).
@@ -384,7 +403,7 @@ export interface PersonIdentity {
384
403
  /** Same as `profile_url` (older name). */
385
404
  social_media_url?: string;
386
405
  }
387
- export interface PersonProfileOptions extends ToolOptions, PersonIdentity {
406
+ export interface PersonProfileOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
388
407
  /** Off by default. Adds the per-person add-on on the pricing page for up to one person; no phone hit guaranteed. */
389
408
  includePhone?: boolean;
390
409
  /** Employer domain (older name; `company` takes a name or a domain). */
@@ -392,7 +411,7 @@ export interface PersonProfileOptions extends ToolOptions, PersonIdentity {
392
411
  /** Employer name (older name; `company` takes a name or a domain). */
393
412
  company_name?: string;
394
413
  }
395
- export interface CompanyFindOptions extends ToolOptions {
414
+ export interface CompanyFindOptions extends ToolOptions, FreshLookupOption {
396
415
  name?: string;
397
416
  domain?: string;
398
417
  industry?: string[];
@@ -404,13 +423,13 @@ export interface CompanyFindOptions extends ToolOptions {
404
423
  tags?: string[];
405
424
  limit?: number;
406
425
  }
407
- export interface CompanyProfileOptions extends ToolOptions {
426
+ export interface CompanyProfileOptions extends ToolOptions, FreshLookupOption {
408
427
  domain?: string;
409
428
  name?: string;
410
429
  linkedin_url?: string;
411
430
  ticker?: string;
412
431
  }
413
- export interface PersonEmailOptions extends ToolOptions, PersonIdentity {
432
+ export interface PersonEmailOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
414
433
  /** Same as `name` (older name). */
415
434
  full_name?: string;
416
435
  first_name?: string;
@@ -420,26 +439,26 @@ export interface PersonEmailOptions extends ToolOptions, PersonIdentity {
420
439
  /** Employer name (older name; `company` takes a name or a domain). */
421
440
  company_name?: string;
422
441
  }
423
- export interface PersonEmailStatusOptions extends ToolOptions {
442
+ export interface PersonEmailStatusOptions extends ToolOptions, FreshLookupOption {
424
443
  email: string;
425
444
  }
426
- export interface PersonDossierOptions extends ToolOptions, PersonIdentity {
445
+ export interface PersonDossierOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
427
446
  /** Off by default. Adds the per-person add-on on the pricing page for up to one person; no phone hit guaranteed. */
428
447
  includePhone?: boolean;
429
448
  }
430
- export interface PersonSocialAccountsOptions extends ToolOptions, PersonIdentity {
449
+ export interface PersonSocialAccountsOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
431
450
  }
432
- export interface PersonArticlesOptions extends ToolOptions {
451
+ export interface PersonArticlesOptions extends ToolOptions, FreshLookupOption {
433
452
  name: string;
434
453
  company: string;
435
454
  sort?: 'recent' | 'popular';
436
455
  limit?: number;
437
456
  }
438
- export interface PersonPostsOptions extends ToolOptions, PersonIdentity {
457
+ export interface PersonPostsOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
439
458
  }
440
- export interface PersonInterestsOptions extends ToolOptions, PersonIdentity {
459
+ export interface PersonInterestsOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
441
460
  }
442
- export interface PersonFollowersOptions extends ToolOptions, PersonIdentity {
461
+ export interface PersonFollowersOptions extends ToolOptions, PersonIdentity, FreshLookupOption {
443
462
  type?: 'replies' | 'followers' | 'following' | 'followers,following';
444
463
  max_results?: number;
445
464
  }
@@ -473,13 +492,17 @@ export interface ProductFindOptions extends ToolOptions {
473
492
  export interface WebSearchOptions extends ToolOptions {
474
493
  query: string;
475
494
  max_results?: number;
495
+ /** Only results published within the last day, week, month or year. */
496
+ published_within?: 'day' | 'week' | 'month' | 'year';
476
497
  }
477
498
  export interface WebSearchResult {
478
499
  query: string;
500
+ /** `published_at` is the publication date (YYYY-MM-DD) when the provider gives one, otherwise null. */
479
501
  results: Array<{
480
502
  url: string;
481
503
  title: string;
482
504
  description: string;
505
+ published_at: string | null;
483
506
  }>;
484
507
  result_count: number;
485
508
  memo?: string;
@@ -489,7 +512,8 @@ export interface WebReadOptions extends ToolOptions {
489
512
  /** URL of the web page to read */
490
513
  url: string;
491
514
  }
492
- export interface WebReadResult {
515
+ export interface WebReadResult extends UntrustedContent {
516
+ hidden_removed: number;
493
517
  request_id?: string;
494
518
  /** Receipt id (`rcpt_…`) for this call. Pass to `tagReceiptValue` to annotate value later. */
495
519
  receipt_id?: string;
@@ -557,7 +581,7 @@ export interface Education {
557
581
  /**
558
582
  * A normalized person record. The worker returns every scalar field below and
559
583
  * uses `null`, not a missing key, for a value the provider did not have; the
560
- * declared person_dossier schema requires exactly that shape (#1789).
584
+ * declared person_dossier schema requires exactly that shape.
561
585
  */
562
586
  export interface PersonResult {
563
587
  company_address?: BusinessAddress | null;
@@ -592,7 +616,7 @@ export interface PersonResult {
592
616
  * person twice: it returns the number already found. */
593
617
  phone_lookup?: 'found' | 'none' | 'not_attempted' | 'unavailable' | 'pending';
594
618
  }
595
- export interface PersonFindResult {
619
+ export interface PersonFindResult extends CachedRecordFields {
596
620
  status: string;
597
621
  results: PersonResult[];
598
622
  total_found: number;
@@ -636,11 +660,11 @@ export interface EmailResult {
636
660
  error?: string;
637
661
  /**
638
662
  * Non-blocking advisory from the server. Values:
639
- * - `pinned_domain_warming` — a pinned sender's domain is still warming (low warmup score)
640
- * - `pinned_over_limit` — a pinned sender's domain is over its daily_send_limit
663
+ * - `pinned_domain_warming` - a pinned sender's domain is still warming (low warmup score)
664
+ * - `pinned_over_limit` - a pinned sender's domain is over its daily_send_limit
641
665
  * The send still proceeds; read this to back off / defer. (Note: an un-pinned
642
666
  * send with no eligible owned domain is a hard `400 no_sending_domain`, not a
643
- * warning — there is no shared fallback sender.)
667
+ * warning - there is no shared fallback sender.)
644
668
  */
645
669
  warning?: string;
646
670
  email?: {
@@ -662,7 +686,7 @@ export type DomainWarmupState = 'warming' | 'warmed' | 'degraded';
662
686
  export type DomainPauseReason = 'warming' | 'low_reputation' | 'manual' | null;
663
687
  /** A mailbox already provisioned on a domain (from `/email/domains` `addresses[]`). */
664
688
  export interface DomainAddressEntry {
665
- /** Full email address, lowercased — e.g. `sales@yourdomain.com`. */
689
+ /** Full email address, lowercased - e.g. `sales@yourdomain.com`. */
666
690
  address: string;
667
691
  /** Mailbox provisioning state. Only `active` counts as already-provisioned (free to send from). */
668
692
  status: 'active' | 'provisioning' | 'failed';
@@ -672,34 +696,34 @@ export interface DomainAddressEntry {
672
696
  export interface DomainPoolEntry {
673
697
  domain: string;
674
698
  /**
675
- * Canonical sending address for this domain (e.g. `agent@yourdomain.com`) — the
699
+ * Canonical sending address for this domain (e.g. `agent@yourdomain.com`) - the
676
700
  * default mailbox when you don't pick one. Like any address, the first send from
677
701
  * it incurs the one-time `mailbox_provisioning_fee`; free once it's `active`.
678
702
  */
679
703
  default_from: string;
680
704
  /**
681
705
  * Mailboxes already provisioned on this domain. Empty = none yet; you can still
682
- * send from any address — a new one is provisioned (and billed
706
+ * send from any address - a new one is provisioned (and billed
683
707
  * `mailbox_provisioning_fee`) on first use.
684
708
  */
685
709
  addresses: DomainAddressEntry[];
686
710
  /**
687
711
  * Which side of the provisioning fee this domain sits on.
688
712
  *
689
- * `mailbox` — a real mailbox is provisioned per address, so every address
713
+ * `mailbox` - a real mailbox is provisioned per address, so every address
690
714
  * that isn't already `active` in `addresses[]` bills the one-time
691
715
  * `mailbox_provisioning_fee` on its first send. That includes the canonical
692
716
  * `default_from`; nothing is exempt.
693
- * `relay` — header-only send, nothing provisioned, no per-address fee.
717
+ * `relay` - header-only send, nothing provisioned, no per-address fee.
694
718
  *
695
- * This is a property of the DOMAIN, fixed when it was set up — not of the
719
+ * This is a property of the DOMAIN, fixed when it was set up - not of the
696
720
  * call. Omitting `mailbox_mode` on a quote does not make the send relay; the
697
721
  * domain's own mode always wins. Check here before you quote.
698
722
  */
699
723
  mailbox_mode: 'relay' | 'mailbox';
700
- /** Rotation eligibility — the selector only picks `active`. */
724
+ /** Rotation eligibility - the selector only picks `active`. */
701
725
  pool_status: 'active' | 'paused' | 'removed';
702
- /** Reputation health — a domain can be `paused` AND still `warming`/recovering. */
726
+ /** Reputation health - a domain can be `paused` AND still `warming`/recovering. */
703
727
  warmup_state: DomainWarmupState;
704
728
  pause_reason: DomainPauseReason;
705
729
  provisioning_status: string;
@@ -730,7 +754,7 @@ export interface DossierSection<T> {
730
754
  state: 'found' | 'none' | 'unavailable';
731
755
  data: T;
732
756
  }
733
- export interface PersonProfileResult {
757
+ export interface PersonProfileResult extends CachedRecordFields {
734
758
  status: string;
735
759
  profile: PersonResult & {
736
760
  social_accounts: SocialAccount[];
@@ -764,7 +788,7 @@ export interface CompanyResult {
764
788
  linkedin_url?: string;
765
789
  [key: string]: unknown;
766
790
  }
767
- export interface CompanyFindResult {
791
+ export interface CompanyFindResult extends CachedRecordFields {
768
792
  status: string;
769
793
  results: CompanyResult[];
770
794
  total_found: number;
@@ -776,7 +800,7 @@ export interface CompanyFindResult {
776
800
  memo?: string;
777
801
  cost?: number;
778
802
  }
779
- export interface CompanyProfileResult {
803
+ export interface CompanyProfileResult extends CachedRecordFields {
780
804
  status: string;
781
805
  company: CompanyResult;
782
806
  request_id?: string;
@@ -786,7 +810,7 @@ export interface CompanyProfileResult {
786
810
  memo?: string;
787
811
  cost?: number;
788
812
  }
789
- export interface PersonEmailResult {
813
+ export interface PersonEmailResult extends CachedRecordFields {
790
814
  status: string;
791
815
  email: string | null;
792
816
  found: boolean;
@@ -855,7 +879,7 @@ export type PersonDossierPost = Omit<PersonPostsResult['result'][number], 'platf
855
879
  url?: string | null;
856
880
  posted_at?: string | null;
857
881
  };
858
- export interface PersonDossierResult {
882
+ export interface PersonDossierResult extends CachedRecordFields {
859
883
  status: string;
860
884
  result: {
861
885
  profile: {
@@ -882,7 +906,7 @@ export interface PersonDossierResult {
882
906
  memo?: string;
883
907
  cost?: number;
884
908
  }
885
- export interface PersonSocialAccountsResult {
909
+ export interface PersonSocialAccountsResult extends CachedRecordFields {
886
910
  status: string;
887
911
  result: Record<string, {
888
912
  url?: string;
@@ -895,7 +919,7 @@ export interface PersonSocialAccountsResult {
895
919
  memo?: string;
896
920
  cost?: number;
897
921
  }
898
- export interface PersonArticlesResult {
922
+ export interface PersonArticlesResult extends CachedRecordFields {
899
923
  status: string;
900
924
  result: Array<{
901
925
  title?: string;
@@ -909,7 +933,7 @@ export interface PersonArticlesResult {
909
933
  memo?: string;
910
934
  cost?: number;
911
935
  }
912
- export interface PersonPostsResult {
936
+ export interface PersonPostsResult extends CachedRecordFields {
913
937
  status: string;
914
938
  result: Array<{
915
939
  platform?: string;
@@ -925,7 +949,7 @@ export interface PersonPostsResult {
925
949
  memo?: string;
926
950
  cost?: number;
927
951
  }
928
- export interface PersonInterestsResult {
952
+ export interface PersonInterestsResult extends CachedRecordFields {
929
953
  status: string;
930
954
  result: Record<string, unknown>;
931
955
  request_id: string;
@@ -933,7 +957,7 @@ export interface PersonInterestsResult {
933
957
  memo?: string;
934
958
  cost?: number;
935
959
  }
936
- export interface PersonFollowersResult {
960
+ export interface PersonFollowersResult extends CachedRecordFields {
937
961
  status: string;
938
962
  result: {
939
963
  followers?: Array<Record<string, unknown>>;
@@ -945,7 +969,7 @@ export interface PersonFollowersResult {
945
969
  memo?: string;
946
970
  cost?: number;
947
971
  }
948
- export interface PersonEmailStatusResult {
972
+ export interface PersonEmailStatusResult extends CachedRecordFields {
949
973
  status: string;
950
974
  email: string;
951
975
  valid: boolean;
@@ -959,7 +983,9 @@ export interface PersonEmailStatusResult {
959
983
  memo?: string;
960
984
  cost?: number;
961
985
  }
962
- export interface InboxEmail {
986
+ export interface InboxEmail extends UntrustedContent {
987
+ hidden_removed: number;
988
+ authenticated: boolean;
963
989
  id: string;
964
990
  from: string;
965
991
  subject: string;
@@ -974,7 +1000,8 @@ export interface InboxEmail {
974
1000
  content?: string;
975
1001
  }>;
976
1002
  }
977
- export interface InboxListResult {
1003
+ export interface InboxListResult extends UntrustedContent {
1004
+ hidden_removed: number;
978
1005
  emails: InboxEmail[];
979
1006
  count: number;
980
1007
  has_more: boolean;
@@ -1027,13 +1054,6 @@ export interface VoiceQuote {
1027
1054
  quote_id: string;
1028
1055
  target_numbers: string[];
1029
1056
  conference_mode: boolean;
1030
- /** @deprecated The API stopped emitting a paraphrased objective summary
1031
- * when the voice prompt pipeline switched to verbatim assembly. Field
1032
- * retained for type-back-compat; will be removed in the next major. */
1033
- objective_summary?: string;
1034
- /** @deprecated See objective_summary — the LLM rewrite that produced these
1035
- * bullets is gone. The full objective is in the call's system prompt. */
1036
- talking_points?: string[];
1037
1057
  success_criteria: string[];
1038
1058
  estimated_duration_minutes: number;
1039
1059
  complexity_score: number;
@@ -1207,7 +1227,7 @@ export interface InboundCallsOptions {
1207
1227
  export interface Notification {
1208
1228
  id: string;
1209
1229
  agentId: string;
1210
- type: 'job_completed' | 'job_failed' | 'voice_completed' | 'sms_completed' | 'credit_issued' | 'domain_expiring' | 'phone_expiring';
1230
+ type: 'job_completed' | 'job_failed' | 'voice_completed' | 'sms_completed' | 'credit_issued' | 'domain_expiring' | 'phone_expiring' | 'goal_awaiting_budget' | 'goal_budget_warning';
1211
1231
  title: string;
1212
1232
  body?: string;
1213
1233
  metadata?: Record<string, unknown>;
@@ -1342,14 +1362,12 @@ export interface BrowserTaskOptions extends ToolOptions {
1342
1362
  output_schema?: Record<string, unknown>;
1343
1363
  /** Initial URL to navigate to */
1344
1364
  start_url?: string;
1345
- /** Instruct the agent to stay within these domains; not a network firewall. */
1365
+ /** Stay within these domains (subdomains included). Checked after each recorded navigation, not a network block: one outside the list ends the task with `browser_domain_not_allowed`. */
1346
1366
  allowed_domains?: string[];
1347
1367
  /** Reuse an existing browser session */
1348
1368
  session_id?: string;
1349
1369
  /** Persistent browser profile ID for reusing cookies/localStorage across sessions */
1350
1370
  profile_id?: string;
1351
- /** @deprecated Unsupported. Import cookies/storage_state when creating a profile. */
1352
- secrets?: Record<string, string>;
1353
1371
  /** Legacy step-derived budget allowance (default: 50, supported: 25–100); not an exact action limit. */
1354
1372
  max_steps?: number;
1355
1373
  }
@@ -1554,7 +1572,7 @@ export interface ComputeSchedule {
1554
1572
  cron: string;
1555
1573
  /** USDC budget per run */
1556
1574
  budget_per_run: number;
1557
- /** Maximum number of runs (optional — runs indefinitely if omitted) */
1575
+ /** Maximum number of runs (optional - runs indefinitely if omitted) */
1558
1576
  max_runs?: number;
1559
1577
  }
1560
1578
  export interface ComputeOptions extends ToolOptions {
@@ -1586,6 +1604,24 @@ export interface ComputeOptions extends ToolOptions {
1586
1604
  * approval covers exactly one call: that tool, those params, at most that amount.
1587
1605
  */
1588
1606
  approvals?: ComputeApprovals;
1607
+ /**
1608
+ * Hosts the goal's sandboxes may reach besides OneShot's API: hostnames, IPv4
1609
+ * addresses or IPv4 ranges, at most 50. Setting it (even to []) limits every
1610
+ * sandbox of the goal to OneShot's API and these hosts; an organization with
1611
+ * sandbox default-deny on gets the same for all its goals.
1612
+ */
1613
+ egress_allowlist?: string[];
1614
+ /**
1615
+ * Your reading of the goal: the unit, how a unit starts, what each unit needs, the overhead, the
1616
+ * volume and what no price list covers. It replaces the quote's reading and is priced again in
1617
+ * code; a tool the goal cannot call is refused. Omit it and the quote proposes one.
1618
+ */
1619
+ scope?: ComputeGoalScope;
1620
+ /**
1621
+ * Called with the quote before anything is paid: read `quote.scope`, `quote.price` and
1622
+ * `quote.done_check` there, and throw to stop without paying. `maxCost` still caps the total.
1623
+ */
1624
+ onQuote?: (quote: ComputeQuote) => void;
1589
1625
  }
1590
1626
  export type ComputeDoneCheck =
1591
1627
  /** At least `at_least` calls of `tool` that reached `status` (default `completed`). */
@@ -1618,7 +1654,7 @@ export type ComputeDoneCheck =
1618
1654
  equals?: string | number | boolean;
1619
1655
  at_least?: number;
1620
1656
  }
1621
- /** Every case of the goal is in one of `finished_states` (a state in `owner_required_for` also needs an owner in the record). With no cases the check is not met. */
1657
+ /** Every case of the goal is in one of `finished_states` (a state in `owner_required_for` also needs an owner in the record). `unreached` always counts as finished and is reported on its own. With no cases the check is not met. */
1622
1658
  | {
1623
1659
  kind: 'cases';
1624
1660
  finished_states: string[];
@@ -1640,13 +1676,122 @@ export interface ComputeCheckResult {
1640
1676
  evaluated_at: string;
1641
1677
  attempt?: number;
1642
1678
  }
1643
- export type ComputeEndReason = 'check_passed' | 'owner_confirmed' | 'check_failed' | 'budget_exhausted' | 'deadline_passed' | 'planner_failed';
1679
+ export type ComputeEndReason = 'check_passed' | 'owner_confirmed' | 'check_failed' | 'budget_exhausted' | 'deadline_passed' | 'planner_failed' | 'impossible' | 'impossible_unverified' | 'connection_timeout' | 'tool_timeout';
1644
1680
  export interface ComputeApprovals {
1645
1681
  /** Hold any single call whose cost exceeds this many USDC. */
1646
1682
  spend_over_usdc?: number;
1647
1683
  /** Hold every call of these tools, whatever the cost (e.g. ["commerce_buy", "physical_mail", "voice", "soul_hire"]). */
1648
1684
  tools?: string[];
1649
1685
  }
1686
+ /** A connected system a goal needs, as the quote read it from the objective. */
1687
+ export interface ComputeRequirement {
1688
+ family: 'crm' | 'ledger' | 'shipping' | 'tax' | 'procurement' | 'meetings' | 'mailbox' | 'files' | 'repository';
1689
+ /** The product the objective names (e.g. "QuickBooks"); null when only the kind of system was named. */
1690
+ product: string | null;
1691
+ /** The system can be connected on OneShot right now. */
1692
+ available: boolean;
1693
+ /** The goal owner has an active connection to it. null for a caller that has not proven it holds the agent wallet (access token or signed proof). */
1694
+ connected: boolean | null;
1695
+ /** Where the owner connects a system; only for a caller proven to hold the agent wallet. */
1696
+ connect_url?: string;
1697
+ }
1698
+ /**
1699
+ * Whether a goal can be done, as the quote judged it. `refuse` comes only with a proof and no quote;
1700
+ * `hold` means a supported system is not connected yet (the quote is still issued); an unproven caller instead gets
1701
+ * `accept` with the reason `connection_checked_at_payment`. Warnings never change the verdict.
1702
+ */
1703
+ export interface ComputeFeasibility {
1704
+ verdict: 'accept' | 'hold' | 'refuse';
1705
+ reasons: {
1706
+ code: 'system_unsupported' | 'deadline_in_past' | 'infeasible_input' | 'connection_checked_at_payment';
1707
+ message: string;
1708
+ conflicts?: {
1709
+ constraints: {
1710
+ family: string;
1711
+ ref: string;
1712
+ label: string;
1713
+ }[];
1714
+ explanation: string;
1715
+ }[];
1716
+ }[];
1717
+ warnings: {
1718
+ code: 'no_tool_matched' | 'tight_deadline' | 'finish_line_unknowable' | 'product_unverified' | 'similar_goal_was_impossible';
1719
+ message: string;
1720
+ }[];
1721
+ finish_line?: {
1722
+ kind: 'measurable' | 'needs_owner' | 'unknowable';
1723
+ done_check?: ComputeDoneCheck;
1724
+ };
1725
+ /** What the goal needs that no tool does, as the estimate read it; each is a `no_tool_matched` warning, and the quote is still issued. */
1726
+ missing?: {
1727
+ entity: string;
1728
+ attribute?: string;
1729
+ action?: string;
1730
+ operation: 'lookup' | 'list' | 'act';
1731
+ purpose: string;
1732
+ }[];
1733
+ }
1734
+ /** One tool use inside a unit of a goal's scope. */
1735
+ export interface ComputeScopeUse {
1736
+ tool: string;
1737
+ qty: number;
1738
+ max_attempts: number;
1739
+ /** Whom or what the use is pointed at, in your words. */
1740
+ target?: string;
1741
+ persistence?: {
1742
+ max_attempts: number;
1743
+ spacing_seconds: number;
1744
+ escalate_to?: string;
1745
+ then: 'owner' | 'give_up';
1746
+ };
1747
+ }
1748
+ /** A goal's scope: the unit the goal works in, what one unit takes, and how many units there are. */
1749
+ export interface ComputeGoalScope {
1750
+ unit: {
1751
+ name: string;
1752
+ starts_on: 'list' | 'event' | 'schedule' | 'once';
1753
+ };
1754
+ per_unit: {
1755
+ uses: ComputeScopeUse[];
1756
+ step_allowance: number;
1757
+ done: string[];
1758
+ };
1759
+ overhead: {
1760
+ uses: Pick<ComputeScopeUse, 'tool' | 'qty' | 'max_attempts'>[];
1761
+ step_allowance: number;
1762
+ };
1763
+ volume: {
1764
+ kind: 'list';
1765
+ count: number;
1766
+ } | {
1767
+ kind: 'open';
1768
+ };
1769
+ unpriced: {
1770
+ name: string;
1771
+ reason: 'connection' | 'quoted_tool';
1772
+ assumption?: string;
1773
+ }[];
1774
+ }
1775
+ /** What a quote prices: one unit, the overhead, the whole goal or the units a budget covers, and what it cannot price. */
1776
+ export interface ComputeScopePrice {
1777
+ per_unit: {
1778
+ expected: number;
1779
+ ceiling: number;
1780
+ };
1781
+ overhead: {
1782
+ expected: number;
1783
+ ceiling: number;
1784
+ };
1785
+ /** A listed volume: the whole goal. */
1786
+ total?: {
1787
+ expected: number;
1788
+ ceiling: number;
1789
+ };
1790
+ /** An open volume with a budget: whole units after overhead; null for a zero-cost unit. */
1791
+ units_covered?: number | null;
1792
+ unpriced: ComputeGoalScope['unpriced'];
1793
+ unmeasured: string[];
1794
+ }
1650
1795
  export interface ComputeQuote {
1651
1796
  quote_id: string;
1652
1797
  objective_summary: string;
@@ -1654,6 +1799,14 @@ export interface ComputeQuote {
1654
1799
  estimated_tasks: number;
1655
1800
  estimated_duration_days: number;
1656
1801
  budget_breakdown: Record<string, string>;
1802
+ /** One entry per connected system the goal needs. */
1803
+ requires: ComputeRequirement[];
1804
+ feasibility: ComputeFeasibility;
1805
+ /** The recipe the goal is held to: yours, or the quote's reading. */
1806
+ scope: ComputeGoalScope;
1807
+ price: ComputeScopePrice;
1808
+ /** The done check the goal is held to: yours, else the proposed one; null means you confirm. */
1809
+ done_check: ComputeDoneCheck | null;
1657
1810
  total_budget: string;
1658
1811
  expires_at: string;
1659
1812
  schedule_cron?: string;
@@ -1662,6 +1815,7 @@ export interface ComputeQuote {
1662
1815
  projected_runs?: number;
1663
1816
  }
1664
1817
  export interface ComputeGoalResult {
1818
+ requires?: ComputeRequirement[];
1665
1819
  goal_id: string;
1666
1820
  request_id: string;
1667
1821
  receipt_id?: string;
@@ -1679,9 +1833,35 @@ export interface ComputeGoalResult {
1679
1833
  next_run_at?: string;
1680
1834
  };
1681
1835
  }
1836
+ export type GoalStatus = 'active' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'awaiting_confirmation' | 'awaiting_connection' | 'awaiting_budget' | 'awaiting_tool';
1837
+ export interface ComputeGoalClaimSource {
1838
+ tool: string;
1839
+ input_summary: string;
1840
+ /** Source-reported time, or null when the tool did not report it. */
1841
+ as_of: string | null;
1842
+ retrieved_at: string;
1843
+ call_id: string | null;
1844
+ }
1845
+ export interface ComputeGoalClaim {
1846
+ text: string;
1847
+ kind: 'observed' | 'inferred';
1848
+ sources: ComputeGoalClaimSource[];
1849
+ /** Zero-based indices of earlier claims. Inference rules are stated in text. */
1850
+ basis?: number[];
1851
+ }
1682
1852
  export interface ComputeGoalStatus {
1683
1853
  id: string;
1684
- status: string;
1854
+ status: GoalStatus;
1855
+ tool_requests: Array<{
1856
+ id: string;
1857
+ need: string;
1858
+ status: 'open' | 'queued' | 'filed' | 'building' | 'shipped' | 'declined' | 'matched_existing' | 'duplicate';
1859
+ tool_name?: string;
1860
+ }>;
1861
+ connection_hold?: {
1862
+ since: string;
1863
+ requires: ComputeRequirement[];
1864
+ } | null;
1685
1865
  name: string;
1686
1866
  objective: string;
1687
1867
  current_phase: number | null;
@@ -1698,11 +1878,20 @@ export interface ComputeGoalStatus {
1698
1878
  done_check?: ComputeDoneCheck | null;
1699
1879
  /** The latest evaluation of the done-check. */
1700
1880
  check_result?: ComputeCheckResult | null;
1701
- /** Why the goal ended. A goal that ran out of budget is `budget_exhausted`, never completed. */
1881
+ /** Progress and code-priced funding estimate while waiting for budget. */
1882
+ budget_hold?: {
1883
+ since: string;
1884
+ units_done: number;
1885
+ units_left?: number;
1886
+ cost_to_finish?: number;
1887
+ price_per_unit?: number;
1888
+ } | null;
1889
+ /** Why the goal ended. Budget exhaustion holds for 7 days before ending `budget_exhausted`. */
1702
1890
  end_reason?: ComputeEndReason | null;
1703
1891
  /** The goal's answer in the planner's words, written when it finished. What its tasks produced: `getComputeOutputs`. */
1704
1892
  result?: string | null;
1705
1893
  result_at?: string | null;
1894
+ claims?: ComputeGoalClaim[];
1706
1895
  started_at: string | null;
1707
1896
  completed_at: string | null;
1708
1897
  last_wake_at: string | null;
@@ -1773,7 +1962,7 @@ export interface ComputeBudgetStatus {
1773
1962
  created_at: string;
1774
1963
  }>;
1775
1964
  }
1776
- export interface BusinessFindOptions extends ToolOptions {
1965
+ export interface BusinessFindOptions extends ToolOptions, FreshLookupOption {
1777
1966
  /** Business categories, e.g. ['hvac contractor', 'dental practice']. category or keywords required. */
1778
1967
  category?: string[];
1779
1968
  /** Free-text keywords (alternative to category). */
@@ -1791,7 +1980,7 @@ export interface BusinessFindOptions extends ToolOptions {
1791
1980
  /** 1-500, default 100. Effective max is bounded by the vendor-call cap; see `truncated`. */
1792
1981
  limit?: number;
1793
1982
  }
1794
- export interface BusinessResolveOptions extends ToolOptions {
1983
+ export interface BusinessResolveOptions extends ToolOptions, FreshLookupOption {
1795
1984
  name: string;
1796
1985
  address?: string;
1797
1986
  city?: string;
@@ -1824,7 +2013,7 @@ export interface LocalResult {
1824
2013
  latitude: number | null;
1825
2014
  longitude: number | null;
1826
2015
  }
1827
- export interface BusinessFindResult {
2016
+ export interface BusinessFindResult extends CachedRecordFields {
1828
2017
  status: string;
1829
2018
  results: LocalResult[];
1830
2019
  total_found: number;
@@ -1838,9 +2027,9 @@ export interface BusinessFindResult {
1838
2027
  memo?: string;
1839
2028
  cost?: number;
1840
2029
  }
1841
- export interface BusinessResolveResult {
2030
+ export interface BusinessResolveResult extends CachedRecordFields {
1842
2031
  status: string;
1843
- /** false is a completed job, not an error — the same contract as personEmail. */
2032
+ /** false is a completed job, not an error - the same contract as personEmail. */
1844
2033
  found: boolean;
1845
2034
  /** 0..1 confidence of the best candidate (0 when nothing was returned). */
1846
2035
  confidence: number;
@@ -1864,7 +2053,7 @@ export type GovNoticeTypeCode = 'r' | 'p' | 'o' | 'k' | 's' | 'a' | 'u' | 'i' |
1864
2053
  export interface RecordSolicitationsFindOptions extends ToolOptions {
1865
2054
  /** 6-digit NAICS codes, 1-20. Required. */
1866
2055
  naics: string[];
1867
- /** Default ['r', 'p'] — Sources Sought + Presolicitation, the window where the requirement is still being written. */
2056
+ /** Default ['r', 'p'] - Sources Sought + Presolicitation, the window where the requirement is still being written. */
1868
2057
  notice_types?: GovNoticeTypeCode[];
1869
2058
  /** Look-back window on posted date, 1-365. Default 30. */
1870
2059
  since_days?: number;
@@ -1934,7 +2123,7 @@ export interface RecordSolicitationsFindResult {
1934
2123
  description_fetches: number;
1935
2124
  /**
1936
2125
  * ISO timestamp of the data snapshot behind `results`: the publish time of
1937
- * SAM.gov's daily extract when served from it (the common case — same-day
2126
+ * SAM.gov's daily extract when served from it (the common case - same-day
1938
2127
  * postings appear the next morning), or the request time when the live
1939
2128
  * SAM.gov API answered.
1940
2129
  */
@@ -1947,13 +2136,11 @@ export interface RecordSolicitationsFindResult {
1947
2136
  memo?: string;
1948
2137
  cost?: number;
1949
2138
  }
1950
- /** Interactive profile login (#1889). setup_url is a secret for the account's owner; do not log or persist it. */
2139
+ /** Interactive profile login. setup_url is a secret for the account's owner; do not log or persist it. */
1951
2140
  export interface BrowserProfileSetup {
1952
2141
  profile_id: string;
1953
2142
  session_id?: string;
1954
2143
  status: string;
1955
- /** @deprecated Use setup_url. Removed in the next release. */
1956
- live_url?: string | null;
1957
2144
  /** The OneShot page the account's owner opens to sign in. Opens once; a fresh one comes from createBrowserProfileSetupLink. Returned by start and link. */
1958
2145
  setup_url?: string;
1959
2146
  /** When setup_url stops opening (10 minutes after it was minted, or when the setup expires). */
@@ -2181,7 +2368,7 @@ export interface LinkedInConversationsOptions {
2181
2368
  export interface LinkedInMessagesOptions {
2182
2369
  accountId: string;
2183
2370
  conversationId?: string;
2184
- /** `inbound` = the human received it — use with `since` as a reply watermark. */
2371
+ /** `inbound` = the human received it - use with `since` as a reply watermark. */
2185
2372
  direction?: 'inbound' | 'outbound';
2186
2373
  /** ISO time: only messages sent after this. */
2187
2374
  since?: string;
@@ -2356,7 +2543,7 @@ export type DiscoverToolsResult = {
2356
2543
  message?: string;
2357
2544
  searchedCategories?: string[];
2358
2545
  };
2359
- /** One of the agent's connections (`GET /v1/connections`, #2403). A read of a connected system takes its `id` as `connection_id`. */
2546
+ /** One of the agent's connections (`GET /v1/connections`). A read of a connected system takes its `id` as `connection_id`. */
2360
2547
  export interface AgentConnection {
2361
2548
  id: string;
2362
2549
  name: string;
@@ -2367,9 +2554,11 @@ export interface AgentConnection {
2367
2554
  account_label: string | null;
2368
2555
  /** Only an `active` connection can be read. */
2369
2556
  status: 'pending' | 'active' | 'expired' | 'revoked';
2557
+ /** `region` is the data center named at start, for a system that runs several (Zoho Books). */
2370
2558
  scope: {
2371
2559
  repositories: string[];
2372
2560
  accountId?: string;
2561
+ region?: string;
2373
2562
  oauthScopes?: string[];
2374
2563
  };
2375
2564
  credential?: 'stored';