@arbidocs/react 0.3.102 → 0.3.104

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
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, AgentStepEvent } from '@arbidocs/sdk/browser';
3
+ import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, AgentStepEvent, ArtifactEvent } from '@arbidocs/sdk/browser';
4
4
  export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateMemoryRequest, CreateTaskRequest, MemoryResponse, MemorySearchRequest, MemorySearchResponse, MessageMetadataPayload, OutputTokensDetails, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserInputRequestEvent, UserMessageEvent } from '@arbidocs/sdk/browser';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import * as _arbidocs_client from '@arbidocs/client';
@@ -9,6 +9,7 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
9
9
  import * as class_variance_authority_types from 'class-variance-authority/types';
10
10
  import { VariantProps } from 'class-variance-authority';
11
11
  import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
12
+ import { LucideIcon } from 'lucide-react';
12
13
  import * as zustand from 'zustand';
13
14
  import { ClassValue } from 'clsx';
14
15
 
@@ -320,6 +321,7 @@ declare function useAssistantQuery(): _tanstack_react_query.UseMutationResult<SS
320
321
  onToken?: (content: string) => void;
321
322
  onStreamStart?: (data: SSEStreamStartData) => void;
322
323
  onAgentStep?: (data: AgentStepEvent) => void;
324
+ onArtifact?: (data: ArtifactEvent) => void;
323
325
  onError?: (message: string) => void;
324
326
  onComplete?: () => void;
325
327
  }, unknown>;
@@ -473,14 +475,14 @@ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.
473
475
  declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
474
476
 
475
477
  declare const badgeVariants: (props?: ({
476
- variant?: "outline" | "default" | "secondary" | "destructive" | null | undefined;
478
+ variant?: "outline" | "default" | "accent" | "secondary" | "destructive" | null | undefined;
477
479
  } & class_variance_authority_types.ClassProp) | undefined) => string;
478
480
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
479
481
  }
480
482
  declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
481
483
 
482
484
  declare const buttonVariants: (props?: ({
483
- variant?: "link" | "outline" | "default" | "secondary" | "destructive" | "ghost" | null | undefined;
485
+ variant?: "link" | "outline" | "default" | "accent" | "secondary" | "destructive" | "ghost" | null | undefined;
484
486
  size?: "default" | "icon" | "sm" | "lg" | null | undefined;
485
487
  } & class_variance_authority_types.ClassProp) | undefined) => string;
486
488
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -492,6 +494,247 @@ declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
492
494
  declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
493
495
  declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
494
496
 
497
+ declare function Card({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
498
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
499
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
500
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
501
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
502
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
503
+
504
+ declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
505
+
506
+ /**
507
+ * The AI engine — domain-agnostic hooks for building an AI-native app on ARBI.
508
+ *
509
+ * `useAiTask` runs a streaming, cited agentic query (tokens, agent steps and
510
+ * artifacts accumulate live, with follow-up threading). `useWorkspaceDocs`
511
+ * resolves a workspace's document ids to ground on, and `useSemanticSearch`
512
+ * returns retrieval-only cited passages. These wrap the low-level SDK hooks so a
513
+ * vertical app never re-implements the streaming/accumulation plumbing.
514
+ */
515
+
516
+ /**
517
+ * Resolve a workspace's document set and their external ids. Pass the active
518
+ * `workspaceId`; the kit stays agnostic about how selection is managed.
519
+ */
520
+ declare function useWorkspaceDocs(workspaceId?: string): {
521
+ wsId: string | undefined;
522
+ docs: {
523
+ external_id: string;
524
+ workspace_ext_id: string;
525
+ file_name?: string | null | undefined;
526
+ status?: string | null | undefined;
527
+ error_message?: string | null | undefined;
528
+ failed_stage?: string | null | undefined;
529
+ n_pages?: number | null | undefined;
530
+ n_chunks?: number | null | undefined;
531
+ tokens?: number | null | undefined;
532
+ file_type?: string | null | undefined;
533
+ file_size?: number | null | undefined;
534
+ storage_type?: string | null | undefined;
535
+ storage_uri?: string | null | undefined;
536
+ content_hash?: string | null | undefined;
537
+ shared?: boolean | null | undefined;
538
+ re_ocred?: boolean | null | undefined;
539
+ config_ext_id?: string | null | undefined;
540
+ parent_ext_id?: string | null | undefined;
541
+ created_by_ext_id: string;
542
+ updated_by_ext_id?: string | null | undefined;
543
+ created_at: string;
544
+ updated_at: string;
545
+ wp_type?: string | null | undefined;
546
+ folder?: string | null | undefined;
547
+ doctags: {
548
+ doc_ext_id: string;
549
+ tag_ext_id: string;
550
+ note?: string | null | undefined;
551
+ citations?: {
552
+ [x: string]: {
553
+ chunk_ids: string[];
554
+ scores: number[];
555
+ statement: string;
556
+ offset_start: number;
557
+ offset_end: number;
558
+ };
559
+ } | null | undefined;
560
+ created_by_ext_id: string;
561
+ updated_by_ext_id?: string | null | undefined;
562
+ created_at: string;
563
+ updated_at: string;
564
+ }[];
565
+ doc_metadata?: {
566
+ doc_nature?: string | null | undefined;
567
+ doc_author?: string | null | undefined;
568
+ doc_subject?: string | null | undefined;
569
+ doc_date?: string | null | undefined;
570
+ title?: string | null | undefined;
571
+ } | null | undefined;
572
+ }[];
573
+ docIds: string[];
574
+ isLoading: boolean;
575
+ isError: boolean;
576
+ ready: boolean;
577
+ };
578
+ type AiTaskStatus = 'idle' | 'running' | 'done' | 'error';
579
+ interface AiRunOptions {
580
+ /** Continue a prior turn (follow-up questions in the same thread). */
581
+ previousResponseId?: string | null;
582
+ model?: string;
583
+ }
584
+ /**
585
+ * Run a single streaming agentic task grounded in a set of documents.
586
+ *
587
+ * Returns live state (`text` accumulates tokens as they stream) plus a `run`
588
+ * that resolves to the full {@link SSEStreamResult} — including the response id
589
+ * needed to chain follow-ups.
590
+ */
591
+ declare function useAiTask(): {
592
+ status: AiTaskStatus;
593
+ text: string;
594
+ stepCount: number;
595
+ error: string | null;
596
+ responseId: string | null;
597
+ artifacts: {
598
+ t?: number | null;
599
+ type: "arbi.artifact";
600
+ doc_ext_id: string;
601
+ title: string;
602
+ mode: "markdown" | "html" | "text";
603
+ content: string;
604
+ is_complete: boolean;
605
+ version: number;
606
+ message_ext_id?: string | null;
607
+ }[];
608
+ run: (question: string, docIds: string[], opts?: AiRunOptions) => Promise<SSEStreamResult | null>;
609
+ reset: () => void;
610
+ isRunning: boolean;
611
+ isDone: boolean;
612
+ };
613
+ interface SearchChunk {
614
+ docId?: string | null;
615
+ docTitle?: string | null;
616
+ page?: number | null;
617
+ score?: number | null;
618
+ content: string;
619
+ }
620
+ /** Search a set of documents and return the top matching passages. */
621
+ declare function useSemanticSearch(docIds: string[]): {
622
+ query: string;
623
+ results: SearchChunk[];
624
+ status: AiTaskStatus;
625
+ error: string | null;
626
+ search: (q: string, mode?: "semantic" | "keyword" | "hybrid") => Promise<void>;
627
+ isRunning: boolean;
628
+ };
629
+
630
+ /** Produce inline `<del>/<ins>` redline markdown from two document versions. */
631
+ declare function toRedlineMarkdown(original: string, revised: string): string;
632
+ /** Count added/removed words between two versions (for a redline summary). */
633
+ declare function redlineStats(original: string, revised: string): {
634
+ added: number;
635
+ removed: number;
636
+ };
637
+ /** Wrap arbitrary text/markdown as a synthetic artifact for the canvas. */
638
+ declare function textToArtifact(title: string, content: string, opts?: {
639
+ mode?: ArtifactEvent['mode'];
640
+ isComplete?: boolean;
641
+ version?: number;
642
+ id?: string;
643
+ }): ArtifactEvent;
644
+
645
+ /**
646
+ * Renders agent output (markdown — headings, lists, GFM tables) in one house
647
+ * style so every AI result across the app looks the same. Redline marks
648
+ * (`<del>` / `<ins>` / `<mark>`) render as tracked changes. Token-neutral: uses
649
+ * shadcn semantic tokens plus the kit's `ai-accent` colour.
650
+ */
651
+ declare function AiMarkdown({ children, className }: {
652
+ children: string;
653
+ className?: string;
654
+ }): React.JSX.Element;
655
+
656
+ /**
657
+ * Renders the live state of a single agentic task: streaming tokens, a "thinking"
658
+ * indicator with the running step count, errors, and a grounded/cited footer with
659
+ * copy-to-clipboard. Shared by every AI feature so streaming looks identical
660
+ * everywhere. Copy is customisable via `groundedNote` / `runningHint`.
661
+ */
662
+ declare function AiAnswer({ status, text, stepCount, error, className, emptyHint, groundedNote, runningHint, testId, }: {
663
+ status: AiTaskStatus;
664
+ text: string;
665
+ stepCount?: number;
666
+ error?: string | null;
667
+ className?: string;
668
+ emptyHint?: string;
669
+ groundedNote?: string;
670
+ runningHint?: string;
671
+ testId?: string;
672
+ }): React.JSX.Element | null;
673
+
674
+ /**
675
+ * A self-contained one-click agentic workflow: title + description + a Run button
676
+ * that streams a grounded, cited result inline. Drop it on any page — it owns its
677
+ * own task state via `useAiTask`.
678
+ */
679
+ declare function AiActionCard({ icon: Icon, title, description, prompt, docIds, runLabel, noDocsHint, disabled, testId, }: {
680
+ icon?: LucideIcon;
681
+ title: string;
682
+ description: string;
683
+ /** The fully-built prompt to run, or a factory (deferred until click). */
684
+ prompt: string | (() => string);
685
+ docIds: string[];
686
+ runLabel?: string;
687
+ noDocsHint?: string;
688
+ disabled?: boolean;
689
+ testId?: string;
690
+ }): React.JSX.Element;
691
+
692
+ /**
693
+ * The artifacts canvas — renders agent-produced documents (drafts, redlines,
694
+ * memos) as first-class artifacts in a paper-styled panel. Markdown mode supports
695
+ * redlines (`<del>` deletions / `<ins>` additions). Streams live: content grows
696
+ * and `is_complete` flips when finished. Token-neutral: the "paper" surface is
697
+ * the kit's `ai-surface` colour.
698
+ */
699
+ declare function ArtifactCanvas({ artifacts, className, emptyHint, busy, busyHint, stepCount, error, }: {
700
+ artifacts: ArtifactEvent[];
701
+ className?: string;
702
+ emptyHint?: string;
703
+ /** A run failed before producing content — show it instead of the empty hint. */
704
+ error?: string | null;
705
+ /**
706
+ * The agent is running but hasn't produced streamable content yet. Agentic
707
+ * drafts spend a while planning/retrieving before the first token, so show a
708
+ * live working state instead of the empty hint — otherwise the canvas reads
709
+ * as broken during a perfectly normal multi-step run.
710
+ */
711
+ busy?: boolean;
712
+ busyHint?: string;
713
+ /** Agent steps completed so far, surfaced in the working state when > 0. */
714
+ stepCount?: number;
715
+ }): React.JSX.Element;
716
+
717
+ /**
718
+ * Semantic search across a document set — retrieval-only (no LLM), returning the
719
+ * top matching passages with their source document and page. Uses the SDK's
720
+ * `assistant.retrieve`, so every hit is a real, cited chunk of a real document.
721
+ */
722
+ declare function DocSearch({ docIds, onOpenDoc, placeholder, className, }: {
723
+ docIds: string[];
724
+ onOpenDoc?: (docId: string) => void;
725
+ placeholder?: string;
726
+ className?: string;
727
+ }): React.JSX.Element;
728
+
729
+ /**
730
+ * Ask questions grounded in a SINGLE document (docId scoped to one file), plus a
731
+ * one-click "suggest tags" action. Drop it in a document viewer.
732
+ */
733
+ declare function DocQaPanel({ docId, docName }: {
734
+ docId: string;
735
+ docName?: string;
736
+ }): React.JSX.Element;
737
+
495
738
  /** PDF file icon (red). Promoted from the ARBI app for SDK reuse. */
496
739
 
497
740
  interface IconProps$5 {
@@ -789,4 +1032,4 @@ declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState
789
1032
 
790
1033
  declare function cn(...inputs: ClassValue[]): string;
791
1034
 
792
- export { ArbiChat, type ArbiChatLabels, ArbiChatPanel, type ArbiChatPanelProps, type ArbiChatProps, type ArbiChatTheme, ArbiProvider, type ArbiProviderProps, type ArbiUiState, AudIcon, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, DocumentEntity, type DocumentEntityProps, type DocumentLike, DocumentTable, type DocumentTableProps, EmlIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, HoverCard, HoverCardContent, HoverCardTrigger, ImgIcon, PdfIcon, ProjectEntity, type ProjectEntityProps, type ProjectRelation, TagEntity, type TagEntityProps, type TagLike, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VidIcon, arbiQueryKeys, badgeVariants, buttonVariants, cn, useAgents, useArbi, useArbiUiStore, useAssistantQuery, useConfigs, useConversations, useDeleteAgents, useDocuments, useHealth, useMemories, useSessions, useTags, useTasks, useWorkspaces };
1035
+ export { AiActionCard, AiAnswer, AiMarkdown, type AiRunOptions, type AiTaskStatus, ArbiChat, type ArbiChatLabels, ArbiChatPanel, type ArbiChatPanelProps, type ArbiChatProps, type ArbiChatTheme, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArtifactCanvas, AudIcon, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DocQaPanel, DocSearch, DocumentEntity, type DocumentEntityProps, type DocumentLike, DocumentTable, type DocumentTableProps, EmlIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, HoverCard, HoverCardContent, HoverCardTrigger, ImgIcon, Input, PdfIcon, ProjectEntity, type ProjectEntityProps, type ProjectRelation, type SearchChunk, TagEntity, type TagEntityProps, type TagLike, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VidIcon, arbiQueryKeys, badgeVariants, buttonVariants, cn, redlineStats, textToArtifact, toRedlineMarkdown, useAgents, useAiTask, useArbi, useArbiUiStore, useAssistantQuery, useConfigs, useConversations, useDeleteAgents, useDocuments, useHealth, useMemories, useSemanticSearch, useSessions, useTags, useTasks, useWorkspaceDocs, useWorkspaces };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode } from 'react';
3
- import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, AgentStepEvent } from '@arbidocs/sdk/browser';
3
+ import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, AgentStepEvent, ArtifactEvent } from '@arbidocs/sdk/browser';
4
4
  export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateMemoryRequest, CreateTaskRequest, MemoryResponse, MemorySearchRequest, MemorySearchResponse, MessageMetadataPayload, OutputTokensDetails, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserInputRequestEvent, UserMessageEvent } from '@arbidocs/sdk/browser';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import * as _arbidocs_client from '@arbidocs/client';
@@ -9,6 +9,7 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
9
9
  import * as class_variance_authority_types from 'class-variance-authority/types';
10
10
  import { VariantProps } from 'class-variance-authority';
11
11
  import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
12
+ import { LucideIcon } from 'lucide-react';
12
13
  import * as zustand from 'zustand';
13
14
  import { ClassValue } from 'clsx';
14
15
 
@@ -320,6 +321,7 @@ declare function useAssistantQuery(): _tanstack_react_query.UseMutationResult<SS
320
321
  onToken?: (content: string) => void;
321
322
  onStreamStart?: (data: SSEStreamStartData) => void;
322
323
  onAgentStep?: (data: AgentStepEvent) => void;
324
+ onArtifact?: (data: ArtifactEvent) => void;
323
325
  onError?: (message: string) => void;
324
326
  onComplete?: () => void;
325
327
  }, unknown>;
@@ -473,14 +475,14 @@ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.
473
475
  declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
474
476
 
475
477
  declare const badgeVariants: (props?: ({
476
- variant?: "outline" | "default" | "secondary" | "destructive" | null | undefined;
478
+ variant?: "outline" | "default" | "accent" | "secondary" | "destructive" | null | undefined;
477
479
  } & class_variance_authority_types.ClassProp) | undefined) => string;
478
480
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
479
481
  }
480
482
  declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
481
483
 
482
484
  declare const buttonVariants: (props?: ({
483
- variant?: "link" | "outline" | "default" | "secondary" | "destructive" | "ghost" | null | undefined;
485
+ variant?: "link" | "outline" | "default" | "accent" | "secondary" | "destructive" | "ghost" | null | undefined;
484
486
  size?: "default" | "icon" | "sm" | "lg" | null | undefined;
485
487
  } & class_variance_authority_types.ClassProp) | undefined) => string;
486
488
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -492,6 +494,247 @@ declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
492
494
  declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
493
495
  declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
494
496
 
497
+ declare function Card({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
498
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
499
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
500
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
501
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
502
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
503
+
504
+ declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
505
+
506
+ /**
507
+ * The AI engine — domain-agnostic hooks for building an AI-native app on ARBI.
508
+ *
509
+ * `useAiTask` runs a streaming, cited agentic query (tokens, agent steps and
510
+ * artifacts accumulate live, with follow-up threading). `useWorkspaceDocs`
511
+ * resolves a workspace's document ids to ground on, and `useSemanticSearch`
512
+ * returns retrieval-only cited passages. These wrap the low-level SDK hooks so a
513
+ * vertical app never re-implements the streaming/accumulation plumbing.
514
+ */
515
+
516
+ /**
517
+ * Resolve a workspace's document set and their external ids. Pass the active
518
+ * `workspaceId`; the kit stays agnostic about how selection is managed.
519
+ */
520
+ declare function useWorkspaceDocs(workspaceId?: string): {
521
+ wsId: string | undefined;
522
+ docs: {
523
+ external_id: string;
524
+ workspace_ext_id: string;
525
+ file_name?: string | null | undefined;
526
+ status?: string | null | undefined;
527
+ error_message?: string | null | undefined;
528
+ failed_stage?: string | null | undefined;
529
+ n_pages?: number | null | undefined;
530
+ n_chunks?: number | null | undefined;
531
+ tokens?: number | null | undefined;
532
+ file_type?: string | null | undefined;
533
+ file_size?: number | null | undefined;
534
+ storage_type?: string | null | undefined;
535
+ storage_uri?: string | null | undefined;
536
+ content_hash?: string | null | undefined;
537
+ shared?: boolean | null | undefined;
538
+ re_ocred?: boolean | null | undefined;
539
+ config_ext_id?: string | null | undefined;
540
+ parent_ext_id?: string | null | undefined;
541
+ created_by_ext_id: string;
542
+ updated_by_ext_id?: string | null | undefined;
543
+ created_at: string;
544
+ updated_at: string;
545
+ wp_type?: string | null | undefined;
546
+ folder?: string | null | undefined;
547
+ doctags: {
548
+ doc_ext_id: string;
549
+ tag_ext_id: string;
550
+ note?: string | null | undefined;
551
+ citations?: {
552
+ [x: string]: {
553
+ chunk_ids: string[];
554
+ scores: number[];
555
+ statement: string;
556
+ offset_start: number;
557
+ offset_end: number;
558
+ };
559
+ } | null | undefined;
560
+ created_by_ext_id: string;
561
+ updated_by_ext_id?: string | null | undefined;
562
+ created_at: string;
563
+ updated_at: string;
564
+ }[];
565
+ doc_metadata?: {
566
+ doc_nature?: string | null | undefined;
567
+ doc_author?: string | null | undefined;
568
+ doc_subject?: string | null | undefined;
569
+ doc_date?: string | null | undefined;
570
+ title?: string | null | undefined;
571
+ } | null | undefined;
572
+ }[];
573
+ docIds: string[];
574
+ isLoading: boolean;
575
+ isError: boolean;
576
+ ready: boolean;
577
+ };
578
+ type AiTaskStatus = 'idle' | 'running' | 'done' | 'error';
579
+ interface AiRunOptions {
580
+ /** Continue a prior turn (follow-up questions in the same thread). */
581
+ previousResponseId?: string | null;
582
+ model?: string;
583
+ }
584
+ /**
585
+ * Run a single streaming agentic task grounded in a set of documents.
586
+ *
587
+ * Returns live state (`text` accumulates tokens as they stream) plus a `run`
588
+ * that resolves to the full {@link SSEStreamResult} — including the response id
589
+ * needed to chain follow-ups.
590
+ */
591
+ declare function useAiTask(): {
592
+ status: AiTaskStatus;
593
+ text: string;
594
+ stepCount: number;
595
+ error: string | null;
596
+ responseId: string | null;
597
+ artifacts: {
598
+ t?: number | null;
599
+ type: "arbi.artifact";
600
+ doc_ext_id: string;
601
+ title: string;
602
+ mode: "markdown" | "html" | "text";
603
+ content: string;
604
+ is_complete: boolean;
605
+ version: number;
606
+ message_ext_id?: string | null;
607
+ }[];
608
+ run: (question: string, docIds: string[], opts?: AiRunOptions) => Promise<SSEStreamResult | null>;
609
+ reset: () => void;
610
+ isRunning: boolean;
611
+ isDone: boolean;
612
+ };
613
+ interface SearchChunk {
614
+ docId?: string | null;
615
+ docTitle?: string | null;
616
+ page?: number | null;
617
+ score?: number | null;
618
+ content: string;
619
+ }
620
+ /** Search a set of documents and return the top matching passages. */
621
+ declare function useSemanticSearch(docIds: string[]): {
622
+ query: string;
623
+ results: SearchChunk[];
624
+ status: AiTaskStatus;
625
+ error: string | null;
626
+ search: (q: string, mode?: "semantic" | "keyword" | "hybrid") => Promise<void>;
627
+ isRunning: boolean;
628
+ };
629
+
630
+ /** Produce inline `<del>/<ins>` redline markdown from two document versions. */
631
+ declare function toRedlineMarkdown(original: string, revised: string): string;
632
+ /** Count added/removed words between two versions (for a redline summary). */
633
+ declare function redlineStats(original: string, revised: string): {
634
+ added: number;
635
+ removed: number;
636
+ };
637
+ /** Wrap arbitrary text/markdown as a synthetic artifact for the canvas. */
638
+ declare function textToArtifact(title: string, content: string, opts?: {
639
+ mode?: ArtifactEvent['mode'];
640
+ isComplete?: boolean;
641
+ version?: number;
642
+ id?: string;
643
+ }): ArtifactEvent;
644
+
645
+ /**
646
+ * Renders agent output (markdown — headings, lists, GFM tables) in one house
647
+ * style so every AI result across the app looks the same. Redline marks
648
+ * (`<del>` / `<ins>` / `<mark>`) render as tracked changes. Token-neutral: uses
649
+ * shadcn semantic tokens plus the kit's `ai-accent` colour.
650
+ */
651
+ declare function AiMarkdown({ children, className }: {
652
+ children: string;
653
+ className?: string;
654
+ }): React.JSX.Element;
655
+
656
+ /**
657
+ * Renders the live state of a single agentic task: streaming tokens, a "thinking"
658
+ * indicator with the running step count, errors, and a grounded/cited footer with
659
+ * copy-to-clipboard. Shared by every AI feature so streaming looks identical
660
+ * everywhere. Copy is customisable via `groundedNote` / `runningHint`.
661
+ */
662
+ declare function AiAnswer({ status, text, stepCount, error, className, emptyHint, groundedNote, runningHint, testId, }: {
663
+ status: AiTaskStatus;
664
+ text: string;
665
+ stepCount?: number;
666
+ error?: string | null;
667
+ className?: string;
668
+ emptyHint?: string;
669
+ groundedNote?: string;
670
+ runningHint?: string;
671
+ testId?: string;
672
+ }): React.JSX.Element | null;
673
+
674
+ /**
675
+ * A self-contained one-click agentic workflow: title + description + a Run button
676
+ * that streams a grounded, cited result inline. Drop it on any page — it owns its
677
+ * own task state via `useAiTask`.
678
+ */
679
+ declare function AiActionCard({ icon: Icon, title, description, prompt, docIds, runLabel, noDocsHint, disabled, testId, }: {
680
+ icon?: LucideIcon;
681
+ title: string;
682
+ description: string;
683
+ /** The fully-built prompt to run, or a factory (deferred until click). */
684
+ prompt: string | (() => string);
685
+ docIds: string[];
686
+ runLabel?: string;
687
+ noDocsHint?: string;
688
+ disabled?: boolean;
689
+ testId?: string;
690
+ }): React.JSX.Element;
691
+
692
+ /**
693
+ * The artifacts canvas — renders agent-produced documents (drafts, redlines,
694
+ * memos) as first-class artifacts in a paper-styled panel. Markdown mode supports
695
+ * redlines (`<del>` deletions / `<ins>` additions). Streams live: content grows
696
+ * and `is_complete` flips when finished. Token-neutral: the "paper" surface is
697
+ * the kit's `ai-surface` colour.
698
+ */
699
+ declare function ArtifactCanvas({ artifacts, className, emptyHint, busy, busyHint, stepCount, error, }: {
700
+ artifacts: ArtifactEvent[];
701
+ className?: string;
702
+ emptyHint?: string;
703
+ /** A run failed before producing content — show it instead of the empty hint. */
704
+ error?: string | null;
705
+ /**
706
+ * The agent is running but hasn't produced streamable content yet. Agentic
707
+ * drafts spend a while planning/retrieving before the first token, so show a
708
+ * live working state instead of the empty hint — otherwise the canvas reads
709
+ * as broken during a perfectly normal multi-step run.
710
+ */
711
+ busy?: boolean;
712
+ busyHint?: string;
713
+ /** Agent steps completed so far, surfaced in the working state when > 0. */
714
+ stepCount?: number;
715
+ }): React.JSX.Element;
716
+
717
+ /**
718
+ * Semantic search across a document set — retrieval-only (no LLM), returning the
719
+ * top matching passages with their source document and page. Uses the SDK's
720
+ * `assistant.retrieve`, so every hit is a real, cited chunk of a real document.
721
+ */
722
+ declare function DocSearch({ docIds, onOpenDoc, placeholder, className, }: {
723
+ docIds: string[];
724
+ onOpenDoc?: (docId: string) => void;
725
+ placeholder?: string;
726
+ className?: string;
727
+ }): React.JSX.Element;
728
+
729
+ /**
730
+ * Ask questions grounded in a SINGLE document (docId scoped to one file), plus a
731
+ * one-click "suggest tags" action. Drop it in a document viewer.
732
+ */
733
+ declare function DocQaPanel({ docId, docName }: {
734
+ docId: string;
735
+ docName?: string;
736
+ }): React.JSX.Element;
737
+
495
738
  /** PDF file icon (red). Promoted from the ARBI app for SDK reuse. */
496
739
 
497
740
  interface IconProps$5 {
@@ -789,4 +1032,4 @@ declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState
789
1032
 
790
1033
  declare function cn(...inputs: ClassValue[]): string;
791
1034
 
792
- export { ArbiChat, type ArbiChatLabels, ArbiChatPanel, type ArbiChatPanelProps, type ArbiChatProps, type ArbiChatTheme, ArbiProvider, type ArbiProviderProps, type ArbiUiState, AudIcon, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, DocumentEntity, type DocumentEntityProps, type DocumentLike, DocumentTable, type DocumentTableProps, EmlIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, HoverCard, HoverCardContent, HoverCardTrigger, ImgIcon, PdfIcon, ProjectEntity, type ProjectEntityProps, type ProjectRelation, TagEntity, type TagEntityProps, type TagLike, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VidIcon, arbiQueryKeys, badgeVariants, buttonVariants, cn, useAgents, useArbi, useArbiUiStore, useAssistantQuery, useConfigs, useConversations, useDeleteAgents, useDocuments, useHealth, useMemories, useSessions, useTags, useTasks, useWorkspaces };
1035
+ export { AiActionCard, AiAnswer, AiMarkdown, type AiRunOptions, type AiTaskStatus, ArbiChat, type ArbiChatLabels, ArbiChatPanel, type ArbiChatPanelProps, type ArbiChatProps, type ArbiChatTheme, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArtifactCanvas, AudIcon, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DocQaPanel, DocSearch, DocumentEntity, type DocumentEntityProps, type DocumentLike, DocumentTable, type DocumentTableProps, EmlIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, HoverCard, HoverCardContent, HoverCardTrigger, ImgIcon, Input, PdfIcon, ProjectEntity, type ProjectEntityProps, type ProjectRelation, type SearchChunk, TagEntity, type TagEntityProps, type TagLike, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VidIcon, arbiQueryKeys, badgeVariants, buttonVariants, cn, redlineStats, textToArtifact, toRedlineMarkdown, useAgents, useAiTask, useArbi, useArbiUiStore, useAssistantQuery, useConfigs, useConversations, useDeleteAgents, useDocuments, useHealth, useMemories, useSemanticSearch, useSessions, useTags, useTasks, useWorkspaceDocs, useWorkspaces };