@parall/sdk 1.12.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.
@@ -0,0 +1,1130 @@
1
+ export type UserType = 'human' | 'agent';
2
+ export type UserStatus = 'active' | 'disabled';
3
+ export interface User {
4
+ id: string;
5
+ type: UserType;
6
+ display_name: string;
7
+ avatar_url: string | null;
8
+ email: string | null;
9
+ phone: string | null;
10
+ status: UserStatus;
11
+ email_verified: boolean;
12
+ last_seen_at: string | null;
13
+ created_at: string;
14
+ }
15
+ export type ChatType = 'direct' | 'group';
16
+ export type AgentRoutingMode = 'passive' | 'active' | 'smart';
17
+ export interface Chat {
18
+ id: string;
19
+ type: ChatType;
20
+ org_id: string;
21
+ name: string | null;
22
+ avatar_url: string | null;
23
+ description: string | null;
24
+ agent_routing_mode: AgentRoutingMode;
25
+ last_message_at: string | null;
26
+ last_message_preview: string | null;
27
+ last_message_sender: string | null;
28
+ creator_id: string;
29
+ created_at: string;
30
+ updated_at: string;
31
+ }
32
+ export type ChatMemberRole = 'owner' | 'admin' | 'member';
33
+ export type NotificationLevel = 'all' | 'mentions_only' | 'none';
34
+ export interface PushSubscribeRequest {
35
+ platform: 'web' | 'ios' | 'android';
36
+ token: string;
37
+ device_id?: string;
38
+ }
39
+ export interface NotifPrefs {
40
+ dm?: boolean;
41
+ mention?: boolean;
42
+ task_assign?: boolean;
43
+ }
44
+ export interface NotificationPreferences {
45
+ scope: string;
46
+ prefs: NotifPrefs;
47
+ updated_at: string;
48
+ }
49
+ export interface ChatMember {
50
+ chat_id: string;
51
+ user_id: string;
52
+ role: ChatMemberRole;
53
+ notification_level: NotificationLevel;
54
+ pinned: boolean;
55
+ joined_at: string;
56
+ user?: User;
57
+ }
58
+ export type MessageType = 'text' | 'file' | 'tool_call' | 'tool_result' | 'approval_card' | 'state_delta' | 'card' | 'system';
59
+ export declare const MENTION_ALL_USER_ID = "all";
60
+ export interface Mention {
61
+ user_id: string;
62
+ offset: number;
63
+ length: number;
64
+ }
65
+ export interface LinkPreview {
66
+ url: string;
67
+ title?: string;
68
+ image?: string;
69
+ description?: string;
70
+ }
71
+ export interface TextContent {
72
+ text: string;
73
+ format?: string;
74
+ mentions?: Mention[];
75
+ link_previews?: LinkPreview[];
76
+ }
77
+ export interface MediaContent {
78
+ attachment_id: string;
79
+ file_name: string;
80
+ file_size: number;
81
+ mime_type: string;
82
+ width?: number;
83
+ height?: number;
84
+ duration?: number;
85
+ caption?: string;
86
+ }
87
+ export interface ToolCallContent {
88
+ tool_name: string;
89
+ tool_input: Record<string, unknown>;
90
+ status: string;
91
+ started_at: string;
92
+ }
93
+ export interface ToolResultContent {
94
+ tool_call_id: string;
95
+ tool_name: string;
96
+ status: string;
97
+ output: string;
98
+ duration_ms: number;
99
+ collapsible: boolean;
100
+ }
101
+ export interface ApprovalOption {
102
+ key: string;
103
+ label: string;
104
+ style: 'primary' | 'danger' | 'secondary';
105
+ }
106
+ export interface ApprovalCardContent {
107
+ approval_id: string;
108
+ title: string;
109
+ description: string;
110
+ action_type: string;
111
+ action_payload: Record<string, unknown>;
112
+ risk_level: string;
113
+ status: string;
114
+ options: ApprovalOption[];
115
+ expires_at: string;
116
+ }
117
+ export type CardContent = {
118
+ card_type: 'approval';
119
+ data: ApprovalCardContent;
120
+ approval_id?: string;
121
+ } | {
122
+ card_type: string;
123
+ data: Record<string, unknown>;
124
+ approval_id?: string;
125
+ };
126
+ export type AgentState = 'thinking' | 'tool_calling' | 'streaming' | 'waiting_approval' | 'completed' | 'error';
127
+ export interface StateDeltaContent {
128
+ state: AgentState;
129
+ text: string;
130
+ progress: number;
131
+ collapsible: boolean;
132
+ }
133
+ export type SystemEvent = 'chat_created' | 'member_added' | 'member_removed' | 'member_role_changed' | 'chat_renamed' | 'chat_avatar_changed';
134
+ export interface SystemContent {
135
+ event: SystemEvent;
136
+ actor_id: string;
137
+ actor_name: string;
138
+ target_id?: string;
139
+ target_name?: string;
140
+ }
141
+ export type MessageContent = TextContent | MediaContent | ToolCallContent | ToolResultContent | ApprovalCardContent | StateDeltaContent | SystemContent | IssueProjectionContent | CardContent;
142
+ export interface Message {
143
+ id: string;
144
+ chat_id: string;
145
+ sender_id: string;
146
+ sender?: User;
147
+ thread_root_id: string | null;
148
+ message_type: MessageType;
149
+ content: MessageContent;
150
+ version: number;
151
+ reply_count: number;
152
+ edited_at: string | null;
153
+ deleted_at: string | null;
154
+ created_at: string;
155
+ idempotency_key: string | null;
156
+ agent_step_id?: string | null;
157
+ hints?: MessageHints | null;
158
+ }
159
+ export interface Attachment {
160
+ id: string;
161
+ org_id: string;
162
+ uploader_id: string;
163
+ file_name: string;
164
+ file_size: number;
165
+ mime_type: string;
166
+ storage_key: string;
167
+ status: 'pending' | 'uploaded';
168
+ width: number | null;
169
+ height: number | null;
170
+ thumbnail_key: string | null;
171
+ created_at: string;
172
+ }
173
+ export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
174
+ export interface Approval {
175
+ id: string;
176
+ message_id: string;
177
+ chat_id: string;
178
+ requester_id: string;
179
+ status: ApprovalStatus;
180
+ action_type: string;
181
+ action_payload: Record<string, unknown>;
182
+ decided_by: string | null;
183
+ decided_at: string | null;
184
+ expires_at: string | null;
185
+ created_at: string;
186
+ }
187
+ export type OrgMemberRole = 'owner' | 'admin' | 'member';
188
+ export interface Organization {
189
+ id: string;
190
+ name: string;
191
+ avatar_url: string | null;
192
+ is_personal: boolean;
193
+ created_at: string;
194
+ }
195
+ export interface OrgMember {
196
+ org_id: string;
197
+ user_id: string;
198
+ role: OrgMemberRole;
199
+ joined_at: string;
200
+ user?: User;
201
+ }
202
+ export type InvitationStatus = 'pending' | 'accepted' | 'declined';
203
+ export interface OrgInvitation {
204
+ id: string;
205
+ org_id: string;
206
+ email: string;
207
+ role: OrgMemberRole;
208
+ status: InvitationStatus;
209
+ inviter_id: string;
210
+ expires_at: string;
211
+ accepted_at: string | null;
212
+ created_at: string;
213
+ inviter?: User;
214
+ org?: Organization;
215
+ }
216
+ export interface InvitationPublicInfo {
217
+ id: string;
218
+ org_name: string;
219
+ org_avatar_url: string | null;
220
+ inviter_name: string;
221
+ email: string;
222
+ role: OrgMemberRole;
223
+ expires_at: string;
224
+ }
225
+ export interface CreateInvitationRequest {
226
+ email: string;
227
+ role?: OrgMemberRole;
228
+ }
229
+ export interface ApiKey {
230
+ id: string;
231
+ key: string;
232
+ agent_id: string;
233
+ created_at: string;
234
+ }
235
+ export interface CreateAgentResponse {
236
+ user: User;
237
+ api_key: string;
238
+ machine?: Machine;
239
+ }
240
+ export interface UnreadCount {
241
+ chat_id: string;
242
+ unread_count: number;
243
+ last_read_message_id: string;
244
+ last_read_at: string;
245
+ }
246
+ export interface PaginatedResponse<T> {
247
+ data: T[];
248
+ has_more: boolean;
249
+ next_cursor?: string;
250
+ }
251
+ export interface ErrorResponse {
252
+ error: string;
253
+ code: string;
254
+ details?: Record<string, unknown>;
255
+ }
256
+ export interface AuthTokens {
257
+ access_token: string;
258
+ refresh_token: string;
259
+ user: User;
260
+ }
261
+ export interface RegisterResponse {
262
+ email: string;
263
+ }
264
+ export interface CheckEmailResponse {
265
+ exists: boolean;
266
+ }
267
+ export interface PresignResponse {
268
+ upload_url: string;
269
+ attachment_id: string;
270
+ expires_in: number;
271
+ }
272
+ export interface WsTicketResponse {
273
+ ticket: string;
274
+ expires_at: string;
275
+ ws_url: string;
276
+ }
277
+ export interface RegisterRequest {
278
+ email: string;
279
+ password: string;
280
+ display_name: string;
281
+ }
282
+ export interface LoginRequest {
283
+ email: string;
284
+ password: string;
285
+ }
286
+ export interface CreateChatRequest {
287
+ type: ChatType;
288
+ org_id: string;
289
+ name?: string;
290
+ description?: string;
291
+ member_ids: string[];
292
+ agent_routing_mode?: AgentRoutingMode;
293
+ }
294
+ export interface MessageHints {
295
+ no_reply?: boolean;
296
+ }
297
+ export interface SendMessageRequest {
298
+ message_type: MessageType;
299
+ content: MessageContent;
300
+ thread_root_id?: string;
301
+ idempotency_key?: string;
302
+ agent_step_id?: string;
303
+ hints?: MessageHints;
304
+ }
305
+ export interface SendDirectMessageRequest {
306
+ user_id: string;
307
+ message_type: MessageType;
308
+ content: MessageContent;
309
+ thread_root_id?: string;
310
+ idempotency_key?: string;
311
+ agent_step_id?: string;
312
+ hints?: MessageHints;
313
+ }
314
+ export interface DirectMessageResponse {
315
+ chat: Chat;
316
+ message: Message;
317
+ }
318
+ export interface PatchMessageRequest {
319
+ version: number;
320
+ ops: JsonPatchOp[];
321
+ }
322
+ export interface JsonPatchOp {
323
+ op: 'replace' | 'add';
324
+ path: string;
325
+ value: unknown;
326
+ }
327
+ export interface WorkspaceFiles {
328
+ soul_md?: string;
329
+ agents_md?: string;
330
+ tools_md?: string;
331
+ }
332
+ export interface CreateAgentRequest {
333
+ display_name: string;
334
+ agent_provider?: string;
335
+ agent_endpoint?: string;
336
+ agent_model?: string;
337
+ agent_permissions?: string[];
338
+ runtime_type?: string;
339
+ machine_type?: string;
340
+ machine_label?: string;
341
+ workspace?: WorkspaceFiles;
342
+ }
343
+ export type MachineStatus = 'provisioning' | 'starting' | 'running' | 'stopped' | 'error' | 'terminated';
344
+ export interface Machine {
345
+ id: string;
346
+ org_id: string;
347
+ label: string;
348
+ status: MachineStatus;
349
+ compute_provider: string;
350
+ runtime_type: string;
351
+ region: string | null;
352
+ created_by: string;
353
+ created_at: string;
354
+ updated_at: string;
355
+ }
356
+ export interface RunConfig {
357
+ intermediate_text?: 'step_only' | 'chat';
358
+ }
359
+ export interface AgentProfile {
360
+ user_id: string;
361
+ provider: string | null;
362
+ endpoint: string | null;
363
+ model: string | null;
364
+ permissions: string[];
365
+ machine_id: string | null;
366
+ runtime_type: string;
367
+ run_config?: RunConfig;
368
+ created_by: string;
369
+ created_at: string;
370
+ }
371
+ export interface AgentPresence {
372
+ online: boolean;
373
+ status: string;
374
+ session_id?: string;
375
+ telemetry?: Record<string, unknown>;
376
+ }
377
+ export interface AgentWithRuntime extends User {
378
+ agent_profile?: AgentProfile | null;
379
+ machine?: Machine | null;
380
+ presence?: AgentPresence | null;
381
+ }
382
+ export interface PresignUploadRequest {
383
+ file_name: string;
384
+ file_size: number;
385
+ mime_type: string;
386
+ }
387
+ export interface FileUrlResponse {
388
+ url: string;
389
+ expires_in: number;
390
+ width?: number;
391
+ height?: number;
392
+ }
393
+ export type TaskStatus = 'todo' | 'in_progress' | 'in_review' | 'done' | 'canceled';
394
+ export type TaskPriority = 'high' | 'normal' | 'low';
395
+ export type TaskRelationTargetType = 'task' | 'message' | 'chat' | 'agent_session';
396
+ export type TaskRelationType = 'blocks' | 'related' | 'duplicate' | 'source' | 'reference' | 'discussion' | 'execution';
397
+ export interface Task {
398
+ id: string;
399
+ org_id: string;
400
+ title: string;
401
+ description: string | null;
402
+ status: TaskStatus;
403
+ priority: TaskPriority;
404
+ assignee_id: string | null;
405
+ creator_id: string;
406
+ parent_id: string | null;
407
+ project_id: string | null;
408
+ seq_number: number | null;
409
+ identifier: string | null;
410
+ sort_order: number;
411
+ assignee?: User;
412
+ creator?: User;
413
+ created_at: string;
414
+ updated_at: string;
415
+ started_at: string | null;
416
+ completed_at: string | null;
417
+ canceled_at: string | null;
418
+ }
419
+ /** Content shape for system messages that project issue operations into chat. */
420
+ export interface IssueProjectionContent {
421
+ event: 'issue_created' | 'issue_status_changed' | 'issue_assigned';
422
+ actor_id: string;
423
+ actor_name: string;
424
+ issue_id: string;
425
+ identifier: string;
426
+ title: string;
427
+ old_status?: string;
428
+ new_status?: string;
429
+ assignee_id?: string;
430
+ assignee_name?: string;
431
+ }
432
+ export interface TaskRelation {
433
+ id: string;
434
+ task_id: string;
435
+ target_type: TaskRelationTargetType;
436
+ target_id: string;
437
+ relation_type: TaskRelationType;
438
+ created_by: string;
439
+ created_at: string;
440
+ }
441
+ export interface CreateTaskRequest {
442
+ title: string;
443
+ description?: string;
444
+ status?: TaskStatus;
445
+ priority?: TaskPriority;
446
+ assignee_id?: string;
447
+ parent_id?: string;
448
+ project_id?: string;
449
+ source_chat_id?: string;
450
+ sort_order?: number;
451
+ }
452
+ export interface UpdateTaskRequest {
453
+ title?: string;
454
+ description?: string;
455
+ status?: TaskStatus;
456
+ priority?: TaskPriority;
457
+ assignee_id?: string | null;
458
+ parent_id?: string | null;
459
+ project_id?: string | null;
460
+ sort_order?: number;
461
+ }
462
+ export interface CreateTaskRelationRequest {
463
+ target_type: TaskRelationTargetType;
464
+ target_id: string;
465
+ relation_type: TaskRelationType;
466
+ }
467
+ export type ProjectStatus = 'active' | 'paused' | 'completed' | 'archived';
468
+ export interface Project {
469
+ id: string;
470
+ org_id: string;
471
+ name: string;
472
+ key: string;
473
+ description: string | null;
474
+ lead_id: string | null;
475
+ status: ProjectStatus;
476
+ color: string | null;
477
+ sort_order: number;
478
+ created_at: string;
479
+ updated_at: string;
480
+ }
481
+ export interface CreateProjectRequest {
482
+ name: string;
483
+ key?: string;
484
+ description?: string;
485
+ lead_id?: string;
486
+ color?: string;
487
+ }
488
+ export interface UpdateProjectRequest {
489
+ name?: string;
490
+ key?: string;
491
+ description?: string | null;
492
+ lead_id?: string | null;
493
+ status?: ProjectStatus;
494
+ color?: string | null;
495
+ sort_order?: number;
496
+ }
497
+ export type WikiChangesetStatus = 'draft' | 'proposed' | 'approval_pending' | 'approved' | 'rejected' | 'merged' | 'closed' | 'superseded';
498
+ export interface Wiki {
499
+ id: string;
500
+ org_id: string;
501
+ slug: string;
502
+ name: string;
503
+ repo_owner: string;
504
+ repo_name: string;
505
+ default_branch: string;
506
+ created_by: string;
507
+ created_at: string;
508
+ updated_at: string;
509
+ }
510
+ export interface WikiFileChange {
511
+ path: string;
512
+ action: 'create' | 'update' | 'delete';
513
+ }
514
+ export interface WikiChangeset {
515
+ id: string;
516
+ wiki_id: string;
517
+ title: string;
518
+ message: string | null;
519
+ status: WikiChangesetStatus;
520
+ merge_commit: string | null;
521
+ file_changes: WikiFileChange[];
522
+ changed_paths: string[];
523
+ approval_id: string | null;
524
+ source_chat_id: string | null;
525
+ source_message_id: string | null;
526
+ source_run_id: string | null;
527
+ last_error: string | null;
528
+ created_by: string;
529
+ created_at: string;
530
+ updated_at: string;
531
+ }
532
+ export interface WikiTreeEntry {
533
+ name: string;
534
+ path: string;
535
+ type: 'tree' | 'blob';
536
+ size?: number;
537
+ }
538
+ export interface WikiTreeResponse {
539
+ data: WikiTreeEntry[];
540
+ path: string;
541
+ }
542
+ export interface WikiFileManifestEntry {
543
+ path: string;
544
+ sha256: string;
545
+ size: number;
546
+ version: number;
547
+ updated_at: string;
548
+ }
549
+ export interface WikiNodeSection {
550
+ wiki_id: string;
551
+ wiki_slug: string;
552
+ wiki_name: string;
553
+ node_id: string;
554
+ path: string;
555
+ title: string;
556
+ heading_path?: string[];
557
+ section_path: string;
558
+ level: number;
559
+ start_line: number;
560
+ end_line: number;
561
+ content: string;
562
+ }
563
+ export interface WikiNodeSectionArtifact {
564
+ version: number;
565
+ generated_at: string;
566
+ wiki_id: string;
567
+ wiki_slug: string;
568
+ wiki_name: string;
569
+ ref: string;
570
+ manifest_digest: string;
571
+ file_count: number;
572
+ nodes: WikiNodeSection[];
573
+ }
574
+ export interface WikiSearchResult {
575
+ wiki_id: string;
576
+ wiki_slug: string;
577
+ wiki_name: string;
578
+ node_id: string;
579
+ path: string;
580
+ title: string;
581
+ heading_path?: string[];
582
+ section_path: string;
583
+ level: number;
584
+ start_line: number;
585
+ end_line: number;
586
+ score: number;
587
+ snippet: string;
588
+ }
589
+ export interface WikiSearchResponse {
590
+ wiki_id: string;
591
+ wiki_slug: string;
592
+ wiki_name: string;
593
+ query: string;
594
+ ref: string;
595
+ results: WikiSearchResult[];
596
+ }
597
+ export interface WikiPageIndexEntry {
598
+ path: string;
599
+ title: string;
600
+ top_headings: string[];
601
+ size_bytes: number;
602
+ section_count: number;
603
+ }
604
+ export interface WikiPageIndex {
605
+ wiki_id: string;
606
+ wiki_slug: string;
607
+ wiki_name: string;
608
+ ref: string;
609
+ generated_at: string;
610
+ page_count: number;
611
+ pages: WikiPageIndexEntry[];
612
+ }
613
+ export interface WikiFileRef {
614
+ source_path: string;
615
+ uri: string;
616
+ context?: string;
617
+ prefix: string;
618
+ entity_id: string;
619
+ target_path?: string;
620
+ fragment?: string;
621
+ line: number;
622
+ }
623
+ export interface WikiRefsResponse {
624
+ wiki_id: string;
625
+ wiki_slug: string;
626
+ wiki_name: string;
627
+ ref: string;
628
+ total: number;
629
+ refs: WikiFileRef[];
630
+ }
631
+ export interface WikiBrokenRef extends WikiFileRef {
632
+ reason: string;
633
+ }
634
+ export interface WikiRefsCheckResponse {
635
+ wiki_id: string;
636
+ wiki_slug: string;
637
+ wiki_name: string;
638
+ ref: string;
639
+ total: number;
640
+ broken: WikiBrokenRef[];
641
+ }
642
+ export interface WikiDiffFile {
643
+ path: string;
644
+ action?: string;
645
+ additions: number;
646
+ deletions: number;
647
+ }
648
+ export interface WikiDiff {
649
+ patch: string;
650
+ files: WikiDiffFile[];
651
+ }
652
+ export interface CreateWikiRequest {
653
+ slug: string;
654
+ name: string;
655
+ default_branch?: string;
656
+ }
657
+ export interface CreateWikiChangesetRequest {
658
+ title: string;
659
+ message?: string;
660
+ file_changes: Array<{
661
+ path: string;
662
+ action: 'create' | 'update' | 'delete';
663
+ content_base64?: string;
664
+ base_version?: number;
665
+ }>;
666
+ source_chat_id?: string;
667
+ source_message_id?: string;
668
+ source_run_id?: string;
669
+ }
670
+ export interface UpdateWikiChangesetRequest {
671
+ title?: string;
672
+ message?: string;
673
+ file_changes?: Array<{
674
+ path: string;
675
+ action: 'create' | 'update' | 'delete';
676
+ content_base64?: string;
677
+ base_version?: number;
678
+ }>;
679
+ }
680
+ export interface WikiCommit {
681
+ sha: string;
682
+ title: string;
683
+ message: string;
684
+ author_name: string;
685
+ author_email: string;
686
+ date: string;
687
+ changeset_id?: string;
688
+ }
689
+ export interface WikiBlameEntry {
690
+ sha: string;
691
+ lines: string[];
692
+ message: string;
693
+ author: string;
694
+ date: string;
695
+ changeset_id?: string;
696
+ }
697
+ export interface WikiPathScope {
698
+ id: string;
699
+ wiki_id: string;
700
+ path: string;
701
+ readers: unknown;
702
+ maintainers: unknown;
703
+ admins: unknown;
704
+ created_by: string;
705
+ created_at: string;
706
+ }
707
+ export interface CreateWikiPathScopeRequest {
708
+ path: string;
709
+ readers?: unknown;
710
+ maintainers?: unknown;
711
+ admins?: unknown;
712
+ }
713
+ export interface WikiAccessStatus {
714
+ path: string;
715
+ read: boolean;
716
+ maintain: boolean;
717
+ admin: boolean;
718
+ }
719
+ export interface CreateWikiAccessRequest {
720
+ path: string;
721
+ reason: string;
722
+ }
723
+ export interface WikiOperation {
724
+ id: string;
725
+ wiki_id: string;
726
+ actor_id: string;
727
+ op_type: string;
728
+ changeset_id?: string | null;
729
+ payload: Record<string, unknown>;
730
+ parent_op_id?: string | null;
731
+ created_at: string;
732
+ }
733
+ export interface WikiOperationsResponse {
734
+ data: WikiOperation[];
735
+ has_more: boolean;
736
+ }
737
+ export interface WikiBlob {
738
+ path: string;
739
+ content: string;
740
+ size: number;
741
+ encoding: string;
742
+ sha256?: string;
743
+ }
744
+ export interface WsFrame<T = unknown> {
745
+ type: string;
746
+ seq?: number;
747
+ data: T;
748
+ }
749
+ export interface HelloData {
750
+ conn_id: string;
751
+ user_id: string;
752
+ session_id?: string;
753
+ server_time: string;
754
+ heartbeat_interval: number;
755
+ }
756
+ export interface MessageNewData {
757
+ id: string;
758
+ chat_id: string;
759
+ sender_id: string;
760
+ sender?: User;
761
+ thread_root_id: string | null;
762
+ message_type: MessageType;
763
+ content: MessageContent;
764
+ version: number;
765
+ created_at: string;
766
+ reply_count?: number;
767
+ edited_at?: string | null;
768
+ deleted_at?: string | null;
769
+ idempotency_key?: string | null;
770
+ agent_step_id?: string | null;
771
+ hints?: MessageHints | null;
772
+ }
773
+ export interface MessagePatchData {
774
+ message_id: string;
775
+ chat_id: string;
776
+ version: number;
777
+ ops: JsonPatchOp[];
778
+ }
779
+ export interface MessageEditData {
780
+ message_id: string;
781
+ chat_id: string;
782
+ content: MessageContent;
783
+ edited_at: string;
784
+ }
785
+ export interface MessageDeleteData {
786
+ message_id: string;
787
+ chat_id: string;
788
+ thread_root_id?: string;
789
+ }
790
+ export interface TypingUpdateData {
791
+ chat_id: string;
792
+ thread_root_id: string | null;
793
+ user_id: string;
794
+ action: 'start' | 'stop';
795
+ }
796
+ export interface ChatCreatedData extends Chat {
797
+ }
798
+ export interface ChatUpdateData {
799
+ chat_id: string;
800
+ changes: Partial<Pick<Chat, 'name' | 'avatar_url' | 'description' | 'agent_routing_mode' | 'last_message_at' | 'last_message_preview' | 'last_message_sender'>>;
801
+ }
802
+ export interface ChatDeletedData {
803
+ chat_id: string;
804
+ }
805
+ /** @deprecated Use CardUpdateData */
806
+ export type ApprovalUpdateData = CardUpdateData;
807
+ export interface CardUpdateData {
808
+ card_type: string;
809
+ approval_id?: string;
810
+ message_id: string;
811
+ chat_id: string;
812
+ status: string;
813
+ decided_by?: string;
814
+ decided_at?: string;
815
+ }
816
+ export interface RecoveryOverflowData {
817
+ message: string;
818
+ }
819
+ export interface WatchingData {
820
+ chat_ids: string[];
821
+ }
822
+ export interface MembershipChangedData {
823
+ chat_id: string;
824
+ user_id: string;
825
+ action: 'added' | 'removed';
826
+ }
827
+ export type TaskActivityAction = 'created' | 'field_changed' | 'commented';
828
+ export interface TaskComment {
829
+ id: string;
830
+ task_id: string;
831
+ author_id: string;
832
+ body: string;
833
+ mentions?: Mention[];
834
+ agent_step_id?: string | null;
835
+ created_at: string;
836
+ updated_at: string;
837
+ author?: User;
838
+ }
839
+ export interface TaskActivity {
840
+ id: string;
841
+ task_id: string;
842
+ actor_id: string;
843
+ action: TaskActivityAction;
844
+ field?: string;
845
+ old_value?: string;
846
+ new_value?: string;
847
+ created_at: string;
848
+ actor?: User;
849
+ }
850
+ export interface CreateTaskCommentRequest {
851
+ body: string;
852
+ }
853
+ export interface UpdateTaskCommentRequest {
854
+ body: string;
855
+ }
856
+ export type TaskCreatedData = Task;
857
+ export type TaskUpdatedData = Task;
858
+ /** Sent to user:{agentID} channel when a task is assigned to an agent. Data is the full Task. */
859
+ export type TaskAssignedData = Task;
860
+ export interface TaskDeletedData {
861
+ task_id: string;
862
+ org_id: string;
863
+ }
864
+ export type TaskCommentCreatedData = TaskComment;
865
+ export type TaskCommentUpdatedData = TaskComment;
866
+ export interface TaskCommentDeletedData {
867
+ comment_id: string;
868
+ task_id: string;
869
+ org_id: string;
870
+ }
871
+ export type ProjectCreatedData = Project;
872
+ export type ProjectUpdatedData = Project;
873
+ export interface ProjectDeletedData {
874
+ project_id: string;
875
+ org_id: string;
876
+ }
877
+ export interface AgentSessionDB {
878
+ id: string;
879
+ agent_id: string;
880
+ org_id: string;
881
+ status: string;
882
+ runtime_type: string;
883
+ runtime_key: string | null;
884
+ runtime_ref: Record<string, unknown> | null;
885
+ started_at: string;
886
+ finished_at: string | null;
887
+ created_at: string;
888
+ }
889
+ export interface AgentStep {
890
+ id: string;
891
+ session_id: string;
892
+ step_type: string;
893
+ target_type: string;
894
+ target_id: string | null;
895
+ content: Record<string, unknown>;
896
+ group_key: string | null;
897
+ runtime_key: string | null;
898
+ idempotency_key?: string;
899
+ created_at: string;
900
+ }
901
+ export interface CreateAgentSessionRequest {
902
+ runtime_type?: string;
903
+ runtime_key?: string;
904
+ runtime_ref?: Record<string, unknown>;
905
+ }
906
+ export interface CreateAgentStepRequest {
907
+ step_type: string;
908
+ content: Record<string, unknown>;
909
+ target_type?: string;
910
+ target_id?: string;
911
+ group_key?: string;
912
+ runtime_key?: string;
913
+ idempotency_key?: string;
914
+ projection?: boolean;
915
+ }
916
+ export interface UpdateAgentSessionRequest {
917
+ status: string;
918
+ }
919
+ export type AgentSessionNewData = AgentSessionDB;
920
+ export interface AgentSessionUpdateData {
921
+ session_id: string;
922
+ status: string;
923
+ finished_at?: string;
924
+ }
925
+ export interface AgentStepNewData extends AgentStep {
926
+ }
927
+ export type WikiChangesetCreatedData = WikiChangeset & {
928
+ org_id: string;
929
+ };
930
+ export type WikiChangesetUpdatedData = WikiChangeset & {
931
+ org_id: string;
932
+ };
933
+ export type InboxItemType = 'mention' | 'task_assign' | 'task_update' | 'task_comment' | 'approval_request' | 'agent_alert' | 'invitation';
934
+ export interface InboxItem {
935
+ id: string;
936
+ org_id: string;
937
+ recipient_id: string;
938
+ actor_id: string | null;
939
+ type: InboxItemType;
940
+ entity_type: string;
941
+ entity_id: string;
942
+ group_key: string;
943
+ source_type: string;
944
+ source_id: string;
945
+ chat_id: string | null;
946
+ task_id: string | null;
947
+ title: string;
948
+ body: string;
949
+ read_at: string | null;
950
+ archived_at: string | null;
951
+ snoozed_until: string | null;
952
+ created_at: string;
953
+ updated_at: string;
954
+ }
955
+ export type DispatchEventType = 'message' | 'task_assign';
956
+ export type DispatchStatus = 'pending' | 'acked';
957
+ export interface DispatchEvent {
958
+ id: string;
959
+ org_id: string;
960
+ agent_id: string;
961
+ event_type: DispatchEventType;
962
+ source_type: string;
963
+ source_id: string;
964
+ chat_id: string | null;
965
+ task_id: string | null;
966
+ actor_id: string | null;
967
+ status: DispatchStatus;
968
+ acked_at: string | null;
969
+ created_at: string;
970
+ }
971
+ export type DispatchNewData = DispatchEvent;
972
+ export type InboxNewData = InboxItem;
973
+ export interface InboxUpdateData {
974
+ id: string;
975
+ read_at?: string | null;
976
+ archived_at?: string | null;
977
+ snoozed_until?: string | null;
978
+ }
979
+ export interface InboxBulkUpdateData {
980
+ action: 'mark_all_read' | 'archive_all';
981
+ }
982
+ export interface InboxUnreadCountResponse {
983
+ count: number;
984
+ }
985
+ export interface ReadPositionUpdateData {
986
+ chat_id: string;
987
+ last_read_message_id: string;
988
+ }
989
+ export interface NotificationAlertData {
990
+ title: string;
991
+ body: string;
992
+ category: string;
993
+ data: Record<string, string> | null;
994
+ }
995
+ export type WsEventMap = {
996
+ 'hello': HelloData;
997
+ 'message.new': MessageNewData;
998
+ 'message.patch': MessagePatchData;
999
+ 'message.edit': MessageEditData;
1000
+ 'message.delete': MessageDeleteData;
1001
+ 'typing.update': TypingUpdateData;
1002
+ 'chat.created': ChatCreatedData;
1003
+ 'chat.update': ChatUpdateData;
1004
+ 'chat.deleted': ChatDeletedData;
1005
+ 'approval.update': ApprovalUpdateData;
1006
+ 'card.update': CardUpdateData;
1007
+ 'recovery.overflow': RecoveryOverflowData;
1008
+ 'watching': WatchingData;
1009
+ 'pong': {
1010
+ ts: number;
1011
+ };
1012
+ 'membership.changed': MembershipChangedData;
1013
+ 'task.created': TaskCreatedData;
1014
+ 'task.updated': TaskUpdatedData;
1015
+ 'task.deleted': TaskDeletedData;
1016
+ 'task.assigned': TaskAssignedData;
1017
+ 'task.comment.created': TaskCommentCreatedData;
1018
+ 'task.comment.updated': TaskCommentUpdatedData;
1019
+ 'task.comment.deleted': TaskCommentDeletedData;
1020
+ 'project.created': ProjectCreatedData;
1021
+ 'project.updated': ProjectUpdatedData;
1022
+ 'project.deleted': ProjectDeletedData;
1023
+ 'agent_session.new': AgentSessionNewData;
1024
+ 'agent_session.update': AgentSessionUpdateData;
1025
+ 'agent_step.new': AgentStepNewData;
1026
+ 'invitation.new': InvitationNewEventData;
1027
+ 'invitation.accepted': InvitationAcceptedEventData;
1028
+ 'invitation.declined': InvitationDeclinedEventData;
1029
+ 'agent_config.update': AgentConfigUpdateData;
1030
+ 'presence.update': PresenceUpdateData;
1031
+ 'wiki.changeset.created': WikiChangesetCreatedData;
1032
+ 'wiki.changeset.updated': WikiChangesetUpdatedData;
1033
+ 'notification.alert': NotificationAlertData;
1034
+ 'inbox.new': InboxNewData;
1035
+ 'inbox.update': InboxUpdateData;
1036
+ 'inbox.bulk_update': InboxBulkUpdateData;
1037
+ 'read_position.updated': ReadPositionUpdateData;
1038
+ 'dispatch.new': DispatchNewData;
1039
+ };
1040
+ export interface InvitationNewEventData {
1041
+ id: string;
1042
+ org_id: string;
1043
+ org_name: string;
1044
+ inviter_name: string;
1045
+ role: OrgMemberRole;
1046
+ expires_at: string;
1047
+ }
1048
+ export interface InvitationAcceptedEventData {
1049
+ invitation_id: string;
1050
+ org_id: string;
1051
+ user_id: string;
1052
+ display_name: string;
1053
+ role: OrgMemberRole;
1054
+ }
1055
+ export interface InvitationDeclinedEventData {
1056
+ invitation_id: string;
1057
+ org_id: string;
1058
+ email: string;
1059
+ }
1060
+ export interface PlatformConfigResponse {
1061
+ version: string;
1062
+ schema_version: number;
1063
+ min_plugin_version?: string;
1064
+ config: Record<string, unknown>;
1065
+ }
1066
+ export interface AgentConfigUpdateData {
1067
+ version: string;
1068
+ }
1069
+ export interface PresenceUpdateData {
1070
+ org_id: string;
1071
+ user_id: string;
1072
+ status: string;
1073
+ }
1074
+ export interface ResolveRefsRequest {
1075
+ refs: string[];
1076
+ }
1077
+ export interface ResolvedRef {
1078
+ type: string;
1079
+ exists: boolean;
1080
+ restricted?: boolean;
1081
+ display_name?: string;
1082
+ avatar_url?: string | null;
1083
+ user_type?: string;
1084
+ title?: string;
1085
+ status?: string;
1086
+ identifier?: string;
1087
+ chat_name?: string | null;
1088
+ chat_type?: string;
1089
+ sender_name?: string;
1090
+ preview?: string;
1091
+ chat_id?: string;
1092
+ file_name?: string;
1093
+ wiki_name?: string;
1094
+ fragment_exists?: boolean;
1095
+ comment_author?: string;
1096
+ comment_body?: string;
1097
+ task_id?: string;
1098
+ }
1099
+ export interface ResolveRefsResponse {
1100
+ results: Record<string, ResolvedRef>;
1101
+ }
1102
+ export interface BacklinkItem {
1103
+ source_type: string;
1104
+ source_id: string;
1105
+ context?: string;
1106
+ snippet?: string;
1107
+ created_at: string;
1108
+ chat_id?: string;
1109
+ sender_name?: string;
1110
+ task_title?: string;
1111
+ task_id?: string;
1112
+ author_name?: string;
1113
+ }
1114
+ export interface BacklinksResponse {
1115
+ backlinks: BacklinkItem[];
1116
+ next_cursor?: string;
1117
+ }
1118
+ export interface BrokenRefItem {
1119
+ ref_link_id: string;
1120
+ source_type: string;
1121
+ source_id: string;
1122
+ uri: string;
1123
+ target_type: string;
1124
+ target_id: string;
1125
+ }
1126
+ export interface BrokenRefsResponse {
1127
+ broken_refs: BrokenRefItem[];
1128
+ total: number;
1129
+ }
1130
+ //# sourceMappingURL=types.d.ts.map