@cmdop/react 0.1.1 → 0.1.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/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CMDOPConfig } from '@cmdop/core';
3
3
  export { API_BASE_URL, AuthenticationError, CMDOPConfig, CMDOPError, CancelledError, ConnectionError, DEFAULT_CONFIG, FileInfo, MachinesModule, NotFoundError, PermissionError, ResourceExhaustedError, SessionError, SessionInfo, SessionState, SystemModule, TimeoutError, TransportMode, UnavailableError, VERSION, WorkspacesModule, api, machines, system, workspaces } from '@cmdop/core';
4
- import { ReactNode } from 'react';
4
+ import { ReactNode, Dispatch, SetStateAction } from 'react';
5
5
  import { SWRConfiguration } from 'swr';
6
6
 
7
7
  /**
@@ -47,9 +47,15 @@ declare class CMDOPWebSocketClient {
47
47
  */
48
48
  unsubscribe(channel: string): void;
49
49
  /**
50
- * Make an RPC call via Centrifugo
50
+ * Make an RPC call via Centrifugo (namedRPC compatible)
51
51
  */
52
52
  rpc<TRequest, TResponse>(method: string, data: TRequest): Promise<TResponse>;
53
+ /**
54
+ * Alias for rpc() - compatible with generated APIClient interface
55
+ */
56
+ namedRPC<TResponse = unknown>(method: string, params: unknown, _options?: {
57
+ timeout?: number;
58
+ }): Promise<TResponse>;
53
59
  /**
54
60
  * Publish to a channel (fire-and-forget)
55
61
  */
@@ -101,7 +107,7 @@ declare function WebSocketProvider({ children, url, getToken, autoConnect, debug
101
107
  declare function useWebSocket(): WebSocketContextValue;
102
108
 
103
109
  /**
104
- * Centrifugo React hooks for CMDOP
110
+ * WebSocket React hooks for CMDOP
105
111
  */
106
112
  interface UseSubscriptionOptions<T> {
107
113
  /**
@@ -169,6 +175,895 @@ interface UseRPCResult {
169
175
  */
170
176
  declare function useRPC(options?: UseRPCOptions): UseRPCResult;
171
177
 
178
+ /**
179
+ * Generated TypeScript Types
180
+ * Auto-generated - DO NOT EDIT
181
+ */
182
+ declare const enum WsFileChangeType {
183
+ UNSPECIFIED = 0,
184
+ CREATE = 1,
185
+ MODIFY = 2,
186
+ DELETE = 3,
187
+ MOVE = 4
188
+ }
189
+ declare const enum WsFileIconType {
190
+ UNSPECIFIED = 0,
191
+ FILE = 1,
192
+ CODE = 2,
193
+ TEXT = 3,
194
+ IMAGE = 4,
195
+ VIDEO = 5,
196
+ AUDIO = 6,
197
+ ARCHIVE = 7,
198
+ DATA = 8,
199
+ PDF = 9,
200
+ FOLDER = 10,
201
+ FOLDER_HOME = 11,
202
+ FOLDER_DESKTOP = 12,
203
+ FOLDER_DOCUMENTS = 13,
204
+ FOLDER_DOWNLOADS = 14,
205
+ FOLDER_PICTURES = 15,
206
+ FOLDER_MUSIC = 16,
207
+ FOLDER_VIDEOS = 17,
208
+ FOLDER_APPLICATIONS = 18,
209
+ FOLDER_LIBRARY = 19,
210
+ FOLDER_SYSTEM = 20,
211
+ FOLDER_DRIVE = 21,
212
+ FOLDER_CLOUD = 22,
213
+ FOLDER_TRASH = 23,
214
+ FOLDER_HIDDEN = 24,
215
+ FOLDER_CODE = 25,
216
+ FOLDER_SERVER = 26,
217
+ FOLDER_DATABASE = 27,
218
+ FOLDER_ARCHIVE = 28
219
+ }
220
+ declare const enum WsLoadMethod {
221
+ UNSPECIFIED = 0,
222
+ RPC = 1,
223
+ HTTP_STREAM = 2,
224
+ SKIP = 3,
225
+ HTTP_TRANSCODE = 4,
226
+ HTTP_HLS = 5
227
+ }
228
+ declare const enum WsSearchMatchType {
229
+ UNSPECIFIED = 0,
230
+ FILENAME = 1,
231
+ CONTENT = 2
232
+ }
233
+ declare const enum WsViewerType {
234
+ UNKNOWN = 0,
235
+ CODE = 1,
236
+ TEXT = 2,
237
+ IMAGE = 3,
238
+ VIDEO = 4,
239
+ AUDIO = 5,
240
+ PDF = 6,
241
+ MARKDOWN = 7,
242
+ JSON = 8,
243
+ YAML = 9,
244
+ XML = 10,
245
+ ARCHIVE = 11,
246
+ HEX = 12
247
+ }
248
+ interface WsCreateArchiveParams {
249
+ /** Terminal session UUID */
250
+ session_id: string;
251
+ /** Files/directories to archive */
252
+ source_paths: string[];
253
+ /** Archive destination (auto-generated if empty) */
254
+ destination_path?: string;
255
+ /** Archive format: zip, tar, tar.gz */
256
+ format?: string;
257
+ /** Include hidden files */
258
+ include_hidden?: boolean;
259
+ }
260
+ interface WsGetChangesParams {
261
+ /** Agent session ID */
262
+ session_id: string;
263
+ /** Root path to get changes from */
264
+ path?: string;
265
+ /** Sequence number to get changes since */
266
+ since_sequence?: number;
267
+ /** Maximum number of changes to return */
268
+ limit?: number;
269
+ }
270
+ interface WsContentMatch {
271
+ line_number: number;
272
+ line: string;
273
+ column_start: number;
274
+ column_end: number;
275
+ context_before?: string[];
276
+ context_after?: string[];
277
+ }
278
+ interface WsFileEntry {
279
+ name: string;
280
+ path: string;
281
+ type: string;
282
+ size: number;
283
+ permissions: string;
284
+ owner: string;
285
+ modified_at: string;
286
+ is_hidden: boolean;
287
+ is_readable: boolean;
288
+ is_writable: boolean;
289
+ mime_type?: string | null;
290
+ symlink_target?: string | null;
291
+ icon_type?: WsFileIconType;
292
+ is_system?: boolean;
293
+ viewer_type?: WsViewerType;
294
+ load_method?: WsLoadMethod;
295
+ media_metadata?: WsMediaMetadata | null;
296
+ }
297
+ interface WsMediaMetadata {
298
+ duration_seconds?: number;
299
+ bitrate_kbps?: number;
300
+ sample_rate_hz?: number;
301
+ audio_channels?: number;
302
+ audio_codec?: string;
303
+ width?: number;
304
+ height?: number;
305
+ frame_rate?: number;
306
+ video_codec?: string;
307
+ title?: string;
308
+ artist?: string;
309
+ album?: string;
310
+ album_artist?: string;
311
+ genre?: string;
312
+ year?: number;
313
+ track_number?: number;
314
+ disc_number?: number;
315
+ comment?: string;
316
+ composer?: string;
317
+ cover_art?: string | null;
318
+ cover_art_mime_type?: string;
319
+ container_format?: string;
320
+ has_video?: boolean;
321
+ has_audio?: boolean;
322
+ }
323
+ interface WsSearchMatch {
324
+ entry: WsFileEntry;
325
+ match_type?: WsSearchMatchType;
326
+ content_matches?: WsContentMatch[];
327
+ }
328
+ interface WsSearchResult {
329
+ success: boolean;
330
+ error?: string | null;
331
+ matches?: WsSearchMatch[];
332
+ total_matches?: number;
333
+ truncated?: boolean;
334
+ search_path?: string;
335
+ files_scanned?: number;
336
+ duration_ms?: number;
337
+ }
338
+ interface WsCheckVersionParams {
339
+ /** Client API version hash */
340
+ client_version: string;
341
+ }
342
+ interface WsTerminalCreateSessionParams {
343
+ /** Optional session name */
344
+ name?: string;
345
+ /** Shell to use */
346
+ shell?: string;
347
+ /** Initial working directory */
348
+ working_directory?: string;
349
+ }
350
+ interface WsTransferInfo {
351
+ transfer_id: string;
352
+ source_session_id: string;
353
+ target_session_id: string;
354
+ source_path: string;
355
+ target_path: string;
356
+ file_size: number;
357
+ state: string;
358
+ upload_progress: number;
359
+ download_progress: number;
360
+ is_source: boolean;
361
+ is_target: boolean;
362
+ }
363
+ interface WsListTransfersResult {
364
+ success: boolean;
365
+ transfers?: WsTransferInfo[];
366
+ error?: string | null;
367
+ }
368
+ interface WsTerminalCloseParams {
369
+ /** Terminal session UUID */
370
+ session_id: string;
371
+ /** Reason for closing */
372
+ reason?: string;
373
+ }
374
+ interface WsCreateDirectoryResult {
375
+ success: boolean;
376
+ error?: string | null;
377
+ path?: string;
378
+ }
379
+ interface WsMessageItem {
380
+ id: string;
381
+ role: string;
382
+ content: string;
383
+ response_text?: string;
384
+ status: string;
385
+ error?: string;
386
+ created_at: string;
387
+ iterations?: number;
388
+ }
389
+ interface WsMessageListResult {
390
+ success: boolean;
391
+ messages?: WsMessageItem[];
392
+ has_more?: boolean;
393
+ error?: string;
394
+ }
395
+ interface WsListSessionsParams {
396
+ /** Max sessions to return */
397
+ limit?: number;
398
+ }
399
+ interface WsBrowserExecuteScriptParams {
400
+ /** Terminal session UUID (agent connection) */
401
+ session_id: string;
402
+ /** Browser session ID */
403
+ browser_session_id: string;
404
+ /** JavaScript code to execute */
405
+ script: string;
406
+ }
407
+ interface WsTransferStatusResult {
408
+ found: boolean;
409
+ transfer_id?: string;
410
+ state?: string;
411
+ source_session_id?: string;
412
+ target_session_id?: string;
413
+ source_path?: string;
414
+ target_path?: string;
415
+ file_size?: number;
416
+ stored_size?: number;
417
+ upload_progress?: number;
418
+ download_progress?: number;
419
+ total_chunks?: number;
420
+ chunks_uploaded?: number;
421
+ chunks_downloaded?: number;
422
+ error?: string | null;
423
+ }
424
+ interface WsTerminalHistoryParams {
425
+ /** Terminal session UUID */
426
+ session_id: string;
427
+ /** Max commands to return */
428
+ limit?: number;
429
+ /** Offset for pagination */
430
+ offset?: number;
431
+ }
432
+ interface WsInitiateTransferResult {
433
+ success: boolean;
434
+ transfer_id?: string;
435
+ chunk_size?: number;
436
+ total_chunks?: number;
437
+ error?: string | null;
438
+ }
439
+ interface WsInitiateTransferParams {
440
+ /** Source device session ID */
441
+ source_session_id: string;
442
+ /** Target device session ID */
443
+ target_session_id: string;
444
+ /** File path on source device */
445
+ source_path: string;
446
+ /** Destination path on target device */
447
+ target_path: string;
448
+ /** Total file size in bytes */
449
+ file_size: number;
450
+ /** MD5 checksum of entire file (optional) */
451
+ file_checksum?: string;
452
+ /** Chunk size for transfer */
453
+ chunk_size?: number;
454
+ }
455
+ interface WsBrowserValidateSelectorsParams {
456
+ /** Terminal session UUID (agent connection) */
457
+ session_id: string;
458
+ /** Browser session ID */
459
+ browser_session_id: string;
460
+ /** CSS selector for repeating item container */
461
+ item: string;
462
+ /** Field name to CSS selector mapping */
463
+ fields: Record<string, any>;
464
+ }
465
+ interface WsBrowserValidateSelectorsResult {
466
+ success: boolean;
467
+ valid?: boolean;
468
+ counts?: Record<string, any>;
469
+ samples?: Record<string, any>;
470
+ errors?: string[];
471
+ error?: string;
472
+ }
473
+ interface WsGetFileInfoResult {
474
+ success: boolean;
475
+ error?: string | null;
476
+ entry?: WsFileEntry | null;
477
+ is_text?: boolean;
478
+ }
479
+ interface WsListDirectoryResult {
480
+ success: boolean;
481
+ error?: string | null;
482
+ current_path?: string;
483
+ entries?: WsFileEntry[];
484
+ next_page_token?: string;
485
+ total_count?: number;
486
+ has_more?: boolean;
487
+ file_count?: number;
488
+ directory_count?: number;
489
+ }
490
+ interface WsChatCreateSessionParams {
491
+ /** Workspace UUID */
492
+ workspace_id: string;
493
+ /** Optional session title */
494
+ title?: string;
495
+ }
496
+ interface WsBrowserExtractRegexParams {
497
+ /** Terminal session UUID (agent connection) */
498
+ session_id: string;
499
+ /** Browser session ID */
500
+ browser_session_id: string;
501
+ /** Regex pattern */
502
+ pattern: string;
503
+ /** Source: `html` or `text` */
504
+ source?: string;
505
+ /** Max matches */
506
+ limit?: number;
507
+ }
508
+ interface WsCancelTransferResult {
509
+ success: boolean;
510
+ error?: string | null;
511
+ }
512
+ interface WsDeleteResult {
513
+ success: boolean;
514
+ error?: string | null;
515
+ deleted_path?: string;
516
+ files_deleted?: number;
517
+ dirs_deleted?: number;
518
+ }
519
+ interface WsMoveResult {
520
+ success: boolean;
521
+ error?: string | null;
522
+ path?: string;
523
+ }
524
+ interface WsChannelAuthResult {
525
+ authorized: boolean;
526
+ error?: string;
527
+ }
528
+ interface WsBrowserExecuteScriptResult {
529
+ success: boolean;
530
+ result?: string;
531
+ error?: string;
532
+ }
533
+ interface WsChatSessionResult {
534
+ success: boolean;
535
+ session_id?: string;
536
+ error?: string;
537
+ }
538
+ interface WsGetSessionParams {
539
+ /** Terminal session UUID */
540
+ session_id: string;
541
+ }
542
+ interface WsReadFileResult {
543
+ success: boolean;
544
+ error?: string | null;
545
+ content?: string;
546
+ total_size?: number;
547
+ read_size?: number;
548
+ mime_type?: string | null;
549
+ is_text?: boolean;
550
+ viewer_type?: WsViewerType;
551
+ }
552
+ interface WsSearchParams {
553
+ /** Terminal session UUID */
554
+ session_id: string;
555
+ /** Base directory to search */
556
+ path?: string;
557
+ /** Glob pattern for filenames (e.g., `*.ts`, `**\/*.go`) */
558
+ filename_pattern?: string;
559
+ /** Regex pattern for file content */
560
+ content_pattern?: string;
561
+ /** Case sensitivity for content search */
562
+ case_sensitive?: boolean;
563
+ /** Include hidden files/directories */
564
+ include_hidden?: boolean;
565
+ /** Maximum results */
566
+ max_results?: number;
567
+ /** Maximum directory depth (0 = unlimited) */
568
+ max_depth?: number;
569
+ /** Lines of context around matches */
570
+ context_lines?: number;
571
+ }
572
+ interface WsMessageResult {
573
+ success: boolean;
574
+ message_id?: string;
575
+ status?: string;
576
+ error?: string;
577
+ }
578
+ interface WsBrowserExtractDataParams {
579
+ /** Terminal session UUID (agent connection) */
580
+ session_id: string;
581
+ /** Browser session ID */
582
+ browser_session_id: string;
583
+ /** CSS selector for repeating item container */
584
+ item: string;
585
+ /** Field extractors (string or {selector, attr, regex}) */
586
+ fields: Record<string, any>;
587
+ /** Max items to extract */
588
+ limit?: number;
589
+ }
590
+ interface WsTerminalResizeParams {
591
+ /** Terminal session UUID */
592
+ session_id: string;
593
+ /** Number of columns */
594
+ cols: number;
595
+ /** Number of rows */
596
+ rows: number;
597
+ }
598
+ interface WsCancelTransferParams {
599
+ /** Transfer ID to cancel */
600
+ transfer_id: string;
601
+ }
602
+ interface WsCreateDirectoryParams {
603
+ /** Terminal session UUID */
604
+ session_id: string;
605
+ /** Directory path to create */
606
+ path: string;
607
+ /** Create parent directories */
608
+ create_parents?: boolean;
609
+ }
610
+ interface WsSessionResult {
611
+ session_id: string;
612
+ name: string;
613
+ status: string;
614
+ shell: string;
615
+ working_directory: string;
616
+ agent_hostname?: string;
617
+ commands_count?: number;
618
+ }
619
+ interface WsMoveParams {
620
+ /** Terminal session UUID */
621
+ session_id: string;
622
+ /** Source path */
623
+ source_path: string;
624
+ /** Destination path */
625
+ destination_path: string;
626
+ /** Overwrite if exists */
627
+ overwrite?: boolean;
628
+ }
629
+ interface WsListTransfersParams {
630
+ /** Session ID to list transfers for */
631
+ session_id: string;
632
+ /** Include completed transfers */
633
+ include_completed?: boolean;
634
+ }
635
+ interface WsSuccessResult {
636
+ success: boolean;
637
+ message?: string;
638
+ }
639
+ interface WsGetFileInfoParams {
640
+ /** Terminal session UUID */
641
+ session_id: string;
642
+ /** File path */
643
+ path: string;
644
+ }
645
+ interface WsFileChange {
646
+ /** Type of change (create, modify, delete, rename) */
647
+ change_type: WsFileChangeType;
648
+ /** File entry (null for delete) */
649
+ item?: WsFileEntry | null;
650
+ /** Previous path (for rename operations) */
651
+ old_path?: string;
652
+ }
653
+ interface WsGetChangesResult {
654
+ /** Whether operation succeeded */
655
+ success?: boolean;
656
+ /** Error message if failed */
657
+ error?: string;
658
+ /** List of file changes */
659
+ changes?: WsFileChange[];
660
+ /** Current sequence number (for next sync) */
661
+ current_sequence?: number;
662
+ /** Server timestamp (Unix epoch) */
663
+ server_timestamp?: number;
664
+ /** Whether there are more changes to fetch */
665
+ has_more?: boolean;
666
+ /** Cursor for pagination (if has_more is true) */
667
+ next_cursor?: string;
668
+ /** MD5 hash of directory state for integrity check */
669
+ state_digest?: string;
670
+ }
671
+ interface WsBrowserExtractRegexResult {
672
+ success: boolean;
673
+ matches?: Record<string, any>[];
674
+ count?: number;
675
+ error?: string;
676
+ }
677
+ interface WsTerminalInputParams {
678
+ /** Terminal session UUID */
679
+ session_id: string;
680
+ /** Input data (base64 encoded) */
681
+ data: string;
682
+ }
683
+ interface WsSessionListResult {
684
+ sessions: WsSessionResult[];
685
+ total: number;
686
+ }
687
+ interface WsChannelAuthParams {
688
+ /** Channel name to authorize */
689
+ channel: string;
690
+ }
691
+ interface WsGetHistoryParams {
692
+ /** Workspace UUID */
693
+ workspace_id: string;
694
+ /** Filter by session UUID */
695
+ session_id?: string | null;
696
+ /** Max messages to return */
697
+ limit?: number;
698
+ /** Pagination offset */
699
+ offset?: number;
700
+ }
701
+ interface WsWriteFileParams {
702
+ /** Terminal session UUID */
703
+ session_id: string;
704
+ /** File path to write */
705
+ path: string;
706
+ /** File content (base64 encoded) */
707
+ content: string;
708
+ /** Overwrite if exists */
709
+ overwrite?: boolean;
710
+ /** Create parent directories */
711
+ create_parents?: boolean;
712
+ }
713
+ interface WsDeleteParams {
714
+ /** Terminal session UUID */
715
+ session_id: string;
716
+ /** Path to delete */
717
+ path: string;
718
+ /** Delete directories recursively */
719
+ recursive?: boolean;
720
+ }
721
+ interface WsTransferStatusParams {
722
+ /** Transfer ID */
723
+ transfer_id: string;
724
+ }
725
+ interface WsHistoryResult {
726
+ commands: string[];
727
+ total: number;
728
+ }
729
+ interface WsReadFileParams {
730
+ /** Terminal session UUID */
731
+ session_id: string;
732
+ /** File path to read */
733
+ path: string;
734
+ /** Start offset in bytes */
735
+ offset?: number;
736
+ /** Bytes to read (0 = entire file) */
737
+ length?: number;
738
+ }
739
+ interface WsCreateArchiveResult {
740
+ success: boolean;
741
+ error?: string | null;
742
+ archive_path?: string;
743
+ bytes_archived?: number;
744
+ files_archived?: number;
745
+ dirs_archived?: number;
746
+ }
747
+ interface WsListDirectoryParams {
748
+ /** Terminal session UUID */
749
+ session_id: string;
750
+ /** Directory path to list */
751
+ path: string;
752
+ /** Max entries per page */
753
+ page_size?: number;
754
+ /** Token for pagination */
755
+ page_token?: string;
756
+ /** Include hidden files */
757
+ include_hidden?: boolean;
758
+ /** Sort order */
759
+ sort_order?: string;
760
+ }
761
+ interface WsWriteFileResult {
762
+ success: boolean;
763
+ error?: string | null;
764
+ bytes_written?: number;
765
+ path?: string;
766
+ }
767
+ interface WsBrowserExtractDataResult {
768
+ success: boolean;
769
+ items?: Record<string, any>[];
770
+ count?: number;
771
+ error?: string;
772
+ }
773
+ interface WsVersionCheckResult {
774
+ /** Whether versions are compatible */
775
+ compatible: boolean;
776
+ /** Client version received */
777
+ client_version: string;
778
+ /** Server API version hash */
779
+ server_version: string;
780
+ /** Additional info message */
781
+ message?: string;
782
+ }
783
+ interface WsTerminalSignalParams {
784
+ /** Terminal session UUID */
785
+ session_id: string;
786
+ /** Signal number (2=SIGINT, 9=SIGKILL, 15=SIGTERM) */
787
+ signal?: number;
788
+ }
789
+ interface WsSendMessageParams {
790
+ /** Workspace UUID */
791
+ workspace_id: string;
792
+ /** User message/prompt */
793
+ message: string;
794
+ /** Optional chat session UUID */
795
+ session_id?: string | null;
796
+ /** Target machine UUIDs for orchestrator mode (empty = all machines) */
797
+ target_machine_ids?: string[];
798
+ /** Client-generated message ID for optimistic UI updates */
799
+ client_message_id?: string | null;
800
+ /** Enable streaming response */
801
+ stream?: boolean;
802
+ }
803
+
804
+ /**
805
+ * Generated API Client
806
+ * Auto-generated thin wrapper - DO NOT EDIT
807
+ *
808
+ * @generated 2026-01-25T04:56:47.477899
809
+ */
810
+
811
+ /**
812
+ * API contract version - changes when methods or models change.
813
+ * Use checkVersion() to verify client/server compatibility.
814
+ */
815
+ declare const API_VERSION = "5e38751f";
816
+ /**
817
+ * Timestamp when this client was generated.
818
+ */
819
+ declare const GENERATED_AT = "2026-01-25T04:56:47.477899";
820
+ interface CentrifugoClient {
821
+ namedRPC<T = any>(method: string, params: any, options?: {
822
+ timeout?: number;
823
+ }): Promise<T>;
824
+ /** Optional: fire-and-forget RPC (no response expected) */
825
+ namedRPCNoWait?(method: string, params: any): void;
826
+ }
827
+
828
+ declare class APIClient {
829
+ private client;
830
+ constructor(client: CentrifugoClient);
831
+ /**
832
+ * Check if client API version is compatible with server.
833
+ * Call this after connecting to ensure contract compatibility.
834
+ *
835
+ * @throws Error if versions are incompatible
836
+ * @returns WsVersionCheckResult with compatibility info
837
+ *
838
+ * @example
839
+ * const apiClient = new APIClient(client);
840
+ * const result = await apiClient.checkVersion();
841
+ * if (!result.compatible) {
842
+ * console.error('API version mismatch! Please regenerate client.');
843
+ * }
844
+ */
845
+ checkVersion(): Promise<WsVersionCheckResult>;
846
+ /**
847
+ * Get the API contract version of this client.
848
+ */
849
+ getVersion(): string;
850
+ /**
851
+ * Send input to terminal session (fire-and-forget).
852
+ */
853
+ terminalInput(params: WsTerminalInputParams): Promise<WsSuccessResult>;
854
+ /**
855
+ * Send input to terminal session (fire-and-forget). (fire-and-forget)
856
+ */
857
+ terminalInputNoWait(params: WsTerminalInputParams): void;
858
+ /**
859
+ * Resize terminal (fire-and-forget).
860
+ */
861
+ terminalResize(params: WsTerminalResizeParams): Promise<WsSuccessResult>;
862
+ /**
863
+ * Resize terminal (fire-and-forget). (fire-and-forget)
864
+ */
865
+ terminalResizeNoWait(params: WsTerminalResizeParams): void;
866
+ /**
867
+ * Send signal to terminal process.
868
+ */
869
+ terminalSignal(params: WsTerminalSignalParams): Promise<WsSuccessResult>;
870
+ /**
871
+ * Close terminal session.
872
+ */
873
+ terminalClose(params: WsTerminalCloseParams): Promise<WsSuccessResult>;
874
+ /**
875
+ * Create new terminal session.
876
+ */
877
+ terminalCreateSession(params: WsTerminalCreateSessionParams): Promise<WsSessionResult>;
878
+ /**
879
+ * Get terminal session info.
880
+ */
881
+ terminalGetSession(params: WsGetSessionParams): Promise<WsSessionResult>;
882
+ /**
883
+ * List user's terminal sessions.
884
+ */
885
+ terminalListSessions(params: WsListSessionsParams): Promise<WsSessionListResult>;
886
+ /**
887
+ * Get terminal command history.
888
+ */
889
+ terminalHistory(params: WsTerminalHistoryParams): Promise<WsHistoryResult>;
890
+ /**
891
+ * List directory contents via gRPC.
892
+ */
893
+ fileListDirectory(params: WsListDirectoryParams): Promise<WsListDirectoryResult>;
894
+ /**
895
+ * Create a new directory via gRPC.
896
+ */
897
+ fileCreateDirectory(params: WsCreateDirectoryParams): Promise<WsCreateDirectoryResult>;
898
+ /**
899
+ * Read file contents via gRPC.
900
+ */
901
+ fileRead(params: WsReadFileParams): Promise<WsReadFileResult>;
902
+ /**
903
+ * Write file contents via gRPC.
904
+ */
905
+ fileWrite(params: WsWriteFileParams): Promise<WsWriteFileResult>;
906
+ /**
907
+ * Delete a file or directory via gRPC.
908
+ */
909
+ fileDelete(params: WsDeleteParams): Promise<WsDeleteResult>;
910
+ /**
911
+ * Move or rename a file or directory via gRPC.
912
+ */
913
+ fileMove(params: WsMoveParams): Promise<WsMoveResult>;
914
+ /**
915
+ * Get file or directory info via gRPC.
916
+ */
917
+ fileGetInfo(params: WsGetFileInfoParams): Promise<WsGetFileInfoResult>;
918
+ /**
919
+ * Create archive from selected files via gRPC.
920
+ */
921
+ fileCreateArchive(params: WsCreateArchiveParams): Promise<WsCreateArchiveResult>;
922
+ /**
923
+ * Search files by filename pattern and/or content via gRPC.
924
+ */
925
+ fileSearch(params: WsSearchParams): Promise<WsSearchResult>;
926
+ /**
927
+ * Get file changes since a sequence number.
928
+ */
929
+ fileGetChanges(params: WsGetChangesParams): Promise<WsGetChangesResult>;
930
+ /**
931
+ * Initiate a cross-device file transfer via streaming relay.
932
+ */
933
+ transferInitiate(params: WsInitiateTransferParams): Promise<WsInitiateTransferResult>;
934
+ /**
935
+ * Get status of a cross-device transfer.
936
+ */
937
+ transferStatus(params: WsTransferStatusParams): Promise<WsTransferStatusResult>;
938
+ /**
939
+ * Cancel a cross-device transfer.
940
+ */
941
+ transferCancel(params: WsCancelTransferParams): Promise<WsCancelTransferResult>;
942
+ /**
943
+ * List active transfers for a session.
944
+ */
945
+ transferList(params: WsListTransfersParams): Promise<WsListTransfersResult>;
946
+ /**
947
+ * Validate CSS selectors on current browser page.
948
+ */
949
+ browserValidateSelectors(params: WsBrowserValidateSelectorsParams): Promise<WsBrowserValidateSelectorsResult>;
950
+ /**
951
+ * Extract structured data from browser page.
952
+ */
953
+ browserExtractData(params: WsBrowserExtractDataParams): Promise<WsBrowserExtractDataResult>;
954
+ /**
955
+ * Execute JavaScript in browser.
956
+ */
957
+ browserExecuteScript(params: WsBrowserExecuteScriptParams): Promise<WsBrowserExecuteScriptResult>;
958
+ /**
959
+ * Extract data from page using regex.
960
+ */
961
+ browserExtractRegex(params: WsBrowserExtractRegexParams): Promise<WsBrowserExtractRegexResult>;
962
+ /**
963
+ * Check if client API version is compatible with server.
964
+ */
965
+ systemCheckVersion(params: WsCheckVersionParams): Promise<WsVersionCheckResult>;
966
+ /**
967
+ * Authorize access to a channel.
968
+ */
969
+ channelAuthorize(params: WsChannelAuthParams): Promise<WsChannelAuthResult>;
970
+ /**
971
+ * Send a chat message for AI processing.
972
+ */
973
+ aiChatSendMessage(params: WsSendMessageParams): Promise<WsMessageResult>;
974
+ /**
975
+ * Get message history for a workspace or session.
976
+ */
977
+ aiChatGetHistory(params: WsGetHistoryParams): Promise<WsMessageListResult>;
978
+ /**
979
+ * Create a new chat session.
980
+ */
981
+ aiChatCreateSession(params: WsChatCreateSessionParams): Promise<WsChatSessionResult>;
982
+ }
983
+
984
+ interface WsPlanStep {
985
+ id: string;
986
+ description: string;
987
+ status: 'pending' | 'in_progress' | 'completed' | 'error';
988
+ agent_id?: any;
989
+ machine_id?: any;
990
+ result?: any;
991
+ error?: any;
992
+ }
993
+ interface WsMessageStartEvent {
994
+ type: 'message_start';
995
+ message_id: string;
996
+ client_message_id?: string;
997
+ }
998
+ interface WsMessageChunkEvent {
999
+ type: 'message_chunk';
1000
+ message_id: string;
1001
+ client_message_id?: string;
1002
+ chunk: string;
1003
+ }
1004
+ interface WsMessageCompleteEvent {
1005
+ type: 'message_complete';
1006
+ message_id: string;
1007
+ client_message_id?: string;
1008
+ content: string;
1009
+ }
1010
+ interface WsErrorEvent {
1011
+ type: 'error';
1012
+ message_id: string;
1013
+ client_message_id?: string;
1014
+ error: string;
1015
+ }
1016
+ interface WsOrchestrationRoutingEvent {
1017
+ type: 'orchestration_routing';
1018
+ message_id: string;
1019
+ client_message_id?: string;
1020
+ intent: string;
1021
+ needs_planning: boolean;
1022
+ }
1023
+ interface WsOrchestrationPlanEvent {
1024
+ type: 'orchestration_plan';
1025
+ message_id: string;
1026
+ client_message_id?: string;
1027
+ iteration: number;
1028
+ steps: WsPlanStep[];
1029
+ }
1030
+ interface WsOrchestrationStepStartEvent {
1031
+ type: 'orchestration_step_start';
1032
+ message_id: string;
1033
+ client_message_id?: string;
1034
+ step_id: string;
1035
+ }
1036
+ interface WsOrchestrationStepCompleteEvent {
1037
+ type: 'orchestration_step_complete';
1038
+ message_id: string;
1039
+ client_message_id?: string;
1040
+ step_id: string;
1041
+ result: string;
1042
+ }
1043
+ interface WsOrchestrationStepErrorEvent {
1044
+ type: 'orchestration_step_error';
1045
+ message_id: string;
1046
+ client_message_id?: string;
1047
+ step_id: string;
1048
+ error: string;
1049
+ }
1050
+ interface WsOrchestrationEvaluationEvent {
1051
+ type: 'orchestration_evaluation';
1052
+ message_id: string;
1053
+ client_message_id?: string;
1054
+ goal_achieved: boolean;
1055
+ reasoning: string;
1056
+ }
1057
+ interface WsOrchestrationCompleteEvent {
1058
+ type: 'orchestration_complete';
1059
+ message_id: string;
1060
+ client_message_id?: string;
1061
+ final_result: string;
1062
+ total_iterations: number;
1063
+ }
1064
+ /** AI chat streaming events (message chunks, orchestration, errors) */
1065
+ type WsAiChatEvent = WsMessageStartEvent | WsMessageChunkEvent | WsMessageCompleteEvent | WsErrorEvent | WsOrchestrationRoutingEvent | WsOrchestrationPlanEvent | WsOrchestrationStepStartEvent | WsOrchestrationStepCompleteEvent | WsOrchestrationStepErrorEvent | WsOrchestrationEvaluationEvent | WsOrchestrationCompleteEvent;
1066
+
172
1067
  /**
173
1068
  * useTerminal hook - Real-time terminal connection via WebSocket
174
1069
  */
@@ -448,6 +1343,391 @@ interface RunAgentOptions {
448
1343
  */
449
1344
  declare function useAgent(options: UseAgentOptions): UseAgentResult;
450
1345
 
1346
+ /**
1347
+ * useFiles hook - File operations via WebSocket RPC
1348
+ */
1349
+
1350
+ interface UseFilesOptions {
1351
+ /**
1352
+ * Session ID for file operations
1353
+ */
1354
+ sessionId: string;
1355
+ }
1356
+ interface UseFilesResult {
1357
+ /**
1358
+ * List directory contents
1359
+ */
1360
+ list: (path: string, options?: ListOptions) => Promise<WsListDirectoryResult>;
1361
+ /**
1362
+ * Read file contents
1363
+ */
1364
+ read: (path: string, options?: ReadOptions) => Promise<WsReadFileResult>;
1365
+ /**
1366
+ * Write file contents
1367
+ */
1368
+ write: (path: string, content: string, options?: WriteOptions) => Promise<WsWriteFileResult>;
1369
+ /**
1370
+ * Delete file or directory
1371
+ */
1372
+ remove: (path: string, recursive?: boolean) => Promise<WsDeleteResult>;
1373
+ /**
1374
+ * Move or rename file/directory
1375
+ */
1376
+ move: (sourcePath: string, destPath: string) => Promise<WsMoveResult>;
1377
+ /**
1378
+ * Create directory
1379
+ */
1380
+ mkdir: (path: string, createParents?: boolean) => Promise<WsCreateDirectoryResult>;
1381
+ /**
1382
+ * Search files
1383
+ */
1384
+ search: (path: string, options: SearchOptions) => Promise<WsSearchResult>;
1385
+ /**
1386
+ * Get file/directory info
1387
+ */
1388
+ getInfo: (path: string) => Promise<WsGetFileInfoResult>;
1389
+ /**
1390
+ * Loading state
1391
+ */
1392
+ isLoading: boolean;
1393
+ /**
1394
+ * Last error
1395
+ */
1396
+ error: Error | null;
1397
+ /**
1398
+ * Clear error
1399
+ */
1400
+ clearError: () => void;
1401
+ }
1402
+ interface ListOptions {
1403
+ pageSize?: number;
1404
+ pageToken?: string;
1405
+ includeHidden?: boolean;
1406
+ sortOrder?: string;
1407
+ }
1408
+ interface ReadOptions {
1409
+ offset?: number;
1410
+ length?: number;
1411
+ }
1412
+ interface WriteOptions {
1413
+ overwrite?: boolean;
1414
+ createParents?: boolean;
1415
+ }
1416
+ interface SearchOptions {
1417
+ filenamePattern?: string;
1418
+ contentPattern?: string;
1419
+ caseSensitive?: boolean;
1420
+ maxResults?: number;
1421
+ maxDepth?: number;
1422
+ }
1423
+ declare function useFiles({ sessionId }: UseFilesOptions): UseFilesResult;
1424
+
1425
+ /**
1426
+ * useSessions hook - Terminal session management via WebSocket RPC
1427
+ */
1428
+
1429
+ interface UseSessionsOptions {
1430
+ /**
1431
+ * Auto-fetch sessions on mount
1432
+ * @default true
1433
+ */
1434
+ autoFetch?: boolean;
1435
+ /**
1436
+ * Max sessions to fetch
1437
+ */
1438
+ limit?: number;
1439
+ }
1440
+ interface UseSessionsResult {
1441
+ /**
1442
+ * List of sessions
1443
+ */
1444
+ sessions: WsSessionResult[];
1445
+ /**
1446
+ * Total session count
1447
+ */
1448
+ total: number;
1449
+ /**
1450
+ * Refresh sessions list
1451
+ */
1452
+ refresh: () => Promise<void>;
1453
+ /**
1454
+ * Create a new session
1455
+ */
1456
+ create: (options?: CreateSessionOptions) => Promise<WsSessionResult>;
1457
+ /**
1458
+ * Get session by ID
1459
+ */
1460
+ get: (sessionId: string) => Promise<WsSessionResult>;
1461
+ /**
1462
+ * Close a session
1463
+ */
1464
+ close: (sessionId: string) => Promise<void>;
1465
+ /**
1466
+ * Loading state
1467
+ */
1468
+ isLoading: boolean;
1469
+ /**
1470
+ * Last error
1471
+ */
1472
+ error: Error | null;
1473
+ /**
1474
+ * Clear error
1475
+ */
1476
+ clearError: () => void;
1477
+ }
1478
+ interface CreateSessionOptions {
1479
+ name?: string;
1480
+ shell?: string;
1481
+ workingDirectory?: string;
1482
+ }
1483
+ declare function useSessions(options?: UseSessionsOptions): UseSessionsResult;
1484
+
1485
+ /**
1486
+ * Base64 encoding/decoding utilities
1487
+ * Browser-focused implementation using btoa/atob
1488
+ */
1489
+ /**
1490
+ * Encode string to base64
1491
+ * Handles Unicode strings correctly
1492
+ */
1493
+ declare function encodeBase64(str: string): string;
1494
+ /**
1495
+ * Decode base64 to string
1496
+ * Handles Unicode strings correctly
1497
+ */
1498
+ declare function decodeBase64(base64: string): string;
1499
+ /**
1500
+ * Try to decode base64, return original string on failure
1501
+ */
1502
+ declare function tryDecodeBase64(str: string): string;
1503
+ /**
1504
+ * Encode binary data (Uint8Array) to base64
1505
+ */
1506
+ declare function encodeBase64Bytes(data: Uint8Array): string;
1507
+ /**
1508
+ * Decode base64 to binary data (Uint8Array)
1509
+ */
1510
+ declare function decodeBase64Bytes(base64: string): Uint8Array;
1511
+
1512
+ /**
1513
+ * Error mapping utilities
1514
+ * Maps WebSocket/RPC errors to @cmdop/core error types
1515
+ */
1516
+ /**
1517
+ * Map an RPC error to appropriate CMDOP error type
1518
+ */
1519
+ declare function mapRPCError(error: unknown): Error;
1520
+ /**
1521
+ * Create error from RPC result with success=false
1522
+ */
1523
+ declare function createErrorFromResult(result: {
1524
+ success: false;
1525
+ error?: string;
1526
+ error_code?: string;
1527
+ }): Error;
1528
+ /**
1529
+ * Check if error is a connection error that should trigger reconnect
1530
+ */
1531
+ declare function isRetryableError(error: unknown): boolean;
1532
+
1533
+ /**
1534
+ * Class name utility
1535
+ * Simple utility for conditional class name merging
1536
+ */
1537
+ type ClassValue = string | undefined | null | false | 0;
1538
+ /**
1539
+ * Merge class names, filtering out falsy values
1540
+ */
1541
+ declare function cn(...classes: ClassValue[]): string;
1542
+
1543
+ /**
1544
+ * Chat Component Types
1545
+ */
1546
+
1547
+ interface BaseMessage {
1548
+ id: string;
1549
+ role: 'user' | 'assistant';
1550
+ content: string;
1551
+ timestamp: Date;
1552
+ isStreaming?: boolean;
1553
+ }
1554
+ interface ChatInputProps {
1555
+ onSend: (content: string) => void;
1556
+ disabled?: boolean;
1557
+ isLoading?: boolean;
1558
+ placeholder?: string;
1559
+ className?: string;
1560
+ inputClassName?: string;
1561
+ buttonClassName?: string;
1562
+ }
1563
+ interface ChatMessagesProps<T extends BaseMessage> {
1564
+ messages: T[];
1565
+ renderMessage: (message: T) => ReactNode;
1566
+ onLoadMore?: () => void;
1567
+ isLoadingHistory?: boolean;
1568
+ hasMoreHistory?: boolean;
1569
+ isStreaming?: boolean;
1570
+ emptyState?: ReactNode;
1571
+ className?: string;
1572
+ loadingIndicator?: ReactNode;
1573
+ typingIndicator?: ReactNode;
1574
+ }
1575
+ interface MessageBubbleProps {
1576
+ role: 'user' | 'assistant';
1577
+ content: string;
1578
+ timestamp?: Date;
1579
+ isStreaming?: boolean;
1580
+ children?: ReactNode;
1581
+ className?: string;
1582
+ /** Render custom content instead of default text */
1583
+ renderContent?: (content: string, isUser: boolean) => ReactNode;
1584
+ }
1585
+ interface TypingIndicatorProps {
1586
+ text?: string;
1587
+ className?: string;
1588
+ }
1589
+ interface UseMessageOperationsResult<T extends BaseMessage> {
1590
+ messages: T[];
1591
+ setMessages: Dispatch<SetStateAction<T[]>>;
1592
+ addMessage: (message: T) => void;
1593
+ updateMessage: (id: string, updates: Partial<T>) => void;
1594
+ appendContent: (id: string, chunk: string) => void;
1595
+ removeMessage: (id: string) => void;
1596
+ clearMessages: () => void;
1597
+ }
1598
+ interface MachineMessage extends BaseMessage {
1599
+ /** Command executions attached to this message */
1600
+ executions?: CommandExecution[];
1601
+ }
1602
+ interface CommandExecution {
1603
+ id: string;
1604
+ command: string;
1605
+ status: 'pending' | 'running' | 'completed' | 'error';
1606
+ output: string;
1607
+ exitCode?: number;
1608
+ startedAt?: Date;
1609
+ completedAt?: Date;
1610
+ }
1611
+ /** Centrifugo RPC client interface (compatible with @djangocfg/centrifugo CentrifugoRPCClient) */
1612
+ interface CentrifugoClientInterface {
1613
+ /** Make typed RPC call (namedRPC from @djangocfg/centrifugo) */
1614
+ namedRPC<T = unknown>(method: string, params: unknown, options?: {
1615
+ timeout?: number;
1616
+ }): Promise<T>;
1617
+ }
1618
+ interface MachineChatProps {
1619
+ /** Workspace ID */
1620
+ workspaceId: string;
1621
+ /** Machine ID */
1622
+ machineId: string;
1623
+ /** Machine name for display */
1624
+ machineName?: string;
1625
+ /** External Centrifugo client for RPC calls (from @djangocfg/centrifugo) */
1626
+ centrifugoClient?: CentrifugoClientInterface;
1627
+ /**
1628
+ * Subscription data from external useSubscription hook.
1629
+ * Pass data from: useSubscription({ channel: `ai_chat:workspace:${workspaceId}` })
1630
+ */
1631
+ subscriptionData?: MachineCentrifugoMessage | null;
1632
+ /** Additional CSS classes */
1633
+ className?: string;
1634
+ /** Custom header renderer */
1635
+ renderHeader?: (machineName?: string) => ReactNode;
1636
+ /** Custom empty state renderer */
1637
+ renderEmptyState?: () => ReactNode;
1638
+ }
1639
+ interface CommandOutputProps {
1640
+ execution: CommandExecution;
1641
+ className?: string;
1642
+ }
1643
+ interface CentrifugoMessageBase {
1644
+ message_id: string;
1645
+ client_message_id?: string;
1646
+ }
1647
+ type MachineCommandEvent = (CentrifugoMessageBase & {
1648
+ type: 'command_generated';
1649
+ executions: CommandExecution[];
1650
+ }) | (CentrifugoMessageBase & {
1651
+ type: 'execution_started';
1652
+ execution_id: string;
1653
+ command: string;
1654
+ }) | (CentrifugoMessageBase & {
1655
+ type: 'output_chunk';
1656
+ execution_id: string;
1657
+ chunk: string;
1658
+ }) | (CentrifugoMessageBase & {
1659
+ type: 'execution_completed';
1660
+ execution_id: string;
1661
+ exit_code: number;
1662
+ });
1663
+ type MachineCentrifugoMessage = WsAiChatEvent | MachineCommandEvent;
1664
+ interface UseMachineChatOptions {
1665
+ workspaceId: string;
1666
+ machineId: string;
1667
+ /** External Centrifugo client for RPC calls (from @djangocfg/centrifugo) */
1668
+ centrifugoClient?: CentrifugoClientInterface;
1669
+ /**
1670
+ * Subscription data from external useSubscription hook.
1671
+ * Pass data from: useSubscription({ channel: `ai_chat:workspace:${workspaceId}` })
1672
+ */
1673
+ subscriptionData?: MachineCentrifugoMessage | null;
1674
+ }
1675
+ interface UseMachineChatResult {
1676
+ messages: MachineMessage[];
1677
+ isLoadingHistory: boolean;
1678
+ hasMoreHistory: boolean;
1679
+ isExecuting: boolean;
1680
+ isStreaming: boolean;
1681
+ error: string | null;
1682
+ sendMessage: (content: string) => Promise<void>;
1683
+ loadMoreMessages: () => void;
1684
+ clearMessages: () => void;
1685
+ clearError: () => void;
1686
+ }
1687
+
1688
+ declare function ChatInput({ onSend, disabled, isLoading, placeholder, className, inputClassName, buttonClassName, }: ChatInputProps): react_jsx_runtime.JSX.Element;
1689
+
1690
+ declare function ChatMessages<T extends BaseMessage>({ messages, renderMessage, onLoadMore, isLoadingHistory, hasMoreHistory, isStreaming, emptyState, className, loadingIndicator, typingIndicator, }: ChatMessagesProps<T>): react_jsx_runtime.JSX.Element;
1691
+
1692
+ declare function MessageBubble({ role, content, timestamp, isStreaming, children, className, renderContent, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
1693
+
1694
+ declare function TypingIndicator({ text, className }: TypingIndicatorProps): react_jsx_runtime.JSX.Element;
1695
+
1696
+ declare function CommandOutput({ execution, className }: CommandOutputProps): react_jsx_runtime.JSX.Element;
1697
+
1698
+ declare function MachineChat({ workspaceId, machineId, machineName, centrifugoClient, subscriptionData, className, renderHeader, renderEmptyState, }: MachineChatProps): react_jsx_runtime.JSX.Element;
1699
+
1700
+ /**
1701
+ * Message Operations Hook
1702
+ *
1703
+ * Generic hook for managing chat messages
1704
+ */
1705
+
1706
+ declare function useMessageOperations<T extends BaseMessage>(): UseMessageOperationsResult<T>;
1707
+
1708
+ /**
1709
+ * Machine Chat Hook
1710
+ *
1711
+ * Manages chat state for single machine context.
1712
+ * Uses external Centrifugo client for RPC and receives subscription data as prop.
1713
+ *
1714
+ * @example
1715
+ * ```tsx
1716
+ * // In apps/web with @djangocfg/centrifugo
1717
+ * const { client } = useCentrifugo();
1718
+ * const { data } = useSubscription({ channel: `ai_chat:workspace:${workspaceId}` });
1719
+ *
1720
+ * const chat = useMachineChat({
1721
+ * workspaceId,
1722
+ * machineId,
1723
+ * centrifugoClient: client,
1724
+ * subscriptionData: data,
1725
+ * });
1726
+ * ```
1727
+ */
1728
+
1729
+ declare function useMachineChat({ workspaceId, machineId, centrifugoClient, subscriptionData, }: UseMachineChatOptions): UseMachineChatResult;
1730
+
451
1731
  interface CMDOPContextValue {
452
1732
  config: CMDOPConfig;
453
1733
  isAuthenticated: boolean;
@@ -535,4 +1815,4 @@ interface UseWorkspaceResult {
535
1815
  }
536
1816
  declare function useWorkspace(workspaceId: string | undefined, options?: SWRConfiguration): UseWorkspaceResult;
537
1817
 
538
- export { type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentTokenEvent, type AgentToolCallEvent, type AgentToolResultEvent, CMDOPProvider, type CMDOPProviderProps, CMDOPWebSocketClient, type CMDOPWebSocketConfig, type ConnectionState, type Machine, type RunAgentOptions, type TerminalOutput, type TerminalStatus, type UseAgentOptions, type UseAgentResult, type UseMachineResult, type UseMachinesOptions, type UseMachinesResult, type UseRPCOptions, type UseRPCResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseTerminalOptions, type UseTerminalResult, type UseWorkspaceResult, type UseWorkspacesResult, WebSocketProvider, type WebSocketProviderProps, type Workspace, useAgent, useCMDOP, useMachine, useMachines, useRPC, useSubscription, useTerminal, useWebSocket, useWorkspace, useWorkspaces };
1818
+ export { APIClient, API_VERSION, type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentTokenEvent, type AgentToolCallEvent, type AgentToolResultEvent, type BaseMessage, CMDOPProvider, type CMDOPProviderProps, CMDOPWebSocketClient, type CMDOPWebSocketConfig, ChatInput, type ChatInputProps, ChatMessages, type ChatMessagesProps, type CommandExecution, CommandOutput, type CommandOutputProps, type ConnectionState, type CreateSessionOptions, GENERATED_AT, type ListOptions, type Machine, type MachineCentrifugoMessage, MachineChat, type MachineChatProps, type MachineMessage, MessageBubble, type MessageBubbleProps, type ReadOptions, type RunAgentOptions, type SearchOptions, type TerminalOutput, type TerminalStatus, TypingIndicator, type TypingIndicatorProps, type UseAgentOptions, type UseAgentResult, type UseFilesOptions, type UseFilesResult, type UseMachineChatOptions, type UseMachineChatResult, type UseMachineResult, type UseMachinesOptions, type UseMachinesResult, type UseMessageOperationsResult, type UseRPCOptions, type UseRPCResult, type UseSessionsOptions, type UseSessionsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseTerminalOptions, type UseTerminalResult, type UseWorkspaceResult, type UseWorkspacesResult, WebSocketProvider, type WebSocketProviderProps, type Workspace, type WriteOptions, type WsBrowserExecuteScriptParams, type WsBrowserExecuteScriptResult, type WsBrowserExtractDataParams, type WsBrowserExtractDataResult, type WsBrowserExtractRegexParams, type WsBrowserExtractRegexResult, type WsBrowserValidateSelectorsParams, type WsBrowserValidateSelectorsResult, type WsCancelTransferParams, type WsCancelTransferResult, type WsChannelAuthParams, type WsChannelAuthResult, type WsChatCreateSessionParams, type WsChatSessionResult, type WsCheckVersionParams, type WsContentMatch, type WsCreateArchiveParams, type WsCreateArchiveResult, type WsCreateDirectoryParams, type WsCreateDirectoryResult, type WsDeleteParams, type WsDeleteResult, type WsFileChange, WsFileChangeType, type WsFileEntry, WsFileIconType, type WsGetChangesParams, type WsGetChangesResult, type WsGetFileInfoParams, type WsGetFileInfoResult, type WsGetHistoryParams, type WsGetSessionParams, type WsHistoryResult, type WsInitiateTransferParams, type WsInitiateTransferResult, type WsListDirectoryParams, type WsListDirectoryResult, type WsListSessionsParams, type WsListTransfersParams, type WsListTransfersResult, WsLoadMethod, type WsMediaMetadata, type WsMessageItem, type WsMessageListResult, type WsMessageResult, type WsMoveParams, type WsMoveResult, type WsReadFileParams, type WsReadFileResult, type WsSearchMatch, WsSearchMatchType, type WsSearchParams, type WsSearchResult, type WsSendMessageParams, type WsSessionListResult, type WsSessionResult, type WsSuccessResult, type WsTerminalCloseParams, type WsTerminalCreateSessionParams, type WsTerminalHistoryParams, type WsTerminalInputParams, type WsTerminalResizeParams, type WsTerminalSignalParams, type WsTransferInfo, type WsTransferStatusParams, type WsTransferStatusResult, type WsVersionCheckResult, WsViewerType, type WsWriteFileParams, type WsWriteFileResult, cn, createErrorFromResult, decodeBase64, decodeBase64Bytes, encodeBase64, encodeBase64Bytes, isRetryableError, mapRPCError, tryDecodeBase64, useAgent, useCMDOP, useFiles, useMachine, useMachineChat, useMachines, useMessageOperations, useRPC, useSessions, useSubscription, useTerminal, useWebSocket, useWorkspace, useWorkspaces };