@oneshot-agent/sdk 0.61.0 → 0.63.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
@@ -219,6 +219,7 @@ export interface ToolOptions {
219
219
  idempotencyKey?: string;
220
220
  }) => void;
221
221
  maxCost?: number;
222
+ /** Polling limit in seconds. Overrides a tool's manifest timeout or its existing default. */
222
223
  timeout?: number;
223
224
  signal?: AbortSignal;
224
225
  onStatusUpdate?: StatusUpdateFn;
@@ -287,39 +288,19 @@ export interface EmailToolOptions extends ToolOptions {
287
288
  reply_to_email_id?: string;
288
289
  from_domain?: string;
289
290
  /**
290
- * Sender mailbox / local-part. Defaults to `agent` (i.e. agent@from_domain).
291
- * Requires `from_domain` to be set - pinning `from_mailbox` alone throws a
292
- * `ValidationError` (there is no default domain to attach it to). You may
293
- * use any local-part - a new address is auto-provisioned on first use
294
- * (and starts unwarmed, building reputation over time). See the email
295
- * "list domains" tool for each domain's `default_from` and existing `addresses`.
291
+ * Sender address / local-part on `from_domain`. Defaults to the domain's main
292
+ * address (its `default_from` in `listDomains()`). Requires `from_domain` -
293
+ * pinning `from_mailbox` alone throws a `ValidationError`. The address must be
294
+ * one the domain has: an address it does not have answers
295
+ * `status: 'confirmation_required'` with the quote that adds it (see
296
+ * `quoteDomain`), and nothing is sent.
296
297
  */
297
298
  from_mailbox?: string;
298
299
  /**
299
- * How this domain sends (provider-neutral):
300
- * - `'relay'` (default) - header/relay send; any from-address works with nothing
301
- * provisioned per address (no mailbox fee).
302
- * - `'mailbox'` - a real per-address mailbox; each new from-address provisions +
303
- * warms a dedicated mailbox (one-time `mailbox_provisioning_fee` on the quote).
304
- * Only honored when the domain is first set up - an already-provisioned domain
305
- * keeps the mode it was created with. Use `'mailbox'` on a new `from_domain`.
306
- *
307
- * Which means omitting this is NOT a way to avoid the fee: a domain created in
308
- * mailbox mode bills `mailbox_provisioning_fee` for every address that isn't
309
- * already `active` on it - the default `agent@` included - whatever you pass
310
- * here, and `from_mailbox` doesn't change that either. Read `mailbox_mode` per
311
- * domain from `listDomains()` to see which of yours charge.
312
- */
313
- mailbox_mode?: 'relay' | 'mailbox';
314
- /**
315
- * Only meaningful when `from_domain` is a domain the agent doesn't own yet.
316
- * A call with such a `from_domain` always stops after quoting - no charge,
317
- * no send - and returns `status: 'confirmation_required'` with the exact
318
- * total and its `quote_id`. Pass that `quote_id` here on the repeat call to
319
- * register the domain, pay exactly that quote's total, and send in one call:
320
- * the SDK sends against the stored quote instead of quoting again, so the
321
- * amount charged is the amount shown. A bare `true` names no amount
322
- * and only re-quotes. An expired or used quote is refused by the server.
300
+ * Accept the exact setup quote (a new domain, or an address added to one).
301
+ * Buys setup only; no email is sent. Wait for setup to finish, then call
302
+ * email again without this option. A bare true is not confirmation; expired
303
+ * or used quotes are refused.
323
304
  */
324
305
  confirmNewDomain?: string;
325
306
  /** Display name shown to the recipient, e.g. "Jane Doe" → "Jane Doe <jane@domain>". */
@@ -491,13 +472,17 @@ export interface ProductFindOptions extends ToolOptions {
491
472
  export interface WebSearchOptions extends ToolOptions {
492
473
  query: string;
493
474
  max_results?: number;
475
+ /** Only results published within the last day, week, month or year. */
476
+ published_within?: 'day' | 'week' | 'month' | 'year';
494
477
  }
495
478
  export interface WebSearchResult {
496
479
  query: string;
480
+ /** `published_at` is the publication date (YYYY-MM-DD) when the provider gives one, otherwise null. */
497
481
  results: Array<{
498
482
  url: string;
499
483
  title: string;
500
484
  description: string;
485
+ published_at: string | null;
501
486
  }>;
502
487
  result_count: number;
503
488
  memo?: string;
@@ -514,6 +499,7 @@ export interface WebReadResult extends UntrustedContent {
514
499
  receipt_id?: string;
515
500
  url: string;
516
501
  markdown: string;
502
+ /** Private org artifacts: authenticated GET returns download_url/expires_at; GET that URL with the same org session within five minutes. */
517
503
  screenshot_url?: string;
518
504
  metadata?: {
519
505
  title: string;
@@ -642,11 +628,100 @@ export interface ResearchResult {
642
628
  memo?: string;
643
629
  cost?: number;
644
630
  }
631
+ /**
632
+ * How a domain's addresses work, chosen when the domain is bought and fixed after:
633
+ * - `relay` (default): each address sends and receives through the platform, with no hosted inbox. Free per address.
634
+ * - `mailbox`: each address is a hosted inbox, warmed before it joins rotation. Each carries a one-time per-address fee.
635
+ */
636
+ export type MailboxMode = 'relay' | 'mailbox';
637
+ /** What to buy with a domain: its mode and the addresses it has. */
638
+ export interface DomainSetupChoice {
639
+ /** Defaults to `relay`. On a domain the agent already has, the domain's own mode applies. */
640
+ mailbox_mode?: MailboxMode;
641
+ /**
642
+ * Local parts, such as `['sales', 'support']`: 1 to 10, lowercased, unique. The first is the main
643
+ * address that rotation and goals send from. Defaults to `['agent']`. The domain has exactly these
644
+ * addresses: mail to any other is dropped, and a send from one is refused with `address_not_set_up`.
645
+ * On a verified domain the agent already has, the quote prices only the addresses it does not have yet.
646
+ */
647
+ addresses?: string[];
648
+ }
649
+ export interface DomainSetupQuote {
650
+ domain: string;
651
+ /** Absent on an address purchase for a domain the agent already has. */
652
+ available?: boolean;
653
+ premium?: boolean;
654
+ purchasable: boolean;
655
+ reason?: string;
656
+ /** `sending_domain` buys the domain; `domain_addresses` adds addresses to one the agent already has. */
657
+ setup?: 'sending_domain' | 'domain_addresses';
658
+ mailbox_mode?: MailboxMode;
659
+ /** The local parts this quote buys. */
660
+ addresses?: string[];
661
+ /** Named addresses the domain already has; not charged. */
662
+ already_set_up?: string[];
663
+ registration_fee?: number;
664
+ /** The per-address fee times the number of addresses; 0 on relay. */
665
+ mailbox_provisioning_fee?: number;
666
+ quote_id?: string;
667
+ total_cost?: number;
668
+ currency?: string;
669
+ expires_at?: string;
670
+ billing?: {
671
+ one_time: boolean;
672
+ term_years: number;
673
+ renewal_charged: boolean;
674
+ summary: string;
675
+ };
676
+ }
677
+ export interface DomainSetupPurchase {
678
+ request_id?: string;
679
+ receipt_id?: string;
680
+ /** Present on the queued response; completed job results report domain_status instead. */
681
+ status?: string;
682
+ setup?: 'sending_domain' | 'domain_addresses';
683
+ domain?: string;
684
+ mailbox_mode?: MailboxMode;
685
+ addresses?: string[];
686
+ domain_status?: string | null;
687
+ registered?: boolean | null;
688
+ message?: string;
689
+ }
690
+ /** Account setup a call needs before it can run, as `/email/quote` reports it. */
691
+ export interface SetupRequirement {
692
+ kind: string;
693
+ state: string;
694
+ action_url?: string;
695
+ setup?: {
696
+ price: number;
697
+ currency: 'USD';
698
+ estimated: boolean;
699
+ choice?: 'domain_name';
700
+ choices?: Array<'domain_name' | 'mailbox_mode' | 'addresses'>;
701
+ domain?: string;
702
+ addresses?: string[];
703
+ alternatives?: Array<{
704
+ action_url: string;
705
+ price: number;
706
+ currency: 'USD';
707
+ choice: 'domain_name';
708
+ choices?: Array<'domain_name' | 'mailbox_mode' | 'addresses'>;
709
+ }>;
710
+ };
711
+ [key: string]: unknown;
712
+ }
645
713
  export interface EmailResult {
714
+ /** Account setup is separate from this email; inspect its quote or purchase result. */
715
+ setup?: DomainSetupQuote | DomainSetupPurchase;
716
+ /**
717
+ * On `status: 'setup_required'` or `'setup_pending'`: the setup the send needs, from the server's
718
+ * `no_sending_domain` or `address_not_set_up` answer. Nothing was charged.
719
+ */
720
+ requirements?: SetupRequirement[];
646
721
  request_id?: string;
647
722
  /** On `status: 'confirmation_required'`: the quote to pass back as `confirmNewDomain` to accept exactly this cost. */
648
723
  quote_id?: string;
649
- /** On `status: 'confirmation_required'`: the explanation to relay, with the exact cost and the confirming call. */
724
+ /** On `status: 'confirmation_required'`: the setup instructions; the exact cost and billing terms are in setup. */
650
725
  message?: string;
651
726
  /** Receipt id (`rcpt_…`) for this call. Pass to `tagReceiptValue` to annotate value later. */
652
727
  receipt_id?: string;
@@ -657,8 +732,8 @@ export interface EmailResult {
657
732
  * Non-blocking advisory from the server. Values:
658
733
  * - `pinned_domain_warming` - a pinned sender's domain is still warming (low warmup score)
659
734
  * - `pinned_over_limit` - a pinned sender's domain is over its daily_send_limit
660
- * The send still proceeds; read this to back off / defer. (Note: an un-pinned
661
- * send with no eligible owned domain is a hard `400 no_sending_domain`, not a
735
+ * The send still proceeds; read this to back off / defer. (A send with no
736
+ * verified domain answers `status: 'setup_required'` with `requirements`, not a
662
737
  * warning - there is no shared fallback sender.)
663
738
  */
664
739
  warning?: string;
@@ -675,47 +750,37 @@ export interface EmailResult {
675
750
  memo?: string;
676
751
  cost?: number;
677
752
  }
678
- /** Reputation health, orthogonal to rotation eligibility. */
679
- export type DomainWarmupState = 'warming' | 'warmed' | 'degraded';
753
+ /**
754
+ * Reputation health, orthogonal to rotation eligibility. `not_warmed`: a relay domain or address, which is
755
+ * never warmed and joins rotation at once on a daily limit that rises with the domain's age.
756
+ */
757
+ export type DomainWarmupState = 'warming' | 'warmed' | 'degraded' | 'not_warmed';
680
758
  /** Why a domain is out of rotation (null when active). 'low_reputation' auto-recovers; 'manual' needs a resume. */
681
759
  export type DomainPauseReason = 'warming' | 'low_reputation' | 'manual' | null;
682
- /** A mailbox already provisioned on a domain (from `/email/domains` `addresses[]`). */
760
+ /** An address on a domain (from `/email/domains` `addresses[]`). */
683
761
  export interface DomainAddressEntry {
684
762
  /** Full email address, lowercased - e.g. `sales@yourdomain.com`. */
685
763
  address: string;
686
- /** Mailbox provisioning state. Only `active` counts as already-provisioned (free to send from). */
764
+ /** Only `active` addresses send and receive. `provisioning` is being set up; `failed` was refunded and can be bought again. */
687
765
  status: 'active' | 'provisioning' | 'failed';
688
- /** Per-address reputation health (each provisioned address is warmed individually). */
766
+ /** Per-address reputation health: mailbox addresses are warmed one by one; relay addresses are `not_warmed`. */
689
767
  warmup_state: DomainWarmupState;
690
768
  }
691
769
  export interface DomainPoolEntry {
692
770
  domain: string;
693
- /**
694
- * Canonical sending address for this domain (e.g. `agent@yourdomain.com`) - the
695
- * default mailbox when you don't pick one. Like any address, the first send from
696
- * it incurs the one-time `mailbox_provisioning_fee`; free once it's `active`.
697
- */
771
+ /** The domain's main address (e.g. `agent@yourdomain.com`): rotation and goals send from it. */
698
772
  default_from: string;
699
773
  /**
700
- * Mailboxes already provisioned on this domain. Empty = none yet; you can still
701
- * send from any address - a new one is provisioned (and billed
702
- * `mailbox_provisioning_fee`) on first use.
774
+ * The addresses this domain has. It sends and receives only at these; add more with
775
+ * `quoteDomain(domain, { addresses })` and `buyDomain`.
703
776
  */
704
777
  addresses: DomainAddressEntry[];
705
778
  /**
706
- * Which side of the provisioning fee this domain sits on.
707
- *
708
- * `mailbox` - a real mailbox is provisioned per address, so every address
709
- * that isn't already `active` in `addresses[]` bills the one-time
710
- * `mailbox_provisioning_fee` on its first send. That includes the canonical
711
- * `default_from`; nothing is exempt.
712
- * `relay` - header-only send, nothing provisioned, no per-address fee.
713
- *
714
- * This is a property of the DOMAIN, fixed when it was set up - not of the
715
- * call. Omitting `mailbox_mode` on a quote does not make the send relay; the
716
- * domain's own mode always wins. Check here before you quote.
779
+ * The domain's mode, fixed when it was bought. `mailbox`: each address is a hosted inbox, with a
780
+ * one-time per-address fee when it is added. `relay`: addresses send and receive with no hosted
781
+ * inbox, free to add.
717
782
  */
718
- mailbox_mode: 'relay' | 'mailbox';
783
+ mailbox_mode: MailboxMode;
719
784
  /** Rotation eligibility - the selector only picks `active`. */
720
785
  pool_status: 'active' | 'paused' | 'removed';
721
786
  /** Reputation health - a domain can be `paused` AND still `warming`/recovering. */
@@ -1222,7 +1287,7 @@ export interface InboundCallsOptions {
1222
1287
  export interface Notification {
1223
1288
  id: string;
1224
1289
  agentId: string;
1225
- type: 'job_completed' | 'job_failed' | 'voice_completed' | 'sms_completed' | 'credit_issued' | 'domain_expiring' | 'phone_expiring';
1290
+ type: 'job_completed' | 'job_failed' | 'voice_completed' | 'sms_completed' | 'credit_issued' | 'domain_expiring' | 'phone_expiring' | 'goal_awaiting_budget' | 'goal_budget_warning';
1226
1291
  title: string;
1227
1292
  body?: string;
1228
1293
  metadata?: Record<string, unknown>;
@@ -1606,6 +1671,17 @@ export interface ComputeOptions extends ToolOptions {
1606
1671
  * sandbox default-deny on gets the same for all its goals.
1607
1672
  */
1608
1673
  egress_allowlist?: string[];
1674
+ /**
1675
+ * Your reading of the goal: the unit, how a unit starts, what each unit needs, the overhead, the
1676
+ * volume and what no price list covers. It replaces the quote's reading and is priced again in
1677
+ * code; a tool the goal cannot call is refused. Omit it and the quote proposes one.
1678
+ */
1679
+ scope?: ComputeGoalScope;
1680
+ /**
1681
+ * Called with the quote before anything is paid: read `quote.scope`, `quote.price` and
1682
+ * `quote.done_check` there, and throw to stop without paying. `maxCost` still caps the total.
1683
+ */
1684
+ onQuote?: (quote: ComputeQuote) => void;
1609
1685
  }
1610
1686
  export type ComputeDoneCheck =
1611
1687
  /** At least `at_least` calls of `tool` that reached `status` (default `completed`). */
@@ -1638,20 +1714,44 @@ export type ComputeDoneCheck =
1638
1714
  equals?: string | number | boolean;
1639
1715
  at_least?: number;
1640
1716
  }
1641
- /** 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. */
1717
+ /** 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. */
1642
1718
  | {
1643
1719
  kind: 'cases';
1644
1720
  finished_states: string[];
1645
1721
  owner_required_for?: string[];
1646
1722
  min_cases?: number;
1647
1723
  }
1724
+ /**
1725
+ * A named person accepts proof the agent submits (a document, photo, link or extracted fields). `verifier` needs an
1726
+ * email or a phone number. With `fields`, the proof's document is read first and a field that is missing or breaks
1727
+ * its constraint means the verifier is not asked.
1728
+ */
1729
+ | {
1730
+ kind: 'evidence';
1731
+ verifier: {
1732
+ name: string;
1733
+ email?: string;
1734
+ phone?: string;
1735
+ timezone?: string;
1736
+ };
1737
+ accepts: string;
1738
+ fields?: Array<{
1739
+ name: string;
1740
+ description: string;
1741
+ type: 'string' | 'number' | 'boolean';
1742
+ equals?: string | number | boolean;
1743
+ one_of?: string[];
1744
+ at_least?: number;
1745
+ at_most?: number;
1746
+ }>;
1747
+ }
1648
1748
  /** No check can be written: you confirm with `confirmComputeGoal`. */
1649
1749
  | {
1650
1750
  kind: 'owner';
1651
1751
  };
1652
1752
  /** What an evaluation of the done-check found. */
1653
1753
  export interface ComputeCheckResult {
1654
- kind: 'count' | 'tool_result' | 'cases' | 'owner';
1754
+ kind: 'count' | 'tool_result' | 'cases' | 'evidence' | 'owner';
1655
1755
  /** `null` while waiting for the owner. */
1656
1756
  passed: boolean | null;
1657
1757
  observed?: unknown;
@@ -1660,16 +1760,16 @@ export interface ComputeCheckResult {
1660
1760
  evaluated_at: string;
1661
1761
  attempt?: number;
1662
1762
  }
1663
- export type ComputeEndReason = 'check_passed' | 'owner_confirmed' | 'check_failed' | 'budget_exhausted' | 'deadline_passed' | 'planner_failed' | 'impossible' | 'impossible_unverified' | 'connection_timeout';
1763
+ export type ComputeEndReason = 'check_passed' | 'owner_confirmed' | 'check_failed' | 'budget_exhausted' | 'deadline_passed' | 'planner_failed' | 'impossible' | 'impossible_unverified' | 'connection_timeout' | 'tool_timeout' | 'setup_timeout' | 'runner_retired';
1664
1764
  export interface ComputeApprovals {
1665
1765
  /** Hold any single call whose cost exceeds this many USDC. */
1666
1766
  spend_over_usdc?: number;
1667
1767
  /** Hold every call of these tools, whatever the cost (e.g. ["commerce_buy", "physical_mail", "voice", "soul_hire"]). */
1668
1768
  tools?: string[];
1669
1769
  }
1670
- /** A connected system a goal needs, as the quote read it from the objective. */
1770
+ /** A connected system, or the agent's LinkedIn account, required by the scoped tools or read from the objective. */
1671
1771
  export interface ComputeRequirement {
1672
- family: 'crm' | 'ledger' | 'shipping' | 'tax' | 'procurement' | 'repository';
1772
+ family: 'crm' | 'ledger' | 'shipping' | 'tax' | 'procurement' | 'meetings' | 'mailbox' | 'files' | 'field_service' | 'repository' | 'linkedin';
1673
1773
  /** The product the objective names (e.g. "QuickBooks"); null when only the kind of system was named. */
1674
1774
  product: string | null;
1675
1775
  /** The system can be connected on OneShot right now. */
@@ -1687,7 +1787,7 @@ export interface ComputeRequirement {
1687
1787
  export interface ComputeFeasibility {
1688
1788
  verdict: 'accept' | 'hold' | 'refuse';
1689
1789
  reasons: {
1690
- code: 'system_unsupported' | 'deadline_in_past' | 'infeasible_input' | 'connection_checked_at_payment';
1790
+ code: 'system_unsupported' | 'deadline_in_past' | 'infeasible_input' | 'verifier_unreachable' | 'connection_checked_at_payment';
1691
1791
  message: string;
1692
1792
  conflicts?: {
1693
1793
  constraints: {
@@ -1699,15 +1799,89 @@ export interface ComputeFeasibility {
1699
1799
  }[];
1700
1800
  }[];
1701
1801
  warnings: {
1702
- code: 'no_tool_matched' | 'tight_deadline' | 'finish_line_unknowable' | 'product_unverified' | 'similar_goal_was_impossible';
1802
+ code: 'need_limit_exceeded' | 'no_tool_matched' | 'tight_deadline' | 'finish_line_unknowable' | 'product_unverified' | 'similar_goal_was_impossible';
1703
1803
  message: string;
1704
1804
  }[];
1705
1805
  finish_line?: {
1706
1806
  kind: 'measurable' | 'needs_owner' | 'unknowable';
1707
1807
  done_check?: ComputeDoneCheck;
1708
1808
  };
1809
+ /** 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. */
1810
+ missing?: {
1811
+ entity: string;
1812
+ attribute?: string;
1813
+ action?: string;
1814
+ operation: 'lookup' | 'list' | 'act';
1815
+ purpose: string;
1816
+ }[];
1817
+ }
1818
+ /** One tool use inside a unit of a goal's scope. */
1819
+ export interface ComputeScopeUse {
1820
+ tool: string;
1821
+ qty: number;
1822
+ max_attempts: number;
1823
+ /** Request sizes (recipients, segments, pages, minutes, problem size); never prices. */
1824
+ drivers?: Record<string, number | boolean | string>;
1825
+ /** Whom or what the use is pointed at, in your words. */
1826
+ target?: string;
1827
+ persistence?: {
1828
+ max_attempts: number;
1829
+ spacing_seconds: number;
1830
+ escalate_to?: string;
1831
+ then: 'owner' | 'give_up';
1832
+ };
1833
+ }
1834
+ /** A goal's scope: the unit the goal works in, what one unit takes, and how many units there are. */
1835
+ export interface ComputeGoalScope {
1836
+ unit: {
1837
+ name: string;
1838
+ starts_on: 'list' | 'event' | 'schedule' | 'once';
1839
+ };
1840
+ per_unit: {
1841
+ uses: ComputeScopeUse[];
1842
+ step_allowance: number;
1843
+ done: string[];
1844
+ };
1845
+ overhead: {
1846
+ uses: Pick<ComputeScopeUse, 'tool' | 'qty' | 'max_attempts' | 'drivers'>[];
1847
+ step_allowance: number;
1848
+ };
1849
+ volume: {
1850
+ kind: 'list';
1851
+ count: number;
1852
+ } | {
1853
+ kind: 'open';
1854
+ };
1855
+ unpriced: {
1856
+ name: string;
1857
+ reason: 'connection' | 'quoted_tool';
1858
+ assumption?: string;
1859
+ }[];
1860
+ }
1861
+ /** What a quote prices: one unit, the overhead, the whole goal or the units a budget covers, and what it cannot price. */
1862
+ export interface ComputeScopePrice {
1863
+ per_unit: {
1864
+ expected: number;
1865
+ ceiling: number;
1866
+ };
1867
+ overhead: {
1868
+ expected: number;
1869
+ ceiling: number;
1870
+ };
1871
+ /** A listed volume: the whole goal. */
1872
+ total?: {
1873
+ expected: number;
1874
+ ceiling: number;
1875
+ };
1876
+ /** An open volume with a budget: whole units after overhead; null for a zero-cost unit. */
1877
+ units_covered?: number | null;
1878
+ unpriced: ComputeGoalScope['unpriced'];
1879
+ unmeasured: string[];
1709
1880
  }
1710
1881
  export interface ComputeQuote {
1882
+ /** Account prerequisites, observed without reserving capacity. Setup is purchased separately. */
1883
+ requirements: ComputeToolRequirement[];
1884
+ connection_requirements: ComputeRequirement[];
1711
1885
  quote_id: string;
1712
1886
  objective_summary: string;
1713
1887
  estimated_phases: number;
@@ -1717,6 +1891,11 @@ export interface ComputeQuote {
1717
1891
  /** One entry per connected system the goal needs. */
1718
1892
  requires: ComputeRequirement[];
1719
1893
  feasibility: ComputeFeasibility;
1894
+ /** The recipe the goal is held to: yours, or the quote's reading. */
1895
+ scope: ComputeGoalScope;
1896
+ price: ComputeScopePrice;
1897
+ /** The done check the goal is held to: yours, else the proposed one; null means you confirm. */
1898
+ done_check: ComputeDoneCheck | null;
1720
1899
  total_budget: string;
1721
1900
  expires_at: string;
1722
1901
  schedule_cron?: string;
@@ -1724,8 +1903,35 @@ export interface ComputeQuote {
1724
1903
  max_runs?: number;
1725
1904
  projected_runs?: number;
1726
1905
  }
1906
+ export interface ComputeToolRequirement {
1907
+ kind: 'sending_domain' | 'caller_number' | 'browser_login' | 'connection';
1908
+ family?: ComputeRequirement['family'];
1909
+ product?: string | null;
1910
+ state: 'ready' | 'setup' | 'owner';
1911
+ checked_at_payment?: boolean;
1912
+ action_url?: string;
1913
+ /** Account setup the owner completes at `action_url`. With no `choice`, code picks what is bought. */
1914
+ setup?: {
1915
+ price: number;
1916
+ currency: 'USD';
1917
+ estimated: boolean;
1918
+ choice?: 'domain_name';
1919
+ alternatives?: {
1920
+ action_url: string;
1921
+ price: number;
1922
+ currency: 'USD';
1923
+ choice: 'domain_name';
1924
+ }[];
1925
+ };
1926
+ limit?: {
1927
+ daily: number;
1928
+ remaining: number;
1929
+ requested: number;
1930
+ warming: boolean;
1931
+ };
1932
+ }
1727
1933
  export interface ComputeGoalResult {
1728
- requires?: ComputeRequirement[];
1934
+ requires?: Array<ComputeRequirement | ComputeToolRequirement>;
1729
1935
  goal_id: string;
1730
1936
  request_id: string;
1731
1937
  receipt_id?: string;
@@ -1743,10 +1949,35 @@ export interface ComputeGoalResult {
1743
1949
  next_run_at?: string;
1744
1950
  };
1745
1951
  }
1746
- export type GoalStatus = 'active' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'awaiting_confirmation' | 'awaiting_connection';
1952
+ export type GoalStatus = 'active' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'awaiting_confirmation' | 'awaiting_connection' | 'awaiting_budget' | 'awaiting_tool' | 'awaiting_setup';
1953
+ export interface ComputeGoalClaimSource {
1954
+ tool: string;
1955
+ input_summary: string;
1956
+ /** Source-reported time, or null when the tool did not report it. */
1957
+ as_of: string | null;
1958
+ retrieved_at: string;
1959
+ call_id: string | null;
1960
+ }
1961
+ export interface ComputeGoalClaim {
1962
+ text: string;
1963
+ kind: 'observed' | 'inferred';
1964
+ sources: ComputeGoalClaimSource[];
1965
+ /** Zero-based indices of earlier claims. Inference rules are stated in text. */
1966
+ basis?: number[];
1967
+ }
1747
1968
  export interface ComputeGoalStatus {
1748
1969
  id: string;
1749
1970
  status: GoalStatus;
1971
+ tool_requests: Array<{
1972
+ id: string;
1973
+ need: string;
1974
+ status: 'open' | 'queued' | 'filed' | 'building' | 'shipped' | 'declined' | 'matched_existing' | 'duplicate';
1975
+ tool_name?: string;
1976
+ }>;
1977
+ setup_hold?: {
1978
+ since: string;
1979
+ requires: ComputeToolRequirement[];
1980
+ } | null;
1750
1981
  connection_hold?: {
1751
1982
  since: string;
1752
1983
  requires: ComputeRequirement[];
@@ -1767,11 +1998,20 @@ export interface ComputeGoalStatus {
1767
1998
  done_check?: ComputeDoneCheck | null;
1768
1999
  /** The latest evaluation of the done-check. */
1769
2000
  check_result?: ComputeCheckResult | null;
1770
- /** Why the goal ended. A goal that ran out of budget is `budget_exhausted`, never completed. */
2001
+ /** Progress and code-priced funding estimate while waiting for budget. */
2002
+ budget_hold?: {
2003
+ since: string;
2004
+ units_done: number;
2005
+ units_left?: number;
2006
+ cost_to_finish?: number;
2007
+ price_per_unit?: number;
2008
+ } | null;
2009
+ /** Why the goal ended. Budget exhaustion holds for 7 days before ending `budget_exhausted`. */
1771
2010
  end_reason?: ComputeEndReason | null;
1772
2011
  /** The goal's answer in the planner's words, written when it finished. What its tasks produced: `getComputeOutputs`. */
1773
2012
  result?: string | null;
1774
2013
  result_at?: string | null;
2014
+ claims?: ComputeGoalClaim[];
1775
2015
  started_at: string | null;
1776
2016
  completed_at: string | null;
1777
2017
  last_wake_at: string | null;
@@ -1828,6 +2068,19 @@ export interface ComputeTask {
1828
2068
  completed_at: string | null;
1829
2069
  created_at: string;
1830
2070
  }
2071
+ export interface ComputeTaskListOptions {
2072
+ /** Only tasks with this status. */
2073
+ status?: 'pending' | 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';
2074
+ /** Tasks per page, 1 to 500 (default 100). */
2075
+ limit?: number;
2076
+ /** The `next_cursor` of the previous page. */
2077
+ cursor?: string;
2078
+ }
2079
+ export interface ComputeTaskPage {
2080
+ tasks: ComputeTask[];
2081
+ /** Pass as `cursor` for the next page; null on the last one. */
2082
+ next_cursor: string | null;
2083
+ }
1831
2084
  export interface ComputeBudgetStatus {
1832
2085
  budgetId: string;
1833
2086
  goalId: string;
@@ -2434,9 +2687,11 @@ export interface AgentConnection {
2434
2687
  account_label: string | null;
2435
2688
  /** Only an `active` connection can be read. */
2436
2689
  status: 'pending' | 'active' | 'expired' | 'revoked';
2690
+ /** `region` is the data center named at start, for a system that runs several (Zoho Books). */
2437
2691
  scope: {
2438
2692
  repositories: string[];
2439
2693
  accountId?: string;
2694
+ region?: string;
2440
2695
  oauthScopes?: string[];
2441
2696
  };
2442
2697
  credential?: 'stored';