@erdoai/ui 0.1.13 → 0.1.14

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
@@ -285,221 +285,616 @@ interface DatasetTableProps {
285
285
  */
286
286
  declare function DatasetTable({ title, invocationId, datasetSlug, columns, maxRows, className, onScrollUpdate, }: DatasetTableProps): react_jsx_runtime.JSX.Element;
287
287
 
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;
303
- }
304
-
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
288
  /**
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} />
343
- *
344
- * // With custom overrides
345
- * <Content
346
- * content={contentItem}
347
- * components={{
348
- * 'bot_invocation': MyBotInvocation,
349
- * 'authorize_integration': AuthorizeIntegration,
350
- * }}
351
- * />
352
- * ```
289
+ * JSON streaming parser utilities.
290
+ * Used for parsing potentially incomplete JSON during SSE streaming.
353
291
  */
354
- declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
355
-
356
- interface TextContentProps {
357
- content: string;
358
- className?: string;
359
- }
360
- declare function TextContent({ content, className }: TextContentProps): react_jsx_runtime.JSX.Element | null;
361
-
362
- interface JsonContentProps {
363
- content: unknown;
364
- className?: string;
292
+ type JSONValue = string | number | boolean | null | {
293
+ [key: string]: JSONValue;
294
+ [parsingSymbol]?: boolean;
295
+ } | (JSONValue[] & {
296
+ [parsingSymbol]?: boolean;
297
+ });
298
+ 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';
299
+ declare const parsingSymbol: unique symbol;
300
+ declare class JSONStreamParser {
301
+ result: JSONValue | undefined;
302
+ private stack;
303
+ private key;
304
+ state: ParserState;
305
+ private stringBuffer;
306
+ private numberBuffer;
307
+ private quoteBuffer;
308
+ private escapeNext;
309
+ private unicode;
310
+ private isInTripleQuotes;
311
+ constructor();
312
+ private reset;
313
+ parse(jsonString: string): JSONValue | undefined;
314
+ add(chunk: string): JSONValue | undefined;
315
+ private processChar;
316
+ private handleStartState;
317
+ private error;
318
+ private handleObjectState;
319
+ private handleArrayState;
320
+ private handleObjectKeyState;
321
+ private handleAfterKeyState;
322
+ private handleObjectValueState;
323
+ private handleStringState;
324
+ private handleNumberState;
325
+ private handleLiteralState;
326
+ private handleUnicodeState;
327
+ private handleEscapeChar;
328
+ private startObject;
329
+ private endObject;
330
+ private startArray;
331
+ private endArray;
332
+ private startValue;
333
+ private endString;
334
+ private endNumber;
335
+ private endLiteral;
336
+ private addValueToParent;
337
+ private updateValueInParent;
338
+ private isWhitespace;
339
+ private getParentState;
365
340
  }
366
- declare function JsonContent({ content, className }: JsonContentProps): react_jsx_runtime.JSX.Element | null;
341
+ /**
342
+ * Parse a complete JSON string, with fallback to streaming parser for malformed JSON.
343
+ */
344
+ declare function parseCompleteJson(content: string): any;
345
+ type ContentChunk = {
346
+ content: string | Record<string, any>;
347
+ type: 'json' | 'text';
348
+ };
349
+ declare function isWhitespaceChar(char: string): boolean;
350
+ /**
351
+ * Parse mixed content that may contain JSON objects embedded in text.
352
+ * Handles both markdown code blocks (```json...```) and inline JSON.
353
+ */
354
+ declare function parseMixedJson(content: string | any[] | Record<string, any>): ContentChunk[] | any[] | Record<string, any>;
355
+ declare function isParsingComplete(value: any): boolean;
356
+ declare function isParsingInProgress(value: any): boolean;
367
357
 
368
- interface MarkdownContentProps {
369
- /** The markdown content to render */
370
- content: string;
371
- /** Additional CSS class names */
372
- className?: string;
373
- }
374
358
  /**
375
- * Renders markdown content with GitHub Flavored Markdown support.
359
+ * SSE Event Types for parsing streaming invocation results.
376
360
  *
377
- * @example
378
- * ```tsx
379
- * <MarkdownContent content="# Hello\n\nThis is **bold** text." />
380
- * ```
361
+ * These types are standalone and don't depend on any generated client types.
362
+ * They represent the structure of entities that can be built from SSE events.
381
363
  */
382
- declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element | null;
383
364
 
384
- interface TableColumn {
385
- column_name: string;
386
- key: string;
387
- format?: string;
388
- value_type?: 'number' | 'category' | 'date';
389
- }
390
- interface TableContentProps {
391
- title?: string;
392
- columns: TableColumn[];
393
- data: any[];
394
- className?: string;
395
- maxRows?: number;
365
+ type ContentType = 'text' | 'json' | 'xml' | 'thinking' | 'redacted_thinking';
366
+ declare function isJsonLike(contentType: ContentType, uiContentType: string): boolean;
367
+ type EntityType = 'message' | 'message_content' | 'invocation' | 'output' | 'output_content' | 'step' | 'result_handler' | 'status' | 'log';
368
+ type MessageStreamingState = 'in_progress' | 'completed';
369
+ interface SSEEventData {
370
+ payload: Record<string, any> | string;
371
+ metadata: {
372
+ path: string;
373
+ content_type?: ContentType;
374
+ history_content_type?: string;
375
+ ui_content_type?: string;
376
+ invocation_id?: string;
377
+ message_id?: string;
378
+ message_content_id?: string;
379
+ user_visibility?: string;
380
+ bot_visibility?: string;
381
+ visibility?: string;
382
+ output_id?: string;
383
+ output_content_id?: string;
384
+ step_id?: string;
385
+ result_handler_id?: string;
386
+ status_id?: string;
387
+ [key: string]: any;
388
+ };
396
389
  }
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;
390
+ interface BaseContentFields {
391
+ botInvocation?: BotInvocation;
392
+ parsedJson?: ContentChunk[];
393
+ _currentContent?: ContentChunk;
394
+ _jsonParser?: JSONStreamParser;
395
+ _isInJson?: boolean;
396
+ _charBuffer?: string;
397
+ state: MessageStreamingState;
398
+ invocation_id: string;
406
399
  }
407
- interface Series {
408
- series_name: string;
409
- key: string;
410
- color: string;
411
- dataset_slug?: string;
412
- axis_index?: number;
413
- filters?: Filter[];
400
+ interface Message {
401
+ id: string;
402
+ thread_id: string;
403
+ author_id: string;
404
+ author_entity_type: string;
405
+ created_at: string;
406
+ updated_at: string;
407
+ role: string;
408
+ avatar?: string;
414
409
  }
415
- interface Filter {
416
- key: string;
417
- operator: 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'between';
418
- value: string[];
410
+ interface MessageContent extends BaseContentFields {
411
+ _type: 'message_content';
412
+ id: string;
413
+ message_id: string;
414
+ content_type: ContentType;
415
+ content: string;
416
+ created_by_invocation_id?: string;
417
+ user_visibility: string;
418
+ bot_visibility: string;
419
+ created_at: string;
420
+ updated_at: string;
421
+ content_params: {
422
+ RawMessage: any;
423
+ Valid: boolean;
424
+ };
425
+ history_content_type: {
426
+ String: string;
427
+ Valid: boolean;
428
+ };
429
+ ui_content_type: {
430
+ String: string;
431
+ Valid: boolean;
432
+ };
419
433
  }
420
- interface SortCondition {
421
- key: string;
422
- direction: 'asc' | 'desc';
434
+ interface MessageWithContents {
435
+ _type: 'message';
436
+ message: Message;
437
+ state: MessageStreamingState;
438
+ contents: MessageContent[];
439
+ contentsByID: Record<string, MessageContent>;
440
+ contentIDToIdx: Record<string, number>;
423
441
  }
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;
442
+ interface Output {
443
+ id: string;
444
+ invocation_id?: string;
445
+ path?: string;
446
+ created_at: string;
447
+ updated_at: string;
448
+ }
449
+ interface OutputContent extends BaseContentFields {
450
+ _type: 'output_content';
451
+ id: string;
452
+ output_id: string;
453
+ content: string;
454
+ content_type: ContentType;
455
+ user_visibility: string;
456
+ bot_visibility: string;
457
+ created_at: string;
458
+ updated_at: string;
459
+ content_params: {
460
+ RawMessage: any;
461
+ Valid: boolean;
433
462
  };
434
- stacked?: boolean;
435
- sort?: SortCondition[];
463
+ history_content_type: {
464
+ String: string;
465
+ Valid: boolean;
466
+ };
467
+ ui_content_type: {
468
+ String: string;
469
+ Valid: boolean;
470
+ };
471
+ output: OutputWithContents | null;
436
472
  }
437
- interface ChartContentProps {
438
- config: ContentChartConfig;
439
- data: any[];
440
- className?: string;
473
+ interface OutputWithContents {
474
+ _type: 'output';
475
+ id: string;
476
+ step_id?: string;
477
+ output: Output;
478
+ state: MessageStreamingState;
479
+ contents: OutputContent[];
480
+ contentsByID: Record<string, OutputContent>;
481
+ contentIDToIdx: Record<string, number>;
441
482
  }
442
- declare function ChartContent({ config, data, className }: ChartContentProps): react_jsx_runtime.JSX.Element;
483
+ interface Step {
484
+ _type: 'step';
485
+ id: string;
486
+ invocation_id: string;
487
+ step_id: string;
488
+ created_at: string;
489
+ updated_at: string;
490
+ current_status_id: string;
491
+ path: {
492
+ String: string;
493
+ Valid: boolean;
494
+ };
495
+ action_type: {
496
+ String: string;
497
+ Valid: boolean;
498
+ };
499
+ key: {
500
+ String: string;
501
+ Valid: boolean;
502
+ };
503
+ bot_id?: string;
504
+ result_handler_id: string;
505
+ step_order: {
506
+ Int32: number;
507
+ Valid: boolean;
508
+ };
509
+ output_content_type: {
510
+ String: string;
511
+ Valid: boolean;
512
+ };
513
+ execution_mode: {
514
+ String: string;
515
+ Valid: boolean;
516
+ };
517
+ output_behaviour: {
518
+ String: string;
519
+ Valid: boolean;
520
+ };
521
+ user_output_visibility: {
522
+ String: string;
523
+ Valid: boolean;
524
+ };
525
+ output_channels: string[];
526
+ running_message: {
527
+ String: string;
528
+ Valid: boolean;
529
+ };
530
+ finished_message: {
531
+ String: string;
532
+ Valid: boolean;
533
+ };
534
+ depends_on: string[];
535
+ eventsByID: Record<string, InvocationEvent>;
536
+ currentStatus: Status | null;
537
+ }
538
+ interface ResultHandler {
539
+ _type: 'result_handler';
540
+ id: string;
541
+ invocation_id: string;
542
+ result_handler_id: string;
543
+ step_invocation_id: string;
544
+ type: string;
545
+ if_conditions: Record<string, any>;
546
+ created_at: string;
547
+ updated_at: string;
548
+ output_content_type: string;
549
+ result_handler_order: number;
550
+ eventsByID: Record<string, InvocationEvent>;
551
+ }
552
+ declare enum InvocationStatus {
553
+ Pending = "pending",
554
+ Running = "running",
555
+ Success = "success",
556
+ Error = "error",
557
+ RequiresInfo = "requires info",
558
+ GoToStep = "go to step",
559
+ Skipped = "skipped",
560
+ Break = "break"
561
+ }
562
+ declare enum ExecutionStatus {
563
+ Initializing = "initializing",
564
+ Running = "running",
565
+ ProcessingDatasets = "processing datasets",
566
+ Completed = "completed",
567
+ Failed = "failed"
568
+ }
569
+ interface StatusEvent {
570
+ status: ExecutionStatus | InvocationStatus | string;
571
+ message?: string;
572
+ details?: Record<string, any>;
573
+ }
574
+ interface Status {
575
+ _type: 'status';
576
+ id: string;
577
+ status: string;
578
+ message: {
579
+ String: string;
580
+ Valid: boolean;
581
+ };
582
+ Details: StatusEvent;
583
+ created_at?: string;
584
+ }
585
+ interface BotInvocationData {
586
+ id: string;
587
+ bot_id: string;
588
+ bot_name?: string;
589
+ created_by_user_id?: string;
590
+ current_state_id: string;
591
+ parent_invocation_id: string;
592
+ branch_init_state_id: string;
593
+ current_status_id: string;
594
+ organization_id: string;
595
+ created_at: string;
596
+ updated_at: string;
597
+ }
598
+ interface BotInvocation {
599
+ _type: 'invocation';
600
+ bot_invocation: BotInvocationData;
601
+ eventsByID: Record<string, InvocationEvent>;
602
+ currentStatus: Status | null;
603
+ current_status: Status | null;
604
+ step_invocations: any[];
605
+ step_invocation_states: any[];
606
+ resources: any[];
607
+ outputs: any[];
608
+ statuses: any[];
609
+ }
610
+ interface InvocationEvent {
611
+ id?: string;
612
+ type?: EntityType;
613
+ created_at?: string;
614
+ _type: 'invocation_event';
615
+ Output: OutputWithContents | null;
616
+ Message: MessageWithContents | null;
617
+ Status: Status | null;
618
+ ResultHandler: ResultHandler | null;
619
+ Step: Step | null;
620
+ }
621
+ type Entity = MessageWithContents | MessageContent | BotInvocation | OutputWithContents | OutputContent | Step | ResultHandler | Status;
443
622
 
444
- interface ThinkingContentProps {
445
- item: ContentItem;
446
- className?: string;
623
+ interface InvocationEventsProps {
624
+ eventsByID: Record<string, InvocationEvent>;
625
+ /** Optional Content component for rendering nested content */
626
+ ContentComponent?: React__default.ComponentType<{
627
+ content: any;
628
+ className?: string;
629
+ }>;
447
630
  }
448
631
  /**
449
- * Renders Claude's thinking/reasoning content in a collapsible panel.
450
- * Handles both regular thinking and redacted (encrypted) thinking.
632
+ * Renders a list of invocation events (outputs, steps, etc.)
451
633
  */
452
- declare function ThinkingContent({ item, className }: ThinkingContentProps): react_jsx_runtime.JSX.Element;
634
+ declare function InvocationEvents({ eventsByID, ContentComponent }: InvocationEventsProps): react_jsx_runtime.JSX.Element;
453
635
 
454
- interface LogContentProps {
455
- item: ContentItem;
456
- className?: string;
457
- }
458
- interface LogProps {
459
- log: LogEntry;
636
+ interface InvocationEventRendererProps {
637
+ event: InvocationEvent;
638
+ /** Optional Content component for rendering nested content */
639
+ ContentComponent?: React__default.ComponentType<{
640
+ content: any;
641
+ className?: string;
642
+ }>;
460
643
  }
461
- declare function Log({ log }: LogProps): react_jsx_runtime.JSX.Element;
462
644
  /**
463
- * Renders log entries with level-based styling (info, error, requires_info).
645
+ * Routes an invocation event to the appropriate renderer (Output or StepInvocation)
464
646
  */
465
- declare function LogContent({ item, className }: LogContentProps): react_jsx_runtime.JSX.Element;
647
+ declare function InvocationEventRenderer({ event, ContentComponent }: InvocationEventRendererProps): react_jsx_runtime.JSX.Element | null;
466
648
 
467
- interface WebSearchContentProps {
468
- item: ContentItem;
469
- className?: string;
649
+ interface OutputRendererProps {
650
+ output: OutputWithContents;
651
+ /** Optional Content component for rendering output contents */
652
+ ContentComponent?: React__default.ComponentType<{
653
+ content: any;
654
+ className?: string;
655
+ }>;
470
656
  }
471
657
  /**
472
- * Renders web search results as a list of clickable cards.
658
+ * Renders output contents from a step invocation
473
659
  */
474
- declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
660
+ declare function OutputRenderer({ output, ContentComponent }: OutputRendererProps): react_jsx_runtime.JSX.Element | null;
475
661
 
476
- interface WebParseContentProps {
477
- item: ContentItem;
478
- className?: string;
662
+ interface StepInvocationProps {
663
+ step: Step;
664
+ /** Optional Content component for rendering nested content */
665
+ ContentComponent?: React__default.ComponentType<{
666
+ content: any;
667
+ className?: string;
668
+ }>;
479
669
  }
480
670
  /**
481
- * Renders parsed web page content with title, description, and markdown body.
671
+ * Renders a step invocation with its status and nested events
482
672
  */
483
- declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
673
+ declare function StepInvocation({ step, ContentComponent }: StepInvocationProps): react_jsx_runtime.JSX.Element | null;
484
674
 
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;
675
+ interface StepInvocationStatusProps {
676
+ step: Step;
492
677
  }
493
678
  /**
494
- * An expandable container for code output with max-height and scroll.
679
+ * Renders the status of a step invocation with a spinner
495
680
  */
496
- declare function ExpandableOutputContent({ children, defaultOpen, wrapperType, compact, className, }: ExpandableOutputContentProps): react_jsx_runtime.JSX.Element;
497
- interface OutputLineProps {
681
+ declare function StepInvocationStatus({ step }: StepInvocationStatusProps): react_jsx_runtime.JSX.Element | null;
682
+
683
+ declare class ErrorBoundary extends React__default.Component<{
684
+ fallback: React__default.ReactNode;
498
685
  children: React__default.ReactNode;
499
- timestamp?: string;
500
- }
501
- /**
502
- * Standard output text line with optional timestamp.
686
+ }, {
687
+ hasError: boolean;
688
+ }> {
689
+ constructor(props: {
690
+ fallback: React__default.ReactNode;
691
+ children: React__default.ReactNode;
692
+ });
693
+ static getDerivedStateFromError(_: Error): {
694
+ hasError: boolean;
695
+ };
696
+ componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
697
+ render(): React__default.ReactNode;
698
+ }
699
+
700
+ /** Props passed to all content components */
701
+ interface ContentComponentProps {
702
+ content: ContentItem;
703
+ className?: string;
704
+ }
705
+ interface ContentProps {
706
+ content: ContentItem;
707
+ className?: string;
708
+ /**
709
+ * Override renderers for specific content types.
710
+ * Key is the content_type or ui_content_type string.
711
+ * Component receives { content, className, ...otherProps } props.
712
+ * Components can accept additional props beyond ContentComponentProps.
713
+ *
714
+ * @example
715
+ * ```tsx
716
+ * <Content
717
+ * content={contentItem}
718
+ * components={{
719
+ * 'bot_invocation': MyBotInvocation,
720
+ * 'authorize_integration': AuthorizeIntegration,
721
+ * 'my_custom_type': MyCustomRenderer,
722
+ * }}
723
+ * />
724
+ * ```
725
+ */
726
+ components?: Record<string, React__default.ComponentType<any>>;
727
+ }
728
+ /**
729
+ * Routes content to the appropriate renderer based on content_type and ui_content_type.
730
+ *
731
+ * This is the main entry point for rendering content items from Erdo bot invocations.
732
+ * It checks for custom component overrides first, then falls back to built-in renderers.
733
+ *
734
+ * @example
735
+ * ```tsx
736
+ * // Basic usage - uses built-in renderers
737
+ * <Content content={contentItem} />
738
+ *
739
+ * // With custom overrides
740
+ * <Content
741
+ * content={contentItem}
742
+ * components={{
743
+ * 'bot_invocation': MyBotInvocation,
744
+ * 'authorize_integration': AuthorizeIntegration,
745
+ * }}
746
+ * />
747
+ * ```
748
+ */
749
+ declare function Content({ content, className, components }: ContentProps): react_jsx_runtime.JSX.Element | null;
750
+
751
+ interface TextContentProps {
752
+ content: string;
753
+ className?: string;
754
+ }
755
+ declare function TextContent({ content, className }: TextContentProps): react_jsx_runtime.JSX.Element | null;
756
+
757
+ interface JsonContentProps {
758
+ content: unknown;
759
+ className?: string;
760
+ }
761
+ declare function JsonContent({ content, className }: JsonContentProps): react_jsx_runtime.JSX.Element | null;
762
+
763
+ interface MarkdownContentProps {
764
+ /** The markdown content to render */
765
+ content: string;
766
+ /** Additional CSS class names */
767
+ className?: string;
768
+ }
769
+ /**
770
+ * Renders markdown content with GitHub Flavored Markdown support.
771
+ *
772
+ * @example
773
+ * ```tsx
774
+ * <MarkdownContent content="# Hello\n\nThis is **bold** text." />
775
+ * ```
776
+ */
777
+ declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element | null;
778
+
779
+ interface TableColumn {
780
+ column_name: string;
781
+ key: string;
782
+ format?: string;
783
+ value_type?: 'number' | 'category' | 'date';
784
+ }
785
+ interface TableContentProps {
786
+ title?: string;
787
+ columns: TableColumn[];
788
+ data: any[];
789
+ className?: string;
790
+ maxRows?: number;
791
+ }
792
+ declare function TableContent({ title, columns, data, className, maxRows }: TableContentProps): react_jsx_runtime.JSX.Element;
793
+
794
+ interface Axis {
795
+ axis_label: string;
796
+ key: string;
797
+ max_value?: string | null;
798
+ min_value?: string | null;
799
+ value_type?: 'number' | 'category' | 'date' | null;
800
+ format?: string | null;
801
+ }
802
+ interface Series {
803
+ series_name: string;
804
+ key: string;
805
+ color: string;
806
+ dataset_slug?: string;
807
+ axis_index?: number;
808
+ filters?: Filter[];
809
+ }
810
+ interface Filter {
811
+ key: string;
812
+ operator: 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'between';
813
+ value: string[];
814
+ }
815
+ interface SortCondition {
816
+ key: string;
817
+ direction: 'asc' | 'desc';
818
+ }
819
+ interface ContentChartConfig {
820
+ chart_type: 'bar' | 'line' | 'pie' | 'histogram' | 'scatter' | 'heatmap';
821
+ chart_title: string;
822
+ x_axis: Axis;
823
+ y_axes: Axis[];
824
+ series: Series[];
825
+ data_reduction?: {
826
+ strategy: 'none' | 'sample' | 'aggregate' | 'bin';
827
+ target_points: number;
828
+ };
829
+ stacked?: boolean;
830
+ sort?: SortCondition[];
831
+ }
832
+ interface ChartContentProps {
833
+ config: ContentChartConfig;
834
+ data: any[];
835
+ className?: string;
836
+ }
837
+ declare function ChartContent({ config, data, className }: ChartContentProps): react_jsx_runtime.JSX.Element;
838
+
839
+ interface ThinkingContentProps {
840
+ item: ContentItem;
841
+ className?: string;
842
+ }
843
+ /**
844
+ * Renders Claude's thinking/reasoning content in a collapsible panel.
845
+ * Handles both regular thinking and redacted (encrypted) thinking.
846
+ */
847
+ declare function ThinkingContent({ item, className }: ThinkingContentProps): react_jsx_runtime.JSX.Element;
848
+
849
+ interface LogContentProps {
850
+ item: ContentItem;
851
+ className?: string;
852
+ }
853
+ interface LogProps {
854
+ log: LogEntry;
855
+ }
856
+ declare function Log({ log }: LogProps): react_jsx_runtime.JSX.Element;
857
+ /**
858
+ * Renders log entries with level-based styling (info, error, requires_info).
859
+ */
860
+ declare function LogContent({ item, className }: LogContentProps): react_jsx_runtime.JSX.Element;
861
+
862
+ interface WebSearchContentProps {
863
+ item: ContentItem;
864
+ className?: string;
865
+ }
866
+ /**
867
+ * Renders web search results as a list of clickable cards.
868
+ */
869
+ declare function WebSearchContent({ item, className }: WebSearchContentProps): react_jsx_runtime.JSX.Element | null;
870
+
871
+ interface WebParseContentProps {
872
+ item: ContentItem;
873
+ className?: string;
874
+ }
875
+ /**
876
+ * Renders parsed web page content with title, description, and markdown body.
877
+ */
878
+ declare function WebParseContent({ item, className }: WebParseContentProps): react_jsx_runtime.JSX.Element | null;
879
+
880
+ type WrapperType = 'standard' | 'info' | 'warning';
881
+ interface ExpandableOutputContentProps {
882
+ children: React__default.ReactNode;
883
+ defaultOpen?: boolean;
884
+ wrapperType?: WrapperType;
885
+ compact?: boolean;
886
+ className?: string;
887
+ }
888
+ /**
889
+ * An expandable container for code output with max-height and scroll.
890
+ */
891
+ declare function ExpandableOutputContent({ children, defaultOpen, wrapperType, compact, className, }: ExpandableOutputContentProps): react_jsx_runtime.JSX.Element;
892
+ interface OutputLineProps {
893
+ children: React__default.ReactNode;
894
+ timestamp?: string;
895
+ }
896
+ /**
897
+ * Standard output text line with optional timestamp.
503
898
  */
504
899
  declare function StdoutText({ children, timestamp }: OutputLineProps): react_jsx_runtime.JSX.Element;
505
900
  /**
@@ -816,341 +1211,6 @@ declare function toSnakeCase(str: string): string;
816
1211
  */
817
1212
  declare function resolveKeyFromData(dataRows: any[], configKey: string): string;
818
1213
 
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
1214
  /**
1155
1215
  * SSE Event Handler
1156
1216
  *
@@ -1193,4 +1253,4 @@ declare function handleIncrementalMixedJsonParsing(outputContent: MessageContent
1193
1253
  */
1194
1254
  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
1255
 
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 };
1256
+ 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, InvocationEventRenderer, type InvocationEventRendererProps, 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, type Output, type OutputContent, OutputRenderer, type OutputRendererProps, 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 };