@erdoai/ui 0.1.13 → 0.1.15

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.cts CHANGED
@@ -66,6 +66,22 @@ interface ErdoProviderConfig {
66
66
  * ```
67
67
  */
68
68
  dataFetcher?: DataFetcher;
69
+ /**
70
+ * Optional component for rendering content items.
71
+ * When provided, invocation components will use this to render nested content.
72
+ * This allows consumers to inject their own Content component with custom renderers.
73
+ *
74
+ * Example:
75
+ * ```tsx
76
+ * <ErdoProvider config={{ baseUrl: '...', ContentComponent: MyContent }}>
77
+ * <InvocationEvents eventsByID={events} />
78
+ * </ErdoProvider>
79
+ * ```
80
+ */
81
+ ContentComponent?: React__default.ComponentType<{
82
+ content: any;
83
+ className?: string;
84
+ }>;
69
85
  }
70
86
  interface ErdoProviderProps {
71
87
  children: React__default.ReactNode;
@@ -285,226 +301,621 @@ interface DatasetTableProps {
285
301
  */
286
302
  declare function DatasetTable({ title, invocationId, datasetSlug, columns, maxRows, className, onScrollUpdate, }: DatasetTableProps): react_jsx_runtime.JSX.Element;
287
303
 
288
- declare class ErrorBoundary extends React__default.Component<{
289
- fallback: React__default.ReactNode;
290
- children: React__default.ReactNode;
291
- }, {
292
- hasError: boolean;
293
- }> {
294
- constructor(props: {
295
- fallback: React__default.ReactNode;
296
- children: React__default.ReactNode;
297
- });
298
- static getDerivedStateFromError(_: Error): {
299
- hasError: boolean;
300
- };
301
- componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
302
- render(): React__default.ReactNode;
304
+ /**
305
+ * JSON streaming parser utilities.
306
+ * Used for parsing potentially incomplete JSON during SSE streaming.
307
+ */
308
+ type JSONValue = string | number | boolean | null | {
309
+ [key: string]: JSONValue;
310
+ [parsingSymbol]?: boolean;
311
+ } | (JSONValue[] & {
312
+ [parsingSymbol]?: boolean;
313
+ });
314
+ type ParserState = 'START' | 'IN_OBJECT' | 'IN_ARRAY' | 'IN_OBJECT_KEY' | 'AFTER_KEY' | 'IN_OBJECT_VALUE' | 'IN_STRING' | 'IN_NUMBER' | 'IN_TRUE' | 'IN_FALSE' | 'IN_NULL' | 'IN_UNICODE' | 'END';
315
+ declare const parsingSymbol: unique symbol;
316
+ declare class JSONStreamParser {
317
+ result: JSONValue | undefined;
318
+ private stack;
319
+ private key;
320
+ state: ParserState;
321
+ private stringBuffer;
322
+ private numberBuffer;
323
+ private quoteBuffer;
324
+ private escapeNext;
325
+ private unicode;
326
+ private isInTripleQuotes;
327
+ constructor();
328
+ private reset;
329
+ parse(jsonString: string): JSONValue | undefined;
330
+ add(chunk: string): JSONValue | undefined;
331
+ private processChar;
332
+ private handleStartState;
333
+ private error;
334
+ private handleObjectState;
335
+ private handleArrayState;
336
+ private handleObjectKeyState;
337
+ private handleAfterKeyState;
338
+ private handleObjectValueState;
339
+ private handleStringState;
340
+ private handleNumberState;
341
+ private handleLiteralState;
342
+ private handleUnicodeState;
343
+ private handleEscapeChar;
344
+ private startObject;
345
+ private endObject;
346
+ private startArray;
347
+ private endArray;
348
+ private startValue;
349
+ private endString;
350
+ private endNumber;
351
+ private endLiteral;
352
+ private addValueToParent;
353
+ private updateValueInParent;
354
+ private isWhitespace;
355
+ private getParentState;
303
356
  }
357
+ /**
358
+ * Parse a complete JSON string, with fallback to streaming parser for malformed JSON.
359
+ */
360
+ declare function parseCompleteJson(content: string): any;
361
+ type ContentChunk = {
362
+ content: string | Record<string, any>;
363
+ type: 'json' | 'text';
364
+ };
365
+ declare function isWhitespaceChar(char: string): boolean;
366
+ /**
367
+ * Parse mixed content that may contain JSON objects embedded in text.
368
+ * Handles both markdown code blocks (```json...```) and inline JSON.
369
+ */
370
+ declare function parseMixedJson(content: string | any[] | Record<string, any>): ContentChunk[] | any[] | Record<string, any>;
371
+ declare function isParsingComplete(value: any): boolean;
372
+ declare function isParsingInProgress(value: any): boolean;
304
373
 
305
- /** Props passed to all content components */
306
- interface ContentComponentProps {
307
- content: ContentItem;
308
- className?: string;
309
- }
310
- interface ContentProps {
311
- content: ContentItem;
312
- className?: string;
313
- /**
314
- * Override renderers for specific content types.
315
- * Key is the content_type or ui_content_type string.
316
- * Component receives { content, className, ...otherProps } props.
317
- * Components can accept additional props beyond ContentComponentProps.
318
- *
319
- * @example
320
- * ```tsx
321
- * <Content
322
- * content={contentItem}
323
- * components={{
324
- * 'bot_invocation': MyBotInvocation,
325
- * 'authorize_integration': AuthorizeIntegration,
326
- * 'my_custom_type': MyCustomRenderer,
327
- * }}
328
- * />
329
- * ```
330
- */
331
- components?: Record<string, React__default.ComponentType<any>>;
332
- }
333
374
  /**
334
- * Routes content to the appropriate renderer based on content_type and ui_content_type.
335
- *
336
- * This is the main entry point for rendering content items from Erdo bot invocations.
337
- * It checks for custom component overrides first, then falls back to built-in renderers.
338
- *
339
- * @example
340
- * ```tsx
341
- * // Basic usage - uses built-in renderers
342
- * <Content content={contentItem} />
375
+ * SSE Event Types for parsing streaming invocation results.
343
376
  *
344
- * // With custom overrides
345
- * <Content
346
- * content={contentItem}
347
- * components={{
348
- * 'bot_invocation': MyBotInvocation,
349
- * 'authorize_integration': AuthorizeIntegration,
350
- * }}
351
- * />
352
- * ```
377
+ * These types are standalone and don't depend on any generated client types.
378
+ * They represent the structure of entities that can be built from SSE events.
353
379
  */
354
- declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
355
380
 
356
- interface TextContentProps {
357
- content: string;
358
- className?: string;
381
+ type ContentType = 'text' | 'json' | 'xml' | 'thinking' | 'redacted_thinking';
382
+ declare function isJsonLike(contentType: ContentType, uiContentType: string): boolean;
383
+ type EntityType = 'message' | 'message_content' | 'invocation' | 'output' | 'output_content' | 'step' | 'result_handler' | 'status' | 'log';
384
+ type MessageStreamingState = 'in_progress' | 'completed';
385
+ interface SSEEventData {
386
+ payload: Record<string, any> | string;
387
+ metadata: {
388
+ path: string;
389
+ content_type?: ContentType;
390
+ history_content_type?: string;
391
+ ui_content_type?: string;
392
+ invocation_id?: string;
393
+ message_id?: string;
394
+ message_content_id?: string;
395
+ user_visibility?: string;
396
+ bot_visibility?: string;
397
+ visibility?: string;
398
+ output_id?: string;
399
+ output_content_id?: string;
400
+ step_id?: string;
401
+ result_handler_id?: string;
402
+ status_id?: string;
403
+ [key: string]: any;
404
+ };
359
405
  }
360
- declare function TextContent({ content, className }: TextContentProps): react_jsx_runtime.JSX.Element | null;
361
-
362
- interface JsonContentProps {
363
- content: unknown;
364
- className?: string;
406
+ interface BaseContentFields {
407
+ botInvocation?: BotInvocation;
408
+ parsedJson?: ContentChunk[];
409
+ _currentContent?: ContentChunk;
410
+ _jsonParser?: JSONStreamParser;
411
+ _isInJson?: boolean;
412
+ _charBuffer?: string;
413
+ state: MessageStreamingState;
414
+ invocation_id: string;
365
415
  }
366
- declare function JsonContent({ content, className }: JsonContentProps): react_jsx_runtime.JSX.Element | null;
367
-
368
- interface MarkdownContentProps {
369
- /** The markdown content to render */
416
+ interface Message {
417
+ id: string;
418
+ thread_id: string;
419
+ author_id: string;
420
+ author_entity_type: string;
421
+ created_at: string;
422
+ updated_at: string;
423
+ role: string;
424
+ avatar?: string;
425
+ }
426
+ interface MessageContent extends BaseContentFields {
427
+ _type: 'message_content';
428
+ id: string;
429
+ message_id: string;
430
+ content_type: ContentType;
370
431
  content: string;
371
- /** Additional CSS class names */
372
- className?: string;
432
+ created_by_invocation_id?: string;
433
+ user_visibility: string;
434
+ bot_visibility: string;
435
+ created_at: string;
436
+ updated_at: string;
437
+ content_params: {
438
+ RawMessage: any;
439
+ Valid: boolean;
440
+ };
441
+ history_content_type: {
442
+ String: string;
443
+ Valid: boolean;
444
+ };
445
+ ui_content_type: {
446
+ String: string;
447
+ Valid: boolean;
448
+ };
373
449
  }
374
- /**
375
- * Renders markdown content with GitHub Flavored Markdown support.
376
- *
377
- * @example
378
- * ```tsx
379
- * <MarkdownContent content="# Hello\n\nThis is **bold** text." />
380
- * ```
381
- */
382
- declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element | null;
383
-
384
- interface TableColumn {
385
- column_name: string;
386
- key: string;
387
- format?: string;
388
- value_type?: 'number' | 'category' | 'date';
450
+ interface MessageWithContents {
451
+ _type: 'message';
452
+ message: Message;
453
+ state: MessageStreamingState;
454
+ contents: MessageContent[];
455
+ contentsByID: Record<string, MessageContent>;
456
+ contentIDToIdx: Record<string, number>;
389
457
  }
390
- interface TableContentProps {
391
- title?: string;
392
- columns: TableColumn[];
393
- data: any[];
394
- className?: string;
395
- maxRows?: number;
458
+ interface Output$1 {
459
+ id: string;
460
+ invocation_id?: string;
461
+ path?: string;
462
+ created_at: string;
463
+ updated_at: string;
396
464
  }
397
- declare function TableContent({ title, columns, data, className, maxRows }: TableContentProps): react_jsx_runtime.JSX.Element;
398
-
399
- interface Axis {
400
- axis_label: string;
401
- key: string;
402
- max_value?: string | null;
403
- min_value?: string | null;
404
- value_type?: 'number' | 'category' | 'date' | null;
405
- format?: string | null;
465
+ interface OutputContent extends BaseContentFields {
466
+ _type: 'output_content';
467
+ id: string;
468
+ output_id: string;
469
+ content: string;
470
+ content_type: ContentType;
471
+ user_visibility: string;
472
+ bot_visibility: string;
473
+ created_at: string;
474
+ updated_at: string;
475
+ content_params: {
476
+ RawMessage: any;
477
+ Valid: boolean;
478
+ };
479
+ history_content_type: {
480
+ String: string;
481
+ Valid: boolean;
482
+ };
483
+ ui_content_type: {
484
+ String: string;
485
+ Valid: boolean;
486
+ };
487
+ output: OutputWithContents | null;
406
488
  }
407
- interface Series {
408
- series_name: string;
409
- key: string;
410
- color: string;
411
- dataset_slug?: string;
412
- axis_index?: number;
413
- filters?: Filter[];
489
+ interface OutputWithContents {
490
+ _type: 'output';
491
+ id: string;
492
+ step_id?: string;
493
+ output: Output$1;
494
+ state: MessageStreamingState;
495
+ contents: OutputContent[];
496
+ contentsByID: Record<string, OutputContent>;
497
+ contentIDToIdx: Record<string, number>;
414
498
  }
415
- interface Filter {
416
- key: string;
417
- operator: 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'between';
418
- value: string[];
499
+ interface Step {
500
+ _type: 'step';
501
+ id: string;
502
+ invocation_id: string;
503
+ step_id: string;
504
+ created_at: string;
505
+ updated_at: string;
506
+ current_status_id: string;
507
+ path: {
508
+ String: string;
509
+ Valid: boolean;
510
+ };
511
+ action_type: {
512
+ String: string;
513
+ Valid: boolean;
514
+ };
515
+ key: {
516
+ String: string;
517
+ Valid: boolean;
518
+ };
519
+ bot_id?: string;
520
+ result_handler_id: string;
521
+ step_order: {
522
+ Int32: number;
523
+ Valid: boolean;
524
+ };
525
+ output_content_type: {
526
+ String: string;
527
+ Valid: boolean;
528
+ };
529
+ execution_mode: {
530
+ String: string;
531
+ Valid: boolean;
532
+ };
533
+ output_behaviour: {
534
+ String: string;
535
+ Valid: boolean;
536
+ };
537
+ user_output_visibility: {
538
+ String: string;
539
+ Valid: boolean;
540
+ };
541
+ output_channels: string[];
542
+ running_message: {
543
+ String: string;
544
+ Valid: boolean;
545
+ };
546
+ finished_message: {
547
+ String: string;
548
+ Valid: boolean;
549
+ };
550
+ depends_on: string[];
551
+ eventsByID: Record<string, InvocationEvent$1>;
552
+ currentStatus: Status | null;
419
553
  }
420
- interface SortCondition {
421
- key: string;
422
- direction: 'asc' | 'desc';
554
+ interface ResultHandler {
555
+ _type: 'result_handler';
556
+ id: string;
557
+ invocation_id: string;
558
+ result_handler_id: string;
559
+ step_invocation_id: string;
560
+ type: string;
561
+ if_conditions: Record<string, any>;
562
+ created_at: string;
563
+ updated_at: string;
564
+ output_content_type: string;
565
+ result_handler_order: number;
566
+ eventsByID: Record<string, InvocationEvent$1>;
423
567
  }
424
- interface ContentChartConfig {
425
- chart_type: 'bar' | 'line' | 'pie' | 'histogram' | 'scatter' | 'heatmap';
426
- chart_title: string;
427
- x_axis: Axis;
428
- y_axes: Axis[];
429
- series: Series[];
430
- data_reduction?: {
431
- strategy: 'none' | 'sample' | 'aggregate' | 'bin';
432
- target_points: number;
568
+ declare enum InvocationStatus {
569
+ Pending = "pending",
570
+ Running = "running",
571
+ Success = "success",
572
+ Error = "error",
573
+ RequiresInfo = "requires info",
574
+ GoToStep = "go to step",
575
+ Skipped = "skipped",
576
+ Break = "break"
577
+ }
578
+ declare enum ExecutionStatus {
579
+ Initializing = "initializing",
580
+ Running = "running",
581
+ ProcessingDatasets = "processing datasets",
582
+ Completed = "completed",
583
+ Failed = "failed"
584
+ }
585
+ interface StatusEvent {
586
+ status: ExecutionStatus | InvocationStatus | string;
587
+ message?: string;
588
+ details?: Record<string, any>;
589
+ }
590
+ interface Status {
591
+ _type: 'status';
592
+ id: string;
593
+ status: string;
594
+ message: {
595
+ String: string;
596
+ Valid: boolean;
433
597
  };
434
- stacked?: boolean;
435
- sort?: SortCondition[];
598
+ Details: StatusEvent;
599
+ created_at?: string;
436
600
  }
437
- interface ChartContentProps {
438
- config: ContentChartConfig;
439
- data: any[];
440
- className?: string;
601
+ interface BotInvocationData {
602
+ id: string;
603
+ bot_id: string;
604
+ bot_name?: string;
605
+ created_by_user_id?: string;
606
+ current_state_id: string;
607
+ parent_invocation_id: string;
608
+ branch_init_state_id: string;
609
+ current_status_id: string;
610
+ organization_id: string;
611
+ created_at: string;
612
+ updated_at: string;
441
613
  }
442
- declare function ChartContent({ config, data, className }: ChartContentProps): react_jsx_runtime.JSX.Element;
614
+ interface BotInvocation {
615
+ _type: 'invocation';
616
+ bot_invocation: BotInvocationData;
617
+ eventsByID: Record<string, InvocationEvent$1>;
618
+ currentStatus: Status | null;
619
+ current_status: Status | null;
620
+ step_invocations: any[];
621
+ step_invocation_states: any[];
622
+ resources: any[];
623
+ outputs: any[];
624
+ statuses: any[];
625
+ }
626
+ interface InvocationEvent$1 {
627
+ id?: string;
628
+ type?: EntityType;
629
+ created_at?: string;
630
+ _type: 'invocation_event';
631
+ Output: OutputWithContents | null;
632
+ Message: MessageWithContents | null;
633
+ Status: Status | null;
634
+ ResultHandler: ResultHandler | null;
635
+ Step: Step | null;
636
+ }
637
+ type Entity = MessageWithContents | MessageContent | BotInvocation | OutputWithContents | OutputContent | Step | ResultHandler | Status;
443
638
 
444
- interface ThinkingContentProps {
445
- item: ContentItem;
446
- className?: string;
639
+ interface InvocationEventsProps {
640
+ eventsByID: Record<string, InvocationEvent$1>;
641
+ /** Optional Content component override (defaults to provider's ContentComponent) */
642
+ ContentComponent?: React__default.ComponentType<{
643
+ content: any;
644
+ className?: string;
645
+ }>;
447
646
  }
448
647
  /**
449
- * Renders Claude's thinking/reasoning content in a collapsible panel.
450
- * Handles both regular thinking and redacted (encrypted) thinking.
648
+ * Renders a list of invocation events (outputs, steps, etc.)
451
649
  */
452
- declare function ThinkingContent({ item, className }: ThinkingContentProps): react_jsx_runtime.JSX.Element;
650
+ declare function InvocationEvents({ eventsByID, ContentComponent }: InvocationEventsProps): react_jsx_runtime.JSX.Element;
453
651
 
454
- interface LogContentProps {
455
- item: ContentItem;
456
- className?: string;
457
- }
458
- interface LogProps {
459
- log: LogEntry;
652
+ interface InvocationEventProps {
653
+ event: InvocationEvent$1;
654
+ /** Optional Content component override (defaults to provider's ContentComponent) */
655
+ ContentComponent?: React__default.ComponentType<{
656
+ content: any;
657
+ className?: string;
658
+ }>;
460
659
  }
461
- declare function Log({ log }: LogProps): react_jsx_runtime.JSX.Element;
462
660
  /**
463
- * Renders log entries with level-based styling (info, error, requires_info).
661
+ * Routes an invocation event to the appropriate renderer (Output or StepInvocation)
464
662
  */
465
- declare function LogContent({ item, className }: LogContentProps): react_jsx_runtime.JSX.Element;
663
+ declare function InvocationEvent({ event, ContentComponent }: InvocationEventProps): react_jsx_runtime.JSX.Element | null;
466
664
 
467
- interface WebSearchContentProps {
468
- item: ContentItem;
469
- className?: string;
665
+ interface OutputProps {
666
+ output: OutputWithContents;
667
+ /** Optional Content component override (defaults to provider's ContentComponent) */
668
+ ContentComponent?: React__default.ComponentType<{
669
+ content: any;
670
+ className?: string;
671
+ }>;
470
672
  }
471
673
  /**
472
- * Renders web search results as a list of clickable cards.
674
+ * Renders output contents from a step invocation
473
675
  */
474
- declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
676
+ declare function Output({ output, ContentComponent }: OutputProps): react_jsx_runtime.JSX.Element | null;
475
677
 
476
- interface WebParseContentProps {
477
- item: ContentItem;
478
- className?: string;
678
+ interface StepInvocationProps {
679
+ step: Step;
680
+ /** Optional Content component for rendering nested content */
681
+ ContentComponent?: React__default.ComponentType<{
682
+ content: any;
683
+ className?: string;
684
+ }>;
479
685
  }
480
686
  /**
481
- * Renders parsed web page content with title, description, and markdown body.
687
+ * Renders a step invocation with its status and nested events
482
688
  */
483
- declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
689
+ declare function StepInvocation({ step, ContentComponent }: StepInvocationProps): react_jsx_runtime.JSX.Element | null;
484
690
 
485
- type WrapperType = 'standard' | 'info' | 'warning';
486
- interface ExpandableOutputContentProps {
487
- children: React__default.ReactNode;
488
- defaultOpen?: boolean;
489
- wrapperType?: WrapperType;
490
- compact?: boolean;
491
- className?: string;
691
+ interface StepInvocationStatusProps {
692
+ step: Step;
492
693
  }
493
694
  /**
494
- * An expandable container for code output with max-height and scroll.
695
+ * Renders the status of a step invocation with a spinner
495
696
  */
496
- declare function ExpandableOutputContent({ children, defaultOpen, wrapperType, compact, className, }: ExpandableOutputContentProps): react_jsx_runtime.JSX.Element;
497
- interface OutputLineProps {
697
+ declare function StepInvocationStatus({ step }: StepInvocationStatusProps): react_jsx_runtime.JSX.Element | null;
698
+
699
+ declare class ErrorBoundary extends React__default.Component<{
700
+ fallback: React__default.ReactNode;
498
701
  children: React__default.ReactNode;
499
- timestamp?: string;
500
- }
501
- /**
502
- * Standard output text line with optional timestamp.
503
- */
504
- declare function StdoutText({ children, timestamp }: OutputLineProps): react_jsx_runtime.JSX.Element;
505
- /**
506
- * Error/stderr output text line with info styling.
507
- */
702
+ }, {
703
+ hasError: boolean;
704
+ }> {
705
+ constructor(props: {
706
+ fallback: React__default.ReactNode;
707
+ children: React__default.ReactNode;
708
+ });
709
+ static getDerivedStateFromError(_: Error): {
710
+ hasError: boolean;
711
+ };
712
+ componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
713
+ render(): React__default.ReactNode;
714
+ }
715
+
716
+ /** Props passed to all content components */
717
+ interface ContentComponentProps {
718
+ content: ContentItem;
719
+ className?: string;
720
+ }
721
+ interface ContentProps {
722
+ content: ContentItem;
723
+ className?: string;
724
+ /**
725
+ * Override renderers for specific content types.
726
+ * Key is the content_type or ui_content_type string.
727
+ * Component receives { content, className, ...otherProps } props.
728
+ * Components can accept additional props beyond ContentComponentProps.
729
+ *
730
+ * @example
731
+ * ```tsx
732
+ * <Content
733
+ * content={contentItem}
734
+ * components={{
735
+ * 'bot_invocation': MyBotInvocation,
736
+ * 'authorize_integration': AuthorizeIntegration,
737
+ * 'my_custom_type': MyCustomRenderer,
738
+ * }}
739
+ * />
740
+ * ```
741
+ */
742
+ components?: Record<string, React__default.ComponentType<any>>;
743
+ }
744
+ /**
745
+ * Routes content to the appropriate renderer based on content_type and ui_content_type.
746
+ *
747
+ * This is the main entry point for rendering content items from Erdo bot invocations.
748
+ * It checks for custom component overrides first, then falls back to built-in renderers.
749
+ *
750
+ * @example
751
+ * ```tsx
752
+ * // Basic usage - uses built-in renderers
753
+ * <Content content={contentItem} />
754
+ *
755
+ * // With custom overrides
756
+ * <Content
757
+ * content={contentItem}
758
+ * components={{
759
+ * 'bot_invocation': MyBotInvocation,
760
+ * 'authorize_integration': AuthorizeIntegration,
761
+ * }}
762
+ * />
763
+ * ```
764
+ */
765
+ declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
766
+
767
+ interface TextContentProps {
768
+ content: string;
769
+ className?: string;
770
+ }
771
+ declare function TextContent({ content, className }: TextContentProps): react_jsx_runtime.JSX.Element | null;
772
+
773
+ interface JsonContentProps {
774
+ content: unknown;
775
+ className?: string;
776
+ }
777
+ declare function JsonContent({ content, className }: JsonContentProps): react_jsx_runtime.JSX.Element | null;
778
+
779
+ interface MarkdownContentProps {
780
+ /** The markdown content to render */
781
+ content: string;
782
+ /** Additional CSS class names */
783
+ className?: string;
784
+ }
785
+ /**
786
+ * Renders markdown content with GitHub Flavored Markdown support.
787
+ *
788
+ * @example
789
+ * ```tsx
790
+ * <MarkdownContent content="# Hello\n\nThis is **bold** text." />
791
+ * ```
792
+ */
793
+ declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element | null;
794
+
795
+ interface TableColumn {
796
+ column_name: string;
797
+ key: string;
798
+ format?: string;
799
+ value_type?: 'number' | 'category' | 'date';
800
+ }
801
+ interface TableContentProps {
802
+ title?: string;
803
+ columns: TableColumn[];
804
+ data: any[];
805
+ className?: string;
806
+ maxRows?: number;
807
+ }
808
+ declare function TableContent({ title, columns, data, className, maxRows }: TableContentProps): react_jsx_runtime.JSX.Element;
809
+
810
+ interface Axis {
811
+ axis_label: string;
812
+ key: string;
813
+ max_value?: string | null;
814
+ min_value?: string | null;
815
+ value_type?: 'number' | 'category' | 'date' | null;
816
+ format?: string | null;
817
+ }
818
+ interface Series {
819
+ series_name: string;
820
+ key: string;
821
+ color: string;
822
+ dataset_slug?: string;
823
+ axis_index?: number;
824
+ filters?: Filter[];
825
+ }
826
+ interface Filter {
827
+ key: string;
828
+ operator: 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'between';
829
+ value: string[];
830
+ }
831
+ interface SortCondition {
832
+ key: string;
833
+ direction: 'asc' | 'desc';
834
+ }
835
+ interface ContentChartConfig {
836
+ chart_type: 'bar' | 'line' | 'pie' | 'histogram' | 'scatter' | 'heatmap';
837
+ chart_title: string;
838
+ x_axis: Axis;
839
+ y_axes: Axis[];
840
+ series: Series[];
841
+ data_reduction?: {
842
+ strategy: 'none' | 'sample' | 'aggregate' | 'bin';
843
+ target_points: number;
844
+ };
845
+ stacked?: boolean;
846
+ sort?: SortCondition[];
847
+ }
848
+ interface ChartContentProps {
849
+ config: ContentChartConfig;
850
+ data: any[];
851
+ className?: string;
852
+ }
853
+ declare function ChartContent({ config, data, className }: ChartContentProps): react_jsx_runtime.JSX.Element;
854
+
855
+ interface ThinkingContentProps {
856
+ item: ContentItem;
857
+ className?: string;
858
+ }
859
+ /**
860
+ * Renders Claude's thinking/reasoning content in a collapsible panel.
861
+ * Handles both regular thinking and redacted (encrypted) thinking.
862
+ */
863
+ declare function ThinkingContent({ item, className }: ThinkingContentProps): react_jsx_runtime.JSX.Element;
864
+
865
+ interface LogContentProps {
866
+ item: ContentItem;
867
+ className?: string;
868
+ }
869
+ interface LogProps {
870
+ log: LogEntry;
871
+ }
872
+ declare function Log({ log }: LogProps): react_jsx_runtime.JSX.Element;
873
+ /**
874
+ * Renders log entries with level-based styling (info, error, requires_info).
875
+ */
876
+ declare function LogContent({ item, className }: LogContentProps): react_jsx_runtime.JSX.Element;
877
+
878
+ interface WebSearchContentProps {
879
+ item: ContentItem;
880
+ className?: string;
881
+ }
882
+ /**
883
+ * Renders web search results as a list of clickable cards.
884
+ */
885
+ declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
886
+
887
+ interface WebParseContentProps {
888
+ item: ContentItem;
889
+ className?: string;
890
+ }
891
+ /**
892
+ * Renders parsed web page content with title, description, and markdown body.
893
+ */
894
+ declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
895
+
896
+ type WrapperType = 'standard' | 'info' | 'warning';
897
+ interface ExpandableOutputContentProps {
898
+ children: React__default.ReactNode;
899
+ defaultOpen?: boolean;
900
+ wrapperType?: WrapperType;
901
+ compact?: boolean;
902
+ className?: string;
903
+ }
904
+ /**
905
+ * An expandable container for code output with max-height and scroll.
906
+ */
907
+ declare function ExpandableOutputContent({ children, defaultOpen, wrapperType, compact, className, }: ExpandableOutputContentProps): react_jsx_runtime.JSX.Element;
908
+ interface OutputLineProps {
909
+ children: React__default.ReactNode;
910
+ timestamp?: string;
911
+ }
912
+ /**
913
+ * Standard output text line with optional timestamp.
914
+ */
915
+ declare function StdoutText({ children, timestamp }: OutputLineProps): react_jsx_runtime.JSX.Element;
916
+ /**
917
+ * Error/stderr output text line with info styling.
918
+ */
508
919
  declare function StderrText({ children, timestamp }: OutputLineProps): react_jsx_runtime.JSX.Element;
509
920
  /**
510
921
  * Warning output text line with warning styling.
@@ -816,341 +1227,6 @@ declare function toSnakeCase(str: string): string;
816
1227
  */
817
1228
  declare function resolveKeyFromData(dataRows: any[], configKey: string): string;
818
1229
 
819
- /**
820
- * JSON streaming parser utilities.
821
- * Used for parsing potentially incomplete JSON during SSE streaming.
822
- */
823
- type JSONValue = string | number | boolean | null | {
824
- [key: string]: JSONValue;
825
- [parsingSymbol]?: boolean;
826
- } | (JSONValue[] & {
827
- [parsingSymbol]?: boolean;
828
- });
829
- type ParserState = 'START' | 'IN_OBJECT' | 'IN_ARRAY' | 'IN_OBJECT_KEY' | 'AFTER_KEY' | 'IN_OBJECT_VALUE' | 'IN_STRING' | 'IN_NUMBER' | 'IN_TRUE' | 'IN_FALSE' | 'IN_NULL' | 'IN_UNICODE' | 'END';
830
- declare const parsingSymbol: unique symbol;
831
- declare class JSONStreamParser {
832
- result: JSONValue | undefined;
833
- private stack;
834
- private key;
835
- state: ParserState;
836
- private stringBuffer;
837
- private numberBuffer;
838
- private quoteBuffer;
839
- private escapeNext;
840
- private unicode;
841
- private isInTripleQuotes;
842
- constructor();
843
- private reset;
844
- parse(jsonString: string): JSONValue | undefined;
845
- add(chunk: string): JSONValue | undefined;
846
- private processChar;
847
- private handleStartState;
848
- private error;
849
- private handleObjectState;
850
- private handleArrayState;
851
- private handleObjectKeyState;
852
- private handleAfterKeyState;
853
- private handleObjectValueState;
854
- private handleStringState;
855
- private handleNumberState;
856
- private handleLiteralState;
857
- private handleUnicodeState;
858
- private handleEscapeChar;
859
- private startObject;
860
- private endObject;
861
- private startArray;
862
- private endArray;
863
- private startValue;
864
- private endString;
865
- private endNumber;
866
- private endLiteral;
867
- private addValueToParent;
868
- private updateValueInParent;
869
- private isWhitespace;
870
- private getParentState;
871
- }
872
- /**
873
- * Parse a complete JSON string, with fallback to streaming parser for malformed JSON.
874
- */
875
- declare function parseCompleteJson(content: string): any;
876
- type ContentChunk = {
877
- content: string | Record<string, any>;
878
- type: 'json' | 'text';
879
- };
880
- declare function isWhitespaceChar(char: string): boolean;
881
- /**
882
- * Parse mixed content that may contain JSON objects embedded in text.
883
- * Handles both markdown code blocks (```json...```) and inline JSON.
884
- */
885
- declare function parseMixedJson(content: string | any[] | Record<string, any>): ContentChunk[] | any[] | Record<string, any>;
886
- declare function isParsingComplete(value: any): boolean;
887
- declare function isParsingInProgress(value: any): boolean;
888
-
889
- /**
890
- * SSE Event Types for parsing streaming invocation results.
891
- *
892
- * These types are standalone and don't depend on any generated client types.
893
- * They represent the structure of entities that can be built from SSE events.
894
- */
895
-
896
- type ContentType = 'text' | 'json' | 'xml' | 'thinking' | 'redacted_thinking';
897
- declare function isJsonLike(contentType: ContentType, uiContentType: string): boolean;
898
- type EntityType = 'message' | 'message_content' | 'invocation' | 'output' | 'output_content' | 'step' | 'result_handler' | 'status' | 'log';
899
- type MessageStreamingState = 'in_progress' | 'completed';
900
- interface SSEEventData {
901
- payload: Record<string, any> | string;
902
- metadata: {
903
- path: string;
904
- content_type?: ContentType;
905
- history_content_type?: string;
906
- ui_content_type?: string;
907
- invocation_id?: string;
908
- message_id?: string;
909
- message_content_id?: string;
910
- user_visibility?: string;
911
- bot_visibility?: string;
912
- visibility?: string;
913
- output_id?: string;
914
- output_content_id?: string;
915
- step_id?: string;
916
- result_handler_id?: string;
917
- status_id?: string;
918
- [key: string]: any;
919
- };
920
- }
921
- interface BaseContentFields {
922
- botInvocation?: BotInvocation;
923
- parsedJson?: ContentChunk[];
924
- _currentContent?: ContentChunk;
925
- _jsonParser?: JSONStreamParser;
926
- _isInJson?: boolean;
927
- _charBuffer?: string;
928
- state: MessageStreamingState;
929
- invocation_id: string;
930
- }
931
- interface Message {
932
- id: string;
933
- thread_id: string;
934
- author_id: string;
935
- author_entity_type: string;
936
- created_at: string;
937
- updated_at: string;
938
- role: string;
939
- avatar?: string;
940
- }
941
- interface MessageContent extends BaseContentFields {
942
- _type: 'message_content';
943
- id: string;
944
- message_id: string;
945
- content_type: ContentType;
946
- content: string;
947
- created_by_invocation_id?: string;
948
- user_visibility: string;
949
- bot_visibility: string;
950
- created_at: string;
951
- updated_at: string;
952
- content_params: {
953
- RawMessage: any;
954
- Valid: boolean;
955
- };
956
- history_content_type: {
957
- String: string;
958
- Valid: boolean;
959
- };
960
- ui_content_type: {
961
- String: string;
962
- Valid: boolean;
963
- };
964
- }
965
- interface MessageWithContents {
966
- _type: 'message';
967
- message: Message;
968
- state: MessageStreamingState;
969
- contents: MessageContent[];
970
- contentsByID: Record<string, MessageContent>;
971
- contentIDToIdx: Record<string, number>;
972
- }
973
- interface Output {
974
- id: string;
975
- invocation_id?: string;
976
- path?: string;
977
- created_at: string;
978
- updated_at: string;
979
- }
980
- interface OutputContent extends BaseContentFields {
981
- _type: 'output_content';
982
- id: string;
983
- output_id: string;
984
- content: string;
985
- content_type: ContentType;
986
- user_visibility: string;
987
- bot_visibility: string;
988
- created_at: string;
989
- updated_at: string;
990
- content_params: {
991
- RawMessage: any;
992
- Valid: boolean;
993
- };
994
- history_content_type: {
995
- String: string;
996
- Valid: boolean;
997
- };
998
- ui_content_type: {
999
- String: string;
1000
- Valid: boolean;
1001
- };
1002
- output: OutputWithContents | null;
1003
- }
1004
- interface OutputWithContents {
1005
- _type: 'output';
1006
- id: string;
1007
- step_id?: string;
1008
- output: Output;
1009
- state: MessageStreamingState;
1010
- contents: OutputContent[];
1011
- contentsByID: Record<string, OutputContent>;
1012
- contentIDToIdx: Record<string, number>;
1013
- }
1014
- interface Step {
1015
- _type: 'step';
1016
- id: string;
1017
- invocation_id: string;
1018
- step_id: string;
1019
- created_at: string;
1020
- updated_at: string;
1021
- current_status_id: string;
1022
- path: {
1023
- String: string;
1024
- Valid: boolean;
1025
- };
1026
- action_type: {
1027
- String: string;
1028
- Valid: boolean;
1029
- };
1030
- key: {
1031
- String: string;
1032
- Valid: boolean;
1033
- };
1034
- bot_id?: string;
1035
- result_handler_id: string;
1036
- step_order: {
1037
- Int32: number;
1038
- Valid: boolean;
1039
- };
1040
- output_content_type: {
1041
- String: string;
1042
- Valid: boolean;
1043
- };
1044
- execution_mode: {
1045
- String: string;
1046
- Valid: boolean;
1047
- };
1048
- output_behaviour: {
1049
- String: string;
1050
- Valid: boolean;
1051
- };
1052
- user_output_visibility: {
1053
- String: string;
1054
- Valid: boolean;
1055
- };
1056
- output_channels: string[];
1057
- running_message: {
1058
- String: string;
1059
- Valid: boolean;
1060
- };
1061
- finished_message: {
1062
- String: string;
1063
- Valid: boolean;
1064
- };
1065
- depends_on: string[];
1066
- eventsByID: Record<string, InvocationEvent>;
1067
- currentStatus: Status | null;
1068
- }
1069
- interface ResultHandler {
1070
- _type: 'result_handler';
1071
- id: string;
1072
- invocation_id: string;
1073
- result_handler_id: string;
1074
- step_invocation_id: string;
1075
- type: string;
1076
- if_conditions: Record<string, any>;
1077
- created_at: string;
1078
- updated_at: string;
1079
- output_content_type: string;
1080
- result_handler_order: number;
1081
- eventsByID: Record<string, InvocationEvent>;
1082
- }
1083
- declare enum InvocationStatus {
1084
- Pending = "pending",
1085
- Running = "running",
1086
- Success = "success",
1087
- Error = "error",
1088
- RequiresInfo = "requires info",
1089
- GoToStep = "go to step",
1090
- Skipped = "skipped",
1091
- Break = "break"
1092
- }
1093
- declare enum ExecutionStatus {
1094
- Initializing = "initializing",
1095
- Running = "running",
1096
- ProcessingDatasets = "processing datasets",
1097
- Completed = "completed",
1098
- Failed = "failed"
1099
- }
1100
- interface StatusEvent {
1101
- status: ExecutionStatus | InvocationStatus | string;
1102
- message?: string;
1103
- details?: Record<string, any>;
1104
- }
1105
- interface Status {
1106
- _type: 'status';
1107
- id: string;
1108
- status: string;
1109
- message: {
1110
- String: string;
1111
- Valid: boolean;
1112
- };
1113
- Details: StatusEvent;
1114
- created_at?: string;
1115
- }
1116
- interface BotInvocationData {
1117
- id: string;
1118
- bot_id: string;
1119
- bot_name?: string;
1120
- created_by_user_id?: string;
1121
- current_state_id: string;
1122
- parent_invocation_id: string;
1123
- branch_init_state_id: string;
1124
- current_status_id: string;
1125
- organization_id: string;
1126
- created_at: string;
1127
- updated_at: string;
1128
- }
1129
- interface BotInvocation {
1130
- _type: 'invocation';
1131
- bot_invocation: BotInvocationData;
1132
- eventsByID: Record<string, InvocationEvent>;
1133
- currentStatus: Status | null;
1134
- current_status: Status | null;
1135
- step_invocations: any[];
1136
- step_invocation_states: any[];
1137
- resources: any[];
1138
- outputs: any[];
1139
- statuses: any[];
1140
- }
1141
- interface InvocationEvent {
1142
- id?: string;
1143
- type?: EntityType;
1144
- created_at?: string;
1145
- _type: 'invocation_event';
1146
- Output: OutputWithContents | null;
1147
- Message: MessageWithContents | null;
1148
- Status: Status | null;
1149
- ResultHandler: ResultHandler | null;
1150
- Step: Step | null;
1151
- }
1152
- type Entity = MessageWithContents | MessageContent | BotInvocation | OutputWithContents | OutputContent | Step | ResultHandler | Status;
1153
-
1154
1230
  /**
1155
1231
  * SSE Event Handler
1156
1232
  *
@@ -1193,4 +1269,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
1193
1269
  */
1194
1270
  declare function handleSSEEvent(eventType: string, event: SSEEventData, path: string[], threadID: string, activeMessagesByID: Record<string, MessageWithContents>, currentEntity?: Entity | null, parents?: Entity[], entityIds?: Record<string, string>): Entity | null;
1195
1271
 
1196
- export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, type InvocationEvent, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, type Output, type OutputContent, type OutputWithContents, PieChart, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseInvocationOptions, type UseInvocationReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, cn, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocation, useMultipleDatasetContents };
1272
+ export { BarChart, type BaseChartProps, type BotInvocation, BotInvocationContent, type BotInvocationContentData, type BotInvocationContentProps, type BotInvocationData, type BotInvocationEventInfo, type BotInvocationStatusInfo, Chart, type ChartConfig, ChartContainer, ChartContent, type ChartContentProps, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeexecContent, type CodeexecContentProps, CodegenContent, type CodegenContentProps, CollapsibleCodeBlock, type CollapsibleCodeBlockProps, Content, type ContentChartConfig, type ContentChunk, type ContentComponentProps, type ContentProps, type ContentType, type DataFetcher, DatasetChart, type DatasetChartProps, DatasetTable, type DatasetTableProps, type Entity, type EntityType, ErdoProvider, type ErdoProviderConfig, type ErdoProviderProps, ErrorBoundary, ExecutionStatus, ExpandableOutputContent, type ExpandableOutputContentProps, HeatmapChart, InvocationEvent, type InvocationEventProps, InvocationEvents, type InvocationEventsProps, InvocationStatus, JSONStreamParser, type JSONValue, JsonContent, type JsonContentProps, LineChart, Log, LogContent, type LogContentProps, type LogProps, MarkdownContent, type MarkdownContentProps, type Message, type MessageContent, type MessageStreamingState, type MessageWithContents, Output, type OutputContent, type OutputProps, type OutputWithContents, PieChart, type ResolvedBotInvocation, type ResultHandler, type SSEEventData, ScatterChart, type SpinnerStatus, SqlContent, type SqlContentProps, type Status, type StatusEvent, StatusSpinner, type StatusSpinnerProps, StderrText, StdoutText, StdwarnText, type Step, StepInvocation, type StepInvocationProps, StepInvocationStatus, type StepInvocationStatusProps, TableContent, type TableContentProps, TextContent, type TextContentProps, ThinkingContent, type ThinkingContentProps, ToolGroupContent, type ToolGroupContentProps, type UseInvocationOptions, type UseInvocationReturn, WebParseContent, type WebParseContentProps, WebSearchContent, type WebSearchContentProps, type WrapperType, cn, formatValue, handleIncrementalMixedJsonParsing, handleSSEEvent, isJsonLike, isParsingComplete, isParsingInProgress, isWhitespaceChar, parseCompleteJson, parseMixedJson, parseToDate, resolveKeyFromData, toSnakeCase, useChartZoom, useDatasetContents, useErdoConfig, useErdoConfigOptional, useInvocation, useMultipleDatasetContents };