@oneshot-agent/sdk 0.51.0 → 0.52.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
@@ -238,7 +238,7 @@ export interface ToolOptions {
238
238
  * `waitForPhones: true` to keep polling at a slower cadence (every 5s)
239
239
  * until phones land or `phoneTimeoutSec` expires (default 360s = 6 min).
240
240
  * Only meaningful for tools whose upstream enrichment supports async
241
- * phone reveals (research/person, enrich/profile, …). For other tools
241
+ * phone reveals (person-dossier, person-profile, …). For other tools
242
242
  * the flag is a no-op.
243
243
  */
244
244
  waitForPhones?: boolean;
@@ -250,8 +250,8 @@ export interface ToolOptions {
250
250
  * idempotency. Those endpoints reject a conflicting body with 422.
251
251
  * Access-token enrichment requests do not receive replay or conflict
252
252
  * checks. Replay window and requirement differ by endpoint: email.send
253
- * is optional with a 24h cached-response replay window; enrichProfile /
254
- * findEmail / verifyEmail are honored when durable enrichment is enabled
253
+ * is optional with a 24h cached-response replay window; personProfile /
254
+ * personEmail / personEmailStatus are honored when durable enrichment is enabled
255
255
  * on the server AND the session authenticates with a wallet, not an
256
256
  * `accessToken` — an access-token session skips the durable-replay check
257
257
  * on these three routes entirely and always dispatches a fresh job, even
@@ -323,7 +323,7 @@ export interface ResearchToolOptions extends ToolOptions {
323
323
  topic: string;
324
324
  depth?: 'deep' | 'quick';
325
325
  }
326
- export interface PeopleSearchOptions extends ToolOptions {
326
+ export interface PersonFindOptions extends ToolOptions {
327
327
  job_titles?: string[];
328
328
  keywords?: string[];
329
329
  companies?: string[];
@@ -350,13 +350,13 @@ export interface PeopleSearchOptions extends ToolOptions {
350
350
  * regardless of which provider answers the search. */
351
351
  offset?: number;
352
352
  }
353
- export interface EnrichProfileOptions extends ToolOptions {
353
+ export interface PersonProfileOptions extends ToolOptions {
354
354
  linkedin_url?: string;
355
355
  email?: string;
356
356
  name?: string;
357
357
  company_domain?: string;
358
358
  }
359
- export interface CompanySearchOptions extends ToolOptions {
359
+ export interface CompanyFindOptions extends ToolOptions {
360
360
  name?: string;
361
361
  domain?: string;
362
362
  industry?: string[];
@@ -368,38 +368,38 @@ export interface CompanySearchOptions extends ToolOptions {
368
368
  tags?: string[];
369
369
  limit?: number;
370
370
  }
371
- export interface EnrichCompanyOptions extends ToolOptions {
371
+ export interface CompanyProfileOptions extends ToolOptions {
372
372
  domain?: string;
373
373
  name?: string;
374
374
  linkedin_url?: string;
375
375
  ticker?: string;
376
376
  }
377
- export interface FindEmailOptions extends ToolOptions {
377
+ export interface PersonEmailOptions extends ToolOptions {
378
378
  full_name?: string;
379
379
  first_name?: string;
380
380
  last_name?: string;
381
381
  company_domain: string;
382
382
  }
383
- export interface VerifyEmailOptions extends ToolOptions {
383
+ export interface PersonEmailStatusOptions extends ToolOptions {
384
384
  email: string;
385
385
  }
386
- export interface DeepResearchPersonOptions extends ToolOptions {
386
+ export interface PersonDossierOptions extends ToolOptions {
387
387
  email?: string;
388
388
  social_media_url?: string;
389
389
  name?: string;
390
390
  company?: string;
391
391
  }
392
- export interface SocialProfilesOptions extends ToolOptions {
392
+ export interface PersonSocialAccountsOptions extends ToolOptions {
393
393
  email?: string;
394
394
  social_media_url?: string;
395
395
  }
396
- export interface ArticleSearchOptions extends ToolOptions {
396
+ export interface PersonArticlesOptions extends ToolOptions {
397
397
  name: string;
398
398
  company: string;
399
399
  sort?: 'recent' | 'popular';
400
400
  limit?: number;
401
401
  }
402
- export interface PersonNewsfeedOptions extends ToolOptions {
402
+ export interface PersonPostsOptions extends ToolOptions {
403
403
  social_media_url: string;
404
404
  }
405
405
  export interface PersonInterestsOptions extends ToolOptions {
@@ -407,7 +407,7 @@ export interface PersonInterestsOptions extends ToolOptions {
407
407
  phone?: string;
408
408
  social_media_url?: string;
409
409
  }
410
- export interface PersonInteractionsOptions extends ToolOptions {
410
+ export interface PersonFollowersOptions extends ToolOptions {
411
411
  social_media_url: string;
412
412
  type?: 'replies' | 'followers' | 'following' | 'followers,following';
413
413
  max_results?: number;
@@ -521,19 +521,24 @@ export interface Education {
521
521
  start_date?: string;
522
522
  end_date?: string;
523
523
  }
524
+ /**
525
+ * A normalized person record. The worker returns every scalar field below and
526
+ * uses `null`, not a missing key, for a value the provider did not have; the
527
+ * declared person_dossier schema requires exactly that shape (#1789).
528
+ */
524
529
  export interface PersonResult {
525
530
  company_address?: BusinessAddress | null;
526
- full_name?: string;
527
- first_name?: string;
528
- last_name?: string;
529
- title?: string;
530
- company?: string;
531
- company_domain?: string;
532
- linkedin_url?: string;
533
- location?: string;
534
- email?: string;
535
- phone?: string;
536
- summary?: string;
531
+ full_name?: string | null;
532
+ first_name?: string | null;
533
+ last_name?: string | null;
534
+ title?: string | null;
535
+ company?: string | null;
536
+ company_domain?: string | null;
537
+ linkedin_url?: string | null;
538
+ location?: string | null;
539
+ email?: string | null;
540
+ phone?: string | null;
541
+ summary?: string | null;
537
542
  skills?: string[];
538
543
  experience?: Experience[];
539
544
  education?: Education[];
@@ -544,7 +549,7 @@ export interface PersonResult {
544
549
  best_work_email?: string | null;
545
550
  best_personal_email?: string | null;
546
551
  }
547
- export interface PeopleSearchResult {
552
+ export interface PersonFindResult {
548
553
  status: string;
549
554
  results: PersonResult[];
550
555
  total_found: number;
@@ -673,9 +678,20 @@ export interface DomainPoolStatusResult {
673
678
  warmup_state: DomainWarmupState;
674
679
  pause_reason: DomainPauseReason;
675
680
  }
676
- export interface EnrichProfileResult {
681
+ export interface SocialAccount {
682
+ platform: string;
683
+ url: string;
684
+ handle: string | null;
685
+ }
686
+ export interface DossierSection<T> {
687
+ state: 'found' | 'none' | 'unavailable';
688
+ data: T;
689
+ }
690
+ export interface PersonProfileResult {
677
691
  status: string;
678
- profile: PersonResult;
692
+ profile: PersonResult & {
693
+ social_accounts: SocialAccount[];
694
+ };
679
695
  request_id?: string;
680
696
  /** Receipt id (`rcpt_…`) for this call. Pass to `tagReceiptValue` to annotate value later. */
681
697
  receipt_id?: string;
@@ -705,7 +721,7 @@ export interface CompanyResult {
705
721
  linkedin_url?: string;
706
722
  [key: string]: unknown;
707
723
  }
708
- export interface CompanySearchResult {
724
+ export interface CompanyFindResult {
709
725
  status: string;
710
726
  results: CompanyResult[];
711
727
  total_found: number;
@@ -717,7 +733,7 @@ export interface CompanySearchResult {
717
733
  memo?: string;
718
734
  cost?: number;
719
735
  }
720
- export interface EnrichCompanyResult {
736
+ export interface CompanyProfileResult {
721
737
  status: string;
722
738
  company: CompanyResult;
723
739
  request_id?: string;
@@ -727,7 +743,7 @@ export interface EnrichCompanyResult {
727
743
  memo?: string;
728
744
  cost?: number;
729
745
  }
730
- export interface FindEmailResult {
746
+ export interface PersonEmailResult {
731
747
  status: string;
732
748
  email: string | null;
733
749
  found: boolean;
@@ -744,7 +760,7 @@ export interface AsyncJobResult {
744
760
  request_id: string;
745
761
  status: string;
746
762
  }
747
- /** Enrichment data nested inside deep research and enrichment responses. */
763
+ /** Legacy enrichment fields retained for consumers of earlier result shapes. */
748
764
  export interface PersonEnrichment {
749
765
  displayname?: string;
750
766
  firstname?: string;
@@ -789,26 +805,41 @@ export interface PersonEnrichment {
789
805
  };
790
806
  }>;
791
807
  }
792
- export interface DeepResearchPersonResult {
808
+ /** A post can retain null metadata when the collector had no value. */
809
+ export type PersonDossierPost = Omit<PersonPostsResult['result'][number], 'platform' | 'content' | 'url' | 'posted_at'> & {
810
+ platform?: string | null;
811
+ content?: string | null;
812
+ url?: string | null;
813
+ posted_at?: string | null;
814
+ };
815
+ export interface PersonDossierResult {
793
816
  status: string;
794
817
  result: {
795
- enrichment: PersonEnrichment;
796
- following?: Record<string, unknown>[];
797
- articles?: Array<{
798
- title?: string;
799
- url?: string;
800
- source?: string;
801
- published_date?: string;
802
- snippet?: string;
803
- }>;
804
- dossier?: Record<string, unknown>;
818
+ profile: {
819
+ state: 'found';
820
+ data: PersonProfileResult['profile'];
821
+ };
822
+ social_accounts: DossierSection<SocialAccount[]>;
823
+ articles: DossierSection<Array<{
824
+ title: string | null;
825
+ url: string | null;
826
+ source: string | null;
827
+ published_date: string | null;
828
+ snippet: string | null;
829
+ }>>;
830
+ /** At most ten recent posts, using the person_posts representation. */
831
+ posts: DossierSection<PersonDossierPost[]>;
832
+ /** Section-grounded prose; one line when only the profile was found. */
833
+ summary: string;
805
834
  };
806
835
  request_id: string;
807
836
  completed_at: string;
837
+ receipt_id?: string;
838
+ decisionContext?: Record<string, unknown>;
808
839
  memo?: string;
809
840
  cost?: number;
810
841
  }
811
- export interface SocialProfilesResult {
842
+ export interface PersonSocialAccountsResult {
812
843
  status: string;
813
844
  result: Record<string, {
814
845
  url?: string;
@@ -821,7 +852,7 @@ export interface SocialProfilesResult {
821
852
  memo?: string;
822
853
  cost?: number;
823
854
  }
824
- export interface ArticleSearchResult {
855
+ export interface PersonArticlesResult {
825
856
  status: string;
826
857
  result: Array<{
827
858
  title?: string;
@@ -835,7 +866,7 @@ export interface ArticleSearchResult {
835
866
  memo?: string;
836
867
  cost?: number;
837
868
  }
838
- export interface PersonNewsfeedResult {
869
+ export interface PersonPostsResult {
839
870
  status: string;
840
871
  result: Array<{
841
872
  platform?: string;
@@ -859,7 +890,7 @@ export interface PersonInterestsResult {
859
890
  memo?: string;
860
891
  cost?: number;
861
892
  }
862
- export interface PersonInteractionsResult {
893
+ export interface PersonFollowersResult {
863
894
  status: string;
864
895
  result: {
865
896
  followers?: Array<Record<string, unknown>>;
@@ -871,7 +902,7 @@ export interface PersonInteractionsResult {
871
902
  memo?: string;
872
903
  cost?: number;
873
904
  }
874
- export interface VerifyEmailResult {
905
+ export interface PersonEmailStatusResult {
875
906
  status: string;
876
907
  email: string;
877
908
  valid: boolean;
@@ -1702,7 +1733,7 @@ export interface BusinessFindOptions extends ToolOptions {
1702
1733
  is_chain?: boolean;
1703
1734
  /** Default 'open' drops closed businesses. */
1704
1735
  operating_status?: 'open' | 'any';
1705
- /** true = only rows with a resolvable website domain (contactable via findEmail). */
1736
+ /** true = only rows with a resolvable website domain (contactable via personEmail). */
1706
1737
  has_domain?: boolean;
1707
1738
  /** 1-500, default 100. Effective max is bounded by the vendor-call cap; see `truncated`. */
1708
1739
  limit?: number;
@@ -1756,7 +1787,7 @@ export interface BusinessFindResult {
1756
1787
  }
1757
1788
  export interface BusinessResolveResult {
1758
1789
  status: string;
1759
- /** false is a completed job, not an error — the same contract as findEmail. */
1790
+ /** false is a completed job, not an error — the same contract as personEmail. */
1760
1791
  found: boolean;
1761
1792
  /** 0..1 confidence of the best candidate (0 when nothing was returned). */
1762
1793
  confidence: number;
@@ -1901,8 +1932,8 @@ export interface LinkedInConnectIntentIssued {
1901
1932
  requested_actions: string[];
1902
1933
  }
1903
1934
  export interface LinkedInCoverage {
1904
- provider_history: 'never' | 'requested' | 'running' | 'done' | 'error';
1905
- provider_history_completed_at: string | null;
1935
+ history_sync_status: 'never' | 'requested' | 'running' | 'done' | 'error';
1936
+ history_sync_completed_at: string | null;
1906
1937
  enumerated_as_of: string | null;
1907
1938
  enumerated_back_to: string | null;
1908
1939
  latest_message_at: string | null;
@@ -1910,8 +1941,7 @@ export interface LinkedInCoverage {
1910
1941
  message_count: number;
1911
1942
  conversation_count: number;
1912
1943
  last_incremental_at: string | null;
1913
- last_webhook_at: string | null;
1914
- /** provider_history done AND a windowless enumeration finished after it AND no pending cursor. */
1944
+ /** history_sync_status done AND a windowless enumeration finished after it AND no pending cursor. */
1915
1945
  complete: boolean;
1916
1946
  }
1917
1947
  export type LinkedInSyncState = 'reconnect_required' | 'never_synced' | 'syncing' | 'partial' | 'complete';
@@ -1927,8 +1957,8 @@ export interface LinkedInAccount {
1927
1957
  };
1928
1958
  };
1929
1959
  id: string;
1930
- /** deleted_upstream/revoked require a new connect; reconnect_required permits reconnect. */
1931
- status: 'connected' | 'reconnect_required' | 'error' | 'revoked' | 'deleted_upstream';
1960
+ /** connection_deleted/revoked require a new connect; reconnect_required permits reconnect. */
1961
+ status: 'connected' | 'reconnect_required' | 'error' | 'revoked' | 'connection_deleted';
1932
1962
  display_name: string | null;
1933
1963
  member_urn: string | null;
1934
1964
  allowed_actions: string[];
@@ -1937,19 +1967,18 @@ export interface LinkedInAccount {
1937
1967
  reconnected_at: string | null;
1938
1968
  last_status_at: string | null;
1939
1969
  revoked_at: string | null;
1940
- /** False for deleted_upstream: start a new connection instead of retrying reconnect. */
1970
+ /** False for connection_deleted: start a new connection instead of retrying reconnect. */
1941
1971
  reconnect_required: boolean;
1942
1972
  idle_revoke_at: string | null;
1943
- /** Why the grant ended: `agent`, `idle`, `ops` or `upstream_missing`. Null while active. */
1973
+ /** Why the grant ended: `agent`, `idle`, `ops` or `connection_missing`. Null while active. */
1944
1974
  revoked_reason: string | null;
1945
1975
  sync: {
1946
1976
  history_sync_status: string;
1947
1977
  history_sync_completed_at: string | null;
1948
1978
  coverage_earliest_at: string | null;
1949
1979
  coverage_latest_at: string | null;
1950
- last_full_enumeration_at: string | null;
1980
+ last_full_sync_at: string | null;
1951
1981
  last_incremental_at: string | null;
1952
- last_webhook_at: string | null;
1953
1982
  message_count: number;
1954
1983
  conversation_count: number;
1955
1984
  };
@@ -1968,12 +1997,12 @@ export interface LinkedInRevokeResult {
1968
1997
  status: 'revoked';
1969
1998
  revoked_at: string;
1970
1999
  cancelled_sends: number;
1971
- upstream_deleted: boolean;
2000
+ connection_deleted: boolean;
1972
2001
  }
1973
2002
  export interface LinkedInSyncRun {
1974
2003
  run_id: string;
1975
- kind: 'initial' | 'continue' | 'incremental' | 'reconcile' | 'history_request' | 'conversations';
1976
- trigger: 'paid' | 'scheduler' | 'webhook' | 'internal';
2004
+ kind: 'initial' | 'continue' | 'incremental' | 'refresh' | 'history' | 'conversations';
2005
+ trigger: 'paid' | 'scheduled' | 'event' | 'automatic';
1977
2006
  status: 'queued' | 'running' | 'succeeded' | 'failed' | 'paused' | 'superseded';
1978
2007
  continuation_of: string | null;
1979
2008
  has_next_cursor: boolean;
@@ -1981,15 +2010,13 @@ export interface LinkedInSyncRun {
1981
2010
  pages: number;
1982
2011
  requests: number;
1983
2012
  rate_limited: number;
1984
- cursor_resets: number;
1985
2013
  messages_seen: number;
1986
2014
  messages_inserted: number;
1987
2015
  messages_updated: number;
1988
2016
  conversations_inserted: number;
1989
2017
  earliest_seen_at: string | null;
1990
2018
  latest_seen_at: string | null;
1991
- provider_sync_status: string | null;
1992
- upstream_ms: number;
2019
+ history_sync_status: string | null;
1993
2020
  duration_ms: number | null;
1994
2021
  error_code: string | null;
1995
2022
  request_id: string | null;
@@ -2019,7 +2046,7 @@ export interface LinkedInSyncRunResult {
2019
2046
  kind: string;
2020
2047
  outcome: 'exhausted' | 'bounded' | 'partial' | 'not_claimed';
2021
2048
  needs_continuation: boolean;
2022
- provider_history: string;
2049
+ history_sync_status: string;
2023
2050
  pages: number;
2024
2051
  requests: number;
2025
2052
  messages_seen: number;
@@ -2029,12 +2056,11 @@ export interface LinkedInSyncRunResult {
2029
2056
  earliest_seen_at: string | null;
2030
2057
  latest_seen_at: string | null;
2031
2058
  has_next_cursor: boolean;
2032
- upstream_ms: number;
2033
2059
  duration_ms: number;
2034
2060
  [key: string]: unknown;
2035
2061
  }
2036
2062
  export interface LinkedInAttendee {
2037
- provider_id: string | null;
2063
+ external_id: string | null;
2038
2064
  name: string | null;
2039
2065
  is_self: boolean;
2040
2066
  profile_url: string | null;
@@ -2045,7 +2071,7 @@ export interface LinkedInAttendee {
2045
2071
  }
2046
2072
  export interface LinkedInConversation {
2047
2073
  id: string;
2048
- provider_chat_id: string;
2074
+ external_chat_id: string;
2049
2075
  name: string | null;
2050
2076
  subject: string | null;
2051
2077
  type: number | null;
@@ -2061,9 +2087,9 @@ export interface LinkedInConversation {
2061
2087
  export interface LinkedInMessage {
2062
2088
  id: string;
2063
2089
  conversation_id: string;
2064
- provider_message_id: string;
2090
+ external_message_id: string;
2065
2091
  direction: 'inbound' | 'outbound';
2066
- sender_provider_id: string | null;
2092
+ sender_external_id: string | null;
2067
2093
  sender_name: string | null;
2068
2094
  text: string | null;
2069
2095
  sent_at: string;
@@ -2134,14 +2160,14 @@ export interface LinkedInInviteResult {
2134
2160
  action_request_id: string;
2135
2161
  invitation_id: string;
2136
2162
  status: 'sent' | 'already_connected' | 'pending';
2137
- provider_invitation_id?: string | null;
2163
+ external_invitation_id?: string | null;
2138
2164
  tracked?: boolean;
2139
2165
  }
2140
2166
  export interface LinkedInWithdrawInvitationResult {
2141
2167
  action_request_id: string;
2142
2168
  invitation_id: string;
2143
2169
  status: 'cancelled_before_send' | 'withdrawn' | 'already_withdrawn' | 'not_pending';
2144
- provider_invitation_id?: string;
2170
+ external_invitation_id?: string;
2145
2171
  }
2146
2172
  export interface LinkedInReplyOptions extends ToolOptions {
2147
2173
  accountId: string;
@@ -2212,14 +2238,14 @@ export interface LinkedInReactOptions extends ToolOptions {
2212
2238
  export interface LinkedInWriteResult {
2213
2239
  action_request_id: string;
2214
2240
  status: 'sent';
2215
- provider_message_id?: string;
2241
+ external_message_id?: string;
2216
2242
  message_id?: string | null;
2217
2243
  sent_at?: string;
2218
2244
  [key: string]: unknown;
2219
2245
  }
2220
2246
  export interface LinkedInProfileViewResult extends LinkedInWriteResult {
2221
2247
  profile: {
2222
- provider_id: string | null;
2248
+ external_id: string | null;
2223
2249
  public_identifier: string | null;
2224
2250
  name: string | null;
2225
2251
  headline: string | null;
@@ -2238,6 +2264,7 @@ export interface LinkedInExperienceEntry {
2238
2264
  /** As LinkedIn gives it (string or null). */
2239
2265
  start: string | null;
2240
2266
  end: string | null;
2267
+ /** Derived: false when `end` is set; otherwise LinkedIn's flag, or (when LinkedIn gives none) true when `start` is set. */
2241
2268
  current: boolean;
2242
2269
  location: string | null;
2243
2270
  }