@parall/sdk 1.20.0 → 1.20.2

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
@@ -30,13 +30,19 @@ export const ENDPOINTS = {
30
30
  ORG_MEMBERS_ONLINE: (orgId: string) => `${API_BASE}/orgs/${orgId}/members/online`,
31
31
  ORG_MEMBER: (orgId: string, userId: string) =>
32
32
  `${API_BASE}/orgs/${orgId}/members/${userId}`,
33
+ ORG_MEMBER_CHATS: (orgId: string, memberId: string) =>
34
+ `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
35
+ ORG_MEMBER_TASKS: (orgId: string, memberId: string) =>
36
+ `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
33
37
 
34
38
  // Direct messages (org-scoped, atomic find-or-create + send)
35
39
  DM: (orgId: string) => `${API_BASE}/orgs/${orgId}/dm`,
36
40
 
37
41
  // Chats (org-scoped)
38
42
  CHATS: (orgId: string) => `${API_BASE}/orgs/${orgId}/chats`,
43
+ CHATS_DISCOVERABLE: (orgId: string) => `${API_BASE}/orgs/${orgId}/chats/discoverable`,
39
44
  CHAT: (orgId: string, chatId: string) => `${API_BASE}/orgs/${orgId}/chats/${chatId}`,
45
+ CHAT_JOIN: (orgId: string, chatId: string) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/join`,
40
46
  CHAT_ARCHIVE: (orgId: string, chatId: string) =>
41
47
  `${API_BASE}/orgs/${orgId}/chats/${chatId}/archive`,
42
48
  CHAT_RESTORE: (orgId: string, chatId: string) =>
@@ -81,6 +87,8 @@ export const ENDPOINTS = {
81
87
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/sessions/${sessionId}`,
82
88
  AGENT_SESSION_STEPS: (orgId: string, agentId: string, sessionId: string) =>
83
89
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/sessions/${sessionId}/steps`,
90
+ AGENT_SESSION_STEP: (orgId: string, agentId: string, sessionId: string, stepId: string) =>
91
+ `${API_BASE}/orgs/${orgId}/agents/${agentId}/sessions/${sessionId}/steps/${stepId}`,
84
92
  AGENT_TASKS: (orgId: string, agentId: string) =>
85
93
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/tasks`,
86
94
  AGENT_RUNTIME_AUTH: (orgId: string, agentId: string) =>
@@ -99,6 +107,8 @@ export const ENDPOINTS = {
99
107
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime/upgrade`,
100
108
  AGENT_RUNTIME_AVAILABLE_TAGS: (orgId: string, agentId: string) =>
101
109
  `${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime/available-tags`,
110
+ AGENT_RUNTIME_RELEASE: (orgId: string, agentId: string, tag: string) =>
111
+ `${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime/releases/${encodeURIComponent(tag)}`,
102
112
  // Machines (org-scoped)
103
113
  MACHINES: (orgId: string) => `${API_BASE}/orgs/${orgId}/machines`,
104
114
  MACHINE: (orgId: string, machineId: string) =>
@@ -132,6 +142,8 @@ export const ENDPOINTS = {
132
142
  `${API_BASE}/orgs/${orgId}/tasks/${taskId}/relations`,
133
143
  TASK_RELATION: (orgId: string, taskId: string, relId: string) =>
134
144
  `${API_BASE}/orgs/${orgId}/tasks/${taskId}/relations/${relId}`,
145
+ TASK_RELATIONS_BY_TARGET: (orgId: string) =>
146
+ `${API_BASE}/orgs/${orgId}/task-relations`,
135
147
  TASK_COMMENTS: (orgId: string, taskId: string) =>
136
148
  `${API_BASE}/orgs/${orgId}/tasks/${taskId}/comments`,
137
149
  TASK_COMMENT: (orgId: string, taskId: string, commentId: string) =>
@@ -143,6 +155,15 @@ export const ENDPOINTS = {
143
155
  PROJECTS: (orgId: string) => `${API_BASE}/orgs/${orgId}/projects`,
144
156
  PROJECT: (orgId: string, projectId: string) => `${API_BASE}/orgs/${orgId}/projects/${projectId}`,
145
157
 
158
+ // Schedules (org-scoped, platform time trigger primitive)
159
+ SCHEDULES: (orgId: string) => `${API_BASE}/orgs/${orgId}/schedules`,
160
+ SCHEDULE: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}`,
161
+ SCHEDULE_PAUSE: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/pause`,
162
+ SCHEDULE_RESUME: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/resume`,
163
+ SCHEDULE_CANCEL: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/cancel`,
164
+ SCHEDULE_RUNS: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/runs`,
165
+ SCHEDULE_RUN: (orgId: string, runId: string) => `${API_BASE}/orgs/${orgId}/schedule_runs/${runId}`,
166
+
146
167
  // Invitations (org-scoped, admin)
147
168
  ORG_INVITATIONS: (orgId: string) => `${API_BASE}/orgs/${orgId}/invitations`,
148
169
  ORG_INVITATION: (orgId: string, invId: string) =>
@@ -296,6 +317,10 @@ export const WS_EVENTS = {
296
317
  INBOX_BULK_UPDATE: 'inbox.bulk_update',
297
318
  READ_POSITION_UPDATED: 'read_position.updated',
298
319
  DISPATCH_NEW: 'dispatch.new',
320
+ SCHEDULE_CREATED: 'schedule.created',
321
+ SCHEDULE_UPDATED: 'schedule.updated',
322
+ SCHEDULE_DELETED: 'schedule.deleted',
323
+ SCHEDULE_FIRED: 'schedule.fired',
299
324
  } as const;
300
325
 
301
326
  // Canonical target URI builders for unified comments.
package/src/types.ts CHANGED
@@ -20,6 +20,7 @@ export interface User {
20
20
 
21
21
  export type ChatType = 'direct' | 'group';
22
22
  export type AgentRoutingMode = 'passive' | 'active' | 'smart';
23
+ export type ChatVisibility = 'public' | 'private';
23
24
 
24
25
  export interface Chat {
25
26
  id: string;
@@ -28,7 +29,12 @@ export interface Chat {
28
29
  name: string | null;
29
30
  avatar_url: string | null;
30
31
  description: string | null;
32
+ visibility: ChatVisibility;
31
33
  agent_routing_mode: AgentRoutingMode;
34
+ /** Chat-level smart routing override. NULL = use org default. */
35
+ smart_routing_strategy: string | null;
36
+ /** Chat-level smart routing agent override. NULL = use org default. */
37
+ smart_routing_agent_id: string | null;
32
38
  last_message_at: string | null;
33
39
  last_message_preview: string | null;
34
40
  last_message_sender: string | null;
@@ -263,12 +269,10 @@ export interface Organization {
263
269
  avatar_url: string | null;
264
270
  is_personal: boolean;
265
271
  member_limit: number | null;
266
- /**
267
- * User ID of the agent assigned as this org's smart-mode routing handler.
268
- * NULL = smart mode degrades to passive (no auto-dispatch to a router).
269
- * See docs/engineering-design/org-agent-design.md.
270
- */
271
- org_agent_user_id: string | null;
272
+ /** Org-level default smart routing strategy: 'llm' | 'agent' | null. */
273
+ smart_routing_strategy: string | null;
274
+ /** Agent ID for strategy='agent'. NULL when strategy is 'llm' or unset. */
275
+ smart_routing_agent_id: string | null;
272
276
  created_at: string;
273
277
  }
274
278
 
@@ -407,8 +411,21 @@ export interface CreateChatRequest {
407
411
  org_id: string;
408
412
  name?: string;
409
413
  description?: string;
414
+ visibility?: ChatVisibility;
410
415
  member_ids: string[];
411
416
  agent_routing_mode?: AgentRoutingMode;
417
+ smart_routing_strategy?: string;
418
+ smart_routing_agent_id?: string;
419
+ }
420
+
421
+ export interface DiscoverableChat {
422
+ id: string;
423
+ name: string | null;
424
+ description: string | null;
425
+ avatar_url: string | null;
426
+ member_count: number;
427
+ last_message_at: string | null;
428
+ created_at: string;
412
429
  }
413
430
 
414
431
  export interface MessageHints {
@@ -534,7 +551,7 @@ export interface FileUrlResponse {
534
551
 
535
552
  export type TaskStatus = 'todo' | 'in_progress' | 'in_review' | 'done' | 'canceled';
536
553
  export type TaskPriority = 'high' | 'normal' | 'low';
537
- export type TaskRelationTargetType = 'task' | 'message' | 'chat' | 'agent_session';
554
+ export type TaskRelationTargetType = 'task' | 'message' | 'chat' | 'agent_session' | 'wiki_changeset';
538
555
  export type TaskRelationType = 'blocks' | 'related' | 'duplicate' | 'source' | 'reference' | 'discussion' | 'execution';
539
556
 
540
557
  export interface Task {
@@ -660,6 +677,123 @@ export interface UpdateProjectRequest {
660
677
  sort_order?: number;
661
678
  }
662
679
 
680
+ // ============================================================
681
+ // Schedule Types
682
+ // ============================================================
683
+
684
+ export type ScheduleSpecType = 'cron' | 'interval' | 'one_shot';
685
+ export type ScheduleStatus = 'active' | 'paused' | 'completed' | 'cancelled';
686
+ export type ScheduleCancelReason = 'user_cancel' | 'attached_gone' | 'target_ineligible';
687
+ export type ScheduleRunStatus = 'delivered' | 'missed' | 'failed';
688
+
689
+ export interface Schedule {
690
+ id: string;
691
+ org_id: string;
692
+ creator_id: string;
693
+ target_id: string;
694
+ attached_to_uri: string | null;
695
+ name: string;
696
+ description: string;
697
+ spec_type: ScheduleSpecType;
698
+ cron_expr: string | null;
699
+ interval_seconds: number | null;
700
+ run_at: string | null;
701
+ timezone: string;
702
+ start_at: string | null;
703
+ end_at: string | null;
704
+ max_runs: number | null;
705
+ catchup_window_seconds: number;
706
+ status: ScheduleStatus;
707
+ cancel_reason: ScheduleCancelReason | null;
708
+ next_fire_at: string | null;
709
+ last_fire_at: string | null;
710
+ run_count: number;
711
+ created_at: string;
712
+ updated_at: string;
713
+ }
714
+
715
+ export interface ScheduleRun {
716
+ id: string;
717
+ schedule_id: string;
718
+ scheduled_fire_at: string;
719
+ actual_fired_at: string;
720
+ status: ScheduleRunStatus;
721
+ fired_description: string | null;
722
+ fired_attached_uri: string | null;
723
+ dispatch_event_id: string | null;
724
+ inbox_item_id: string | null;
725
+ error: string | null;
726
+ created_at: string;
727
+ }
728
+
729
+ export interface CreateScheduleInput {
730
+ name: string;
731
+ description: string;
732
+ target_id: string;
733
+ attached_to_uri?: string;
734
+ spec_type: ScheduleSpecType;
735
+ cron_expr?: string;
736
+ interval_seconds?: number;
737
+ run_at?: string;
738
+ timezone?: string;
739
+ start_at?: string;
740
+ end_at?: string;
741
+ max_runs?: number;
742
+ catchup_window_seconds?: number;
743
+ }
744
+
745
+ export interface UpdateScheduleInput {
746
+ name?: string;
747
+ description?: string;
748
+ target_id?: string;
749
+ attached_to_uri?: string;
750
+ /** Explicitly clear attached_to_uri. Server honors this over `attached_to_uri`. */
751
+ attached_to_uri_clear?: boolean;
752
+ cron_expr?: string;
753
+ interval_seconds?: number;
754
+ run_at?: string;
755
+ timezone?: string;
756
+ start_at?: string;
757
+ /** Explicitly clear start_at. Server honors this over `start_at`. */
758
+ start_at_clear?: boolean;
759
+ end_at?: string;
760
+ /** Explicitly clear end_at. Server honors this over `end_at`. */
761
+ end_at_clear?: boolean;
762
+ max_runs?: number;
763
+ /** Explicitly clear max_runs. Server honors this over `max_runs`. */
764
+ max_runs_clear?: boolean;
765
+ catchup_window_seconds?: number;
766
+ }
767
+
768
+ export interface ScheduleFilters {
769
+ attached_to?: string;
770
+ target_id?: string;
771
+ creator_id?: string;
772
+ /** Comma-separated list of statuses (e.g. 'active,paused'). */
773
+ status?: string;
774
+ cursor?: string;
775
+ limit?: number;
776
+ }
777
+
778
+ export interface ScheduleRunFilters {
779
+ cursor?: string;
780
+ limit?: number;
781
+ }
782
+
783
+ // Schedule WS event data
784
+ export type ScheduleCreatedData = Schedule;
785
+ export type ScheduleUpdatedData = Schedule;
786
+ export interface ScheduleDeletedData {
787
+ schedule_id: string;
788
+ org_id: string;
789
+ }
790
+ export interface ScheduleFiredData {
791
+ schedule_id: string;
792
+ run_id: string;
793
+ scheduled_fire_at: string;
794
+ actual_fired_at: string;
795
+ }
796
+
663
797
  // ============================================================
664
798
  // Wiki Types
665
799
  // ============================================================
@@ -1033,7 +1167,7 @@ export interface ChatCreatedData extends Chat {}
1033
1167
 
1034
1168
  export interface ChatUpdateData {
1035
1169
  chat_id: string;
1036
- changes: Partial<Pick<Chat, 'name' | 'avatar_url' | 'description' | 'agent_routing_mode' | 'last_message_at' | 'last_message_preview' | 'last_message_sender' | 'archived_at' | 'deleted_at'>>;
1170
+ changes: Partial<Pick<Chat, 'name' | 'avatar_url' | 'description' | 'visibility' | 'agent_routing_mode' | 'smart_routing_strategy' | 'smart_routing_agent_id' | 'last_message_at' | 'last_message_preview' | 'last_message_sender' | 'archived_at' | 'deleted_at'>>;
1037
1171
  }
1038
1172
 
1039
1173
  export interface ChatDeletedData {
@@ -1208,6 +1342,7 @@ export interface Comment {
1208
1342
  author_id: string;
1209
1343
  body: string;
1210
1344
  mentions?: Mention[];
1345
+ hints?: MessageHints | null;
1211
1346
  agent_step_id?: string | null;
1212
1347
  created_at: string;
1213
1348
  updated_at: string;
@@ -1238,7 +1373,7 @@ export interface CommentDeletedData {
1238
1373
  export type InboxItemType =
1239
1374
  | 'mention' | 'task_assign' | 'task_update'
1240
1375
  | 'task_comment' | 'approval_request'
1241
- | 'agent_alert' | 'invitation';
1376
+ | 'agent_alert' | 'invitation' | 'schedule_fire';
1242
1377
 
1243
1378
  export interface InboxItem {
1244
1379
  id: string;
@@ -1266,7 +1401,7 @@ export interface InboxItem {
1266
1401
  // Dispatch Types (agent event delivery)
1267
1402
  // ============================================================
1268
1403
 
1269
- export type DispatchEventType = 'message' | 'task_assign' | 'task_comment';
1404
+ export type DispatchEventType = 'message' | 'task_assign' | 'task_comment' | 'schedule.fire';
1270
1405
  export type DispatchStatus = 'pending' | 'acked';
1271
1406
 
1272
1407
  export interface DispatchEvent {
@@ -1368,6 +1503,10 @@ export type WsEventMap = {
1368
1503
  'inbox.bulk_update': InboxBulkUpdateData;
1369
1504
  'read_position.updated': ReadPositionUpdateData;
1370
1505
  'dispatch.new': DispatchNewData;
1506
+ 'schedule.created': ScheduleCreatedData;
1507
+ 'schedule.updated': ScheduleUpdatedData;
1508
+ 'schedule.deleted': ScheduleDeletedData;
1509
+ 'schedule.fired': ScheduleFiredData;
1371
1510
  };
1372
1511
 
1373
1512
  // Invitation WS event data
@@ -1567,6 +1706,21 @@ export interface RuntimeAvailableTag {
1567
1706
  pushed_at: string; // RFC3339
1568
1707
  }
1569
1708
 
1709
+ export type RuntimeCompatibilityLevel = 'compatible' | 'attention' | 'breaking';
1710
+
1711
+ export interface RuntimeRelease {
1712
+ tag: string;
1713
+ version?: string;
1714
+ runtime_type: string;
1715
+ published_at: string; // RFC3339
1716
+ summary: string;
1717
+ compatibility_level: RuntimeCompatibilityLevel;
1718
+ highlights: string[];
1719
+ breaking_changes: string[];
1720
+ admin_actions: string[];
1721
+ notes_url?: string;
1722
+ }
1723
+
1570
1724
  export interface SetRuntimeModeRequest {
1571
1725
  update_mode: RuntimeUpdateMode;
1572
1726
  pinned_tag?: string | null;