@parall/sdk 1.56.2 → 1.57.1

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.
@@ -0,0 +1,217 @@
1
+ export type BrowserUseAction =
2
+ | 'read'
3
+ | 'tabs'
4
+ | 'wait'
5
+ | 'snapshot'
6
+ | 'get'
7
+ | 'screenshot'
8
+ | 'open'
9
+ | 'navigate'
10
+ | 'viewport'
11
+ | 'click'
12
+ | 'fill'
13
+ | 'type'
14
+ | 'press'
15
+ | 'scroll'
16
+ | 'close'
17
+ | 'recover'
18
+ | 'eval';
19
+
20
+ /** Org-scoped PostHog rollout gate. Missing, non-boolean, and false values are
21
+ * all disabled; Server admission remains authoritative after any UI check. */
22
+ export const BROWSER_USE_FEATURE_FLAG = 'browser-use';
23
+
24
+ export function isBrowserUseEnabled(flags: Record<string, unknown> | null | undefined): boolean {
25
+ return flags?.[BROWSER_USE_FEATURE_FLAG] === true;
26
+ }
27
+
28
+ export type BrowserUseGrant = 'browser.read' | 'browser.interact' | 'browser.advanced';
29
+
30
+ export interface BrowserUseTabTarget {
31
+ tab_id: string;
32
+ browser_generation: number;
33
+ document_generation?: never;
34
+ snapshot_id?: never;
35
+ ref?: never;
36
+ }
37
+
38
+ export interface BrowserUseRefTarget {
39
+ tab_id: string;
40
+ browser_generation: number;
41
+ document_generation: number;
42
+ snapshot_id: string;
43
+ ref: string;
44
+ }
45
+
46
+ export type BrowserUseTarget = BrowserUseTabTarget | BrowserUseRefTarget;
47
+
48
+ export interface BrowserUseViewport {
49
+ width: number;
50
+ height: number;
51
+ }
52
+
53
+ interface BrowserUseRequestBase {
54
+ contract_version: 'browser-use-operation-v1';
55
+ request_id: string;
56
+ profile_id: string;
57
+ /** Canonical RFC3339 UTC instant, no more than two minutes in the future. */
58
+ deadline: string;
59
+ }
60
+
61
+ type NoTarget = { target?: never };
62
+ type TabTarget = { target: BrowserUseTabTarget };
63
+
64
+ type BrowserUseLocator =
65
+ | { target: BrowserUseTabTarget; params: { selector: string } }
66
+ | { target: BrowserUseRefTarget; params: Record<string, never> };
67
+
68
+ type BrowserUseTextLocator<T extends 'fill' | 'type'> =
69
+ | { action: T; target: BrowserUseTabTarget; params: { selector: string; text: string } }
70
+ | { action: T; target: BrowserUseRefTarget; params: { text: string } };
71
+
72
+ export type BrowserUseActionRequest =
73
+ | ({ action: 'read'; params: { url: string } } & NoTarget)
74
+ | ({ action: 'read'; params: Record<string, never> } & TabTarget)
75
+ | ({ action: 'tabs'; params: Record<string, never> } & NoTarget)
76
+ | ({
77
+ action: 'wait';
78
+ params:
79
+ | { state: 'load'; timeout_ms?: number; selector?: never }
80
+ | {
81
+ selector: string;
82
+ state?: 'attached' | 'detached' | 'visible' | 'hidden';
83
+ timeout_ms?: number;
84
+ };
85
+ } & TabTarget)
86
+ | ({
87
+ action: 'snapshot';
88
+ params: { interactive?: boolean; compact?: boolean; depth?: number };
89
+ } & TabTarget)
90
+ | ({ action: 'get'; params: { prop: 'title' | 'url' } } & TabTarget)
91
+ | ({ action: 'get'; params: { prop: 'text' | 'html' | 'value'; selector: string } } & TabTarget)
92
+ | { action: 'get'; params: { prop: 'text' | 'html' | 'value' }; target: BrowserUseRefTarget }
93
+ | ({ action: 'get'; params: { prop: 'attr'; selector: string; name: string } } & TabTarget)
94
+ | { action: 'get'; params: { prop: 'attr'; name: string }; target: BrowserUseRefTarget }
95
+ | ({ action: 'screenshot'; params: Record<string, never> } & TabTarget)
96
+ | ({
97
+ action: 'open';
98
+ params: { url: string; hidden?: boolean; viewport?: BrowserUseViewport };
99
+ } & NoTarget)
100
+ | ({ action: 'navigate'; params: { url: string } } & TabTarget)
101
+ | ({ action: 'viewport'; params: BrowserUseViewport } & TabTarget)
102
+ | ({ action: 'click' } & BrowserUseLocator)
103
+ | BrowserUseTextLocator<'fill'>
104
+ | BrowserUseTextLocator<'type'>
105
+ | ({ action: 'press'; params: { key: string } } & TabTarget)
106
+ | ({
107
+ action: 'scroll';
108
+ params: { direction?: 'up' | 'down' | 'left' | 'right'; pixels?: number };
109
+ } & TabTarget)
110
+ | ({ action: 'close'; params: Record<string, never> } & TabTarget)
111
+ | ({ action: 'recover'; params: Record<string, never> } & TabTarget)
112
+ | ({ action: 'eval'; params: { expression: string; timeout_ms?: number } } & TabTarget);
113
+
114
+ export type BrowserUseOperationRequest = BrowserUseRequestBase & BrowserUseActionRequest;
115
+
116
+ export type BrowserUseOperationPhase =
117
+ | 'accepted'
118
+ | 'started'
119
+ | 'succeeded'
120
+ | 'failed'
121
+ | 'outcome_unknown';
122
+
123
+ export interface BrowserUseOperationError {
124
+ code: string;
125
+ message?: string;
126
+ hint?: string;
127
+ }
128
+
129
+ export interface BrowserUseTabState {
130
+ tab_id: string;
131
+ profile_id: string;
132
+ browser_generation: number;
133
+ document_generation: number;
134
+ url: string;
135
+ title: string;
136
+ }
137
+
138
+ export interface BrowserUseTabSummary extends BrowserUseTabState {
139
+ loading: boolean;
140
+ }
141
+
142
+ export interface BrowserUseArticle {
143
+ title: string | null;
144
+ byline: string | null;
145
+ excerpt: string | null;
146
+ text: string;
147
+ published_time: string | null;
148
+ site_name: string | null;
149
+ length: number;
150
+ }
151
+
152
+ export interface BrowserUseSuccessDataMap {
153
+ read: {
154
+ profile_id: string;
155
+ url: string;
156
+ title: string;
157
+ article: BrowserUseArticle | null;
158
+ };
159
+ tabs: { tabs: BrowserUseTabSummary[] };
160
+ wait: BrowserUseTabState & { matched: true };
161
+ snapshot: BrowserUseTabState & { snapshot: string; snapshot_id: string };
162
+ get: BrowserUseTabState & { value: string | null };
163
+ screenshot: BrowserUseTabState & { format: 'png'; base64: string };
164
+ open: BrowserUseTabState;
165
+ navigate: BrowserUseTabState;
166
+ viewport: BrowserUseTabState & { viewport: BrowserUseViewport };
167
+ click: BrowserUseTabState & { clicked: true };
168
+ fill: BrowserUseTabState & { filled: true; characters: number };
169
+ type: BrowserUseTabState & { typed: true; characters: number };
170
+ press: BrowserUseTabState & { pressed: true };
171
+ scroll: BrowserUseTabState & { scrolled: true };
172
+ close: BrowserUseTabState & { closed: true };
173
+ recover: BrowserUseTabState & { recovered_from_tab_id: string };
174
+ eval: BrowserUseTabState & { value: unknown };
175
+ }
176
+
177
+ /** Durable Browser Use proof. `data` is encrypted/transient: it is present
178
+ * only while result_available is true and disappears after result_expires_at;
179
+ * the terminal receipt and result_digest remain durable. */
180
+ export interface BrowserUseOperationReceiptBase {
181
+ contract_version: 'browser-use-operation-v1';
182
+ operation_id: string;
183
+ request_id: string;
184
+ profile_id: string;
185
+ profile_version: number;
186
+ profile_config_revision: number;
187
+ required_grant: BrowserUseGrant;
188
+ phase: BrowserUseOperationPhase;
189
+ dispatched?: boolean;
190
+ receipt_id?: string;
191
+ receipt_digest?: string;
192
+ occurred_at?: string;
193
+ tab_id?: string;
194
+ browser_generation?: number;
195
+ duration_ms?: number;
196
+ result_digest?: string;
197
+ result_available: boolean;
198
+ result_expires_at?: string;
199
+ error?: BrowserUseOperationError;
200
+ deadline: string;
201
+ accepted_at: string;
202
+ started_at?: string;
203
+ terminal_at?: string;
204
+ updated_at: string;
205
+ }
206
+
207
+ export type BrowserUseOperationReceiptFor<A extends BrowserUseAction> =
208
+ BrowserUseOperationReceiptBase & {
209
+ action: A;
210
+ data?: BrowserUseSuccessDataMap[A];
211
+ };
212
+
213
+ /** Mapped union: checking `action` narrows `data` to that action's stable
214
+ * success shape instead of leaving the two fields independently unioned. */
215
+ export type BrowserUseOperationReceipt<A extends BrowserUseAction = BrowserUseAction> = {
216
+ [K in A]: BrowserUseOperationReceiptFor<K>;
217
+ }[A];
package/src/client.ts CHANGED
@@ -769,7 +769,12 @@ export class ParallClient extends AttachmentClient {
769
769
  data: Partial<
770
770
  Pick<
771
771
  Organization,
772
- 'name' | 'avatar_url' | 'smart_routing_strategy' | 'smart_routing_agent_id' | 'timezone'
772
+ | 'name'
773
+ | 'avatar_url'
774
+ | 'smart_routing_strategy'
775
+ | 'smart_routing_agent_id'
776
+ | 'timezone'
777
+ | 'llm_byok_fallback_enabled'
773
778
  >
774
779
  >,
775
780
  ): Promise<Organization> {
package/src/constants.ts CHANGED
@@ -381,6 +381,26 @@ export const ENDPOINTS = {
381
381
  TEAM_MEMBER: (orgId: string, teamId: string, userId: string) =>
382
382
  `${API_BASE}/orgs/${orgId}/teams/${teamId}/members/${userId}`,
383
383
  ORG_MEMBERS_ONLINE: (orgId: string) => `${API_BASE}/orgs/${orgId}/members/online`,
384
+ LLM_PROVIDERS: (orgId: string) => `${API_BASE}/orgs/${orgId}/llm-providers`,
385
+ LLM_PROVIDER: (orgId: string, providerId: string) =>
386
+ `${API_BASE}/orgs/${orgId}/llm-providers/${providerId}`,
387
+ ORG_LLM_MODELS: (orgId: string) => `${API_BASE}/orgs/${orgId}/llm-models`,
388
+ ORG_LLM_MODEL: (orgId: string, modelRowId: string) =>
389
+ `${API_BASE}/orgs/${orgId}/llm-models/${modelRowId}`,
390
+ /**
391
+ * Platform catalog merged with this org's own model rows. Pass `runtime` to
392
+ * filter org-added models to the ones that runtime can actually reach —
393
+ * without it a picker can offer a model the write path rejects.
394
+ */
395
+ ORG_MODEL_CATALOG: (orgId: string, runtime?: string, includeModel?: string) => {
396
+ const params = new URLSearchParams();
397
+ if (runtime) params.set('runtime', runtime);
398
+ // include_model keeps a hidden legacy model the caller is still pinned to
399
+ // representable, matching the public catalog.
400
+ if (includeModel) params.set('include_model', includeModel);
401
+ const qs = params.toString();
402
+ return `${API_BASE}/orgs/${orgId}/models${qs ? `?${qs}` : ''}`;
403
+ },
384
404
  ORG_MEMBER: (orgId: string, userId: string) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
385
405
  ORG_MEMBER_CHATS: (orgId: string, memberId: string) =>
386
406
  `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
package/src/index.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  export * from './browser-viewer.js';
2
+ export { BROWSER_USE_FEATURE_FLAG, isBrowserUseEnabled } from './browser-use.js';
2
3
  export * from './attachment-types.js';
3
4
  export type { ParallClientOptions } from './client.js';
4
5
  export { ApiError, ParallClient } from './client.js';
5
6
  export * from './constants.js';
7
+ export * from './llm-provider-types.js';
6
8
  export * from './subject.js';
7
9
  export * from './task-label-types.js';
8
10
  export * from './types.js';
@@ -0,0 +1,96 @@
1
+ import { ENDPOINTS } from './constants.js';
2
+ import type {
3
+ CreateLLMProviderRequest,
4
+ CreateOrgLLMModelRequest,
5
+ LLMProvider,
6
+ OrgLLMModel,
7
+ UpdateOrgLLMModelRequest,
8
+ UpdateLLMProviderRequest,
9
+ } from './llm-provider-types.js';
10
+ import type { PlatformModelInfo } from './types.js';
11
+ import { WechatClient } from './wechat-client.js';
12
+
13
+ /**
14
+ * Org-configured model providers (BYOK) and the model rows bound to them.
15
+ *
16
+ * Writes are org-admin only server-side: a provider row carries a credential
17
+ * and decides where the org's LLM spend goes.
18
+ *
19
+ * Design: docs/engineering-design/org-llm-provider-byok-design.md
20
+ */
21
+ export abstract class LLMProviderClient extends WechatClient {
22
+ async getLLMProviders(orgId: string): Promise<LLMProvider[]> {
23
+ const response = await this.request<{ data: LLMProvider[] }>(
24
+ 'GET',
25
+ ENDPOINTS.LLM_PROVIDERS(orgId),
26
+ );
27
+ return response.data;
28
+ }
29
+
30
+ async createLLMProvider(orgId: string, data: CreateLLMProviderRequest): Promise<LLMProvider> {
31
+ return this.request('POST', ENDPOINTS.LLM_PROVIDERS(orgId), data);
32
+ }
33
+
34
+ /** Omitting `api_key` leaves the stored credential untouched. */
35
+ async updateLLMProvider(
36
+ orgId: string,
37
+ providerId: string,
38
+ data: UpdateLLMProviderRequest,
39
+ ): Promise<LLMProvider> {
40
+ return this.request('PATCH', ENDPOINTS.LLM_PROVIDER(orgId, providerId), data);
41
+ }
42
+
43
+ /** Fails with PROVIDER_IN_USE while model rows still point at it. */
44
+ async deleteLLMProvider(orgId: string, providerId: string): Promise<void> {
45
+ return this.request('DELETE', ENDPOINTS.LLM_PROVIDER(orgId, providerId));
46
+ }
47
+
48
+ async getOrgLLMModels(orgId: string): Promise<OrgLLMModel[]> {
49
+ const response = await this.request<{ data: OrgLLMModel[] }>(
50
+ 'GET',
51
+ ENDPOINTS.ORG_LLM_MODELS(orgId),
52
+ );
53
+ return response.data;
54
+ }
55
+
56
+ async createOrgLLMModel(orgId: string, data: CreateOrgLLMModelRequest): Promise<OrgLLMModel> {
57
+ return this.request('POST', ENDPOINTS.ORG_LLM_MODELS(orgId), data);
58
+ }
59
+
60
+ /**
61
+ * Patches a model row in place. Repointing a provider or fixing an upstream
62
+ * name this way avoids the delete-and-recreate window, during which an
63
+ * org-only model has no upstream at all and its pinned agents fail.
64
+ */
65
+ async updateOrgLLMModel(
66
+ orgId: string,
67
+ modelRowId: string,
68
+ data: UpdateOrgLLMModelRequest,
69
+ ): Promise<OrgLLMModel> {
70
+ return this.request('PATCH', ENDPOINTS.ORG_LLM_MODEL(orgId, modelRowId), data);
71
+ }
72
+
73
+ async deleteOrgLLMModel(orgId: string, modelRowId: string): Promise<void> {
74
+ return this.request('DELETE', ENDPOINTS.ORG_LLM_MODEL(orgId, modelRowId));
75
+ }
76
+
77
+ /**
78
+ * The catalog as this org sees it: platform models with the org's rows
79
+ * merged in. Distinct from the public model catalog, which stays org-agnostic
80
+ * and cacheable — use this one wherever an org context exists.
81
+ *
82
+ * Pass `runtime` on a picker: org-added models are then filtered to what that
83
+ * runtime's protocol can reach, matching the server-side pin validation.
84
+ */
85
+ async getOrgModelCatalog(
86
+ orgId: string,
87
+ runtime?: string,
88
+ includeModel?: string,
89
+ ): Promise<PlatformModelInfo[]> {
90
+ const response = await this.request<{ data: PlatformModelInfo[] }>(
91
+ 'GET',
92
+ ENDPOINTS.ORG_MODEL_CATALOG(orgId, runtime, includeModel),
93
+ );
94
+ return response.data;
95
+ }
96
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Org-configured model providers (BYOK) and the model rows bound to them.
3
+ *
4
+ * Design: docs/engineering-design/org-llm-provider-byok-design.md
5
+ */
6
+
7
+ /** Inbound protocol a provider can serve. */
8
+ export type LLMProviderEndpoint = 'chat_completions' | 'messages' | 'responses';
9
+
10
+ export type LLMProviderStatus = 'active' | 'disabled';
11
+
12
+ /**
13
+ * A provider as the server returns it. The credential is never echoed back —
14
+ * `api_key_set` is the only thing a client learns about it.
15
+ */
16
+ export interface LLMProvider {
17
+ id: string;
18
+ name: string;
19
+ base_url: string;
20
+ api_key_set: boolean;
21
+ endpoints: LLMProviderEndpoint[];
22
+ status: LLMProviderStatus;
23
+ is_platform: boolean;
24
+ /**
25
+ * Runtime types whose protocol this provider can actually serve. Anything
26
+ * absent here silently uses the platform provider — surface this, or an
27
+ * operator will assume their credential covers every agent.
28
+ */
29
+ runtimes: string[];
30
+ /** Most recent fallback-worthy failure, if any. */
31
+ last_error_at?: string | null;
32
+ last_error_status?: number | null;
33
+ created_at: string;
34
+ updated_at: string;
35
+ }
36
+
37
+ export interface CreateLLMProviderRequest {
38
+ name: string;
39
+ base_url: string;
40
+ api_key: string;
41
+ endpoints: LLMProviderEndpoint[];
42
+ }
43
+
44
+ /** Omitting `api_key` leaves the stored credential untouched. */
45
+ export interface UpdateLLMProviderRequest {
46
+ name?: string;
47
+ base_url?: string;
48
+ api_key?: string;
49
+ endpoints?: LLMProviderEndpoint[];
50
+ status?: LLMProviderStatus;
51
+ }
52
+
53
+ /**
54
+ * One org's row for a model. Overriding a platform model and adding a new one
55
+ * are the same shape: `overrides_platform` is derived by the server from
56
+ * whether the platform catalog knows this id, never stored.
57
+ */
58
+ export interface OrgLLMModel {
59
+ id: string;
60
+ model_id: string;
61
+ provider_id: string;
62
+ upstream_model_id: string;
63
+ display_name?: string | null;
64
+ context_window?: number | null;
65
+ max_tokens?: number | null;
66
+ overrides_platform: boolean;
67
+ created_at: string;
68
+ updated_at: string;
69
+ }
70
+
71
+ export interface CreateOrgLLMModelRequest {
72
+ model_id: string;
73
+ provider_id: string;
74
+ /** The name to send to this provider, which differs per provider. */
75
+ upstream_model_id: string;
76
+ /** Required when `model_id` is not in the platform catalog. */
77
+ display_name?: string;
78
+ context_window?: number;
79
+ max_tokens?: number;
80
+ effort_levels?: string[];
81
+ input_modalities?: string[];
82
+ }
83
+
84
+ /**
85
+ * Everything about a model row except its identity. `model_id` is what agents
86
+ * pin to, so changing it is a delete-and-recreate the operator performs
87
+ * deliberately; the server rejects it here.
88
+ */
89
+ export interface UpdateOrgLLMModelRequest {
90
+ provider_id?: string;
91
+ upstream_model_id?: string;
92
+ /**
93
+ * Metadata fields accept `null` to clear the org's value and go back to
94
+ * inheriting the platform entry's. Omitting a field leaves it as it is —
95
+ * the two are different requests, so do not send `undefined` meaning
96
+ * "clear". A model the platform does not have cannot clear these: it has
97
+ * nothing to inherit from, and the server rejects it.
98
+ */
99
+ display_name?: string | null;
100
+ context_window?: number | null;
101
+ max_tokens?: number | null;
102
+ effort_levels?: string[] | null;
103
+ input_modalities?: string[] | null;
104
+ }
package/src/types.ts CHANGED
@@ -481,6 +481,25 @@ export interface Organization {
481
481
  onboarding_agent_id: string | null;
482
482
  /** Org-level IANA timezone (e.g. "America/New_York"). Defaults to "UTC". */
483
483
  timezone: string;
484
+ /**
485
+ * Whether this org may configure its own LLM providers (BYOK). Absent means
486
+ * it inherits the platform default, which is off.
487
+ *
488
+ * An entitlement, not a feature flag: only a platform admin changes it, and
489
+ * it is expected to become plan-driven. Turning it off also stops existing
490
+ * provider configuration from taking effect.
491
+ */
492
+ llm_byok_enabled?: boolean | null;
493
+ /**
494
+ * When an org's own model provider fails at run time, retry once on the
495
+ * platform provider — billed to this org's credit balance. Defaults to off,
496
+ * so "no fallback" is the default state and fallback is opted into.
497
+ * Does NOT gate the capability fallback: a provider that cannot serve a
498
+ * runtime's protocol always defers to the platform regardless.
499
+ * Current servers populate this field; it remains optional for source
500
+ * compatibility with cached and rolling-upgrade organization payloads.
501
+ */
502
+ llm_byok_fallback_enabled?: boolean;
484
503
  created_at: string;
485
504
  /** Per-member flag: true when the user has dismissed the onboarding popup for this org. */
486
505
  onboarding_dismissed: boolean;
@@ -1081,10 +1100,8 @@ export interface MessageDispatchSource {
1081
1100
  source_type: string;
1082
1101
  source_id: string;
1083
1102
  /**
1084
- * Conversation generation of the sending execution (parel v2 invocation
1085
- * context). Required by the server for agents on the direct_session_v2
1086
- * transport; a value older than the current New Session barrier is
1087
- * rejected (STALE_GENERATION).
1103
+ * @deprecated Ignored by current servers. Retained so clients compiled
1104
+ * against older SDKs can upgrade without source changes.
1088
1105
  */
1089
1106
  generation?: number;
1090
1107
  }
@@ -1821,8 +1838,8 @@ export interface UpdateTaskRequest {
1821
1838
  * Lane-bound form (v1 consumers): dispatch_lane + dispatch_event_id bind
1822
1839
  * the update to the claimed typed lane (incumbency-checked).
1823
1840
  * By-id form (parel v2 converged consumers — no lane exists):
1824
- * dispatch_event_id + dispatch_generation bind the update to the WorkItem
1825
- * directly under the conversation-generation fence.
1841
+ * dispatch_event_id alone binds the update to the WorkItem; the server
1842
+ * admits it on the binding's transport and deletion state alone.
1826
1843
  * In both forms dispatch_effect_key additionally commits the update as
1827
1844
  * the dispatch's idempotent Effect and resolves the WorkItem in the same
1828
1845
  * transaction. Lane-bound: exactly "task_update:<dispatch_event_id>" —
@@ -1835,6 +1852,10 @@ export interface UpdateTaskRequest {
1835
1852
  dispatch_lane?: string;
1836
1853
  dispatch_event_id?: string;
1837
1854
  dispatch_effect_key?: string;
1855
+ /**
1856
+ * @deprecated Ignored by current servers. Retained so clients compiled
1857
+ * against older SDKs can upgrade without source changes.
1858
+ */
1838
1859
  dispatch_generation?: number;
1839
1860
  }
1840
1861
 
@@ -3386,6 +3407,7 @@ export interface ChannelConversation {
3386
3407
  agent_id: string;
3387
3408
  agent_session_id?: string | null;
3388
3409
  external_conversation_id: string;
3410
+ external_conversation_name?: string;
3389
3411
  external_thread_id: string;
3390
3412
  conversation_type: string;
3391
3413
  external_user_id: string;
@@ -5519,88 +5541,25 @@ export interface BrowserAliasExecutionReceipt {
5519
5541
  updated_at: string;
5520
5542
  }
5521
5543
 
5522
- export type BrowserUseAction =
5523
- | 'read'
5524
- | 'tabs'
5525
- | 'wait'
5526
- | 'snapshot'
5527
- | 'get'
5528
- | 'screenshot'
5529
- | 'open'
5530
- | 'navigate'
5531
- | 'viewport'
5532
- | 'click'
5533
- | 'fill'
5534
- | 'type'
5535
- | 'press'
5536
- | 'scroll'
5537
- | 'close'
5538
- | 'recover'
5539
- | 'eval';
5540
-
5541
- export interface BrowserUseTarget {
5542
- tab_id?: string;
5543
- browser_generation?: number;
5544
- document_generation?: number;
5545
- snapshot_id?: string;
5546
- ref?: string;
5547
- }
5548
-
5549
- export interface BrowserUseOperationRequest {
5550
- contract_version: 'browser-use-operation-v1';
5551
- request_id: string;
5552
- profile_id: string;
5553
- action: BrowserUseAction;
5554
- target?: BrowserUseTarget;
5555
- params: Record<string, unknown>;
5556
- /** Canonical RFC3339 UTC instant, no more than two minutes in the future. */
5557
- deadline: string;
5558
- }
5559
-
5560
- export type BrowserUseOperationPhase =
5561
- | 'accepted'
5562
- | 'started'
5563
- | 'succeeded'
5564
- | 'failed'
5565
- | 'outcome_unknown';
5566
-
5567
- export interface BrowserUseOperationError {
5568
- code: string;
5569
- message?: string;
5570
- hint?: string;
5571
- }
5572
-
5573
- /** Durable Browser Use proof. `data` is encrypted/transient: it is present
5574
- * only while result_available is true and disappears after result_expires_at;
5575
- * the terminal receipt and result_digest remain durable. */
5576
- export interface BrowserUseOperationReceipt {
5577
- contract_version: 'browser-use-operation-v1';
5578
- operation_id: string;
5579
- request_id: string;
5580
- profile_id: string;
5581
- profile_version: number;
5582
- profile_config_revision: number;
5583
- action: BrowserUseAction;
5584
- required_grant: 'browser.read' | 'browser.interact' | 'browser.advanced';
5585
- phase: BrowserUseOperationPhase;
5586
- dispatched?: boolean;
5587
- receipt_id?: string;
5588
- receipt_digest?: string;
5589
- occurred_at?: string;
5590
- tab_id?: string;
5591
- browser_generation?: number;
5592
- duration_ms?: number;
5593
- result_digest?: string;
5594
- result_available: boolean;
5595
- result_expires_at?: string;
5596
- data?: unknown;
5597
- error?: BrowserUseOperationError;
5598
- deadline: string;
5599
- accepted_at: string;
5600
- started_at?: string;
5601
- terminal_at?: string;
5602
- updated_at: string;
5603
- }
5544
+ export type {
5545
+ BrowserUseAction,
5546
+ BrowserUseActionRequest,
5547
+ BrowserUseArticle,
5548
+ BrowserUseGrant,
5549
+ BrowserUseOperationError,
5550
+ BrowserUseOperationPhase,
5551
+ BrowserUseOperationReceipt,
5552
+ BrowserUseOperationReceiptBase,
5553
+ BrowserUseOperationReceiptFor,
5554
+ BrowserUseOperationRequest,
5555
+ BrowserUseRefTarget,
5556
+ BrowserUseSuccessDataMap,
5557
+ BrowserUseTabState,
5558
+ BrowserUseTabSummary,
5559
+ BrowserUseTabTarget,
5560
+ BrowserUseTarget,
5561
+ BrowserUseViewport,
5562
+ } from './browser-use.js';
5604
5563
 
5605
5564
  /**
5606
5565
  * Sanitized per-profile egress proxy status (hosted Cloud Profiles) — the GET