@parall/sdk 1.55.4 → 1.56.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/src/types.ts CHANGED
@@ -4,6 +4,13 @@ import type {
4
4
  LabelDeletedData,
5
5
  LabelUpdatedData,
6
6
  } from './task-label-types.js';
7
+ export type {
8
+ CompletedUploadPart,
9
+ FileUrlResponse,
10
+ PresignedUploadPart,
11
+ PresignResponse,
12
+ PresignUploadRequest,
13
+ } from './attachment-types.js';
7
14
 
8
15
  // ============================================================
9
16
  // Entity Types — mirror server data model
@@ -60,12 +67,31 @@ export interface Chat {
60
67
  pinned: boolean;
61
68
  hidden: boolean;
62
69
  my_notification_level?: NotificationLevel;
70
+ /**
71
+ * Resolved per-(agent, chat) reply policy for an AGENT caller: override →
72
+ * room default → mentions_only floor, gated on the runtime capability.
73
+ * Absent for human callers, DMs, and smart chats — a runtime reading
74
+ * nothing here falls back to its legacy agent_routing_mode check.
75
+ */
76
+ my_agent_reply_policy?: AgentReplyPolicy;
63
77
  }
64
78
 
65
79
  export type ChatMemberRole = 'owner' | 'admin' | 'member';
66
80
 
67
81
  export type NotificationLevel = 'all' | 'mentions_only' | 'none';
68
82
 
83
+ /** Trigger axis of the per-(agent, chat) reply policy. No 'none': @mentions
84
+ * are an unsuppressible floor, so it would equal 'mentions_only'. */
85
+ export type AgentReplyTrigger = 'all' | 'mentions_only';
86
+
87
+ /** Reply-form axis; V1 defines only 'full'. */
88
+ export type AgentReplyForm = 'full';
89
+
90
+ export interface AgentReplyPolicy {
91
+ trigger: AgentReplyTrigger;
92
+ form: AgentReplyForm;
93
+ }
94
+
69
95
  // Push notification subscription
70
96
  export interface PushSubscribeRequest {
71
97
  platform: 'web' | 'ios' | 'android';
@@ -101,6 +127,14 @@ export interface ChatMember {
101
127
  pinned: boolean;
102
128
  hidden: boolean;
103
129
  joined_at: string;
130
+ /**
131
+ * Per-(agent, chat) trigger override on an AGENT member row; absent/null =
132
+ * follow the room default. Writable by chat owners/admins and org admins
133
+ * only — never by the agent itself.
134
+ */
135
+ agent_reply_trigger?: AgentReplyTrigger | null;
136
+ /** Reply-form axis; always 'full' in V1. Absent on older servers. */
137
+ agent_reply_form?: AgentReplyForm;
104
138
  /** Org-scoped public title. Omitted by older servers and for former DM peers. */
105
139
  title?: string;
106
140
  user?: User;
@@ -111,6 +145,11 @@ export interface UpdateChatMemberRequest {
111
145
  pinned?: boolean;
112
146
  hidden?: boolean;
113
147
  notification_level?: NotificationLevel;
148
+ /** 'all' | 'mentions_only' sets the override; '' clears it (follow the
149
+ * room default). Chat-governance authz — agents can never write it. */
150
+ agent_reply_trigger?: AgentReplyTrigger | '';
151
+ /** V1 accepts only 'full'. */
152
+ agent_reply_form?: AgentReplyForm;
114
153
  }
115
154
 
116
155
  export interface TransferChatOwnershipRequest {
@@ -237,6 +276,8 @@ export interface ApprovalCardContent {
237
276
  display: {
238
277
  title: string;
239
278
  description?: string;
279
+ request_reason?: string;
280
+ resource_label?: string;
240
281
  requester?: { id: string; name: string };
241
282
  };
242
283
  interaction: {
@@ -248,6 +289,7 @@ export interface ApprovalCardContent {
248
289
  status: string;
249
290
  decided_by?: string;
250
291
  decided_at?: string;
292
+ decision_reason?: string | null;
251
293
  execution_status?: ExecutionStatus | null;
252
294
  execution_error?: string | null;
253
295
  executed_at?: string | null;
@@ -289,6 +331,7 @@ export interface SystemContent {
289
331
  actor_name: string;
290
332
  target_id?: string;
291
333
  target_name?: string;
334
+ decision_reason?: string;
292
335
  }
293
336
 
294
337
  export type MessageContent =
@@ -322,10 +365,18 @@ export interface Message {
322
365
  recent_repliers?: User[];
323
366
  /**
324
367
  * Per-viewer count of thread replies newer than the viewer's thread read
325
- * cursor, excluding the viewer's own replies (root only). Populated on
326
- * top-level list responses; omitted when zero.
368
+ * cursor, excluding the viewer's own replies (root only). Watcher-scoped:
369
+ * only threads the viewer watches accrue unread. Populated on top-level
370
+ * list responses; omitted when zero.
327
371
  */
328
372
  unread_reply_count?: number;
373
+ /**
374
+ * Per-viewer thread watch state (root only): true when the viewer watches
375
+ * this root's thread. Populated on top-level list responses for roots with
376
+ * replies; omitted means not watching. Seeds the client's live unread
377
+ * mirror.
378
+ */
379
+ watching?: boolean;
329
380
  edited_at: string | null;
330
381
  deleted_at: string | null;
331
382
  created_at: string;
@@ -381,9 +432,12 @@ export interface Approval {
381
432
  resource_uri: string;
382
433
  action_payload: Record<string, unknown>;
383
434
  title: string;
435
+ request_reason?: string | null;
436
+ resource_label?: string | null;
384
437
  requester_id: string;
385
438
  decided_by: string | null;
386
439
  decided_at: string | null;
440
+ decision_reason?: string | null;
387
441
  status: ApprovalStatus;
388
442
  expires_at: string | null;
389
443
  execution_status?: ExecutionStatus | null;
@@ -412,6 +466,9 @@ export interface Organization {
412
466
  avatar_url: string | null;
413
467
  is_personal: boolean;
414
468
  member_limit: number | null;
469
+ attachment_max_file_size_bytes?: number | null;
470
+ attachment_storage_limit_bytes?: number | null;
471
+ attachment_storage_used_bytes?: number;
415
472
  /** Org-level default smart routing strategy: 'llm' | 'agent' | null. */
416
473
  smart_routing_strategy: string | null;
417
474
  /** Agent ID for strategy='agent'. NULL when strategy is 'llm' or unset. */
@@ -699,12 +756,6 @@ export interface CheckEmailResponse {
699
756
  pending_verification?: boolean;
700
757
  }
701
758
 
702
- export interface PresignResponse {
703
- upload_url: string;
704
- attachment_id: string;
705
- expires_in: number;
706
- }
707
-
708
759
  export interface WsTicketResponse {
709
760
  ticket: string;
710
761
  expires_at: string;
@@ -1536,23 +1587,6 @@ export interface LaunchCredentialResponse {
1536
1587
  agent_id: string;
1537
1588
  }
1538
1589
 
1539
- export interface PresignUploadRequest {
1540
- file_name: string;
1541
- file_size: number;
1542
- mime_type?: string;
1543
- }
1544
-
1545
- export interface FileUrlResponse {
1546
- url: string;
1547
- is_proxy_url?: boolean;
1548
- expires_in: number;
1549
- width?: number;
1550
- height?: number;
1551
- file_name: string;
1552
- file_size: number;
1553
- mime_type: string;
1554
- }
1555
-
1556
1590
  export interface AvatarUploadResponse {
1557
1591
  avatar_url: string;
1558
1592
  }
@@ -1705,6 +1739,20 @@ export interface CreateTaskRequest {
1705
1739
  label_ids?: string[];
1706
1740
  }
1707
1741
 
1742
+ /**
1743
+ * Moves a task (and its whole subtree) into another project via
1744
+ * POST /tasks/{taskId}/move — the only path that changes the binding; PATCH
1745
+ * keeps refusing project_id changes. Every subtree node is renumbered from the
1746
+ * target project's counter and its old KEY-N identifier stays resolvable as a
1747
+ * permanent alias. parent_id (must belong to the target project) attaches the
1748
+ * moved root under a parent there; same-project calls with a parent degrade to
1749
+ * a reparent, without one they are an idempotent no-op.
1750
+ */
1751
+ export interface MoveTaskRequest {
1752
+ project_id: string;
1753
+ parent_id?: string;
1754
+ }
1755
+
1708
1756
  export interface UpdateTaskRequest {
1709
1757
  title?: string;
1710
1758
  description?: string;
@@ -1712,9 +1760,10 @@ export interface UpdateTaskRequest {
1712
1760
  priority?: TaskPriority;
1713
1761
  assignee_id?: string | null;
1714
1762
  parent_id?: string | null;
1715
- // project_id is deliberately absent: a Task's Project is immutable after
1716
- // creation (server answers 400 PROJECT_IMMUTABLE; resubmitting the current
1717
- // value is an idempotent no-op).
1763
+ // project_id is deliberately absent: PATCH cannot change a Task's Project
1764
+ // (server answers 400 PROJECT_IMMUTABLE; resubmitting the current value is
1765
+ // an idempotent no-op). Moving between projects is its own explicit
1766
+ // operation — see MoveTaskRequest / moveTask().
1718
1767
  sort_order?: number;
1719
1768
  /**
1720
1769
  * Ordering intent resolved server-side in the update transaction:
@@ -2255,10 +2304,35 @@ export type WikiChangesetStatus =
2255
2304
  | 'superseded'
2256
2305
  | 'conflict';
2257
2306
 
2307
+ export type WikiAccessTier = 'public' | 'restricted' | 'private';
2308
+ export type WikiMemberRole = 'viewer' | 'editor' | 'manager';
2309
+
2310
+ export interface WikiAccessPolicyMember {
2311
+ subject: string; // usr_* or team ID
2312
+ role: WikiMemberRole;
2313
+ }
2314
+
2315
+ /** GET/PUT shape of the who-can-access projection (membership design §4).
2316
+ * PUT must echo the revision from the latest GET (409 POLICY_REVISION_STALE
2317
+ * on mismatch). Container policy bits ride the root ('' path) PUT only. */
2318
+ export interface WikiAccessPolicy {
2319
+ path: string;
2320
+ general_access: WikiAccessTier | 'inherit';
2321
+ default_role?: 'editor' | 'viewer';
2322
+ discoverable: boolean;
2323
+ members: WikiAccessPolicyMember[];
2324
+ revision: string;
2325
+ /** Stored rows the projection cannot express — route to the advanced rules surface. */
2326
+ advanced?: boolean;
2327
+ editors_can_invite?: boolean;
2328
+ viewers_can_download?: boolean;
2329
+ }
2330
+
2258
2331
  export interface Wiki {
2259
2332
  id: string;
2260
2333
  org_id: string;
2261
- slug: string;
2334
+ /** Absent on degraded listing entries (discoverable-but-unreadable). */
2335
+ slug?: string;
2262
2336
  name: string;
2263
2337
  repo_owner: string;
2264
2338
  repo_name: string;
@@ -2279,11 +2353,27 @@ export interface Wiki {
2279
2353
  purge_eligible_at?: string | null;
2280
2354
  /** Server-computed restore availability for recycle-bin rows. */
2281
2355
  restorable?: boolean | null;
2356
+ /** Derived from the root path rules (never stored): public | restricted | private. */
2357
+ access_tier?: 'public' | 'restricted' | 'private';
2358
+ /** Caller's explicit membership at the library root: none | viewer | editor | manager. */
2359
+ my_membership?: 'none' | 'viewer' | 'editor' | 'manager';
2360
+ /** True for discoverable-but-unreadable listing entries: only id, name and
2361
+ * access_tier are populated — enough to request to join, nothing else.
2362
+ * Degraded entries must not be mounted, synced or treated as content. */
2363
+ degraded?: boolean;
2364
+ /** Caller's library-level star (the sidebar Starred group). Carried on full
2365
+ * list/get projections only — degraded entries never have it. */
2366
+ starred?: boolean;
2282
2367
  }
2283
2368
 
2284
2369
  export interface WikiFileChange {
2285
2370
  path: string;
2286
- action: 'create' | 'update' | 'delete';
2371
+ action: 'create' | 'update' | 'delete' | 'rename';
2372
+ /**
2373
+ * Rename source; present only when action is "rename" (path is the rename
2374
+ * target). Additive key — older changesets never carry it.
2375
+ */
2376
+ from_path?: string;
2287
2377
  }
2288
2378
 
2289
2379
  export interface WikiChangeset {
@@ -2316,6 +2406,12 @@ export interface WikiTreeEntry {
2316
2406
  * entry; use it to badge private folders, never for access decisions.
2317
2407
  */
2318
2408
  restricted?: boolean;
2409
+ /**
2410
+ * Committer date (RFC3339) of the newest default-branch commit touching this
2411
+ * entry — the listing's "Last published" value. Present only when the tree
2412
+ * was requested with `last_commit: true` and the lookup succeeded.
2413
+ */
2414
+ last_commit_at?: string;
2319
2415
  }
2320
2416
 
2321
2417
  export interface WikiTreeResponse {
@@ -2493,7 +2589,9 @@ export interface WikiRefsCheckResponse {
2493
2589
 
2494
2590
  export interface WikiDiffFile {
2495
2591
  path: string;
2496
- action?: string; // "create" | "update" | "delete"
2592
+ action?: string; // "create" | "update" | "delete" | "rename"
2593
+ /** Rename source when action is "rename" (path is the target). */
2594
+ from_path?: string;
2497
2595
  additions: number;
2498
2596
  deletions: number;
2499
2597
  }
@@ -2509,20 +2607,44 @@ export interface CreateWikiRequest {
2509
2607
  default_branch?: string;
2510
2608
  }
2511
2609
 
2512
- export interface WikiFileChangeInput {
2610
+ interface WikiFileChangeInputCommon {
2513
2611
  path: string;
2514
- action: 'create' | 'update' | 'delete';
2515
- content_base64?: string;
2516
2612
  base_version?: number;
2517
2613
  /**
2518
2614
  * Git blob SHA of the default-branch version this change was authored
2519
2615
  * against. When set on update/delete, the server rejects the changeset
2520
2616
  * with 409 STALE_BASE if the file has since changed on the default branch
2521
- * (prevents silently overwriting concurrent edits).
2617
+ * (prevents silently overwriting concurrent edits). For rename it guards
2618
+ * the from_path side.
2522
2619
  */
2523
2620
  base_sha?: string;
2524
2621
  }
2525
2622
 
2623
+ export interface WikiFileChangeWriteInput extends WikiFileChangeInputCommon {
2624
+ action: 'create' | 'update' | 'delete';
2625
+ content_base64?: string;
2626
+ /** Only valid with action "rename" — the server rejects it elsewhere. */
2627
+ from_path?: never;
2628
+ }
2629
+
2630
+ /**
2631
+ * Rename is a discriminated variant: `from_path` (the source; `path` is the
2632
+ * target) and `content_base64` are both REQUIRED. The content must be sent —
2633
+ * the server rejects a rename without the content_base64 key
2634
+ * (400 MISSING_FIELDS) because the single-commit move always writes content
2635
+ * and an omitted key would otherwise erase the file; an explicitly empty
2636
+ * string (an empty file) is legal. Requires the server capability
2637
+ * `cap:wiki-rename` — while it is off the server answers 422 RENAME_DISABLED
2638
+ * (older servers answer 400 INVALID_ACTION).
2639
+ */
2640
+ export interface WikiFileChangeRenameInput extends WikiFileChangeInputCommon {
2641
+ action: 'rename';
2642
+ from_path: string;
2643
+ content_base64: string;
2644
+ }
2645
+
2646
+ export type WikiFileChangeInput = WikiFileChangeWriteInput | WikiFileChangeRenameInput;
2647
+
2526
2648
  export interface CreateWikiChangesetRequest {
2527
2649
  title: string;
2528
2650
  message?: string;
@@ -2858,6 +2980,7 @@ export interface CardUpdateData {
2858
2980
  execution_status?: ExecutionStatus | null;
2859
2981
  decided_by?: string;
2860
2982
  decided_at?: string;
2983
+ decision_reason?: string | null;
2861
2984
  executed_at?: string | null;
2862
2985
  execution_error?: string | null;
2863
2986
  }
@@ -2873,7 +2996,7 @@ export interface WatchingData {
2873
2996
  export interface MembershipChangedData {
2874
2997
  chat_id: string;
2875
2998
  user_id: string;
2876
- action: 'added' | 'removed' | 'role_changed';
2999
+ action: 'added' | 'removed' | 'role_changed' | 'policy_changed';
2877
3000
  }
2878
3001
 
2879
3002
  /**
@@ -5015,6 +5138,12 @@ export interface EdgeBrowserProfile {
5015
5138
  edge_id: string;
5016
5139
  name: string;
5017
5140
  is_default: boolean;
5141
+ /** Stable compare-and-swap revision for Local BYOC Profile operations. */
5142
+ version: number;
5143
+ /** Stable configuration binding used by Alias readiness and execution. */
5144
+ config_revision: number;
5145
+ /** Authoritative persisted Profile operation lifecycle. */
5146
+ lifecycle_state: 'active' | 'pending_create' | 'pending_rename' | 'pending_delete';
5018
5147
  created_at: string;
5019
5148
  updated_at: string;
5020
5149
  /**
@@ -5026,6 +5155,421 @@ export interface EdgeBrowserProfile {
5026
5155
  proxy_configured?: boolean;
5027
5156
  }
5028
5157
 
5158
+ export type EdgeProfileOperationAction = 'create' | 'rename' | 'delete';
5159
+ export type EdgeProfileOperationStatus =
5160
+ | 'confirmation_required'
5161
+ | 'pending'
5162
+ | 'retryable'
5163
+ | 'rejected'
5164
+ | 'outcome_unknown'
5165
+ | 'succeeded';
5166
+ export type EdgeProfileOperationOutcome = 'applied' | 'retryable' | 'rejected';
5167
+
5168
+ export type EdgeProfileOperationErrorCode =
5169
+ | 'JWT_REQUIRED'
5170
+ | 'HUMAN_REQUIRED'
5171
+ | 'EDGE_NOT_FOUND'
5172
+ | 'EDGE_OFFLINE'
5173
+ | 'EDGE_STATUS_UNAVAILABLE'
5174
+ | 'PROFILE_NOT_FOUND'
5175
+ | 'PROFILE_VERSION_CONFLICT'
5176
+ | 'PROFILE_OPERATION_IN_PROGRESS'
5177
+ | 'PROFILE_OPERATION_NOT_FOUND'
5178
+ | 'PROFILE_OPERATION_CONFLICT'
5179
+ | 'PROFILE_DELETE_IMPACT_CHANGED'
5180
+ | 'IDEMPOTENCY_CONFLICT'
5181
+ | 'INVALID_IDEMPOTENCY_KEY'
5182
+ | 'INVALID_INPUT';
5183
+
5184
+ export type EdgeProfileOperationRequest =
5185
+ | { action: 'create'; name: string }
5186
+ | { action: 'rename'; profile_id: string; expected_version: number; name: string }
5187
+ | { action: 'delete'; profile_id: string; expected_version: number };
5188
+
5189
+ export interface EdgeProfileOperationConfirmRequest {
5190
+ impact_hash: string;
5191
+ confirmation_token: string;
5192
+ }
5193
+
5194
+ export interface EdgeProfileDeleteImpact {
5195
+ profile_id: string;
5196
+ profile_version: number;
5197
+ aliases: Array<{ alias_id: string; name: string }>;
5198
+ /** Classified legacy rows block confirmation; they are never silently deleted. */
5199
+ legacy_connections: Array<{ connection_id: string; classification: string }>;
5200
+ grants_count: number;
5201
+ accepted_or_running_executions: number;
5202
+ impact_hash: string;
5203
+ confirmation_token: string;
5204
+ }
5205
+
5206
+ export interface EdgeProfileOperationReceipt {
5207
+ operation_id: string;
5208
+ edge_id: string;
5209
+ profile_id: string;
5210
+ action: EdgeProfileOperationAction;
5211
+ status: EdgeProfileOperationStatus;
5212
+ expected_version?: number;
5213
+ target_version: number;
5214
+ attempt: number;
5215
+ name_before?: string;
5216
+ name_after?: string;
5217
+ impact?: EdgeProfileDeleteImpact;
5218
+ /** Present only while a Delete is awaiting the explicit strong confirmation. */
5219
+ confirmation_token?: string;
5220
+ /** Exact Edge outcome only; Server-private lifecycle evidence is never exposed here. */
5221
+ edge_outcome?: EdgeProfileOperationOutcome;
5222
+ error?: { code: string; message?: string };
5223
+ created_at: string;
5224
+ updated_at: string;
5225
+ completed_at?: string;
5226
+ }
5227
+
5228
+ export interface BrowserAliasCreateRequest {
5229
+ name: string;
5230
+ clip_id: string;
5231
+ edge_id: string;
5232
+ profile_id: string;
5233
+ idempotency_key: string;
5234
+ }
5235
+
5236
+ export interface BrowserAliasRenameRequest {
5237
+ name: string;
5238
+ expected_version: number;
5239
+ idempotency_key: string;
5240
+ }
5241
+
5242
+ export interface BrowserAliasDeleteRequest {
5243
+ expected_version: number;
5244
+ idempotency_key: string;
5245
+ }
5246
+
5247
+ export type BrowserAliasErrorCode =
5248
+ | 'JWT_REQUIRED'
5249
+ | 'HUMAN_REQUIRED'
5250
+ | 'INVALID_REQUEST'
5251
+ | 'INVALID_ALIAS_NAME'
5252
+ | 'CLIP_NOT_AVAILABLE'
5253
+ | 'PROFILE_NOT_FOUND'
5254
+ | 'ALIAS_NOT_FOUND'
5255
+ | 'ALIAS_NOT_READY'
5256
+ | 'ALIAS_NAME_TAKEN'
5257
+ | 'ALIAS_STALE'
5258
+ | 'PROFILE_OPERATION_IN_PROGRESS'
5259
+ | 'IDEMPOTENCY_CONFLICT'
5260
+ | 'EDGE_OFFLINE'
5261
+ | 'EDGE_STATUS_UNAVAILABLE';
5262
+
5263
+ export interface BrowserAliasVersion {
5264
+ id: string;
5265
+ version_seq: number;
5266
+ source_kind: 'publisher_working_copy' | 'approved_public_snapshot';
5267
+ source_clip_version_id?: string;
5268
+ source_working_revision?: string;
5269
+ version_label?: string;
5270
+ artifact_digest?: string;
5271
+ preparation_status: 'pending' | 'preparing' | 'ready' | 'failed';
5272
+ preparation_result?: Record<string, unknown>;
5273
+ created_at: string;
5274
+ updated_at: string;
5275
+ }
5276
+
5277
+ export type BrowserAliasReadinessStatus =
5278
+ | 'checking'
5279
+ | 'ready'
5280
+ | 'needs_action'
5281
+ | 'unavailable'
5282
+ | 'error';
5283
+
5284
+ export const BROWSER_ALIAS_READINESS_REASON_CODES = [
5285
+ 'edge_offline',
5286
+ 'profile_not_found',
5287
+ 'profile_damaged',
5288
+ 'artifact_invalid',
5289
+ 'runtime_incompatible',
5290
+ 'needs_login',
5291
+ 'target_service_unavailable',
5292
+ 'readiness_check_running',
5293
+ 'readiness_check_timeout',
5294
+ 'readiness_contract_error',
5295
+ ] as const;
5296
+
5297
+ export type BrowserAliasReadinessReasonCode = (typeof BROWSER_ALIAS_READINESS_REASON_CODES)[number];
5298
+
5299
+ export interface BrowserAliasReadinessReason {
5300
+ code: BrowserAliasReadinessReasonCode;
5301
+ status: BrowserAliasReadinessStatus;
5302
+ hint: string;
5303
+ observed_at: string;
5304
+ retry_after_ms?: number;
5305
+ }
5306
+
5307
+ export interface BrowserAliasReadiness {
5308
+ alias_id: string;
5309
+ status: BrowserAliasReadinessStatus;
5310
+ blocking_reasons: BrowserAliasReadinessReason[];
5311
+ primary_reason?: BrowserAliasReadinessReasonCode;
5312
+ hint?: string;
5313
+ observed_at: string;
5314
+ source: 'server' | 'edge';
5315
+ retry_after_ms?: number;
5316
+ alias_revision: number;
5317
+ active_alias_version_id?: string;
5318
+ profile_revision: number;
5319
+ profile_config_revision: number;
5320
+ generation: number;
5321
+ updated_at: string;
5322
+ }
5323
+
5324
+ export interface BrowserAliasReadinessCheckRequest {
5325
+ idempotency_key: string;
5326
+ }
5327
+
5328
+ export type BrowserAliasReadinessCheckStatus = 'pending' | 'dispatched' | 'succeeded' | 'rejected';
5329
+
5330
+ export interface BrowserAliasReadinessCheckReceipt {
5331
+ check_id: string;
5332
+ alias_id: string;
5333
+ status: BrowserAliasReadinessCheckStatus;
5334
+ error_code?: 'REPORT_STALE';
5335
+ generation: number;
5336
+ attempt: number;
5337
+ readiness?: BrowserAliasReadiness;
5338
+ created_at: string;
5339
+ updated_at: string;
5340
+ dispatched_at?: string;
5341
+ completed_at?: string;
5342
+ }
5343
+
5344
+ export interface BrowserAlias {
5345
+ id: string;
5346
+ name: string;
5347
+ version: number;
5348
+ lifecycle: 'preparing' | 'active' | 'update_preparing' | 'update_failed' | 'deleting';
5349
+ edge: { id: string; name: string; status: 'online' | 'offline'; placement: 'byoc' | 'hosted' };
5350
+ profile: {
5351
+ id: string;
5352
+ name: string;
5353
+ version: number;
5354
+ config_revision: number;
5355
+ lifecycle_state: string;
5356
+ };
5357
+ clip: { id: string; name: string; version?: string };
5358
+ desired_version?: BrowserAliasVersion;
5359
+ active_version?: BrowserAliasVersion;
5360
+ active_artifact_digest?: string;
5361
+ preparation_result?: Record<string, unknown>;
5362
+ update_result?: Record<string, unknown>;
5363
+ readiness?: BrowserAliasReadiness;
5364
+ created_at: string;
5365
+ updated_at: string;
5366
+ }
5367
+
5368
+ export interface BrowserAliasDeleteProof {
5369
+ alias_deleted: true;
5370
+ grants_deleted: number;
5371
+ name_released: true;
5372
+ }
5373
+
5374
+ export interface BrowserAliasCommandContractSnapshot {
5375
+ command_name: string;
5376
+ input_schema: Record<string, unknown>;
5377
+ output_schema: Record<string, unknown> | null;
5378
+ side_effect_level: string;
5379
+ data_scopes: string[];
5380
+ allowed_domains: string[];
5381
+ required_capabilities: string[];
5382
+ }
5383
+
5384
+ export interface BrowserAliasGrantContractEvidence {
5385
+ contract_hash: string;
5386
+ contract_snapshot: BrowserAliasCommandContractSnapshot;
5387
+ }
5388
+
5389
+ export interface BrowserAliasGrantCommand {
5390
+ command_name: string;
5391
+ status: 'missing' | 'active' | 'review_required';
5392
+ authorized?: BrowserAliasGrantContractEvidence;
5393
+ current: BrowserAliasGrantContractEvidence;
5394
+ delta?: { changed_fields: string[] };
5395
+ }
5396
+
5397
+ export interface BrowserAliasGrantSet {
5398
+ key_id: string;
5399
+ alias: { id: string; name: string; clip: BrowserAlias['clip'] };
5400
+ /** Zero means this Key+Alias set has never been written. */
5401
+ version: number;
5402
+ commands: BrowserAliasGrantCommand[];
5403
+ updated_at?: string;
5404
+ }
5405
+
5406
+ export interface BrowserAliasGrantReplaceRequest {
5407
+ expected_version: number;
5408
+ idempotency_key: string;
5409
+ commands: Array<{
5410
+ command_name: string;
5411
+ authorized_contract_hash: string;
5412
+ authorized_contract_snapshot: BrowserAliasCommandContractSnapshot;
5413
+ }>;
5414
+ }
5415
+
5416
+ export interface ManagedBrowserAliasSummary {
5417
+ id: string;
5418
+ name: string;
5419
+ clip: BrowserAlias['clip'];
5420
+ readiness?: BrowserAliasReadiness;
5421
+ commands: string[];
5422
+ needs_owner_review: string[];
5423
+ }
5424
+
5425
+ export interface ManagedBrowserAliasCommand {
5426
+ name: string;
5427
+ status: 'active';
5428
+ description: string;
5429
+ input_schema: Record<string, unknown>;
5430
+ output_schema: Record<string, unknown> | null;
5431
+ side_effect_level: string;
5432
+ data_scopes: string[];
5433
+ allowed_domains: string[];
5434
+ required_capabilities: string[];
5435
+ }
5436
+
5437
+ export interface ManagedBrowserAliasReviewRequiredCommand {
5438
+ name: string;
5439
+ status: 'review_required';
5440
+ hint: string;
5441
+ }
5442
+
5443
+ export interface ManagedBrowserAliasInfo {
5444
+ id: string;
5445
+ name: string;
5446
+ clip: BrowserAlias['clip'];
5447
+ readiness?: BrowserAliasReadiness;
5448
+ commands: ManagedBrowserAliasCommand[];
5449
+ needs_owner_review: ManagedBrowserAliasReviewRequiredCommand[];
5450
+ }
5451
+
5452
+ export type BrowserAliasExecutionStatus =
5453
+ | 'accepted'
5454
+ | 'running'
5455
+ | 'succeeded'
5456
+ | 'failed'
5457
+ | 'outcome_unknown';
5458
+
5459
+ export interface BrowserAliasExecutionRequest {
5460
+ request_id: string;
5461
+ alias: string;
5462
+ command: string;
5463
+ args: Record<string, unknown>;
5464
+ }
5465
+
5466
+ export interface BrowserAliasExecutionError {
5467
+ code: string;
5468
+ message: string;
5469
+ hint?: string;
5470
+ }
5471
+
5472
+ /** Redacted managed-key/Owner recovery DTO. It never contains target IDs,
5473
+ * hashes, dispatch claims or Edge-ledger evidence. */
5474
+ export interface BrowserAliasExecutionReceipt {
5475
+ request_id: string;
5476
+ alias: string;
5477
+ command: string;
5478
+ status: BrowserAliasExecutionStatus;
5479
+ dispatched: true;
5480
+ command_timeout_ms: number;
5481
+ execution_deadline: string;
5482
+ result?: Record<string, unknown>;
5483
+ error?: BrowserAliasExecutionError;
5484
+ accepted_at: string;
5485
+ running_at?: string;
5486
+ terminal_at?: string;
5487
+ updated_at: string;
5488
+ }
5489
+
5490
+ export type BrowserUseAction =
5491
+ | 'read'
5492
+ | 'tabs'
5493
+ | 'wait'
5494
+ | 'snapshot'
5495
+ | 'get'
5496
+ | 'screenshot'
5497
+ | 'open'
5498
+ | 'navigate'
5499
+ | 'viewport'
5500
+ | 'click'
5501
+ | 'fill'
5502
+ | 'type'
5503
+ | 'press'
5504
+ | 'scroll'
5505
+ | 'close'
5506
+ | 'recover'
5507
+ | 'eval';
5508
+
5509
+ export interface BrowserUseTarget {
5510
+ tab_id?: string;
5511
+ browser_generation?: number;
5512
+ document_generation?: number;
5513
+ snapshot_id?: string;
5514
+ ref?: string;
5515
+ }
5516
+
5517
+ export interface BrowserUseOperationRequest {
5518
+ contract_version: 'browser-use-operation-v1';
5519
+ request_id: string;
5520
+ profile_id: string;
5521
+ action: BrowserUseAction;
5522
+ target?: BrowserUseTarget;
5523
+ params: Record<string, unknown>;
5524
+ /** Canonical RFC3339 UTC instant, no more than two minutes in the future. */
5525
+ deadline: string;
5526
+ }
5527
+
5528
+ export type BrowserUseOperationPhase =
5529
+ | 'accepted'
5530
+ | 'started'
5531
+ | 'succeeded'
5532
+ | 'failed'
5533
+ | 'outcome_unknown';
5534
+
5535
+ export interface BrowserUseOperationError {
5536
+ code: string;
5537
+ message?: string;
5538
+ hint?: string;
5539
+ }
5540
+
5541
+ /** Durable Browser Use proof. `data` is encrypted/transient: it is present
5542
+ * only while result_available is true and disappears after result_expires_at;
5543
+ * the terminal receipt and result_digest remain durable. */
5544
+ export interface BrowserUseOperationReceipt {
5545
+ contract_version: 'browser-use-operation-v1';
5546
+ operation_id: string;
5547
+ request_id: string;
5548
+ profile_id: string;
5549
+ profile_version: number;
5550
+ profile_config_revision: number;
5551
+ action: BrowserUseAction;
5552
+ required_grant: 'browser.read' | 'browser.interact' | 'browser.advanced';
5553
+ phase: BrowserUseOperationPhase;
5554
+ dispatched?: boolean;
5555
+ receipt_id?: string;
5556
+ receipt_digest?: string;
5557
+ occurred_at?: string;
5558
+ tab_id?: string;
5559
+ browser_generation?: number;
5560
+ duration_ms?: number;
5561
+ result_digest?: string;
5562
+ result_available: boolean;
5563
+ result_expires_at?: string;
5564
+ data?: unknown;
5565
+ error?: BrowserUseOperationError;
5566
+ deadline: string;
5567
+ accepted_at: string;
5568
+ started_at?: string;
5569
+ terminal_at?: string;
5570
+ updated_at: string;
5571
+ }
5572
+
5029
5573
  /**
5030
5574
  * Sanitized per-profile egress proxy status (hosted Cloud Profiles) — the GET
5031
5575
  * response and the PUT/DELETE result. NEVER carries the password; `password_set`