@invergent/agent-chat-react 2.4.12 → 2.5.0

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
@@ -326,6 +326,13 @@ interface AgentChatBrowserControlResponse {
326
326
  outcome: "granted" | "refreshed" | "conflict";
327
327
  ownerUserId: string;
328
328
  }
329
+ /** One source the planner curated with research_memory(add). */
330
+ interface AgentChatResearchSource {
331
+ /** Stable identifier — citations in the report refer to this (e.g. "S3"). */
332
+ sourceId: string;
333
+ url: string;
334
+ title: string;
335
+ }
329
336
  interface AgentChatState {
330
337
  messages: AgentChatMessage[];
331
338
  isRunning: boolean;
@@ -339,6 +346,9 @@ interface AgentChatState {
339
346
  workspaceRefreshKey: number;
340
347
  browser: AgentChatBrowserState | null;
341
348
  viewMode: AgentChatViewMode;
349
+ /** Sources collected from successful research_memory(add) tool
350
+ * results. Deduped by sourceId on insertion. */
351
+ researchSources: AgentChatResearchSource[];
342
352
  }
343
353
  type AgentChatViewMode = "simple" | "expert";
344
354
  type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg";
@@ -678,6 +688,10 @@ interface AgentChatRuntimeApi {
678
688
  viewMode: AgentChatViewMode;
679
689
  /** Update the chat view mode + persist via adapter / localStorage. */
680
690
  setViewMode(mode: AgentChatViewMode): void;
691
+ /** Sources collected from ``research_memory(add)`` tool results.
692
+ * Hosts render the sources/citations panel from this array; the
693
+ * ``CitationText`` helper resolves ``[S#]`` markers against it. */
694
+ researchSources: AgentChatResearchSource[];
681
695
  }
682
696
  type ChatMessage = AgentChatMessage;
683
697
  type SessionTreeNode = AgentChatSessionTreeNode;
@@ -731,8 +745,17 @@ interface AgentChatProps {
731
745
  * their toast system; the SDK does not surface these on its own.
732
746
  */
733
747
  onComposerError?: (err: ChatComposerError) => void;
748
+ /**
749
+ * Per-agent capability flag. When true, the composer surfaces the
750
+ * ``/deep-research`` slash command in its builtin menu. Off by
751
+ * default; the host (Studio) reads it from the agent record and
752
+ * passes it through. Wired this way (not via the runtime) because
753
+ * the SDK has no notion of the agent's settings -- the host owns
754
+ * that domain.
755
+ */
756
+ deepResearchEnabled?: boolean;
734
757
  }
735
- declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, }: AgentChatProps): react_jsx_runtime.JSX.Element;
758
+ declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, }: AgentChatProps): react_jsx_runtime.JSX.Element;
736
759
 
737
760
  interface AgentChatAdapterContextValue {
738
761
  adapter: AgentChatAdapter;
@@ -818,6 +841,36 @@ declare function groupMissionTasksByBucket(tasks: AgentChatMissionTask[]): Recor
818
841
  */
819
842
  declare function deriveMissionWorkerActivityLabel(worker: AgentChatMissionWorker): string;
820
843
 
844
+ declare function ResearchSourcesPanel({ sources, }: {
845
+ sources: AgentChatResearchSource[];
846
+ }): react_jsx_runtime.JSX.Element;
847
+
848
+ type CitationSegment = {
849
+ kind: "text";
850
+ value: string;
851
+ } | {
852
+ kind: "cite";
853
+ value: string;
854
+ };
855
+ /**
856
+ * Split *text* into plain-text and citation segments.
857
+ *
858
+ * Comma-grouped markers expand into one ``cite`` segment per ID.
859
+ * Empty input returns an empty array. Invalid markers are passed
860
+ * through verbatim as ``text``.
861
+ */
862
+ declare function splitCitations(text: string): CitationSegment[];
863
+ /**
864
+ * Render *text* with each ``[S#]`` marker as a chip that links to the
865
+ * matching :class:`AgentChatResearchSource`. Hosts pass
866
+ * ``onCitationClick`` to scroll the sources panel to the entry.
867
+ */
868
+ declare function CitationText({ text, sources, onCitationClick, }: {
869
+ text: string;
870
+ sources: AgentChatResearchSource[];
871
+ onCitationClick?: (sourceId: string) => void;
872
+ }): react_jsx_runtime.JSX.Element;
873
+
821
874
  interface ScheduledWorkPanelProps {
822
875
  adapter: AgentChatAdapter;
823
876
  agentId?: string;
@@ -854,4 +907,4 @@ interface SessionTreePanelProps {
854
907
  }
855
908
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
856
909
 
857
- export { ACTIVE_MISSION_STATUSES, AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatAskUserQuestionAnswer, type AgentChatAskUserQuestionArgs, type AgentChatAskUserQuestionChoice, type AgentChatAskUserQuestionQuestion, type AgentChatAttachment, type AgentChatChartArtifactSpec, type AgentChatDisplayAttachment, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionList, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatScheduledWorkItem, type AgentChatScheduledWorkKind, type AgentChatScheduledWorkList, type AgentChatSession, type AgentChatSessionList, type AgentChatSessionTree, type AgentChatSessionTreeNode, type AgentChatSlashCommand, type AgentChatSseMessageEvent, type AgentChatState, type AgentChatSvgArtifactSpec, type AgentChatSystemKind, type AgentChatTableArtifactSpec, type AgentChatTokenUsage, type AgentChatToolCallInfo, type AgentChatWorkspaceEntry, type AgentChatWorkspaceFile, type AgentChatWorkspaceTree, type AgentChatWorkspaceUpload, type ArtifactKind, type ArtifactPayload, type AskUserQuestionAnswer, type AskUserQuestionArgs, type AskUserQuestionChoice, type AskUserQuestionQuestion, type ChartArtifactSpec, type ChatComposerError, type ChatMessage, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionTaskBucket, MissionsPanel, type MissionsPanelProps, type RetryIndicator, type ScheduledWorkItem, type ScheduledWorkList, ScheduledWorkPanel, type ScheduledWorkPanelProps, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, deriveMissionWorkerActivityLabel, groupMissionTasksByBucket, isTerminalMissionStatus, missionTaskBucket, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount };
910
+ export { ACTIVE_MISSION_STATUSES, AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatAskUserQuestionAnswer, type AgentChatAskUserQuestionArgs, type AgentChatAskUserQuestionChoice, type AgentChatAskUserQuestionQuestion, type AgentChatAttachment, type AgentChatChartArtifactSpec, type AgentChatDisplayAttachment, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionList, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatProps, type AgentChatResearchSource, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatScheduledWorkItem, type AgentChatScheduledWorkKind, type AgentChatScheduledWorkList, type AgentChatSession, type AgentChatSessionList, type AgentChatSessionTree, type AgentChatSessionTreeNode, type AgentChatSlashCommand, type AgentChatSseMessageEvent, type AgentChatState, type AgentChatSvgArtifactSpec, type AgentChatSystemKind, type AgentChatTableArtifactSpec, type AgentChatTokenUsage, type AgentChatToolCallInfo, type AgentChatWorkspaceEntry, type AgentChatWorkspaceFile, type AgentChatWorkspaceTree, type AgentChatWorkspaceUpload, type ArtifactKind, type ArtifactPayload, type AskUserQuestionAnswer, type AskUserQuestionArgs, type AskUserQuestionChoice, type AskUserQuestionQuestion, type ChartArtifactSpec, type ChatComposerError, type ChatMessage, type CitationSegment, CitationText, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionTaskBucket, MissionsPanel, type MissionsPanelProps, ResearchSourcesPanel, type RetryIndicator, type ScheduledWorkItem, type ScheduledWorkList, ScheduledWorkPanel, type ScheduledWorkPanelProps, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, deriveMissionWorkerActivityLabel, groupMissionTasksByBucket, isTerminalMissionStatus, missionTaskBucket, splitCitations, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount };
package/dist/index.d.ts CHANGED
@@ -326,6 +326,13 @@ interface AgentChatBrowserControlResponse {
326
326
  outcome: "granted" | "refreshed" | "conflict";
327
327
  ownerUserId: string;
328
328
  }
329
+ /** One source the planner curated with research_memory(add). */
330
+ interface AgentChatResearchSource {
331
+ /** Stable identifier — citations in the report refer to this (e.g. "S3"). */
332
+ sourceId: string;
333
+ url: string;
334
+ title: string;
335
+ }
329
336
  interface AgentChatState {
330
337
  messages: AgentChatMessage[];
331
338
  isRunning: boolean;
@@ -339,6 +346,9 @@ interface AgentChatState {
339
346
  workspaceRefreshKey: number;
340
347
  browser: AgentChatBrowserState | null;
341
348
  viewMode: AgentChatViewMode;
349
+ /** Sources collected from successful research_memory(add) tool
350
+ * results. Deduped by sourceId on insertion. */
351
+ researchSources: AgentChatResearchSource[];
342
352
  }
343
353
  type AgentChatViewMode = "simple" | "expert";
344
354
  type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg";
@@ -678,6 +688,10 @@ interface AgentChatRuntimeApi {
678
688
  viewMode: AgentChatViewMode;
679
689
  /** Update the chat view mode + persist via adapter / localStorage. */
680
690
  setViewMode(mode: AgentChatViewMode): void;
691
+ /** Sources collected from ``research_memory(add)`` tool results.
692
+ * Hosts render the sources/citations panel from this array; the
693
+ * ``CitationText`` helper resolves ``[S#]`` markers against it. */
694
+ researchSources: AgentChatResearchSource[];
681
695
  }
682
696
  type ChatMessage = AgentChatMessage;
683
697
  type SessionTreeNode = AgentChatSessionTreeNode;
@@ -731,8 +745,17 @@ interface AgentChatProps {
731
745
  * their toast system; the SDK does not surface these on its own.
732
746
  */
733
747
  onComposerError?: (err: ChatComposerError) => void;
748
+ /**
749
+ * Per-agent capability flag. When true, the composer surfaces the
750
+ * ``/deep-research`` slash command in its builtin menu. Off by
751
+ * default; the host (Studio) reads it from the agent record and
752
+ * passes it through. Wired this way (not via the runtime) because
753
+ * the SDK has no notion of the agent's settings -- the host owns
754
+ * that domain.
755
+ */
756
+ deepResearchEnabled?: boolean;
734
757
  }
735
- declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, }: AgentChatProps): react_jsx_runtime.JSX.Element;
758
+ declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, }: AgentChatProps): react_jsx_runtime.JSX.Element;
736
759
 
737
760
  interface AgentChatAdapterContextValue {
738
761
  adapter: AgentChatAdapter;
@@ -818,6 +841,36 @@ declare function groupMissionTasksByBucket(tasks: AgentChatMissionTask[]): Recor
818
841
  */
819
842
  declare function deriveMissionWorkerActivityLabel(worker: AgentChatMissionWorker): string;
820
843
 
844
+ declare function ResearchSourcesPanel({ sources, }: {
845
+ sources: AgentChatResearchSource[];
846
+ }): react_jsx_runtime.JSX.Element;
847
+
848
+ type CitationSegment = {
849
+ kind: "text";
850
+ value: string;
851
+ } | {
852
+ kind: "cite";
853
+ value: string;
854
+ };
855
+ /**
856
+ * Split *text* into plain-text and citation segments.
857
+ *
858
+ * Comma-grouped markers expand into one ``cite`` segment per ID.
859
+ * Empty input returns an empty array. Invalid markers are passed
860
+ * through verbatim as ``text``.
861
+ */
862
+ declare function splitCitations(text: string): CitationSegment[];
863
+ /**
864
+ * Render *text* with each ``[S#]`` marker as a chip that links to the
865
+ * matching :class:`AgentChatResearchSource`. Hosts pass
866
+ * ``onCitationClick`` to scroll the sources panel to the entry.
867
+ */
868
+ declare function CitationText({ text, sources, onCitationClick, }: {
869
+ text: string;
870
+ sources: AgentChatResearchSource[];
871
+ onCitationClick?: (sourceId: string) => void;
872
+ }): react_jsx_runtime.JSX.Element;
873
+
821
874
  interface ScheduledWorkPanelProps {
822
875
  adapter: AgentChatAdapter;
823
876
  agentId?: string;
@@ -854,4 +907,4 @@ interface SessionTreePanelProps {
854
907
  }
855
908
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
856
909
 
857
- export { ACTIVE_MISSION_STATUSES, AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatAskUserQuestionAnswer, type AgentChatAskUserQuestionArgs, type AgentChatAskUserQuestionChoice, type AgentChatAskUserQuestionQuestion, type AgentChatAttachment, type AgentChatChartArtifactSpec, type AgentChatDisplayAttachment, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionList, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatScheduledWorkItem, type AgentChatScheduledWorkKind, type AgentChatScheduledWorkList, type AgentChatSession, type AgentChatSessionList, type AgentChatSessionTree, type AgentChatSessionTreeNode, type AgentChatSlashCommand, type AgentChatSseMessageEvent, type AgentChatState, type AgentChatSvgArtifactSpec, type AgentChatSystemKind, type AgentChatTableArtifactSpec, type AgentChatTokenUsage, type AgentChatToolCallInfo, type AgentChatWorkspaceEntry, type AgentChatWorkspaceFile, type AgentChatWorkspaceTree, type AgentChatWorkspaceUpload, type ArtifactKind, type ArtifactPayload, type AskUserQuestionAnswer, type AskUserQuestionArgs, type AskUserQuestionChoice, type AskUserQuestionQuestion, type ChartArtifactSpec, type ChatComposerError, type ChatMessage, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionTaskBucket, MissionsPanel, type MissionsPanelProps, type RetryIndicator, type ScheduledWorkItem, type ScheduledWorkList, ScheduledWorkPanel, type ScheduledWorkPanelProps, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, deriveMissionWorkerActivityLabel, groupMissionTasksByBucket, isTerminalMissionStatus, missionTaskBucket, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount };
910
+ export { ACTIVE_MISSION_STATUSES, AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatAskUserQuestionAnswer, type AgentChatAskUserQuestionArgs, type AgentChatAskUserQuestionChoice, type AgentChatAskUserQuestionQuestion, type AgentChatAttachment, type AgentChatChartArtifactSpec, type AgentChatDisplayAttachment, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionList, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatProps, type AgentChatResearchSource, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatScheduledWorkItem, type AgentChatScheduledWorkKind, type AgentChatScheduledWorkList, type AgentChatSession, type AgentChatSessionList, type AgentChatSessionTree, type AgentChatSessionTreeNode, type AgentChatSlashCommand, type AgentChatSseMessageEvent, type AgentChatState, type AgentChatSvgArtifactSpec, type AgentChatSystemKind, type AgentChatTableArtifactSpec, type AgentChatTokenUsage, type AgentChatToolCallInfo, type AgentChatWorkspaceEntry, type AgentChatWorkspaceFile, type AgentChatWorkspaceTree, type AgentChatWorkspaceUpload, type ArtifactKind, type ArtifactPayload, type AskUserQuestionAnswer, type AskUserQuestionArgs, type AskUserQuestionChoice, type AskUserQuestionQuestion, type ChartArtifactSpec, type ChatComposerError, type ChatMessage, type CitationSegment, CitationText, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionTaskBucket, MissionsPanel, type MissionsPanelProps, ResearchSourcesPanel, type RetryIndicator, type ScheduledWorkItem, type ScheduledWorkList, ScheduledWorkPanel, type ScheduledWorkPanelProps, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, deriveMissionWorkerActivityLabel, groupMissionTasksByBucket, isTerminalMissionStatus, missionTaskBucket, splitCitations, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount };