@arbidocs/react 0.3.137 → 0.3.139

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,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, ComponentType } from 'react';
3
3
  import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, ResponseOutputItemDoneEvent, ArtifactEvent } from '@arbidocs/sdk/browser';
4
- export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateMemoryRequest, CreateTaskRequest, MemoryResponse, MemorySearchRequest, MemorySearchResponse, MessageMetadataPayload, OutputTokensDetails, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkspaceChronologyOut } from '@arbidocs/sdk/browser';
4
+ export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateNoteRequest, CreateTaskRequest, MessageMetadataPayload, NoteResponse, NoteSearchRequest, NoteSearchResponse, OutputTokensDetails, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkspaceChronologyOut } from '@arbidocs/sdk/browser';
5
5
  import * as _arbidocs_client from '@arbidocs/client';
6
6
  import { WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage, components } from '@arbidocs/client';
7
7
  export { WebSocketServerMessage, WsBatchCompleteMessage, WsNotificationResponse, WsPresenceUpdateMessage, WsResponseCompleteMessage, WsTaskUpdateMessage, isMessageType } from '@arbidocs/client';
@@ -13,6 +13,7 @@ import { LucideIcon, StickyNote } from 'lucide-react';
13
13
  import { Components } from 'react-markdown';
14
14
  import { ToasterProps } from 'sonner';
15
15
  export { ToasterProps, toast } from 'sonner';
16
+ import { ColDef } from 'ag-grid-community';
16
17
  import 'clsx';
17
18
  import '@radix-ui/react-avatar';
18
19
  import 'class-variance-authority/types';
@@ -357,7 +358,7 @@ declare const arbiQueryKeys: {
357
358
  sessions: () => readonly ["arbi", "sessions"];
358
359
  health: () => readonly ["arbi", "health"];
359
360
  tasks: () => readonly ["arbi", "tasks"];
360
- memories: (workspaceId: string) => readonly ["arbi", "memories", string];
361
+ notes: (workspaceId: string) => readonly ["arbi", "notes", string];
361
362
  configs: () => readonly ["arbi", "configs"];
362
363
  activity: () => readonly ["arbi", "activity"];
363
364
  projects: () => readonly ["arbi", "projects"];
@@ -442,13 +443,11 @@ declare function useDocuments(workspaceId: string | undefined, options?: {
442
443
  doctags: {
443
444
  note?: string | null | undefined;
444
445
  citations?: {
445
- [x: string]: {
446
- chunk_ids: string[];
447
- scores: number[];
448
- statement: string;
449
- offset_start: number;
450
- offset_end: number;
451
- };
446
+ passages: {
447
+ chunk_id: string;
448
+ doc_ext_id?: string | null | undefined;
449
+ page?: number | null | undefined;
450
+ }[];
452
451
  } | null | undefined;
453
452
  doc_ext_id: string;
454
453
  tag_ext_id: string;
@@ -624,20 +623,20 @@ declare function useTasks(options?: {
624
623
  created_at: string;
625
624
  updated_at: string;
626
625
  }[]>, Error>;
627
- /** List the open workspace's memory notes. */
626
+ /** List the open workspace's notes. */
628
627
  declare function useMemories(workspaceId: string | undefined, options?: {
629
628
  enabled?: boolean;
630
629
  pinnedOnly?: boolean;
631
630
  }): _tanstack_react_query.UseQueryResult<NoInfer<{
632
- note?: string | null;
633
- citations?: {
634
- [key: string]: _arbidocs_client.components["schemas"]["CitationData"];
635
- } | null;
631
+ text: string;
632
+ citations?: _arbidocs_client.components["schemas"]["CitationSources"] | null;
636
633
  external_id: string;
637
634
  workspace_ext_id: string;
638
635
  pinned: boolean;
639
636
  shared: boolean;
640
637
  source: string;
638
+ note_date?: string | null;
639
+ tags: _arbidocs_client.components["schemas"]["NoteTagResponse"][];
641
640
  created_by_ext_id: string;
642
641
  created_at: string;
643
642
  updated_at: string;
@@ -872,13 +871,11 @@ declare function useWorkspaceDocs(workspaceId?: string): {
872
871
  doctags: {
873
872
  note?: string | null | undefined;
874
873
  citations?: {
875
- [x: string]: {
876
- chunk_ids: string[];
877
- scores: number[];
878
- statement: string;
879
- offset_start: number;
880
- offset_end: number;
881
- };
874
+ passages: {
875
+ chunk_id: string;
876
+ doc_ext_id?: string | null | undefined;
877
+ page?: number | null | undefined;
878
+ }[];
882
879
  } | null | undefined;
883
880
  doc_ext_id: string;
884
881
  tag_ext_id: string;
@@ -1806,6 +1803,16 @@ declare const ENTITY_MAPPINGS: {
1806
1803
  NEW: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1807
1804
  };
1808
1805
  };
1806
+ NOTE: {
1807
+ NAMES: {
1808
+ SINGULAR: string;
1809
+ PLURAL: string;
1810
+ };
1811
+ ICONS: {
1812
+ DEFAULT: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1813
+ NEW: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1814
+ };
1815
+ };
1809
1816
  USER: {
1810
1817
  NAMES: {
1811
1818
  SINGULAR: string;
@@ -2554,15 +2561,31 @@ interface DocumentTableProps {
2554
2561
  documents?: DocResponse$2[];
2555
2562
  /** Called when a row (document) is opened — row click or name-pill click. */
2556
2563
  onOpenDocument?: (id: string) => void;
2564
+ /**
2565
+ * Whether clicking anywhere in a row opens the document. Default true.
2566
+ *
2567
+ * Set false when the grid is used for bulk work: a reviewer building a
2568
+ * selection to code together will inevitably click a row, and navigating away
2569
+ * mid-selection loses it. With this off, the name pill stays the way to open
2570
+ * a document and the row is purely a selection target.
2571
+ */
2572
+ openOnRowClick?: boolean;
2557
2573
  /** Controlled selection (external ids). Falls back to the SDK ui store. */
2558
2574
  selectedIds?: string[];
2559
2575
  /** Called with the new selection (external ids). Falls back to the SDK ui store. */
2560
2576
  onSelectionChange?: (ids: string[]) => void;
2561
2577
  /** Grid height. Number → pixels; string passed through. Default 480. */
2562
2578
  height?: number | string;
2579
+ /**
2580
+ * Extra columns appended after the built-ins — e.g. one per coding field in a
2581
+ * review protocol, so a grid can be coded across rather than document by
2582
+ * document. Standard AG Grid `ColDef`s; give each an explicit `colId`, since
2583
+ * AG Grid persists column state and auto-generated ids reorder unexpectedly.
2584
+ */
2585
+ extraColumns?: ColDef<DocResponse$2>[];
2563
2586
  className?: string;
2564
2587
  }
2565
- declare function DocumentTable({ workspaceId, documents, onOpenDocument, selectedIds, onSelectionChange, height, className, }: DocumentTableProps): React__default.JSX.Element;
2588
+ declare function DocumentTable({ workspaceId, documents, onOpenDocument, openOnRowClick, selectedIds, onSelectionChange, height, extraColumns, className, }: DocumentTableProps): React__default.JSX.Element;
2566
2589
 
2567
2590
  /**
2568
2591
  * DocumentCard — the canonical document thumbnail tile.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, ComponentType } from 'react';
3
3
  import { ArbiOptions, Arbi, SSEStreamResult, SSEStreamStartData, ResponseOutputItemDoneEvent, ArtifactEvent } from '@arbidocs/sdk/browser';
4
- export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateMemoryRequest, CreateTaskRequest, MemoryResponse, MemorySearchRequest, MemorySearchResponse, MessageMetadataPayload, OutputTokensDetails, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkspaceChronologyOut } from '@arbidocs/sdk/browser';
4
+ export { AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, CreateNoteRequest, CreateTaskRequest, MessageMetadataPayload, NoteResponse, NoteSearchRequest, NoteSearchResponse, OutputTokensDetails, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, TaskResponse, UpdateTaskRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkspaceChronologyOut } from '@arbidocs/sdk/browser';
5
5
  import * as _arbidocs_client from '@arbidocs/client';
6
6
  import { WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage, components } from '@arbidocs/client';
7
7
  export { WebSocketServerMessage, WsBatchCompleteMessage, WsNotificationResponse, WsPresenceUpdateMessage, WsResponseCompleteMessage, WsTaskUpdateMessage, isMessageType } from '@arbidocs/client';
@@ -13,6 +13,7 @@ import { LucideIcon, StickyNote } from 'lucide-react';
13
13
  import { Components } from 'react-markdown';
14
14
  import { ToasterProps } from 'sonner';
15
15
  export { ToasterProps, toast } from 'sonner';
16
+ import { ColDef } from 'ag-grid-community';
16
17
  import 'clsx';
17
18
  import '@radix-ui/react-avatar';
18
19
  import 'class-variance-authority/types';
@@ -357,7 +358,7 @@ declare const arbiQueryKeys: {
357
358
  sessions: () => readonly ["arbi", "sessions"];
358
359
  health: () => readonly ["arbi", "health"];
359
360
  tasks: () => readonly ["arbi", "tasks"];
360
- memories: (workspaceId: string) => readonly ["arbi", "memories", string];
361
+ notes: (workspaceId: string) => readonly ["arbi", "notes", string];
361
362
  configs: () => readonly ["arbi", "configs"];
362
363
  activity: () => readonly ["arbi", "activity"];
363
364
  projects: () => readonly ["arbi", "projects"];
@@ -442,13 +443,11 @@ declare function useDocuments(workspaceId: string | undefined, options?: {
442
443
  doctags: {
443
444
  note?: string | null | undefined;
444
445
  citations?: {
445
- [x: string]: {
446
- chunk_ids: string[];
447
- scores: number[];
448
- statement: string;
449
- offset_start: number;
450
- offset_end: number;
451
- };
446
+ passages: {
447
+ chunk_id: string;
448
+ doc_ext_id?: string | null | undefined;
449
+ page?: number | null | undefined;
450
+ }[];
452
451
  } | null | undefined;
453
452
  doc_ext_id: string;
454
453
  tag_ext_id: string;
@@ -624,20 +623,20 @@ declare function useTasks(options?: {
624
623
  created_at: string;
625
624
  updated_at: string;
626
625
  }[]>, Error>;
627
- /** List the open workspace's memory notes. */
626
+ /** List the open workspace's notes. */
628
627
  declare function useMemories(workspaceId: string | undefined, options?: {
629
628
  enabled?: boolean;
630
629
  pinnedOnly?: boolean;
631
630
  }): _tanstack_react_query.UseQueryResult<NoInfer<{
632
- note?: string | null;
633
- citations?: {
634
- [key: string]: _arbidocs_client.components["schemas"]["CitationData"];
635
- } | null;
631
+ text: string;
632
+ citations?: _arbidocs_client.components["schemas"]["CitationSources"] | null;
636
633
  external_id: string;
637
634
  workspace_ext_id: string;
638
635
  pinned: boolean;
639
636
  shared: boolean;
640
637
  source: string;
638
+ note_date?: string | null;
639
+ tags: _arbidocs_client.components["schemas"]["NoteTagResponse"][];
641
640
  created_by_ext_id: string;
642
641
  created_at: string;
643
642
  updated_at: string;
@@ -872,13 +871,11 @@ declare function useWorkspaceDocs(workspaceId?: string): {
872
871
  doctags: {
873
872
  note?: string | null | undefined;
874
873
  citations?: {
875
- [x: string]: {
876
- chunk_ids: string[];
877
- scores: number[];
878
- statement: string;
879
- offset_start: number;
880
- offset_end: number;
881
- };
874
+ passages: {
875
+ chunk_id: string;
876
+ doc_ext_id?: string | null | undefined;
877
+ page?: number | null | undefined;
878
+ }[];
882
879
  } | null | undefined;
883
880
  doc_ext_id: string;
884
881
  tag_ext_id: string;
@@ -1806,6 +1803,16 @@ declare const ENTITY_MAPPINGS: {
1806
1803
  NEW: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1807
1804
  };
1808
1805
  };
1806
+ NOTE: {
1807
+ NAMES: {
1808
+ SINGULAR: string;
1809
+ PLURAL: string;
1810
+ };
1811
+ ICONS: {
1812
+ DEFAULT: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1813
+ NEW: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
1814
+ };
1815
+ };
1809
1816
  USER: {
1810
1817
  NAMES: {
1811
1818
  SINGULAR: string;
@@ -2554,15 +2561,31 @@ interface DocumentTableProps {
2554
2561
  documents?: DocResponse$2[];
2555
2562
  /** Called when a row (document) is opened — row click or name-pill click. */
2556
2563
  onOpenDocument?: (id: string) => void;
2564
+ /**
2565
+ * Whether clicking anywhere in a row opens the document. Default true.
2566
+ *
2567
+ * Set false when the grid is used for bulk work: a reviewer building a
2568
+ * selection to code together will inevitably click a row, and navigating away
2569
+ * mid-selection loses it. With this off, the name pill stays the way to open
2570
+ * a document and the row is purely a selection target.
2571
+ */
2572
+ openOnRowClick?: boolean;
2557
2573
  /** Controlled selection (external ids). Falls back to the SDK ui store. */
2558
2574
  selectedIds?: string[];
2559
2575
  /** Called with the new selection (external ids). Falls back to the SDK ui store. */
2560
2576
  onSelectionChange?: (ids: string[]) => void;
2561
2577
  /** Grid height. Number → pixels; string passed through. Default 480. */
2562
2578
  height?: number | string;
2579
+ /**
2580
+ * Extra columns appended after the built-ins — e.g. one per coding field in a
2581
+ * review protocol, so a grid can be coded across rather than document by
2582
+ * document. Standard AG Grid `ColDef`s; give each an explicit `colId`, since
2583
+ * AG Grid persists column state and auto-generated ids reorder unexpectedly.
2584
+ */
2585
+ extraColumns?: ColDef<DocResponse$2>[];
2563
2586
  className?: string;
2564
2587
  }
2565
- declare function DocumentTable({ workspaceId, documents, onOpenDocument, selectedIds, onSelectionChange, height, className, }: DocumentTableProps): React__default.JSX.Element;
2588
+ declare function DocumentTable({ workspaceId, documents, onOpenDocument, openOnRowClick, selectedIds, onSelectionChange, height, extraColumns, className, }: DocumentTableProps): React__default.JSX.Element;
2566
2589
 
2567
2590
  /**
2568
2591
  * DocumentCard — the canonical document thumbnail tile.
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { cn, Avatar, AvatarFallback, AvatarImage, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, AiMarkdown, Card, Button, Badge, MarkdownRenderer, Input, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, ScrollArea, Textarea, Slider, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, Checkbox } from './chunk-VTX77MYP.js';
2
2
  export { AiMarkdown, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, MarkdownRenderer, MarkdownStreamingContext, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cardVariants, cn, markdownBaseComponents, splitMarkdownBlocks, toggleVariants } from './chunk-VTX77MYP.js';
3
- import React2, { createContext, memo, useState, forwardRef, useMemo, useCallback, useId, useRef, useContext, useEffect } from 'react';
4
- import { Arbi, connectWithReconnect, resolveCitations, summarizeCitations } from '@arbidocs/sdk/browser';
5
- export { Arbi, ArbiError } from '@arbidocs/sdk/browser';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { useArbi, ArbiProvider } from './chunk-J4MX2W4H.js';
4
+ export { ArbiProvider, useArbi } from './chunk-J4MX2W4H.js';
5
+ import React2, { memo, useState, createContext, forwardRef, useMemo, useCallback, useId, useRef, useContext, useEffect } from 'react';
7
6
  import { useQuery, useMutation, useQueries, QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
8
- import { Trash2, CheckCheck, Check, MessageCircleMore, MoreVertical, MessageSquareLock, Info, FileQuestion, BookOpen, Upload, LogOut, LayoutGrid, Bell, MessageSquare, CircleUserRound, Wrench, Package, ClipboardList, UserPlus, Contact, Settings2, Users, User, StickyNote, FolderPlus, Hash, EyeOff, Eye, CaptionsOff, FolderOpen, MessageSquareMore, MessageSquarePlus, MessageSquareText, MessageSquareOff, MessagesSquare, Columns3Cog, SquarePlus, SquareM, ChevronsDown, Bot, Calendar, Search, Folder, List, SquareCheckBig, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Image as Image$1, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Activity, Gauge, Gift, PartyPopper, UserCheck, FileX2, FileCheck2, Pencil, SquareArrowOutUpRight, XCircle, CheckCircle2, ArrowRight, ChevronDown, MoreHorizontal, SquarePen, FileX, SkipForward, CheckCircle } from 'lucide-react';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+ import { connectWithReconnect, resolveCitations, summarizeCitations } from '@arbidocs/sdk/browser';
9
+ export { Arbi, ArbiError } from '@arbidocs/sdk/browser';
10
+ import { Trash2, CheckCheck, Check, MessageCircleMore, MoreVertical, MessageSquareLock, Info, FileQuestion, BookOpen, Upload, LogOut, LayoutGrid, Bell, MessageSquare, CircleUserRound, Wrench, Package, ClipboardList, UserPlus, Contact, Settings2, Users, User, NotebookPen, NotebookText, StickyNote, FolderPlus, Hash, EyeOff, Eye, CaptionsOff, FolderOpen, MessageSquareMore, MessageSquarePlus, MessageSquareText, MessageSquareOff, MessagesSquare, Columns3Cog, SquarePlus, SquareM, ChevronsDown, Bot, Calendar, Search, Folder, List, SquareCheckBig, Loader2, AlertTriangle, ShieldCheck, Copy, Sparkles, FileText, GitCompareArrows, Download, Image as Image$1, CornerDownLeft, X, ArrowLeft, Send, Tags, Crown, Activity, Gauge, Gift, PartyPopper, UserCheck, FileX2, FileCheck2, Pencil, SquareArrowOutUpRight, XCircle, CheckCircle2, ArrowRight, ChevronDown, MoreHorizontal, SquarePen, FileX, SkipForward, CheckCircle } from 'lucide-react';
9
11
  import { isMessageType } from '@arbidocs/client';
10
12
  export { isMessageType } from '@arbidocs/client';
11
13
  import { create } from 'zustand';
@@ -18,17 +20,6 @@ import Cropper from 'react-easy-crop';
18
20
  import { AgGridReact } from 'ag-grid-react';
19
21
  import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';
20
22
 
21
- var ArbiContext = createContext(null);
22
- function ArbiProvider({ children, ...options }) {
23
- const arbi = useMemo(
24
- () => new Arbi(options),
25
- // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- [options.url, options.deploymentDomain, options.credentials]
28
- );
29
- return /* @__PURE__ */ jsx(ArbiContext.Provider, { value: arbi, children });
30
- }
31
-
32
23
  // src/chat/styles.ts
33
24
  var DEFAULT_THEME = {
34
25
  primaryColor: "#00adef",
@@ -351,13 +342,6 @@ function agentStatusStyle(theme) {
351
342
  alignSelf: "flex-start"
352
343
  };
353
344
  }
354
- function useArbi() {
355
- const arbi = useContext(ArbiContext);
356
- if (!arbi) {
357
- throw new Error("useArbi() must be used within an <ArbiProvider>");
358
- }
359
- return arbi;
360
- }
361
345
  function AuthScreen({ theme, labels, onLogin }) {
362
346
  const arbi = useArbi();
363
347
  const [mode, setMode] = useState("login");
@@ -607,7 +591,7 @@ var arbiQueryKeys = {
607
591
  sessions: () => ["arbi", "sessions"],
608
592
  health: () => ["arbi", "health"],
609
593
  tasks: () => ["arbi", "tasks"],
610
- memories: (workspaceId) => ["arbi", "memories", workspaceId],
594
+ notes: (workspaceId) => ["arbi", "notes", workspaceId],
611
595
  configs: () => ["arbi", "configs"],
612
596
  activity: () => ["arbi", "activity"],
613
597
  projects: () => ["arbi", "projects"],
@@ -712,8 +696,8 @@ function useTasks(options) {
712
696
  function useMemories(workspaceId, options) {
713
697
  const arbi = useArbi();
714
698
  return useQuery({
715
- queryKey: arbiQueryKeys.memories(workspaceId ?? ""),
716
- queryFn: () => arbi.memory.list({ pinnedOnly: options?.pinnedOnly }),
699
+ queryKey: arbiQueryKeys.notes(workspaceId ?? ""),
700
+ queryFn: () => arbi.notes.list({ pinnedOnly: options?.pinnedOnly }),
717
701
  enabled: (options?.enabled ?? true) && !!workspaceId && arbi.hasWorkspace
718
702
  });
719
703
  }
@@ -2566,18 +2550,15 @@ function DocumentReview({
2566
2550
  const list = [];
2567
2551
  const chunkTag = /* @__PURE__ */ new Map();
2568
2552
  for (const dt of doc?.doctags ?? []) {
2569
- const citations = dt.citations ?? {};
2570
- for (const [citId, cit] of Object.entries(citations)) {
2571
- const chunkIds = cit?.chunk_ids ?? [];
2572
- if (chunkIds.length === 0) continue;
2573
- list.push({
2574
- key: `${dt.tag_ext_id}:${citId}`,
2575
- tagExtId: dt.tag_ext_id,
2576
- statement: cit.statement,
2577
- chunkIds
2578
- });
2579
- for (const cid of chunkIds) if (!chunkTag.has(cid)) chunkTag.set(cid, dt.tag_ext_id);
2580
- }
2553
+ const chunkIds = dt.citations?.passages?.map((p) => p.chunk_id) ?? [];
2554
+ if (chunkIds.length === 0) continue;
2555
+ list.push({
2556
+ key: dt.tag_ext_id,
2557
+ tagExtId: dt.tag_ext_id,
2558
+ statement: dt.note ?? "",
2559
+ chunkIds
2560
+ });
2561
+ for (const cid of chunkIds) if (!chunkTag.has(cid)) chunkTag.set(cid, dt.tag_ext_id);
2581
2562
  }
2582
2563
  return { findings: list, chunkToTag: chunkTag };
2583
2564
  }, [doc?.doctags]);
@@ -2947,8 +2928,8 @@ Question: ${question}`,
2947
2928
  `Suggest 3-6 concise, reusable labels for the document "${docName ?? docId}" \u2014 covering document type, the key issues it touches, and any key parties. Return them as a short comma-separated list with a one-line rationale for each.`,
2948
2929
  [docId]
2949
2930
  );
2950
- return /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": "doc-qa", children: [
2951
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2931
+ return /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-3", "data-testid": "doc-qa", children: [
2932
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
2952
2933
  /* @__PURE__ */ jsx(
2953
2934
  Input,
2954
2935
  {
@@ -2956,7 +2937,7 @@ Question: ${question}`,
2956
2937
  onChange: (e) => setQ(e.target.value),
2957
2938
  onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), ask()),
2958
2939
  placeholder: "Ask about this document\u2026",
2959
- className: "bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
2940
+ className: "min-w-0 flex-1 bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
2960
2941
  "data-testid": "doc-qa-input"
2961
2942
  }
2962
2943
  ),
@@ -2967,6 +2948,7 @@ Question: ${question}`,
2967
2948
  size: "icon",
2968
2949
  onClick: ask,
2969
2950
  disabled: task.isRunning || !q.trim(),
2951
+ className: "shrink-0",
2970
2952
  "data-testid": "doc-qa-send",
2971
2953
  children: /* @__PURE__ */ jsx(Send, { className: "size-4" })
2972
2954
  }
@@ -2978,6 +2960,7 @@ Question: ${question}`,
2978
2960
  size: "sm",
2979
2961
  onClick: suggestTags,
2980
2962
  disabled: task.isRunning,
2963
+ className: "shrink-0",
2981
2964
  "data-testid": "doc-qa-tags",
2982
2965
  children: [
2983
2966
  /* @__PURE__ */ jsx(Tags, { className: "size-4" }),
@@ -4654,6 +4637,20 @@ var ENTITY_MAPPINGS = {
4654
4637
  NEW: StickyNote
4655
4638
  }
4656
4639
  },
4640
+ // Workspace knowledge the assistant retains and recalls — durable free text,
4641
+ // optionally grounded in source passages. Distinct from ANNOTATION, which is
4642
+ // attached TO a document field; a NOTE is workspace-scoped and stands alone.
4643
+ // Stored server-side as `memories` (mem-*); "Note" is the user-facing name.
4644
+ NOTE: {
4645
+ NAMES: {
4646
+ SINGULAR: "Note",
4647
+ PLURAL: "Notes"
4648
+ },
4649
+ ICONS: {
4650
+ DEFAULT: NotebookText,
4651
+ NEW: NotebookPen
4652
+ }
4653
+ },
4657
4654
  USER: {
4658
4655
  NAMES: {
4659
4656
  SINGULAR: "User",
@@ -6120,9 +6117,11 @@ function DocumentTable({
6120
6117
  workspaceId,
6121
6118
  documents,
6122
6119
  onOpenDocument,
6120
+ openOnRowClick = true,
6123
6121
  selectedIds,
6124
6122
  onSelectionChange,
6125
6123
  height = 480,
6124
+ extraColumns,
6126
6125
  className
6127
6126
  }) {
6128
6127
  const query = useDocuments(workspaceId, { enabled: !documents });
@@ -6254,9 +6253,10 @@ function DocumentTable({
6254
6253
  sortable: true,
6255
6254
  field: "folder",
6256
6255
  valueFormatter: (p) => p.value || "\u2014"
6257
- }
6256
+ },
6257
+ ...extraColumns ?? []
6258
6258
  ],
6259
- [openDocument, viewingDocId, tagNameById]
6259
+ [openDocument, viewingDocId, tagNameById, extraColumns]
6260
6260
  );
6261
6261
  const handleGridReady = (e) => {
6262
6262
  gridApiRef.current = e.api;
@@ -6267,6 +6267,7 @@ function DocumentTable({
6267
6267
  emitSelection(ids);
6268
6268
  };
6269
6269
  const handleRowClicked = (e) => {
6270
+ if (!openOnRowClick) return;
6270
6271
  const id = e.data?.external_id;
6271
6272
  if (id) openDocument(id);
6272
6273
  };
@@ -6743,6 +6744,6 @@ function DocumentGallery({
6743
6744
  );
6744
6745
  }
6745
6746
 
6746
- export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, ArbiChat, ArbiChatPanel, ArbiIcon, ArbiProvider, ArbiWebSocketProvider, ArtifactCanvas, AudIcon, BASE_COLORS2 as BASE_COLORS, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_NOTIFY_TONE, DirectMessages, DmAvatar, DmComposer, DocIcon, DocQaPanel, DocSearch, DocumentCard, DocumentCardMenu, DocumentEntity, DocumentGallery, DocumentReview, DocumentTable, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, HtmlIcon, ImageCropModal, ImageCropper, ImgIcon, LinkedInIcon, MessageArtifactCard, MessageBubble2 as MessageBubble, MessageThread, NEUTRAL_GRAY2 as NEUTRAL_GRAY, NotificationBell, OpenAIIcon, PLACEHOLDER_COLOR, PdfIcon, ProjectEntity, ProviderIcon, RagDot, SemanticSearch, StatusPill, TAG_TYPE_ICONS, TAG_TYPE_LABELS, TagEntity, Toaster, TxtIcon, TypingIndicator, UserEntity, UserMenu, VISIBILITY_ICONS, VidIcon, VisibilityIcon, XlsIcon, arbiQueryKeys, configureEntityRegistry, configureRagLabels, configureStatusRegistry, cropImage, describeActivity, formatRelativeTime, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getNotificationTypeMeta, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceActionText, getWorkspaceColor, getWorkspaceSentPhrase, isWorkspaceNotificationType, notify, parseActivityContent, redlineStats, seedNotifications, selectUnread, textToArtifact, toRedlineMarkdown, useActivity, useAgents, useAiTask, useArbi, useArbiConnected, useArbiDocumentSync, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useCommandPalette, useConfigs, useConversations, useDeleteAgents, useDirectMessages, useDocuments, useHealth, useMemories, useNotify, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSemanticSearch, useSessions, useTags, useTasks, useThumbnails, useUserUsageToday, useWorkspaceChronology, useWorkspaceDocs, useWorkspaces, userDisplayName, userInitials };
6747
+ export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, ArbiChat, ArbiChatPanel, ArbiIcon, ArbiWebSocketProvider, ArtifactCanvas, AudIcon, BASE_COLORS2 as BASE_COLORS, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_NOTIFY_TONE, DirectMessages, DmAvatar, DmComposer, DocIcon, DocQaPanel, DocSearch, DocumentCard, DocumentCardMenu, DocumentEntity, DocumentGallery, DocumentReview, DocumentTable, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, HtmlIcon, ImageCropModal, ImageCropper, ImgIcon, LinkedInIcon, MessageArtifactCard, MessageBubble2 as MessageBubble, MessageThread, NEUTRAL_GRAY2 as NEUTRAL_GRAY, NotificationBell, OpenAIIcon, PLACEHOLDER_COLOR, PdfIcon, ProjectEntity, ProviderIcon, RagDot, SemanticSearch, StatusPill, TAG_TYPE_ICONS, TAG_TYPE_LABELS, TagEntity, Toaster, TxtIcon, TypingIndicator, UserEntity, UserMenu, VISIBILITY_ICONS, VidIcon, VisibilityIcon, XlsIcon, arbiQueryKeys, configureEntityRegistry, configureRagLabels, configureStatusRegistry, cropImage, describeActivity, formatRelativeTime, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getNotificationTypeMeta, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceActionText, getWorkspaceColor, getWorkspaceSentPhrase, isWorkspaceNotificationType, notify, parseActivityContent, redlineStats, seedNotifications, selectUnread, textToArtifact, toRedlineMarkdown, useActivity, useAgents, useAiTask, useArbiConnected, useArbiDocumentSync, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useCommandPalette, useConfigs, useConversations, useDeleteAgents, useDirectMessages, useDocuments, useHealth, useMemories, useNotify, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSemanticSearch, useSessions, useTags, useTasks, useThumbnails, useUserUsageToday, useWorkspaceChronology, useWorkspaceDocs, useWorkspaces, userDisplayName, userInitials };
6747
6748
  //# sourceMappingURL=index.js.map
6748
6749
  //# sourceMappingURL=index.js.map