@invergent/agent-chat-react 1.4.6 → 1.4.9

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,5 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
2
+ import * as React from 'react';
3
+ import { ComponentProps } from 'react';
4
+ import { Streamdown } from 'streamdown';
3
5
 
4
6
  type AgentChatRole = "user" | "assistant" | "system";
5
7
  type AgentChatMessageStatus = "complete" | "streaming" | "error";
@@ -75,6 +77,26 @@ interface AgentChatSessionList {
75
77
  sessions: AgentChatSession[];
76
78
  total: number;
77
79
  }
80
+ interface AgentChatSessionTreeNode {
81
+ id: string;
82
+ parentId: string | null;
83
+ rootSessionId?: string | null;
84
+ depth?: number;
85
+ agentId?: string | null;
86
+ agentType?: string | null;
87
+ channel?: string | null;
88
+ status: "active" | "paused" | "completed" | "failed" | string;
89
+ title?: string | null;
90
+ model?: string | null;
91
+ messageCount?: number;
92
+ toolCallCount?: number;
93
+ createdAt: string;
94
+ updatedAt: string;
95
+ }
96
+ interface AgentChatSessionTree {
97
+ nodes: AgentChatSessionTreeNode[];
98
+ total: number;
99
+ }
78
100
  type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.result" | "expert.endorse" | "expert.override" | "artifact.created" | "artifact.updated" | "clarify.response";
79
101
  interface AgentChatRuntimeEvent {
80
102
  type: AgentChatEventType;
@@ -227,6 +249,12 @@ interface AgentChatAdapter {
227
249
  deleteSession?(input: {
228
250
  sessionId: string;
229
251
  }): Promise<void>;
252
+ getSessionTree?(input: {
253
+ sessionId: string;
254
+ }): Promise<AgentChatSessionTree>;
255
+ stopSession?(input: {
256
+ sessionId: string;
257
+ }): Promise<void>;
230
258
  getArtifact(input: {
231
259
  sessionId: string;
232
260
  artifactId: string;
@@ -281,6 +309,8 @@ interface AgentChatRuntimeApi {
281
309
  markSendError(errorText: string): void;
282
310
  }
283
311
  type ChatMessage = AgentChatMessage;
312
+ type SessionTreeNode = AgentChatSessionTreeNode;
313
+ type SessionTree = AgentChatSessionTree;
284
314
  type ToolCallInfo = AgentChatToolCallInfo;
285
315
  type TokenUsage = AgentChatTokenUsage;
286
316
  type RetryIndicator = AgentChatRetryIndicator;
@@ -317,7 +347,7 @@ interface AgentChatAdapterContextValue {
317
347
  sessionId: string | null;
318
348
  onFileSelect?: (path: string) => void;
319
349
  }
320
- declare const AgentChatAdapterProvider: react.Provider<AgentChatAdapterContextValue | null>;
350
+ declare const AgentChatAdapterProvider: React.Provider<AgentChatAdapterContextValue | null>;
321
351
  declare function useAgentChatAdapterContext(): AgentChatAdapterContextValue;
322
352
 
323
353
  interface UseAgentChatRuntimeInput {
@@ -328,4 +358,20 @@ interface UseAgentChatRuntimeInput {
328
358
  }
329
359
  declare function useAgentChatRuntime({ adapter, agentId, sessionId, onSessionChange, }: UseAgentChatRuntimeInput): AgentChatRuntimeApi;
330
360
 
331
- export { AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatChartArtifactSpec, type AgentChatClarifyAnswer, type AgentChatClarifyArgs, type AgentChatClarifyChoice, type AgentChatClarifyQuestion, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatSession, type AgentChatSessionList, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, type RetryIndicator, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, useAgentChatAdapterContext, useAgentChatRuntime };
361
+ type MessageResponseProps = ComponentProps<typeof Streamdown>;
362
+ declare const MessageResponse: React.MemoExoticComponent<({ className, ...props }: MessageResponseProps) => react_jsx_runtime.JSX.Element>;
363
+
364
+ interface SessionTreePanelProps {
365
+ adapter: AgentChatAdapter;
366
+ sessionId?: string | null;
367
+ activeSessionId?: string;
368
+ agentId?: string;
369
+ title?: string;
370
+ sessionListLimit?: number;
371
+ /** Treat the root as hidden, so its children appear as top-level rows. */
372
+ hideRoot?: boolean;
373
+ onSessionSelect?: (sessionId: string) => void;
374
+ }
375
+ declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, onSessionSelect, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
376
+
377
+ export { AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatChartArtifactSpec, type AgentChatClarifyAnswer, type AgentChatClarifyArgs, type AgentChatClarifyChoice, type AgentChatClarifyQuestion, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, type RetryIndicator, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, useAgentChatAdapterContext, useAgentChatRuntime };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
2
+ import * as React from 'react';
3
+ import { ComponentProps } from 'react';
4
+ import { Streamdown } from 'streamdown';
3
5
 
4
6
  type AgentChatRole = "user" | "assistant" | "system";
5
7
  type AgentChatMessageStatus = "complete" | "streaming" | "error";
@@ -75,6 +77,26 @@ interface AgentChatSessionList {
75
77
  sessions: AgentChatSession[];
76
78
  total: number;
77
79
  }
80
+ interface AgentChatSessionTreeNode {
81
+ id: string;
82
+ parentId: string | null;
83
+ rootSessionId?: string | null;
84
+ depth?: number;
85
+ agentId?: string | null;
86
+ agentType?: string | null;
87
+ channel?: string | null;
88
+ status: "active" | "paused" | "completed" | "failed" | string;
89
+ title?: string | null;
90
+ model?: string | null;
91
+ messageCount?: number;
92
+ toolCallCount?: number;
93
+ createdAt: string;
94
+ updatedAt: string;
95
+ }
96
+ interface AgentChatSessionTree {
97
+ nodes: AgentChatSessionTreeNode[];
98
+ total: number;
99
+ }
78
100
  type AgentChatEventType = "user.message" | "llm.request" | "llm.response" | "llm.thinking" | "llm.delta" | "tool.call" | "tool.result" | "session.start" | "session.pause" | "session.resume" | "session.complete" | "session.fail" | "session.done" | "harness.wake" | "harness.crash" | "context.compact" | "skill.invoked" | "policy.denied" | "stream.timeout" | "expert.result" | "expert.endorse" | "expert.override" | "artifact.created" | "artifact.updated" | "clarify.response";
79
101
  interface AgentChatRuntimeEvent {
80
102
  type: AgentChatEventType;
@@ -227,6 +249,12 @@ interface AgentChatAdapter {
227
249
  deleteSession?(input: {
228
250
  sessionId: string;
229
251
  }): Promise<void>;
252
+ getSessionTree?(input: {
253
+ sessionId: string;
254
+ }): Promise<AgentChatSessionTree>;
255
+ stopSession?(input: {
256
+ sessionId: string;
257
+ }): Promise<void>;
230
258
  getArtifact(input: {
231
259
  sessionId: string;
232
260
  artifactId: string;
@@ -281,6 +309,8 @@ interface AgentChatRuntimeApi {
281
309
  markSendError(errorText: string): void;
282
310
  }
283
311
  type ChatMessage = AgentChatMessage;
312
+ type SessionTreeNode = AgentChatSessionTreeNode;
313
+ type SessionTree = AgentChatSessionTree;
284
314
  type ToolCallInfo = AgentChatToolCallInfo;
285
315
  type TokenUsage = AgentChatTokenUsage;
286
316
  type RetryIndicator = AgentChatRetryIndicator;
@@ -317,7 +347,7 @@ interface AgentChatAdapterContextValue {
317
347
  sessionId: string | null;
318
348
  onFileSelect?: (path: string) => void;
319
349
  }
320
- declare const AgentChatAdapterProvider: react.Provider<AgentChatAdapterContextValue | null>;
350
+ declare const AgentChatAdapterProvider: React.Provider<AgentChatAdapterContextValue | null>;
321
351
  declare function useAgentChatAdapterContext(): AgentChatAdapterContextValue;
322
352
 
323
353
  interface UseAgentChatRuntimeInput {
@@ -328,4 +358,20 @@ interface UseAgentChatRuntimeInput {
328
358
  }
329
359
  declare function useAgentChatRuntime({ adapter, agentId, sessionId, onSessionChange, }: UseAgentChatRuntimeInput): AgentChatRuntimeApi;
330
360
 
331
- export { AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatChartArtifactSpec, type AgentChatClarifyAnswer, type AgentChatClarifyArgs, type AgentChatClarifyChoice, type AgentChatClarifyQuestion, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, type AgentChatSession, type AgentChatSessionList, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, type RetryIndicator, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, useAgentChatAdapterContext, useAgentChatRuntime };
361
+ type MessageResponseProps = ComponentProps<typeof Streamdown>;
362
+ declare const MessageResponse: React.MemoExoticComponent<({ className, ...props }: MessageResponseProps) => react_jsx_runtime.JSX.Element>;
363
+
364
+ interface SessionTreePanelProps {
365
+ adapter: AgentChatAdapter;
366
+ sessionId?: string | null;
367
+ activeSessionId?: string;
368
+ agentId?: string;
369
+ title?: string;
370
+ sessionListLimit?: number;
371
+ /** Treat the root as hidden, so its children appear as top-level rows. */
372
+ hideRoot?: boolean;
373
+ onSessionSelect?: (sessionId: string) => void;
374
+ }
375
+ declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, onSessionSelect, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
376
+
377
+ export { AgentChat, type AgentChatAdapter, type AgentChatAdapterContextValue, AgentChatAdapterProvider, type AgentChatArtifactKind, type AgentChatArtifactMeta, type AgentChatArtifactPayload, type AgentChatChartArtifactSpec, type AgentChatClarifyAnswer, type AgentChatClarifyArgs, type AgentChatClarifyChoice, type AgentChatClarifyQuestion, type AgentChatErrorCategory, type AgentChatErrorInfo, type AgentChatEventStream, type AgentChatEventType, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatProps, type AgentChatRole, type AgentChatRuntimeApi, type AgentChatRuntimeEvent, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, type RetryIndicator, type SessionTree, type SessionTreeNode, SessionTreePanel, type SessionTreePanelProps, type SvgArtifactSpec, type TableArtifactSpec, type TokenUsage, type ToolCallInfo, type WorkspaceEntry, type WorkspaceFile, type WorkspaceTree, type WorkspaceUpload, useAgentChatAdapterContext, useAgentChatRuntime };