@parall/sdk 1.29.3 → 1.31.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/constants.ts CHANGED
@@ -116,6 +116,7 @@ export const ENDPOINTS = {
116
116
  `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
117
117
  ORG_MEMBER_TASKS: (orgId: string, memberId: string) =>
118
118
  `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
119
+ REF_SEARCH: (orgId: string) => `${API_BASE}/orgs/${orgId}/refs/search`,
119
120
 
120
121
  // Direct messages (org-scoped, atomic find-or-create + send)
121
122
  DM: (orgId: string) => `${API_BASE}/orgs/${orgId}/dm`,
@@ -179,6 +180,8 @@ export const ENDPOINTS = {
179
180
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/monitor`,
180
181
  AGENT_ME: (orgId: string) =>
181
182
  `${API_BASE}/orgs/${orgId}/agents/me`,
183
+ AGENT_NEW_SESSION: (orgId: string, agentId: string) =>
184
+ `${API_BASE}/orgs/${orgId}/agents/${agentId}/new-session`,
182
185
  AGENT_SESSIONS: (orgId: string, agentId: string) =>
183
186
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/sessions`,
184
187
  AGENT_SESSION: (orgId: string, agentId: string, sessionId: string) =>
@@ -254,6 +257,10 @@ export const ENDPOINTS = {
254
257
  `${API_BASE}/orgs/${orgId}/machines/${machineId}/runtime-auth-sessions`,
255
258
  MACHINE_RUNTIME_AUTH_SESSION_COMPLETE: (orgId: string, machineId: string, sessionId: string) =>
256
259
  `${API_BASE}/orgs/${orgId}/machines/${machineId}/runtime-auth-sessions/${sessionId}/complete`,
260
+ MACHINE_REQUEST_UPDATE: (orgId: string, machineId: string) =>
261
+ `${API_BASE}/orgs/${orgId}/machines/${machineId}/request-update`,
262
+ MACHINE_BROWSE: (orgId: string, machineId: string) =>
263
+ `${API_BASE}/orgs/${orgId}/machines/${machineId}/browse`,
257
264
 
258
265
  // Machine self-control-plane (mck_-scoped). The bearer token implicitly
259
266
  // identifies the Machine, so there is no `:mid` URL parameter — these are
@@ -266,6 +273,8 @@ export const ENDPOINTS = {
266
273
  MACHINES_ME_AGENT_WORKSPACE_STATE: (agentId: string) =>
267
274
  `${API_BASE}/machines/me/agents/${agentId}/workspace-state`,
268
275
  MACHINES_ME_WS_TICKET: `${API_BASE}/machines/me/ws/ticket`,
276
+ MACHINES_ME_BROWSE_RESPONSE: (requestId: string) =>
277
+ `${API_BASE}/machines/me/browse-response/${requestId}`,
269
278
 
270
279
  // Tasks (org-scoped)
271
280
  TASKS: (orgId: string) => `${API_BASE}/orgs/${orgId}/tasks`,
@@ -319,6 +328,16 @@ export const ENDPOINTS = {
319
328
  INVITATION_DECLINE: (id: string) => `${API_BASE}/invitations/${id}/decline`,
320
329
  INVITATION_BY_TOKEN: (token: string) => `${API_BASE}/invitations/by-token/${token}`,
321
330
 
331
+ // Org-level shareable invite link
332
+ ORG_INVITE_LINK: (orgId: string) => `${API_BASE}/orgs/${orgId}/invite-link`,
333
+ ORG_INVITE_LINK_REGENERATE: (orgId: string) =>
334
+ `${API_BASE}/orgs/${orgId}/invite-link/regenerate`,
335
+ ORG_INVITE_LINK_JOIN_REQUESTS: (orgId: string) =>
336
+ `${API_BASE}/orgs/${orgId}/invite-link/join-requests`,
337
+ ORG_INVITE_LINK_JOIN_REQUEST_DECIDE: (orgId: string, jrId: string) =>
338
+ `${API_BASE}/orgs/${orgId}/invite-link/join-requests/${jrId}/decide`,
339
+ INVITE_LINK_JOIN: `${API_BASE}/invite-link/join`,
340
+
322
341
  // Wikis (org-scoped, served by wiki-service)
323
342
  WIKIS: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis`,
324
343
  WIKI: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}`,
@@ -474,6 +493,8 @@ export const WS_EVENTS = {
474
493
  INVITATION_ACCEPTED: 'invitation.accepted',
475
494
  INVITATION_DECLINED: 'invitation.declined',
476
495
  INVITATION_REVOKED: 'invitation.revoked',
496
+ ORG_JOIN_REQUEST_NEW: 'org.join_request.new',
497
+ ORG_INVITE_LINK_JOINED: 'org.invite_link.joined',
477
498
  AGENT_CONFIG_UPDATE: 'agent_config.update',
478
499
  PRESENCE_UPDATE: 'presence.update',
479
500
  WIKI_CHANGESET_CREATED: 'wiki.changeset.created',
@@ -501,6 +522,10 @@ export const WS_EVENTS = {
501
522
  MACHINE_AGENT_DETACHED: 'machine.agent.detached',
502
523
  MACHINE_STOP: 'machine.stop',
503
524
  MACHINE_WORKSPACE_SETUP_REQUESTED: 'machine.workspace.setup.requested',
525
+ MACHINE_FILESYSTEM_BROWSE: 'machine.filesystem.browse',
526
+ MACHINE_UPDATE: 'machine.update',
527
+ MACHINE_CONFIG_UPDATED: 'machine.config.updated',
528
+ AGENT_NEW_SESSION: 'agent.new_session',
504
529
  } as const;
505
530
 
506
531
  // Canonical target URI builders for unified comments.
package/src/types.ts CHANGED
@@ -367,6 +367,51 @@ export interface InvitationPublicInfo {
367
367
  expires_at: string;
368
368
  }
369
369
 
370
+ // ---- Org-level shareable invite link ----
371
+
372
+ /** Single regenerable token per org. Sits alongside (not replacing) the
373
+ * per-email OrgInvitation flow. */
374
+ export interface OrgInviteLink {
375
+ org_id: string;
376
+ token: string;
377
+ require_approval: boolean;
378
+ created_at: string;
379
+ regenerated_at: string;
380
+ }
381
+
382
+ export interface JoinByLinkRequest {
383
+ token: string;
384
+ }
385
+
386
+ export interface JoinByLinkResponse {
387
+ org_id: string;
388
+ joined: boolean;
389
+ status: 'active' | 'pending_approval' | 'already_member';
390
+ join_request_id?: string;
391
+ /** Minimal org summary so the join page can render the real org name
392
+ * in success / pending-approval copy without a second round-trip. */
393
+ org?: JoinByLinkOrgInfo;
394
+ }
395
+
396
+ export interface JoinByLinkOrgInfo {
397
+ id: string;
398
+ name: string;
399
+ avatar_url?: string | null;
400
+ }
401
+
402
+ export type OrgJoinRequestStatus = 'pending' | 'approved' | 'rejected';
403
+
404
+ export interface OrgJoinRequest {
405
+ id: string;
406
+ org_id: string;
407
+ user_id: string;
408
+ status: OrgJoinRequestStatus;
409
+ decided_by?: string;
410
+ decided_at?: string;
411
+ created_at: string;
412
+ user?: User;
413
+ }
414
+
370
415
  export interface CreateInvitationRequest {
371
416
  email: string;
372
417
  role?: OrgMemberRole;
@@ -492,6 +537,7 @@ export interface SendMessageRequest {
492
537
  thread_root_id?: string;
493
538
  idempotency_key?: string;
494
539
  agent_step_id?: string;
540
+ agent_session_id?: string;
495
541
  hints?: MessageHints;
496
542
  }
497
543
 
@@ -503,6 +549,7 @@ export interface SendDirectMessageRequest {
503
549
  thread_root_id?: string;
504
550
  idempotency_key?: string;
505
551
  agent_step_id?: string;
552
+ agent_session_id?: string;
506
553
  hints?: MessageHints;
507
554
  }
508
555
 
@@ -569,11 +616,10 @@ export type AgentLLMSource = 'parall' | 'custom' | 'runtime_auth';
569
616
  * `llm_source` makes that source explicit. Missing values are backward-
570
617
  * compatible: empty config means Parall provided, while legacy rows with
571
618
  * credential fields but no source are inferred as custom. Custom provider
572
- * fields let admins bring their own ChatGPT / Anthropic subscription, point
573
- * at Azure OpenAI, or use an OpenAI / Anthropic-compatible proxy.
574
- * `runtime_auth` is the runtime-local sign-in path (Claude.ai OAuth today);
575
- * OAuth is the helper that writes credentials for that source, not model /
576
- * effort control.
619
+ * fields let admins bring their own OpenAI / Anthropic subscription, point
620
+ * at Azure OpenAI, or use an OpenAI / Anthropic-compatible proxy. Hosted
621
+ * runtime OAuth is no longer accepted; self-hosted daemon runtimes manage
622
+ * local CLI OAuth outside provider_config.
577
623
  *
578
624
  * Each runtime consumes exactly one credential family:
579
625
  * - codex → openai_*
@@ -648,6 +694,7 @@ export interface Machine {
648
694
  daemon_mode: boolean;
649
695
  llm_source?: string;
650
696
  compute_mode: 'hosted' | 'local';
697
+ daemon_version?: string | null;
651
698
  region: string | null;
652
699
  created_by: string;
653
700
  created_at: string;
@@ -803,6 +850,42 @@ export interface MachineStopData {
803
850
  reason?: string;
804
851
  }
805
852
 
853
+ export interface MachineFilesystemBrowseData {
854
+ machine_id: string;
855
+ request_id: string;
856
+ path: string;
857
+ }
858
+
859
+ export interface MachineUpdateData {
860
+ machine_id: string;
861
+ new_version: string;
862
+ mandatory: boolean;
863
+ reason?: string;
864
+ }
865
+
866
+ export interface AgentNewSessionData {
867
+ previous_session_id?: string;
868
+ }
869
+
870
+ export interface NewSessionResponse {
871
+ previous_session_id: string;
872
+ closed_count: number;
873
+ }
874
+
875
+ export interface FilesystemEntry {
876
+ name: string;
877
+ type: 'dir' | 'file';
878
+ size?: number;
879
+ modified_at?: string;
880
+ }
881
+
882
+ export interface BrowseMachineFilesystemResponse {
883
+ request_id: string;
884
+ path: string;
885
+ entries: FilesystemEntry[];
886
+ error?: string;
887
+ }
888
+
806
889
  /** Wrapper for `GET /machines/me/agents`. */
807
890
  export interface AttachedAgentsResponse {
808
891
  data: AttachedAgent[];
@@ -912,6 +995,24 @@ export interface TaskRelation {
912
995
  created_at: string;
913
996
  }
914
997
 
998
+ export type RefSearchKind = 'user' | 'task' | 'channel';
999
+
1000
+ export interface RefSearchItem {
1001
+ kind: RefSearchKind;
1002
+ id: string;
1003
+ uri: string;
1004
+ display: string;
1005
+ label: string;
1006
+ title: string;
1007
+ subtitle?: string;
1008
+ subtitle_key?: string;
1009
+ status?: string;
1010
+ }
1011
+
1012
+ export interface RefSearchResponse {
1013
+ data: RefSearchItem[];
1014
+ }
1015
+
915
1016
  export interface CreateTaskRequest {
916
1017
  title: string;
917
1018
  description?: string;
@@ -1646,6 +1747,13 @@ export interface AgentSessionDB {
1646
1747
  started_at: string;
1647
1748
  finished_at: string | null;
1648
1749
  created_at: string;
1750
+
1751
+ // Computed fields populated by ListSessions enrichment.
1752
+ trigger_chat_id?: string | null;
1753
+ trigger_chat_name?: string | null;
1754
+ trigger_chat_type?: string | null;
1755
+ trigger_sender_name?: string | null;
1756
+ step_count?: number | null;
1649
1757
  }
1650
1758
 
1651
1759
  export interface AgentStep {
@@ -1874,6 +1982,8 @@ export type WsEventMap = {
1874
1982
  'invitation.accepted': InvitationAcceptedEventData;
1875
1983
  'invitation.declined': InvitationDeclinedEventData;
1876
1984
  'invitation.revoked': InvitationRevokedEventData;
1985
+ 'org.join_request.new': OrgJoinRequestNewEventData;
1986
+ 'org.invite_link.joined': OrgInviteLinkJoinedEventData;
1877
1987
  'agent_config.update': AgentConfigUpdateData;
1878
1988
  'presence.update': PresenceUpdateData;
1879
1989
  'wiki.changeset.created': WikiChangesetCreatedData;
@@ -1902,6 +2012,9 @@ export type WsEventMap = {
1902
2012
  'machine.config.updated': MachineConfigUpdatedData;
1903
2013
  'machine.workspace.setup.requested': MachineWorkspaceSetupRequestedData;
1904
2014
  'machine.stop': MachineStopData;
2015
+ 'machine.filesystem.browse': MachineFilesystemBrowseData;
2016
+ 'machine.update': MachineUpdateData;
2017
+ 'agent.new_session': AgentNewSessionData;
1905
2018
  };
1906
2019
 
1907
2020
  // Invitation WS event data
@@ -1933,6 +2046,25 @@ export interface InvitationRevokedEventData {
1933
2046
  org_id: string;
1934
2047
  }
1935
2048
 
2049
+ /** Fan-out to org admins when an end-user submits a join-request via the
2050
+ * shareable org invite link. Mirrors the payload published by
2051
+ * publishJoinRequested in server/internal/api/handler/org_invite_link.go. */
2052
+ export interface OrgJoinRequestNewEventData {
2053
+ join_request_id: string;
2054
+ org_id: string;
2055
+ user_id: string;
2056
+ display_name: string;
2057
+ created_at: string;
2058
+ }
2059
+
2060
+ export interface OrgInviteLinkJoinedEventData {
2061
+ org_id: string;
2062
+ user_id: string;
2063
+ display_name: string;
2064
+ role: OrgMemberRole;
2065
+ source: 'invite_link';
2066
+ }
2067
+
1936
2068
  // ============================================================
1937
2069
  // Platform Config Types
1938
2070
  // ============================================================