@parall/sdk 1.32.1 → 1.33.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/client.ts CHANGED
@@ -111,6 +111,7 @@ import type {
111
111
  InboxItem,
112
112
  InboxUnreadCountResponse,
113
113
  DispatchEvent,
114
+ DispatchExpireResult,
114
115
  ResolveRefsResponse,
115
116
  BacklinksResponse,
116
117
  BrokenRefsResponse,
@@ -151,7 +152,14 @@ import type {
151
152
  InvokeClipResponse,
152
153
  OnlineClipInfo,
153
154
  RegistryClipInfo,
154
- MachineClipInstall,
155
+ MachineClip,
156
+ BrowserProfile,
157
+ BrowserProfileStatus,
158
+ BrowserProfileConsent,
159
+ CreateBrowserProfileRequest,
160
+ UpdateBrowserProfileRequest,
161
+ BrowserProfileLifecycleRequest,
162
+ GrantBrowserProfileConsentRequest,
155
163
  } from './types.js';
156
164
 
157
165
  export interface ParallClientOptions {
@@ -761,6 +769,7 @@ export class ParallClient {
761
769
  | 'agent_routing_mode'
762
770
  | 'smart_routing_strategy'
763
771
  | 'smart_routing_agent_id'
772
+ | 'member_invite_policy'
764
773
  >
765
774
  >,
766
775
  ): Promise<Chat> {
@@ -811,8 +820,8 @@ export class ParallClient {
811
820
  return res.data;
812
821
  }
813
822
 
814
- async addChatMember(orgId: string, chatId: string, userId: string, role?: string): Promise<void> {
815
- return this.request('POST', ENDPOINTS.CHAT_MEMBERS(orgId, chatId), { user_id: userId, role });
823
+ async addChatMember(orgId: string, chatId: string, userId: string): Promise<void> {
824
+ return this.request('POST', ENDPOINTS.CHAT_MEMBERS(orgId, chatId), { user_id: userId });
816
825
  }
817
826
 
818
827
  async removeChatMember(orgId: string, chatId: string, userId: string): Promise<void> {
@@ -1302,6 +1311,21 @@ export class ParallClient {
1302
1311
  });
1303
1312
  }
1304
1313
 
1314
+ /**
1315
+ * Toggle whether the machine contributes its local clips as a hub provider
1316
+ * — org-admin-gated (RequireOrgAdmin), like all machine management. See
1317
+ * docs/engineering-design/clip-provider-sharing-design.md.
1318
+ */
1319
+ async patchMachineProviderEnabled(
1320
+ orgId: string,
1321
+ machineId: string,
1322
+ providerEnabled: boolean,
1323
+ ): Promise<Machine> {
1324
+ return this.request('PATCH', ENDPOINTS.MACHINE_PROVIDER_ENABLED(orgId, machineId), {
1325
+ provider_enabled: providerEnabled,
1326
+ });
1327
+ }
1328
+
1305
1329
  /** Get machine-level runtime auth state. */
1306
1330
  async getMachineRuntimeAuth(orgId: string, machineId: string): Promise<MachineRuntimeAuthState> {
1307
1331
  return this.request('GET', ENDPOINTS.MACHINE_RUNTIME_AUTH(orgId, machineId));
@@ -1355,34 +1379,54 @@ export class ParallClient {
1355
1379
  return res.data;
1356
1380
  }
1357
1381
 
1358
- /** `GET /machines/me/clip-installs` — registry clips this machine should
1359
- * install but hasn't yet (durable reconcile, mck_-authed). */
1360
- async listClipInstalls(): Promise<MachineClipInstall[]> {
1361
- const res = await this.request<{ data: MachineClipInstall[] }>(
1382
+ /** `GET /machines/me/clips` — executable Clip definitions assigned to this machine. */
1383
+ async listMachineClips(): Promise<MachineClip[]> {
1384
+ const res = await this.request<{ data: MachineClip[] }>('GET', ENDPOINTS.MACHINES_ME_CLIPS);
1385
+ return res.data;
1386
+ }
1387
+
1388
+ /** `GET /machines/me/browser-profiles` — browser profiles hosted by this machine. */
1389
+ async listMachineBrowserProfiles(): Promise<BrowserProfile[]> {
1390
+ const res = await this.request<{ data: BrowserProfile[] }>(
1362
1391
  'GET',
1363
- ENDPOINTS.MACHINES_ME_CLIP_INSTALLS,
1392
+ ENDPOINTS.MACHINES_ME_BROWSER_PROFILES,
1364
1393
  );
1365
1394
  return res.data;
1366
1395
  }
1367
1396
 
1368
- /** `POST /machines/me/clip-installs/{clipId}/installed` — report a finished install. */
1369
- async reportClipInstall(clipId: string, version?: string): Promise<void> {
1370
- return this.request(
1371
- 'POST',
1372
- ENDPOINTS.MACHINES_ME_CLIP_INSTALL_DONE(clipId),
1373
- version ? { version } : undefined,
1374
- );
1397
+ /** `POST /machines/me/browser-profiles/{profileId}/status` — report runtime status. */
1398
+ async reportBrowserProfileStatus(
1399
+ profileId: string,
1400
+ status: BrowserProfileStatus,
1401
+ errorMsg?: string,
1402
+ ): Promise<void> {
1403
+ await this.request('POST', ENDPOINTS.MACHINES_ME_BROWSER_PROFILE_STATUS(profileId), {
1404
+ status,
1405
+ ...(errorMsg ? { error_msg: errorMsg } : {}),
1406
+ });
1375
1407
  }
1376
1408
 
1377
1409
  /**
1378
- * `POST /machines/me/health` — bump the Machine's `updated_at` to now.
1379
- * Body is intentionally empty; the server ignores any payload. The
1380
- * daemon should call this on a fixed cadence (e.g. every 30s) so an
1381
- * external observer can detect a wedged supervisor.
1410
+ * `POST /machines/me/health` — bump the Machine's `updated_at` to now and
1411
+ * report daemon state. The daemon should call this on a fixed cadence (e.g.
1412
+ * every 30s) so an external observer can detect a wedged supervisor. Both
1413
+ * fields are optional and only persisted when changed:
1414
+ * - `daemonVersion` — the running bundle/launcher version.
1415
+ * - `selfUpdateCapable` — whether the daemon can act on a machine.update
1416
+ * signal (true under a service manager, false for bare `npx` foreground).
1382
1417
  */
1383
- async postMachineHeartbeat(daemonVersion?: string): Promise<void> {
1384
- const body = daemonVersion ? { daemon_version: daemonVersion } : undefined;
1385
- return this.request('POST', ENDPOINTS.MACHINES_ME_HEALTH, body);
1418
+ async postMachineHeartbeat(opts?: {
1419
+ daemonVersion?: string;
1420
+ selfUpdateCapable?: boolean;
1421
+ }): Promise<void> {
1422
+ const body: Record<string, unknown> = {};
1423
+ if (opts?.daemonVersion) body.daemon_version = opts.daemonVersion;
1424
+ if (opts?.selfUpdateCapable !== undefined) body.self_update_capable = opts.selfUpdateCapable;
1425
+ return this.request(
1426
+ 'POST',
1427
+ ENDPOINTS.MACHINES_ME_HEALTH,
1428
+ Object.keys(body).length > 0 ? body : undefined,
1429
+ );
1386
1430
  }
1387
1431
 
1388
1432
  async reportAgentWorkspaceState(
@@ -1583,6 +1627,11 @@ export class ParallClient {
1583
1627
  return this.request('POST', ENDPOINTS.DISPATCH_ACK_BY_ID(orgId, id));
1584
1628
  }
1585
1629
 
1630
+ async expireDispatch(orgId: string, maxAgeHours?: number): Promise<DispatchExpireResult> {
1631
+ const params = maxAgeHours !== undefined ? { max_age_hours: String(maxAgeHours) } : undefined;
1632
+ return this.request('POST', ENDPOINTS.DISPATCH_EXPIRE(orgId), undefined, params);
1633
+ }
1634
+
1586
1635
  async getDispatchByMessages(
1587
1636
  orgId: string,
1588
1637
  chatId: string,
@@ -2485,6 +2534,80 @@ export class ParallClient {
2485
2534
  return resp.data;
2486
2535
  }
2487
2536
 
2537
+ async listBrowserProfiles(orgId: string): Promise<BrowserProfile[]> {
2538
+ const resp = await this.request<{ data: BrowserProfile[] }>(
2539
+ 'GET',
2540
+ ENDPOINTS.BROWSER_PROFILES(orgId),
2541
+ );
2542
+ return resp.data;
2543
+ }
2544
+
2545
+ async createBrowserProfile(
2546
+ orgId: string,
2547
+ req: CreateBrowserProfileRequest,
2548
+ ): Promise<BrowserProfile> {
2549
+ return this.request('POST', ENDPOINTS.BROWSER_PROFILES(orgId), req);
2550
+ }
2551
+
2552
+ async getBrowserProfile(orgId: string, profileId: string): Promise<BrowserProfile> {
2553
+ return this.request('GET', ENDPOINTS.BROWSER_PROFILE(orgId, profileId));
2554
+ }
2555
+
2556
+ async updateBrowserProfile(
2557
+ orgId: string,
2558
+ profileId: string,
2559
+ req: UpdateBrowserProfileRequest,
2560
+ ): Promise<BrowserProfile> {
2561
+ return this.request('PATCH', ENDPOINTS.BROWSER_PROFILE(orgId, profileId), req);
2562
+ }
2563
+
2564
+ async deleteBrowserProfile(orgId: string, profileId: string): Promise<void> {
2565
+ await this.request('DELETE', ENDPOINTS.BROWSER_PROFILE(orgId, profileId));
2566
+ }
2567
+
2568
+ async openBrowserProfile(
2569
+ orgId: string,
2570
+ profileId: string,
2571
+ req: BrowserProfileLifecycleRequest = {},
2572
+ ): Promise<BrowserProfile> {
2573
+ return this.request('POST', ENDPOINTS.BROWSER_PROFILE_OPEN(orgId, profileId), req);
2574
+ }
2575
+
2576
+ async stopBrowserProfile(orgId: string, profileId: string): Promise<BrowserProfile> {
2577
+ return this.request('POST', ENDPOINTS.BROWSER_PROFILE_STOP(orgId, profileId), {});
2578
+ }
2579
+
2580
+ async resetBrowserProfile(orgId: string, profileId: string): Promise<BrowserProfile> {
2581
+ return this.request('POST', ENDPOINTS.BROWSER_PROFILE_RESET(orgId, profileId));
2582
+ }
2583
+
2584
+ async listBrowserProfileConsents(
2585
+ orgId: string,
2586
+ profileId: string,
2587
+ ): Promise<BrowserProfileConsent[]> {
2588
+ const resp = await this.request<{ data: BrowserProfileConsent[] }>(
2589
+ 'GET',
2590
+ ENDPOINTS.BROWSER_PROFILE_CONSENTS(orgId, profileId),
2591
+ );
2592
+ return resp.data;
2593
+ }
2594
+
2595
+ async grantBrowserProfileConsent(
2596
+ orgId: string,
2597
+ profileId: string,
2598
+ req: GrantBrowserProfileConsentRequest,
2599
+ ): Promise<BrowserProfileConsent> {
2600
+ return this.request('POST', ENDPOINTS.BROWSER_PROFILE_CONSENTS(orgId, profileId), req);
2601
+ }
2602
+
2603
+ async revokeBrowserProfileConsent(
2604
+ orgId: string,
2605
+ profileId: string,
2606
+ clipId: string,
2607
+ ): Promise<void> {
2608
+ await this.request('DELETE', ENDPOINTS.BROWSER_PROFILE_CONSENT(orgId, profileId, clipId));
2609
+ }
2610
+
2488
2611
  async listRegistryClips(q?: string): Promise<RegistryClipInfo[]> {
2489
2612
  const url = ENDPOINTS.CLIP_REGISTRY() + (q ? `?q=${encodeURIComponent(q)}` : '');
2490
2613
  const resp = await this.request<{ data: RegistryClipInfo[] }>('GET', url);
package/src/constants.ts CHANGED
@@ -415,6 +415,8 @@ export const ENDPOINTS = {
415
415
  `${API_BASE}/orgs/${orgId}/machines/${machineId}/agents/${agentId}/workspace/setup`,
416
416
  MACHINE_LLM_SOURCE: (orgId: string, machineId: string) =>
417
417
  `${API_BASE}/orgs/${orgId}/machines/${machineId}/llm-source`,
418
+ MACHINE_PROVIDER_ENABLED: (orgId: string, machineId: string) =>
419
+ `${API_BASE}/orgs/${orgId}/machines/${machineId}/provider-enabled`,
418
420
  MACHINE_RUNTIME_AUTH: (orgId: string, machineId: string) =>
419
421
  `${API_BASE}/orgs/${orgId}/machines/${machineId}/runtime-auth`,
420
422
  MACHINE_KEYS: (orgId: string, machineId: string) =>
@@ -436,9 +438,10 @@ export const ENDPOINTS = {
436
438
  MACHINES_ME: `${API_BASE}/machines/me`,
437
439
  MACHINES_ME_AGENTS: `${API_BASE}/machines/me/agents`,
438
440
  MACHINES_ME_HEALTH: `${API_BASE}/machines/me/health`,
439
- MACHINES_ME_CLIP_INSTALLS: `${API_BASE}/machines/me/clip-installs`,
440
- MACHINES_ME_CLIP_INSTALL_DONE: (clipId: string) =>
441
- `${API_BASE}/machines/me/clip-installs/${clipId}/installed`,
441
+ MACHINES_ME_CLIPS: `${API_BASE}/machines/me/clips`,
442
+ MACHINES_ME_BROWSER_PROFILES: `${API_BASE}/machines/me/browser-profiles`,
443
+ MACHINES_ME_BROWSER_PROFILE_STATUS: (profileId: string) =>
444
+ `${API_BASE}/machines/me/browser-profiles/${profileId}/status`,
442
445
  MACHINES_ME_AGENT_LAUNCH_CREDENTIAL: (agentId: string) =>
443
446
  `${API_BASE}/machines/me/agents/${agentId}/launch-credential`,
444
447
  MACHINES_ME_AGENT_WORKSPACE_STATE: (agentId: string) =>
@@ -593,6 +596,7 @@ export const ENDPOINTS = {
593
596
  DISPATCH_RECEIVED: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/received`,
594
597
  DISPATCH_ACK: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/ack`,
595
598
  DISPATCH_ACK_BY_ID: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/dispatch/${id}/ack`,
599
+ DISPATCH_EXPIRE: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/expire`,
596
600
  DISPATCH_BY_MESSAGES: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/by-messages`,
597
601
 
598
602
  // Unread
@@ -644,6 +648,19 @@ export const ENDPOINTS = {
644
648
  `${CLIP_BASE}/orgs/${orgId}/agents/${agentId}/clips/${clipId}`,
645
649
  CLIP_INVOKE: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/invoke`,
646
650
  CLIP_ONLINE: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/online`,
651
+ BROWSER_PROFILES: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/browser-profiles`,
652
+ BROWSER_PROFILE: (orgId: string, profileId: string) =>
653
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}`,
654
+ BROWSER_PROFILE_OPEN: (orgId: string, profileId: string) =>
655
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}/open`,
656
+ BROWSER_PROFILE_STOP: (orgId: string, profileId: string) =>
657
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}/stop`,
658
+ BROWSER_PROFILE_RESET: (orgId: string, profileId: string) =>
659
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}/reset`,
660
+ BROWSER_PROFILE_CONSENTS: (orgId: string, profileId: string) =>
661
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}/consents`,
662
+ BROWSER_PROFILE_CONSENT: (orgId: string, profileId: string, clipId: string) =>
663
+ `${CLIP_BASE}/orgs/${orgId}/browser-profiles/${profileId}/consents/${clipId}`,
647
664
 
648
665
  // Clip registry (global, served by clip-service → Pinix Hub proxy)
649
666
  CLIP_REGISTRY: () => `${CLIP_BASE}/registry/clips`,
@@ -721,9 +738,10 @@ export const WS_EVENTS = {
721
738
  MACHINE_FILESYSTEM_BROWSE: 'machine.filesystem.browse',
722
739
  MACHINE_UPDATE: 'machine.update',
723
740
  MACHINE_CONFIG_UPDATED: 'machine.config.updated',
724
- MACHINE_CLIP_INSTALL: 'machine.clip.install',
741
+ MACHINE_CLIP_SYNC: 'machine.clip.sync',
742
+ MACHINE_BROWSER_PROFILE_LIFECYCLE: 'machine.browser_profile.lifecycle',
725
743
  AGENT_NEW_SESSION: 'agent.new_session',
726
- CLIP_INSTALLED: 'clip.installed',
744
+ CLIP_CREATED: 'clip.created',
727
745
  CLIP_REMOVED: 'clip.removed',
728
746
  CLIP_UPDATED: 'clip.updated',
729
747
  } as const;
package/src/types.ts CHANGED
@@ -21,6 +21,12 @@ export interface User {
21
21
  export type ChatType = 'direct' | 'group';
22
22
  export type AgentRoutingMode = 'passive' | 'active' | 'smart';
23
23
  export type ChatVisibility = 'public' | 'private';
24
+ /**
25
+ * Who can add new members to a chat.
26
+ * - `everyone` (default): any chat member can add another org member.
27
+ * - `admins`: only chat admins/owners (and org admins) may add.
28
+ */
29
+ export type MemberInvitePolicy = 'everyone' | 'admins';
24
30
 
25
31
  export interface Chat {
26
32
  id: string;
@@ -35,6 +41,7 @@ export interface Chat {
35
41
  smart_routing_strategy: string | null;
36
42
  /** Chat-level smart routing agent override. NULL = use org default. */
37
43
  smart_routing_agent_id: string | null;
44
+ member_invite_policy: MemberInvitePolicy;
38
45
  last_message_at: string | null;
39
46
  last_message_preview: string | null;
40
47
  last_message_sender: string | null;
@@ -718,7 +725,24 @@ export interface Machine {
718
725
  daemon_mode: boolean;
719
726
  llm_source?: string;
720
727
  compute_mode: 'hosted' | 'local';
728
+ // Whether the machine contributes its local clips as a hub provider
729
+ // (org-admin-toggleable via PATCH /machines/{id}/provider-enabled). Absent on
730
+ // servers predating the field → treat as true (default-on). See
731
+ // docs/engineering-design/clip-provider-sharing-design.md.
732
+ provider_enabled?: boolean;
733
+ // Externally-reachable ProviderStream endpoint the daemon connects to in order
734
+ // to register its clips with the hub. Server-computed (grey-cloud
735
+ // clip-rpc.{env}.prll.sh, which bypasses Cloudflare's bidi-incompatible proxy)
736
+ // and delivered only to BYOC (local daemon-mode) machines via GET /machines/me;
737
+ // absent for hosted machines. See
738
+ // docs/engineering-design/clip-provider-sharing-design.md.
739
+ clip_provider_url?: string;
721
740
  daemon_version?: string | null;
741
+ // Whether the daemon can act on a machine.update signal — true only when a
742
+ // service manager (launchd/systemd) supervises it, false for bare `npx`
743
+ // foreground runs that can't load the overlay or restart after exit(42).
744
+ // Reported on heartbeat; gates the "Check for Update" affordance + API.
745
+ self_update_capable?: boolean;
722
746
  region: string | null;
723
747
  created_by: string;
724
748
  created_at: string;
@@ -862,6 +886,9 @@ export interface MachineAgentDetachedData {
862
886
  export interface MachineConfigUpdatedData {
863
887
  machine_id: string;
864
888
  llm_source?: string;
889
+ // Present when provider_enabled changed → daemon (de)registers its clip
890
+ // provider. Absent on llm_source-only updates.
891
+ provider_enabled?: boolean;
865
892
  }
866
893
 
867
894
  export interface MachineWorkspaceSetupRequestedData {
@@ -887,11 +914,19 @@ export interface MachineUpdateData {
887
914
  reason?: string;
888
915
  }
889
916
 
890
- export interface MachineClipInstallData {
917
+ export interface MachineClipSyncData {
918
+ machine_id: string;
891
919
  clip_id: string;
892
- alias: string;
893
- source_ref: string;
894
- version?: string;
920
+ action?: 'create' | 'update' | 'delete' | string;
921
+ }
922
+
923
+ export type BrowserProfileLifecycleAction = 'open' | 'stop' | 'reset';
924
+
925
+ export interface MachineBrowserProfileLifecycleData {
926
+ machine_id: string;
927
+ profile_id: string;
928
+ action: BrowserProfileLifecycleAction;
929
+ start_url?: string;
895
930
  }
896
931
 
897
932
  export interface AgentNewSessionData {
@@ -1692,6 +1727,7 @@ export interface ChatUpdateData {
1692
1727
  | 'agent_routing_mode'
1693
1728
  | 'smart_routing_strategy'
1694
1729
  | 'smart_routing_agent_id'
1730
+ | 'member_invite_policy'
1695
1731
  | 'last_message_at'
1696
1732
  | 'last_message_preview'
1697
1733
  | 'last_message_sender'
@@ -1999,6 +2035,20 @@ export interface DispatchEvent {
1999
2035
 
2000
2036
  export type DispatchNewData = DispatchEvent;
2001
2037
 
2038
+ export interface DispatchExpiredGroup {
2039
+ chat_id: string | null;
2040
+ chat_name?: string | null;
2041
+ event_type: DispatchEventType;
2042
+ count: number;
2043
+ oldest: string;
2044
+ newest: string;
2045
+ }
2046
+
2047
+ export interface DispatchExpireResult {
2048
+ total: number;
2049
+ groups: DispatchExpiredGroup[];
2050
+ }
2051
+
2002
2052
  export interface DispatchReceivedData {
2003
2053
  agent_id: string;
2004
2054
  event_type: string;
@@ -2105,8 +2155,9 @@ export type WsEventMap = {
2105
2155
  'machine.stop': MachineStopData;
2106
2156
  'machine.filesystem.browse': MachineFilesystemBrowseData;
2107
2157
  'machine.update': MachineUpdateData;
2108
- 'machine.clip.install': MachineClipInstallData;
2109
- 'clip.installed': ClipInstalledData;
2158
+ 'machine.clip.sync': MachineClipSyncData;
2159
+ 'machine.browser_profile.lifecycle': MachineBrowserProfileLifecycleData;
2160
+ 'clip.created': ClipCreatedData;
2110
2161
  'clip.removed': ClipRemovedData;
2111
2162
  'clip.updated': ClipUpdatedData;
2112
2163
  'agent.new_session': AgentNewSessionData;
@@ -2560,17 +2611,16 @@ export interface Clip {
2560
2611
  org_id: string;
2561
2612
  alias: string;
2562
2613
  name: string;
2614
+ display_name: string;
2563
2615
  description: string | null;
2564
2616
  manifest: Record<string, unknown>;
2565
2617
  source_type: ClipSourceType;
2566
2618
  source_ref: string | null;
2567
2619
  version: string | null;
2568
2620
  status: ClipStatus;
2621
+ machine_id: string;
2622
+ browser_profile_id: string | null;
2569
2623
  created_by: string | null;
2570
- /** Registry clip that reconciles onto every org machine, including machines
2571
- * that join after creation. Targeted installs leave this false and persist
2572
- * per-machine pending clip_instances instead. */
2573
- install_on_all_machines: boolean;
2574
2624
  created_at: string;
2575
2625
  updated_at: string;
2576
2626
  }
@@ -2584,21 +2634,27 @@ export interface AgentClip {
2584
2634
 
2585
2635
  export interface CreateClipRequest {
2586
2636
  alias: string;
2587
- name: string;
2637
+ name?: string;
2638
+ display_name?: string;
2588
2639
  description?: string;
2589
- manifest: Record<string, unknown>;
2640
+ manifest?: Record<string, unknown>;
2590
2641
  source_type?: ClipSourceType;
2591
2642
  source_ref?: string;
2592
2643
  version?: string;
2593
- target_machine_ids?: string[];
2644
+ machine_id: string;
2645
+ browser_profile_id?: string;
2594
2646
  }
2595
2647
 
2596
2648
  export interface UpdateClipRequest {
2597
2649
  name?: string;
2650
+ display_name?: string;
2598
2651
  description?: string;
2599
2652
  manifest?: Record<string, unknown>;
2600
2653
  status?: ClipStatus;
2601
2654
  version?: string;
2655
+ machine_id?: string;
2656
+ /** Empty string clears the binding; omitted leaves it unchanged. */
2657
+ browser_profile_id?: string;
2602
2658
  }
2603
2659
 
2604
2660
  export interface BindAgentClipRequest {
@@ -2606,32 +2662,68 @@ export interface BindAgentClipRequest {
2606
2662
  config?: Record<string, unknown>;
2607
2663
  }
2608
2664
 
2609
- export interface InvokeClipRequest {
2610
- alias: string;
2665
+ interface InvokeClipBaseRequest {
2611
2666
  command: string;
2612
2667
  input?: unknown;
2613
2668
  timeout_ms?: number;
2614
2669
  }
2615
2670
 
2671
+ export type InvokeClipRequest =
2672
+ | (InvokeClipBaseRequest & { alias: string; clip_id?: never })
2673
+ | (InvokeClipBaseRequest & { clip_id: string; alias?: never });
2674
+
2616
2675
  export interface InvokeClipResponse {
2617
2676
  output: unknown;
2618
2677
  error: string | null;
2619
2678
  }
2620
2679
 
2621
- export type ClipInstanceStatus = 'pending' | 'installed' | 'running' | 'stopped' | 'error';
2680
+ export type BrowserProfileStatus = 'pending' | 'running' | 'stopped' | 'error';
2622
2681
 
2623
- export interface ClipInstance {
2682
+ export interface BrowserProfile {
2624
2683
  id: string;
2625
- clip_id: string;
2626
- machine_id: string | null;
2627
- status: ClipInstanceStatus;
2628
- version: string | null;
2629
- error_msg: string | null;
2630
- last_seen: string | null;
2684
+ org_id: string;
2685
+ /** Host machine where the profile's cookies / bb-browser account live. */
2686
+ machine_id: string;
2687
+ owner_user_id: string;
2688
+ display_name: string;
2689
+ status: BrowserProfileStatus;
2690
+ error_msg?: string | null;
2691
+ last_seen?: string | null;
2692
+ created_by?: string | null;
2631
2693
  created_at: string;
2632
2694
  updated_at: string;
2633
2695
  }
2634
2696
 
2697
+ export interface BrowserProfileConsent {
2698
+ id: string;
2699
+ org_id: string;
2700
+ browser_profile_id: string;
2701
+ clip_id: string;
2702
+ owner_user_id: string;
2703
+ granted_by: string;
2704
+ granted_at: string;
2705
+ revoked_at?: string | null;
2706
+ }
2707
+
2708
+ export interface CreateBrowserProfileRequest {
2709
+ /** Host machine that runs the BrowserProfile (cookies / bb-browser account). */
2710
+ machine_id: string;
2711
+ owner_user_id: string;
2712
+ display_name: string;
2713
+ }
2714
+
2715
+ export interface UpdateBrowserProfileRequest {
2716
+ display_name?: string;
2717
+ }
2718
+
2719
+ export interface BrowserProfileLifecycleRequest {
2720
+ start_url?: string;
2721
+ }
2722
+
2723
+ export interface GrantBrowserProfileConsentRequest {
2724
+ clip_id: string;
2725
+ }
2726
+
2635
2727
  export interface OnlineClipInfo {
2636
2728
  alias: string;
2637
2729
  name: string;
@@ -2640,12 +2732,18 @@ export interface OnlineClipInfo {
2640
2732
  provider_name: string;
2641
2733
  }
2642
2734
 
2643
- // Durable install reconcile a registry clip the machine should install.
2644
- export interface MachineClipInstall {
2735
+ // Executable Clip definition assigned to a daemon machine.
2736
+ export interface MachineClip {
2645
2737
  clip_id: string;
2646
2738
  alias: string;
2739
+ name: string;
2740
+ display_name: string;
2741
+ description?: string | null;
2742
+ manifest?: Record<string, unknown>;
2743
+ source_type: ClipSourceType;
2647
2744
  source_ref?: string;
2648
2745
  version?: string;
2746
+ browser_profile_id?: string | null;
2649
2747
  }
2650
2748
 
2651
2749
  // Pinix registry catalog clip info (from GET /clip/v1/registry/clips,
@@ -2657,6 +2755,11 @@ export interface RegistryCommandInfo {
2657
2755
  output?: string;
2658
2756
  }
2659
2757
 
2758
+ export interface RegistryDependencyInfo {
2759
+ package: string;
2760
+ version: string;
2761
+ }
2762
+
2660
2763
  export interface RegistryClipInfo {
2661
2764
  name: string; // @scope/name (canonical package id)
2662
2765
  package: string; // @scope/name (alias derivation + install source_ref)
@@ -2666,11 +2769,11 @@ export interface RegistryClipInfo {
2666
2769
  domain?: string;
2667
2770
  author?: string;
2668
2771
  commands: RegistryCommandInfo[];
2669
- dependencies: string[];
2772
+ dependencies: Record<string, RegistryDependencyInfo>;
2670
2773
  }
2671
2774
 
2672
2775
  // Clip WS event data types
2673
- export type ClipInstalledData = Clip;
2776
+ export type ClipCreatedData = Clip;
2674
2777
  export type ClipUpdatedData = Clip;
2675
2778
  export interface ClipRemovedData {
2676
2779
  clip_id: string;