@arbidocs/react 0.4.76 → 0.4.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, ComponentType } from 'react';
3
3
  import * as _arbidocs_sdk_browser from '@arbidocs/sdk/browser';
4
- import { ArbiOptions, QueryOptions, Arbi, SSEStreamResult, SSEStreamStartData, UserMessageEvent, MessageMetadataPayload, ResponseOutputItemDoneEvent, ArtifactEvent, StepActionRequest, UpdateConversationRequest, UpdateWorkflowRequest, LoginProfile } from '@arbidocs/sdk/browser';
4
+ import { ArbiOptions, QueryOptions, Arbi, SSEStreamResult, SSEStreamStartData, UserMessageEvent, MessageMetadataPayload, ResponseOutputItemDoneEvent, ArtifactEvent, StepActionRequest, UpdateConversationRequest, UpdateWorkflowRequest, TagMatrixSelection, TagFieldDefinition, ProjectEventKind, ProjectUpdateRequest, LoginProfile } from '@arbidocs/sdk/browser';
5
5
  export { ActivityKind, ActivityResponse, AgentStepEvent, Arbi, ArbiError, ArbiOptions, ArtifactEvent, AuthMode, ConversationResponse, CreateFactRequest, CreateWorkRequest, CreateWorkflowRequest, FactResponse, FactSearchRequest, FactSearchResponse, LoginProfile, MessageMetadataPayload, OutputTokensDetails, PendingAuthResponse, PlanWorkRequest, ProjectInvoicesResponse, ProjectUsageResponse, QueryOptions, ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseCreatedEvent, ResponseFailedEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseOutputTextDeltaEvent, ResponseOutputTextDoneEvent, ResponseUsage, SSEStreamCallbacks, SSEStreamResult, SSEStreamStartData, SkillSummary, TaskPlan, UpdateConversationRequest, UpdateWorkflowRequest, UserDailyUsageResponse, UserInputRequestEvent, UserMessageEvent, WorkStatus, WorkflowAuthMode, WorkflowResponse, WorkflowRunResponse } from '@arbidocs/sdk/browser';
6
6
  import * as _arbidocs_client from '@arbidocs/client';
7
7
  import { WebSocketServerMessage, WsTaskUpdateMessage, WsPresenceUpdateMessage, components } from '@arbidocs/client';
@@ -9,6 +9,7 @@ export { WebSocketServerMessage, WsBatchCompleteMessage, WsConversationMessagePo
9
9
  import * as zustand from 'zustand';
10
10
  import * as _tanstack_query_core from '@tanstack/query-core';
11
11
  import * as _tanstack_react_query from '@tanstack/react-query';
12
+ import { QueryClient } from '@tanstack/react-query';
12
13
  import { ao as IdentityStatus, am as IdentityPurchase, ap as IdentityStep, aq as IdentityVerificationFlow, ab as EntityIconComponent } from './index-BVMBElCu.js';
13
14
  export { A as AgentBadge, a as AiMarkdown, b as Avatar, c as AvatarFallback, d as AvatarImage, B as BASE_COLORS, e as Badge, f as BadgeProps, g as Button, h as ButtonProps, C as Card, i as CardContent, j as CardDescription, k as CardFooter, l as CardHeader, m as CardProps, n as CardTitle, o as Checkbox, p as Collapsible, q as CollapsibleContent, r as CollapsibleTrigger, s as Command, t as CommandDialog, u as CommandEmpty, v as CommandGroup, w as CommandInput, x as CommandItem, y as CommandList, z as CommandSeparator, D as CommandShortcut, E as Dialog, F as DialogClose, G as DialogContent, H as DialogDescription, I as DialogFooter, J as DialogHeader, K as DialogOverlay, L as DialogPortal, M as DialogPresentation, N as DialogTitle, O as DialogTrigger, P as DictateContextValue, Q as DictateProvider, R as DocumentCard, S as DocumentCardProps, T as DocumentEntity, U as DocumentEntityProps, V as DocumentLike, W as DropdownMenu, X as DropdownMenuCheckboxItem, Y as DropdownMenuContent, Z as DropdownMenuGroup, _ as DropdownMenuItem, $ as DropdownMenuLabel, a0 as DropdownMenuPortal, a1 as DropdownMenuRadioGroup, a2 as DropdownMenuRadioItem, a3 as DropdownMenuSeparator, a4 as DropdownMenuShortcut, a5 as DropdownMenuSub, a6 as DropdownMenuSubContent, a7 as DropdownMenuSubTrigger, a8 as DropdownMenuTrigger, a9 as ENTITY_MAPPINGS, aa as EntityIcon, ac as EntityPill, ad as EntityRegistryOverride, ae as EntityType, af as HoverCard, ag as HoverCardContent, ah as HoverCardTrigger, ai as IconToggle, aj as IconToggleProps, ak as IdentityBusy, al as IdentityProblem, an as IdentityState, ar as Input, as as InputProps, at as Label, au as MarkMenu, av as MarkMenuItem, aw as MarkMenuProps, ax as MarkdownRenderer, ay as MarkdownRendererProps, az as MarkdownStreamingContext, aA as NEUTRAL_GRAY, aB as PLACEHOLDER_COLOR, aC as PassageCard, aD as PassageCardProps, aE as Popover, aF as PopoverAnchor, aG as PopoverContent, aH as PopoverTrigger, aI as PortalContainerProvider, aJ as PresenceDisplayStatus, aK as PresenceLabel, aL as Progress, aM as ProjectEntity, aN as ProjectEntityProps, aO as ProjectRelation, aP as RadioGroup, aQ as RadioGroupItem, aR as Rag, aS as RagDot, aT as RelevanceDot, aU as ScrollArea, aV as ScrollBar, aW as Select, aX as SelectContent, aY as SelectGroup, aZ as SelectItem, a_ as SelectLabel, a$ as SelectScrollDownButton, b0 as SelectScrollUpButton, b1 as SelectSeparator, b2 as SelectTrigger, b3 as SelectValue, b4 as Separator, b5 as Slider, b6 as StatusBadgeComponent, b7 as StatusBadgeProps, b8 as StatusPill, b9 as StatusPillProps, ba as StatusVariant, bb as Switch, bc as TAG_TYPE_ICONS, bd as TAG_TYPE_LABELS, be as Table, bf as TableBody, bg as TableCaption, bh as TableCell, bi as TableFooter, bj as TableHead, bk as TableHeader, bl as TableRow, bm as Tabs, bn as TabsContent, bo as TabsList, bp as TabsTrigger, bq as TagEntity, br as TagEntityProps, bs as TagLike, bt as Textarea, bu as TextareaProps, bv as ThreadVisibilityIcon, bw as Toggle, bx as ToggleGroup, by as ToggleGroupItem, bz as Tooltip, bA as TooltipContent, bB as TooltipProvider, bC as TooltipTrigger, bD as UserEntity, bE as UserEntityProps, bF as UserMenu, bG as UserMenuItem, bH as UserMenuProps, bI as UserMenuStatus, bJ as VISIBILITY_ICONS, bK as VerifiedBadge, bL as VerifiedBadgeProps, bM as VisibilityIcon, bN as VisibilityToggle, bO as VisibilityToggleProps, bP as badgeVariants, bQ as buttonVariants, bR as cardVariants, bS as closeOpenEmphasis, bT as cn, bU as configureEntityRegistry, bV as configureRagLabels, bW as configureStatusRegistry, bX as getDocIcon, bY as getEntityColor, bZ as getEntityColorStyles, b_ as getEntityIcon, b$ as getEntityLabel, c0 as getStatusVariant, c1 as getTagTypeIcon, c2 as getTagTypeLabel, c3 as getWorkspaceColor, c4 as markdownBaseComponents, c5 as normalizeCitationMarkup, c6 as splitMarkdownBlocks, c7 as toggleVariants, c8 as trimOpenCitation, c9 as usePortalContainer } from './index-BVMBElCu.js';
14
15
  import { VerificationResult } from '@didit-protocol/sdk-web';
@@ -88,7 +89,14 @@ interface ArbiChatMessage {
88
89
  stopped?: boolean;
89
90
  /** The backend id of a finished assistant answer: what a follow-up chains from. */
90
91
  responseId?: string;
92
+ /**
93
+ * A user message the server sent to start a workflow's step (its `tools.workflow_step`): the
94
+ * step's id. A chat shows it as that step, not as the raw instruction.
95
+ */
96
+ workflowStep?: string;
91
97
  }
98
+ /** The workflow step a stored message starts (its `tools.workflow_step` marker), if any. */
99
+ declare function workflowStepOf(tools: object | null | undefined): string | undefined;
92
100
  interface ArbiChatThread {
93
101
  id: string;
94
102
  /** The backend title, else the first question; empty until there is one. */
@@ -529,6 +537,10 @@ declare const arbiQueryKeys: {
529
537
  allConversations: () => readonly ["arbi", "conversations"];
530
538
  conversationThreads: (workspaceId: string, conversationId: string) => readonly ["arbi", "conversations", string, "threads", string];
531
539
  tags: (workspaceId: string) => readonly ["arbi", "tags", string];
540
+ /** Under the workspace's tags: a tag, doctag or fact write that invalidates `tags` refreshes it. */
541
+ tagMatrix: (workspaceId: string, selection: string, linksLimit: number | undefined) => readonly ["arbi", "tags", string, "matrix", string, number | "default"];
542
+ /** Under the conversations prefix: every step action or conversation write refreshes it. */
543
+ conversationUsage: (conversationId: string) => readonly ["arbi", "conversations", string, "usage"];
532
544
  thumbnails: (docIds: string[]) => readonly ["arbi", "thumbnails", string];
533
545
  parsedDoc: (docId: string, stage: string) => readonly ["arbi", "parsedDoc", string, string];
534
546
  agents: () => readonly ["arbi", "agents"];
@@ -539,7 +551,12 @@ declare const arbiQueryKeys: {
539
551
  configs: () => readonly ["arbi", "configs"];
540
552
  activity: () => readonly ["arbi", "activity"];
541
553
  projects: () => readonly ["arbi", "projects"];
554
+ /** A filtered project list, under `projects()`. */
555
+ projectsFiltered: (stage?: string, leadUser?: string) => readonly ["arbi", "projects", "list", string, string];
556
+ /** Under `projects()`: a project update refreshes its events too. */
557
+ projectEvents: (projectExtId: string) => readonly ["arbi", "projects", string, "events"];
542
558
  projectUsage: (projectExtId: string, monthsBack: number) => readonly ["arbi", "projectUsage", string, number];
559
+ projectConversationUsage: (projectExtId: string, monthsBack: number) => readonly ["arbi", "projectUsage", string, "byConversation", number];
543
560
  projectInvoices: (projectExtId: string) => readonly ["arbi", "projectInvoices", string];
544
561
  userUsageToday: () => readonly ["arbi", "userUsageToday"];
545
562
  contacts: () => readonly ["arbi", "contacts"];
@@ -755,7 +772,7 @@ declare function useConversations(workspaceId: string | undefined, options?: {
755
772
  steps: {
756
773
  id: string;
757
774
  title: string;
758
- kind: "form" | "upload" | "agent" | "review";
775
+ kind: "form" | "upload" | "agent" | "review" | "action";
759
776
  after?: string[] | null | undefined;
760
777
  skill?: string | null | undefined;
761
778
  prompt?: string | null | undefined;
@@ -798,6 +815,43 @@ declare function useConversations(workspaceId: string | undefined, options?: {
798
815
  min?: number | null | undefined;
799
816
  max?: number | null | undefined;
800
817
  }[] | null | undefined;
818
+ action?: {
819
+ type: "sign";
820
+ document: string | {
821
+ step?: string | null | undefined;
822
+ input?: string | null | undefined;
823
+ };
824
+ signers: {
825
+ user?: string | null | undefined;
826
+ run_owner?: true | null | undefined;
827
+ input?: string | null | undefined;
828
+ project_lead?: true | null | undefined;
829
+ }[];
830
+ message?: string | null | undefined;
831
+ expires_after_hours?: number | null | undefined;
832
+ } | {
833
+ type: "email_draft";
834
+ to?: string[] | undefined;
835
+ cc?: string[] | undefined;
836
+ subject: string;
837
+ body_template: string;
838
+ attachments?: (string | {
839
+ step?: string | null | undefined;
840
+ input?: string | null | undefined;
841
+ })[] | undefined;
842
+ } | {
843
+ type: "tabular_review";
844
+ tags: string[];
845
+ documents: "run_uploads" | "workspace" | (string | {
846
+ step?: string | null | undefined;
847
+ input?: string | null | undefined;
848
+ })[];
849
+ overwrite: boolean;
850
+ } | null | undefined;
851
+ edit_document?: string | {
852
+ step?: string | null | undefined;
853
+ input?: string | null | undefined;
854
+ } | null | undefined;
801
855
  }[];
802
856
  } | null | undefined;
803
857
  goal_state?: {
@@ -2096,6 +2150,58 @@ declare function useActOnStep(): _tanstack_react_query.UseMutationResult<{
2096
2150
  conversationId: string;
2097
2151
  body: StepActionRequest;
2098
2152
  }, unknown>;
2153
+ /**
2154
+ * Send the work back from a ready person step (`step`) to an earlier one (`to`, default: the step
2155
+ * it waits for), with an optional `note`: that step and every step after it are open again, and an
2156
+ * agent step runs again with the note. The conversation, its activity and its usage are refetched.
2157
+ */
2158
+ declare function useSendBackStep(): _tanstack_react_query.UseMutationResult<{
2159
+ label_ext_ids?: string[];
2160
+ external_id: string;
2161
+ title: string | null;
2162
+ created_by_ext_id: string;
2163
+ updated_by_ext_id?: string | null;
2164
+ created_at: string;
2165
+ updated_at: string;
2166
+ is_shared: boolean;
2167
+ message_count: number;
2168
+ last_message_actor?: _arbidocs_client.components["schemas"]["ConversationTurnActor"] | null;
2169
+ last_message_ext_id?: string | null;
2170
+ last_message_role?: string | null;
2171
+ last_message_updated_at?: string | null;
2172
+ last_message_status?: string | null;
2173
+ assistant_mode: _arbidocs_client.components["schemas"]["AssistantMode"];
2174
+ status?: _arbidocs_client.components["schemas"]["WorkStatus"] | null;
2175
+ description?: string | null;
2176
+ due_at?: string | null;
2177
+ completed_at?: string | null;
2178
+ completed_by_ext_id?: string | null;
2179
+ parent_conversation_ext_id?: string | null;
2180
+ workflow_ext_id?: string | null;
2181
+ agent_ext_id?: string | null;
2182
+ skill_ref?: string | null;
2183
+ skill_inputs?: {
2184
+ [key: string]: unknown;
2185
+ } | null;
2186
+ has_agent_action: boolean;
2187
+ auth_mode?: _arbidocs_client.components["schemas"]["src__models__work__AuthMode"] | null;
2188
+ plan?: _arbidocs_client.components["schemas"]["TaskPlan"] | null;
2189
+ goal_state?: {
2190
+ [key: string]: unknown;
2191
+ } | null;
2192
+ last_error?: string | null;
2193
+ pending_auth_request_id?: string | null;
2194
+ in_progress: boolean;
2195
+ active_response_id?: string | null;
2196
+ run_started_at?: string | null;
2197
+ owner_ext_id?: string | null;
2198
+ is_owner: boolean;
2199
+ }, Error, {
2200
+ conversationId: string;
2201
+ step: string;
2202
+ to?: string | null;
2203
+ note?: string | null;
2204
+ }, unknown>;
2099
2205
  /** Draft an editable plan (goal and acceptance checklist) from an objective. */
2100
2206
  declare function usePlanWork(): _tanstack_react_query.UseMutationResult<{
2101
2207
  goal: string;
@@ -2451,6 +2557,271 @@ declare function useStartAgentSession(): _tanstack_react_query.UseMutationResult
2451
2557
  }, unknown>;
2452
2558
  declare function useCloseAgentSession(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
2453
2559
 
2560
+ /** Refresh what a tag, doctag or fact change affects: the workspace's tags, matrix and facts. */
2561
+ declare function invalidateTagData(qc: QueryClient, workspaceId: string): Promise<unknown>;
2562
+ /** {@link invalidateTagData} for the open workspace: call it after a doctag or fact write. */
2563
+ declare function useInvalidateTagData(): () => Promise<unknown>;
2564
+ /**
2565
+ * The tag matrix of the open workspace: a parent's children (`{parentId}`) or the given tags
2566
+ * (`{tagIds}`), each row with its field values, up to `linksLimit` documents and facts, and their
2567
+ * counts. With a parent, `data.parent.fields` are the shared columns (see the SDK's
2568
+ * `tags.tagMatrixColumns`). Disabled while `selection` is empty.
2569
+ */
2570
+ declare function useTagMatrix(selection: TagMatrixSelection | null | undefined, options?: {
2571
+ linksLimit?: number;
2572
+ enabled?: boolean;
2573
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
2574
+ rows?: _arbidocs_client.components["schemas"]["TagMatrixRow"][];
2575
+ parent?: _arbidocs_client.components["schemas"]["TagResponse"] | null;
2576
+ links_limit: number;
2577
+ }>, Error>;
2578
+ /**
2579
+ * Change a tag's fields: `fields` replaces its own field definitions (keep a field's `id` to keep
2580
+ * its values), `values` merge-patches its values (`null` clears one). The workspace's tags and
2581
+ * every matrix refresh.
2582
+ */
2583
+ declare function useUpdateTagFields(): _tanstack_react_query.UseMutationResult<{
2584
+ external_id: string;
2585
+ workspace_ext_id: string;
2586
+ name: string;
2587
+ instruction?: string | null;
2588
+ tag_type: _arbidocs_client.components["schemas"]["TagFormat"];
2589
+ shared: boolean;
2590
+ parent_ext_id?: string | null;
2591
+ doctag_count: number;
2592
+ facttag_count: number;
2593
+ fields?: _arbidocs_client.components["schemas"]["TagField"][];
2594
+ field_values?: {
2595
+ [key: string]: unknown;
2596
+ };
2597
+ created_by_ext_id: string;
2598
+ updated_by_ext_id?: string | null;
2599
+ created_at: string;
2600
+ updated_at: string;
2601
+ }, Error, {
2602
+ tagId: string;
2603
+ fields?: TagFieldDefinition[];
2604
+ values?: Record<string, unknown>;
2605
+ }, unknown>;
2606
+
2607
+ /** The caller's projects at `stage` and/or led by `leadUser` (`usr-…`). */
2608
+ declare function useFilteredProjects(filters: {
2609
+ stage?: string;
2610
+ leadUser?: string;
2611
+ }, options?: {
2612
+ enabled?: boolean;
2613
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
2614
+ external_id: string;
2615
+ name: string;
2616
+ created_by: string;
2617
+ subscription: string;
2618
+ created_at: string;
2619
+ quotas: {
2620
+ storage_gb: {
2621
+ used: number;
2622
+ limit: number;
2623
+ };
2624
+ ai_credits: {
2625
+ used: number;
2626
+ limit: number;
2627
+ };
2628
+ collaborators: {
2629
+ used: number;
2630
+ limit: number;
2631
+ };
2632
+ budget_reset_at?: number | null | undefined;
2633
+ };
2634
+ daily_cap_per_user?: number | null | undefined;
2635
+ budget?: {
2636
+ amount: number;
2637
+ currency: string;
2638
+ } | null | undefined;
2639
+ client?: string | null | undefined;
2640
+ client_ref?: string | null | undefined;
2641
+ stage?: string | null | undefined;
2642
+ stage_changed_at?: string | null | undefined;
2643
+ lead_user?: string | null | undefined;
2644
+ fields?: {
2645
+ [x: string]: unknown;
2646
+ } | undefined;
2647
+ field_schema?: {
2648
+ key: string;
2649
+ label?: string | null | undefined;
2650
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person";
2651
+ options?: string[] | null | undefined;
2652
+ }[] | null | undefined;
2653
+ plan_interval?: ("month" | "year") | null | undefined;
2654
+ packs: number;
2655
+ plan_change?: {
2656
+ result: "upgraded" | "scheduled" | "unchanged" | "requires_action";
2657
+ charged_pence: number;
2658
+ charged_ex_vat_pence: number;
2659
+ confirm_url?: string | null | undefined;
2660
+ } | null | undefined;
2661
+ addons?: {
2662
+ packs: number;
2663
+ packs_next?: number | null | undefined;
2664
+ plan_name: string;
2665
+ plan_credits: number;
2666
+ plan_storage_gb: number;
2667
+ block_credits: number;
2668
+ block_storage_gb: number;
2669
+ credit_blocks: number;
2670
+ storage_blocks: number;
2671
+ credit_blocks_next?: number | null | undefined;
2672
+ storage_blocks_next?: number | null | undefined;
2673
+ storage_blocks_min: number;
2674
+ auto_topup_threshold_credits: number;
2675
+ min_auto_topup_threshold_credits: number;
2676
+ spend_cap_pence?: number | null | undefined;
2677
+ addon_spend_pence: number;
2678
+ addon_spend_window_end?: number | null | undefined;
2679
+ block_monthly_pence: number;
2680
+ block_monthly_ex_vat_pence: number;
2681
+ block_period_pence: number;
2682
+ block_period_ex_vat_pence: number;
2683
+ credit_block_price_pence: number;
2684
+ credit_block_price_ex_vat_pence: number;
2685
+ storage_block_price_pence: number;
2686
+ storage_block_price_ex_vat_pence: number;
2687
+ cap_reached: boolean;
2688
+ period_end?: number | null | undefined;
2689
+ credits_reset_at?: number | null | undefined;
2690
+ pending_interval?: ("month" | "year") | null | undefined;
2691
+ billing_error?: string | null | undefined;
2692
+ confirm_url?: string | null | undefined;
2693
+ upsell?: {
2694
+ variant: "compare" | "save";
2695
+ interval: "month" | "year";
2696
+ add_on_count: number;
2697
+ current_monthly_pence: number;
2698
+ current_monthly_ex_vat_pence: number;
2699
+ pro_plus_monthly_pence: number;
2700
+ pro_plus_monthly_ex_vat_pence: number;
2701
+ pro_plus_period_pence: number;
2702
+ pro_plus_credits: number;
2703
+ pro_plus_storage_gb: number;
2704
+ saving_monthly_pence: number;
2705
+ } | null | undefined;
2706
+ payment?: {
2707
+ status: "pending" | "paid";
2708
+ kind?: ("credits" | "storage") | null | undefined;
2709
+ amount_pence?: number | null | undefined;
2710
+ amount_ex_vat_pence?: number | null | undefined;
2711
+ tax_pence?: number | null | undefined;
2712
+ at?: number | null | undefined;
2713
+ confirm_url?: string | null | undefined;
2714
+ } | null | undefined;
2715
+ } | null | undefined;
2716
+ price_id?: string | null | undefined;
2717
+ plan?: string | null | undefined;
2718
+ amount?: number | null | undefined;
2719
+ amount_ex_vat?: number | null | undefined;
2720
+ currency?: string | null | undefined;
2721
+ current_period_end?: number | null | undefined;
2722
+ cancel_at_period_end?: boolean | null | undefined;
2723
+ portal_url?: string | null | undefined;
2724
+ }[]>, Error>;
2725
+ /**
2726
+ * Patch a project (owner only): name, daily cap, and the details a host sets (`budget` in minor
2727
+ * units, `client`, `client_ref`, `stage`, `lead_user`, `fields` merged key by key, `field_schema`).
2728
+ * The project list and the project's events refresh.
2729
+ */
2730
+ declare function useUpdateProjectFields(): _tanstack_react_query.UseMutationResult<{
2731
+ external_id: string;
2732
+ name: string;
2733
+ created_by: string;
2734
+ subscription: string;
2735
+ created_at: string;
2736
+ quotas: _arbidocs_client.components["schemas"]["ProjectQuotas"];
2737
+ daily_cap_per_user?: number | null;
2738
+ budget?: _arbidocs_client.components["schemas"]["ProjectBudget"] | null;
2739
+ client?: string | null;
2740
+ client_ref?: string | null;
2741
+ stage?: string | null;
2742
+ stage_changed_at?: string | null;
2743
+ lead_user?: string | null;
2744
+ fields?: {
2745
+ [key: string]: unknown;
2746
+ };
2747
+ field_schema?: _arbidocs_client.components["schemas"]["FieldSchemaEntry"][] | null;
2748
+ plan_interval?: ("month" | "year") | null;
2749
+ packs: number;
2750
+ plan_change?: _arbidocs_client.components["schemas"]["PlanChangeOutcome"] | null;
2751
+ addons?: _arbidocs_client.components["schemas"]["ProjectAddons"] | null;
2752
+ price_id?: string | null;
2753
+ plan?: string | null;
2754
+ amount?: number | null;
2755
+ amount_ex_vat?: number | null;
2756
+ currency?: string | null;
2757
+ current_period_end?: number | null;
2758
+ cancel_at_period_end?: boolean | null;
2759
+ portal_url?: string | null;
2760
+ }, Error, {
2761
+ projectExtId: string;
2762
+ patch: ProjectUpdateRequest;
2763
+ }, unknown>;
2764
+ /** A project's stage and budget changes, newest first. */
2765
+ declare function useProjectEvents(projectExtId: string | undefined, options?: {
2766
+ kind?: ProjectEventKind;
2767
+ limit?: number;
2768
+ enabled?: boolean;
2769
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
2770
+ external_id: string;
2771
+ kind: "stage_changed" | "budget_changed";
2772
+ actor?: string | null;
2773
+ detail: {
2774
+ [key: string]: unknown;
2775
+ };
2776
+ created_at: string;
2777
+ }[]>, Error>;
2778
+ /**
2779
+ * What a conversation's AI work cost this billing period, by step, run, model, agent and feature.
2780
+ * Spend is in CREDITS (see `formatCredits`). Pass `live` while a run is going.
2781
+ */
2782
+ declare function useConversationUsage(conversationId: string | undefined, options?: {
2783
+ enabled?: boolean;
2784
+ live?: boolean;
2785
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
2786
+ conversation_ext_id: string;
2787
+ project_ext_id: string;
2788
+ period_start: string;
2789
+ period_end: string;
2790
+ total_spend: number;
2791
+ total_tokens: number;
2792
+ total_requests: number;
2793
+ by_step: {
2794
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2795
+ };
2796
+ by_run: {
2797
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2798
+ };
2799
+ by_model: {
2800
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2801
+ };
2802
+ by_agent: {
2803
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2804
+ };
2805
+ by_feature: {
2806
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2807
+ };
2808
+ }>, Error>;
2809
+ /** A project's spend by conversation (and what no conversation accounts for), in credits. */
2810
+ declare function useProjectConversationUsage(projectExtId: string | undefined, monthsBack?: number, options?: {
2811
+ enabled?: boolean;
2812
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
2813
+ project_ext_id: string;
2814
+ period_start: string;
2815
+ period_end: string;
2816
+ total_spend: number;
2817
+ total_tokens: number;
2818
+ total_requests: number;
2819
+ by_conversation: {
2820
+ [key: string]: _arbidocs_client.components["schemas"]["TagBreakdown"];
2821
+ };
2822
+ unattributed: _arbidocs_client.components["schemas"]["TagBreakdown"];
2823
+ }>, Error>;
2824
+
2454
2825
  /**
2455
2826
  * Contacts: the user's colleagues and pending invitations.
2456
2827
  *
@@ -5915,4 +6286,4 @@ interface ArbiUiState {
5915
6286
  }
5916
6287
  declare const useArbiUiStore: zustand.UseBoundStore<zustand.StoreApi<ArbiUiState>>;
5917
6288
 
5918
- export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DEFAULT_USD_PER_CREDIT, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, type FormatCreditsOptions, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAX_AVATAR_FILE_BYTES, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeResult, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, XlsIcon, annotateThread, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, creditsToUsd, cropImage, dayKey, describeActivity, formatCredits, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, isUsageMetered, isWorkspaceNotificationType, mountDiditVerification, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDocuments, useEmailChange, useFacts, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useLogoutAllSessions, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSemanticSearch, useSessions, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateProfile, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials };
6289
+ export { type ActivityContent, type ActivityDescription, ActivityFeed, type ActivityFeedProps, type AgentAccessMode, type AgentConfigSections, type AggregatedDailyUsage, type AggregatedModelGroupUsage, AiActionCard, AiAnswer, type AiRunOptions, type AiTaskStatus, AppleIcon, ArbiBotHeadIcon, ArbiBotIcon, type ArbiChat, type ArbiChatCitation, type ArbiChatDocument, type ArbiChatMessage, type ArbiChatMessageStatus, type ArbiChatPassage, type ArbiChatRole, type ArbiChatThread, ArbiIcon, ArbiProvider, type ArbiProviderProps, type ArbiUiState, ArbiWebSocketProvider, type ArbiWebSocketProviderProps, type ArbiWsState, type ArbiWsStatus, ArtifactCanvas, type AspectOption, AudIcon, type AudioRecorderState, type AvatarCrop, type AvatarFileProblem, ChatBubble, type ChatBubbleProps, type Chunk, type ChunkActivation, CitationRenderer, type CitationRendererProps, type CitationState, ClaudeIcon, CommandPalette, type CommandPaletteClassNames, type CommandPaletteProps, CommandPaletteProvider, type CommandPaletteProviderProps, type CommandPaletteValue, ConversationList, type ConversationListProps, type CropArea, type CropOutput, type CropResult, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DEFAULT_USD_PER_CREDIT, DateSeparator, type DateSeparatorProps, type DeleteAccountBlocker, type DeleteAccountFlow, DirectMessages, type DirectMessagesProps, DmAvatar, type DmAvatarProps, type DmClassNames, DmComposer, type DmComposerProps, type DmConversation, type DmMessage, type DmNotification, type DmUser, DocIcon, DocQaPanel, DocSearch, DocumentCardMenu, type DocumentCardMenuProps, DocumentGallery, type DocumentGalleryProps, DocumentReview, type DocumentReviewProps, DocumentTable, type DocumentTableProps, DraftTitleControls, type DraftTitleControlsProps, type EmailChange, type EmailPreferences, EmlIcon, EntityIconComponent, FILE_TYPE_COLORS, FileIcon, FireworksIcon, type FormatCreditsOptions, GeminiIcon, GitHubIcon, GoogleIcon, type GrantAgentAccessVars, HtmlIcon, IdentityPurchase, IdentityStatus, IdentityStep, type IdentityVerificationApi, IdentityVerificationFlow, ImageCropModal, type ImageCropModalProps, ImageCropper, type ImageCropperProps, ImgIcon, InlineMicButton, type InlineMicButtonProps, LinkedInIcon, MAX_AVATAR_FILE_BYTES, type MessageArtifact, MessageArtifactCard, MessageBubble, type MessageBubbleProps, MessageThread, type MessageThreadProps, MicRecordingOverlay, type MicRecordingOverlayProps, MicWaveformIndicator, type MicWaveformIndicatorProps, type MountDiditOptions, type NameEditor, type NotificationPreferencesModel, type NotificationTypeMeta, OpenAIIcon, type PaletteNavItem, type ParsedChunk, type ParsedChunkMetadata, type ParsedDocument, type ParsedDocumentMetadata, type PasswordChangeForm, type PasswordChangeFormMessages, type PasswordChangeResult, type PasswordChangeVars, PdfIcon, PhotoCapture, type PhotoCaptureProps, type ProfileView, type ProjectsUsageAggregate, ProviderIcon, RUN_WINDOW_MS, type RenderMarkdown, type SaveAgentConfigVars, type SearchChunk, SemanticSearch, type SemanticSearchProps, type ShellRecentWorkspaceItem, type ShellWorkspaceItem, type ShellWorkspaceKind, type ShellWorkspaceMember, type ShellWorkspaceSeed, type ShellWorkspaceSource, StartByEmail, type StartByEmailLabels, type StartByEmailProps, type ThreadAccessors, type ThreadItem, type ToolResponses, TxtIcon, TypingIndicator, type UpdateProfileVars, type UsageTotals, type UseArbiChatOptions, type UseArbiShellWorkspacesOptions, type UseAudioRecorderResult, type UseAvatarCropOptions, type UseCameraStreamResult, type UseDeleteAccountFlowOptions, type UseDirectMessagesResult, type UseEmailChangeOptions, type UseIdentityVerificationFlowOptions, type UseNameEditorOptions, type UsePasswordChangeFormOptions, type UseShellWorkspacesOptions, type UseShellWorkspacesResult, type UseVideoRecorderResult, VidIcon, VideoCapture, type VideoCaptureProps, type VideoRecorderState, VoiceNoteRecorder, type VoiceNoteRecorderProps, XlsIcon, annotateThread, arbiQueryKeys, captureFrameAsBlob, classifyMediaError, creditsToUsd, cropImage, dayKey, describeActivity, formatCredits, formatElapsed, formatIdentityPrice, formatRelativeTime, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isUsageMetered, isWorkspaceNotificationType, mountDiditVerification, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useActivity, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAgents, useAiTask, useArbi, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAssistantQuery, useAudioRecorder, useAvatarCrop, useCameraStream, useCloseAgentSession, useCommandPalette, useConfigs, useConfirmEmailChange, useContacts, useConversationActivity, useConversationPendingAuth, useConversationThreads, useConversationUsage, useConversations, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteAgents, useDeleteWorkflow, useDeploymentDomain, useDirectMessages, useDocuments, useEmailChange, useFacts, useFilteredProjects, useGrantAgentAccess, useHealth, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useNameEditor, useNotificationPreferences, useParsedDocument, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSemanticSearch, useSendBackStep, useSessions, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagMatrix, useTags, useTerminateSession, useThumbnails, useUpdateConversation, useUpdateProfile, useUpdateProjectFields, useUpdateTagFields, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useUserUsageToday, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, useWorkspaceUsers, useWorkspaces, userDisplayName, userInitials, workflowStepOf };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-IQ5TYPVU.js';
2
- export { DEFAULT_USD_PER_CREDIT, arbiQueryKeys, creditsToUsd, formatCredits, isUsageMetered, useActivity, useAgents, useAssistantQuery, useConfigs, useConversationThreads, useConversations, useDeleteAgents, useDocuments, useFacts, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessions, useTags, useThumbnails, useUserUsageToday, useWorkspaceUsers, useWorkspaces } from './chunk-IQ5TYPVU.js';
1
+ import { arbiQueryKeys, useDocuments, useConversations, useAssistantQuery, useConversationThreads, useWorkspaces, useParsedDocument, useTags, useActivity, useThumbnails } from './chunk-2JPBOZIH.js';
2
+ export { DEFAULT_USD_PER_CREDIT, arbiQueryKeys, creditsToUsd, formatCredits, isUsageMetered, useActivity, useAgents, useAssistantQuery, useConfigs, useConversationThreads, useConversations, useDeleteAgents, useDocuments, useFacts, useHealth, useParsedDocument, useProjectInvoices, useProjectUsage, useProjects, useProjectsUsage, useSessions, useTags, useThumbnails, useUserUsageToday, useWorkspaceUsers, useWorkspaces } from './chunk-2JPBOZIH.js';
3
3
  export { cleanDraftMarkdown, cleanDraftWithReport, promoteBoldTitle, repairParsedStructure, repairParsedTitle, stripAgentPreamble, unescapeMarkdown, unwrapCitationLinks } from './chunk-G6FHNURH.js';
4
4
  import { formatRelativeTime } from './chunk-ECOSGMTW.js';
5
5
  export { DEFAULT_NOTIFY_TONE, NotificationBell, Toaster, formatRelativeTime, notify, seedNotifications, selectUnread, toast, useNotify } from './chunk-ECOSGMTW.js';
@@ -75,6 +75,19 @@ function useActOnStep() {
75
75
  onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.allConversations() })
76
76
  });
77
77
  }
78
+ function useSendBackStep() {
79
+ const arbi = useArbi();
80
+ const qc = useQueryClient();
81
+ return useMutation({
82
+ mutationFn: ({
83
+ conversationId,
84
+ step,
85
+ to,
86
+ note
87
+ }) => arbi.conversations.sendBackStep(conversationId, step, { to, note }),
88
+ onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.allConversations() })
89
+ });
90
+ }
78
91
  function usePlanWork() {
79
92
  const arbi = useArbi();
80
93
  return useMutation({
@@ -365,6 +378,10 @@ function toChatCitations(source) {
365
378
  }
366
379
 
367
380
  // src/chat/useArbiChat.ts
381
+ function workflowStepOf(tools) {
382
+ const marker = tools?.workflow_step;
383
+ return typeof marker?.workflow_step === "string" ? marker.workflow_step : void 0;
384
+ }
368
385
  var counter = 0;
369
386
  var nextId = (prefix) => `${prefix}-${Date.now().toString(36)}-${(counter++).toString(36)}`;
370
387
  var emptyThread = () => ({
@@ -393,11 +410,13 @@ function messagesFromHistory(history, live = false) {
393
410
  (m) => m.role !== "system" && (m.content.trim() !== "" || m.role === "assistant" && (isUnfinished(m) || m.status === "cancelled"))
394
411
  ).map((m) => {
395
412
  if (m.role === "user") {
413
+ const workflowStep = workflowStepOf(m.tools);
396
414
  return {
397
415
  id: m.external_id,
398
416
  role: "user",
399
417
  content: m.content,
400
418
  status: "complete",
419
+ ...workflowStep ? { workflowStep } : {},
401
420
  ...m.created_by_ext_id ? { authorId: m.created_by_ext_id } : {},
402
421
  ...m.mentions?.length ? { mentions: m.mentions } : {}
403
422
  };
@@ -1461,6 +1480,92 @@ function useArbiShellWorkspaces(options = {}) {
1461
1480
  select: select ?? defaultSelect
1462
1481
  });
1463
1482
  }
1483
+ var selectionKey = (selection) => !selection ? "" : "parentId" in selection ? `parent:${selection.parentId}` : `tags:${selection.tagIds.join(",")}`;
1484
+ function invalidateTagData(qc, workspaceId) {
1485
+ return Promise.all([
1486
+ qc.invalidateQueries({ queryKey: arbiQueryKeys.tags(workspaceId) }),
1487
+ qc.invalidateQueries({ queryKey: arbiQueryKeys.facts(workspaceId) })
1488
+ ]);
1489
+ }
1490
+ function useInvalidateTagData() {
1491
+ const arbi = useArbi();
1492
+ const qc = useQueryClient();
1493
+ return useCallback(() => {
1494
+ const workspaceId = arbi.getWorkspaceId();
1495
+ return workspaceId ? invalidateTagData(qc, workspaceId) : Promise.resolve();
1496
+ }, [arbi, qc]);
1497
+ }
1498
+ function useTagMatrix(selection, options) {
1499
+ const arbi = useArbi();
1500
+ const workspaceId = arbi.getWorkspaceId() ?? "";
1501
+ const key = selectionKey(selection);
1502
+ const hasSelection = !!selection && ("parentId" in selection ? !!selection.parentId : selection.tagIds.length > 0);
1503
+ return useQuery({
1504
+ queryKey: arbiQueryKeys.tagMatrix(workspaceId, key, options?.linksLimit),
1505
+ queryFn: () => arbi.tags.matrix(selection, options?.linksLimit),
1506
+ enabled: (options?.enabled ?? true) && hasSelection && !!workspaceId && arbi.hasWorkspace
1507
+ });
1508
+ }
1509
+ function useUpdateTagFields() {
1510
+ const arbi = useArbi();
1511
+ const qc = useQueryClient();
1512
+ return useMutation({
1513
+ mutationFn: ({
1514
+ tagId,
1515
+ fields,
1516
+ values
1517
+ }) => arbi.tags.updateFields(tagId, { fields, values }),
1518
+ onSuccess: (tag) => invalidateTagData(qc, tag.workspace_ext_id)
1519
+ });
1520
+ }
1521
+ function useFilteredProjects(filters, options) {
1522
+ const arbi = useArbi();
1523
+ return useQuery({
1524
+ queryKey: arbiQueryKeys.projectsFiltered(filters.stage, filters.leadUser),
1525
+ queryFn: () => arbi.projects.list(filters),
1526
+ enabled: options?.enabled ?? arbi.isLoggedIn
1527
+ });
1528
+ }
1529
+ function useUpdateProjectFields() {
1530
+ const arbi = useArbi();
1531
+ const qc = useQueryClient();
1532
+ return useMutation({
1533
+ mutationFn: ({
1534
+ projectExtId,
1535
+ patch
1536
+ }) => arbi.projects.update(projectExtId, patch),
1537
+ onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.projects() })
1538
+ });
1539
+ }
1540
+ function useProjectEvents(projectExtId, options) {
1541
+ const arbi = useArbi();
1542
+ return useQuery({
1543
+ queryKey: [
1544
+ ...arbiQueryKeys.projectEvents(projectExtId ?? ""),
1545
+ options?.kind ?? "all",
1546
+ options?.limit ?? "default"
1547
+ ],
1548
+ queryFn: () => arbi.projects.events(projectExtId, { kind: options?.kind, limit: options?.limit }),
1549
+ enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
1550
+ });
1551
+ }
1552
+ function useConversationUsage(conversationId, options) {
1553
+ const arbi = useArbi();
1554
+ return useQuery({
1555
+ queryKey: arbiQueryKeys.conversationUsage(conversationId ?? ""),
1556
+ queryFn: () => arbi.conversations.usage(conversationId),
1557
+ enabled: (options?.enabled ?? true) && !!conversationId && arbi.isLoggedIn,
1558
+ refetchInterval: options?.live ? 1e4 : false
1559
+ });
1560
+ }
1561
+ function useProjectConversationUsage(projectExtId, monthsBack = 0, options) {
1562
+ const arbi = useArbi();
1563
+ return useQuery({
1564
+ queryKey: arbiQueryKeys.projectConversationUsage(projectExtId ?? "", monthsBack),
1565
+ queryFn: () => arbi.projects.usageByConversation(projectExtId, monthsBack),
1566
+ enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
1567
+ });
1568
+ }
1464
1569
  function useContacts(options) {
1465
1570
  const arbi = useArbi();
1466
1571
  return useQuery({
@@ -6419,6 +6524,6 @@ function hasVideoTrack(blob) {
6419
6524
  });
6420
6525
  }
6421
6526
 
6422
- export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiIcon, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAX_AVATAR_FILE_BYTES, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, annotateThread, captureFrameAsBlob, cropImage, dayKey, describeActivity, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, isWorkspaceNotificationType, mountDiditVerification, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useContacts, useConversationActivity, useConversationPendingAuth, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteWorkflow, useDirectMessages, useEmailChange, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useLogoutAllSessions, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSemanticSearch, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTerminateSession, useUpdateConversation, useUpdateProfile, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, userDisplayName, userInitials };
6527
+ export { ActivityFeed, AiActionCard, AiAnswer, AppleIcon, ArbiBotIcon, ArbiIcon, ArbiWebSocketProvider, ArtifactCanvas, ChatBubble, CitationRenderer, ClaudeIcon, CommandPalette, CommandPaletteProvider, ConversationList, DEFAULT_ASPECT_OPTIONS, DEFAULT_PASSWORD_CHANGE_FORM_MESSAGES, DEFAULT_START_BY_EMAIL_LABELS, DateSeparator, DirectMessages, DmAvatar, DmComposer, DocQaPanel, DocSearch, DocumentCardMenu, DocumentGallery, DocumentReview, DocumentTable, DraftTitleControls, FileIcon, FireworksIcon, GeminiIcon, GitHubIcon, GoogleIcon, ImageCropModal, ImageCropper, LinkedInIcon, MAX_AVATAR_FILE_BYTES, MessageArtifactCard, MessageBubble, MessageThread, OpenAIIcon, PhotoCapture, ProviderIcon, RUN_WINDOW_MS, SemanticSearch, StartByEmail, TypingIndicator, VideoCapture, VoiceNoteRecorder, annotateThread, captureFrameAsBlob, cropImage, dayKey, describeActivity, formatIdentityPrice, getNotificationTypeMeta, getWorkspaceActionText, getWorkspaceKind, getWorkspaceSentPhrase, hasVideoTrack, identityStepFor, invalidateTagData, isWorkspaceNotificationType, mountDiditVerification, parseActivityContent, parseDeleteAccountBlockers, pickRecentWorkspaces, redlineStats, resolveActiveWorkspace, textToArtifact, titleFromQuestion, toChatCitations, toNotificationPreferences, toProfileView, toRedlineMarkdown, toShellWorkspace, useActOnStep, useAddContacts, useAgentChats, useAgentConfig, useAgentModels, useAgentSession, useAgentWorkspaces, useAiTask, useArbiChat, useArbiConnected, useArbiDocumentSync, useArbiShellWorkspaces, useArbiUiStore, useArbiWebSocket, useArbiWsContext, useArbiWsMessage, useArbiWsStatus, useArbiWsStore, useArbiWsTask, useArbiWsTasks, useAvatarCrop, useCameraStream, useCloseAgentSession, useCommandPalette, useConfirmEmailChange, useContacts, useConversationActivity, useConversationPendingAuth, useConversationUsage, useCreateAgent, useCreateWork, useCreateWorkflow, useCurrentSessionId, useDeleteAccount, useDeleteAccountFlow, useDeleteWorkflow, useDirectMessages, useEmailChange, useFilteredProjects, useGrantAgentAccess, useIdentityVerification, useIdentityVerificationFlow, useInvalidateTagData, useLogoutAllSessions, useNameEditor, useNotificationPreferences, usePasswordChange, usePasswordChangeForm, usePendingContacts, usePlanWork, useProfile, useProjectConversationUsage, useProjectEvents, useRemoveContacts, useRequestEmailChange, useRevokeAgentAccess, useRunConversation, useRunWorkflow, useSaveAgentConfig, useSemanticSearch, useSendBackStep, useShellWorkspaces, useSkills, useStartAgentSession, useStartWorkQuery, useTagMatrix, useTerminateSession, useUpdateConversation, useUpdateProfile, useUpdateProjectFields, useUpdateTagFields, useUpdateWorkflow, useUploadSkillFiles, useUserSettings, useVideoRecorder, useWorkNotifications, useWorkflows, useWorkspaceDocs, userDisplayName, userInitials, workflowStepOf };
6423
6528
  //# sourceMappingURL=index.js.map
6424
6529
  //# sourceMappingURL=index.js.map