@invergent/agent-chat-react 1.6.1 → 1.6.2

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
@@ -132,6 +132,45 @@ interface AgentChatScheduledWorkList {
132
132
  items: AgentChatScheduledWorkItem[];
133
133
  total: number;
134
134
  }
135
+ type AgentChatInboxKind = "input_required" | "action_required" | "task_complete" | "governance_gate" | "progress_checkin" | (string & {});
136
+ type AgentChatInboxStatus = "pending" | "acknowledged" | "responded" | "expired" | (string & {});
137
+ interface AgentChatInboxItem {
138
+ id: number;
139
+ orgId: string;
140
+ userId: string;
141
+ sessionId: string;
142
+ sourceEventId: number;
143
+ kind: AgentChatInboxKind;
144
+ status: AgentChatInboxStatus;
145
+ title: string;
146
+ body: string | null;
147
+ payload: Record<string, unknown>;
148
+ actionRef: Record<string, unknown> | null;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ readAt: string | null;
152
+ respondedAt: string | null;
153
+ }
154
+ interface AgentChatInboxList {
155
+ items: AgentChatInboxItem[];
156
+ nextCursor: string | null;
157
+ }
158
+ interface AgentChatInboxListInput {
159
+ status?: AgentChatInboxStatus;
160
+ kind?: AgentChatInboxKind;
161
+ sessionId?: string;
162
+ cursor?: string;
163
+ limit?: number;
164
+ }
165
+ interface AgentChatInboxStreamEvent {
166
+ data: string;
167
+ lastEventId?: string;
168
+ }
169
+ interface AgentChatInboxEventStream {
170
+ addEventListener(type: "item" | "snapshot", listener: (event: AgentChatInboxStreamEvent) => void): void;
171
+ close(): void;
172
+ onerror: (() => void) | null;
173
+ }
135
174
  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" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "clarify.response";
136
175
  interface AgentChatRuntimeEvent {
137
176
  type: AgentChatEventType;
@@ -142,6 +181,10 @@ interface AgentChatBrowserState {
142
181
  status: "provisioning" | "live" | "user-control" | "closed";
143
182
  controlOwner: string | null;
144
183
  }
184
+ interface AgentChatBrowserPreviewSnapshot {
185
+ src: string;
186
+ capturedAt?: string;
187
+ }
145
188
  interface AgentChatBrowserStateResponse {
146
189
  status: "live" | "user-control";
147
190
  controlOwner: string | null;
@@ -321,6 +364,27 @@ interface AgentChatAdapter {
321
364
  cancelScheduledWork?(input: {
322
365
  scheduleId: string;
323
366
  }): Promise<void>;
367
+ listInbox?(input?: AgentChatInboxListInput): Promise<AgentChatInboxList>;
368
+ getInboxItem?(input: {
369
+ itemId: number;
370
+ }): Promise<AgentChatInboxItem>;
371
+ markInboxItemRead?(input: {
372
+ itemId: number;
373
+ }): Promise<AgentChatInboxItem>;
374
+ acknowledgeInboxItem?(input: {
375
+ itemId: number;
376
+ }): Promise<AgentChatInboxItem>;
377
+ deleteInboxItem?(input: {
378
+ itemId: number;
379
+ }): Promise<void>;
380
+ respondGovernanceInboxItem?(input: {
381
+ itemId: number;
382
+ decision: "approve" | "reject";
383
+ }): Promise<AgentChatInboxItem>;
384
+ respondActionRequiredInboxItem?(input: {
385
+ itemId: number;
386
+ }): Promise<AgentChatInboxItem>;
387
+ openInboxStream?(): AgentChatInboxEventStream;
324
388
  getArtifact(input: {
325
389
  sessionId: string;
326
390
  artifactId: string;
@@ -374,6 +438,7 @@ interface AgentChatAdapter {
374
438
  after: number;
375
439
  }): AgentChatEventStream;
376
440
  getBrowserState(sessionId: string): Promise<AgentChatBrowserStateResponse | null>;
441
+ getBrowserPreviewSnapshot?(sessionId: string): Promise<AgentChatBrowserPreviewSnapshot | null>;
377
442
  acquireBrowserControl(sessionId: string): Promise<AgentChatBrowserControlResponse>;
378
443
  releaseBrowserControl(sessionId: string): Promise<void>;
379
444
  browserLiveViewUrl(sessionId: string): string;
@@ -398,6 +463,8 @@ type SessionTreeNode = AgentChatSessionTreeNode;
398
463
  type SessionTree = AgentChatSessionTree;
399
464
  type ScheduledWorkItem = AgentChatScheduledWorkItem;
400
465
  type ScheduledWorkList = AgentChatScheduledWorkList;
466
+ type InboxItem = AgentChatInboxItem;
467
+ type InboxList = AgentChatInboxList;
401
468
  type ToolCallInfo = AgentChatToolCallInfo;
402
469
  type TokenUsage = AgentChatTokenUsage;
403
470
  type RetryIndicator = AgentChatRetryIndicator;
@@ -448,6 +515,24 @@ declare function useAgentChatRuntime({ adapter, agentId, sessionId, onSessionCha
448
515
  type MessageResponseProps = ComponentProps<typeof Streamdown>;
449
516
  declare const MessageResponse: React.MemoExoticComponent<({ className, ...props }: MessageResponseProps) => react_jsx_runtime.JSX.Element>;
450
517
 
518
+ interface InboxPanelProps {
519
+ adapter: AgentChatAdapter;
520
+ title?: string;
521
+ selectedId?: number | null;
522
+ onSelectedIdChange?: (itemId: number | null) => void;
523
+ onSessionSelect?: (sessionId: string) => void;
524
+ hideHeader?: boolean;
525
+ limit?: number;
526
+ }
527
+ declare function InboxPanel({ adapter, title, selectedId, onSelectedIdChange, onSessionSelect, hideHeader, limit, }: InboxPanelProps): react_jsx_runtime.JSX.Element;
528
+
529
+ interface InboxUnreadCountState {
530
+ unreadCount: number;
531
+ hasLoaded: boolean;
532
+ error: string | null;
533
+ }
534
+ declare function useInboxUnreadCount(adapter: AgentChatAdapter): InboxUnreadCountState;
535
+
451
536
  interface ScheduledWorkPanelProps {
452
537
  adapter: AgentChatAdapter;
453
538
  agentId?: string;
@@ -484,4 +569,4 @@ interface SessionTreePanelProps {
484
569
  }
485
570
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
486
571
 
487
- 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 AgentChatImageAttachment, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, 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, useAgentChatAdapterContext, useAgentChatRuntime };
572
+ 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 AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, 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, useAgentChatAdapterContext, useAgentChatRuntime, useInboxUnreadCount };
package/dist/index.d.ts CHANGED
@@ -132,6 +132,45 @@ interface AgentChatScheduledWorkList {
132
132
  items: AgentChatScheduledWorkItem[];
133
133
  total: number;
134
134
  }
135
+ type AgentChatInboxKind = "input_required" | "action_required" | "task_complete" | "governance_gate" | "progress_checkin" | (string & {});
136
+ type AgentChatInboxStatus = "pending" | "acknowledged" | "responded" | "expired" | (string & {});
137
+ interface AgentChatInboxItem {
138
+ id: number;
139
+ orgId: string;
140
+ userId: string;
141
+ sessionId: string;
142
+ sourceEventId: number;
143
+ kind: AgentChatInboxKind;
144
+ status: AgentChatInboxStatus;
145
+ title: string;
146
+ body: string | null;
147
+ payload: Record<string, unknown>;
148
+ actionRef: Record<string, unknown> | null;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ readAt: string | null;
152
+ respondedAt: string | null;
153
+ }
154
+ interface AgentChatInboxList {
155
+ items: AgentChatInboxItem[];
156
+ nextCursor: string | null;
157
+ }
158
+ interface AgentChatInboxListInput {
159
+ status?: AgentChatInboxStatus;
160
+ kind?: AgentChatInboxKind;
161
+ sessionId?: string;
162
+ cursor?: string;
163
+ limit?: number;
164
+ }
165
+ interface AgentChatInboxStreamEvent {
166
+ data: string;
167
+ lastEventId?: string;
168
+ }
169
+ interface AgentChatInboxEventStream {
170
+ addEventListener(type: "item" | "snapshot", listener: (event: AgentChatInboxStreamEvent) => void): void;
171
+ close(): void;
172
+ onerror: (() => void) | null;
173
+ }
135
174
  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" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "clarify.response";
136
175
  interface AgentChatRuntimeEvent {
137
176
  type: AgentChatEventType;
@@ -142,6 +181,10 @@ interface AgentChatBrowserState {
142
181
  status: "provisioning" | "live" | "user-control" | "closed";
143
182
  controlOwner: string | null;
144
183
  }
184
+ interface AgentChatBrowserPreviewSnapshot {
185
+ src: string;
186
+ capturedAt?: string;
187
+ }
145
188
  interface AgentChatBrowserStateResponse {
146
189
  status: "live" | "user-control";
147
190
  controlOwner: string | null;
@@ -321,6 +364,27 @@ interface AgentChatAdapter {
321
364
  cancelScheduledWork?(input: {
322
365
  scheduleId: string;
323
366
  }): Promise<void>;
367
+ listInbox?(input?: AgentChatInboxListInput): Promise<AgentChatInboxList>;
368
+ getInboxItem?(input: {
369
+ itemId: number;
370
+ }): Promise<AgentChatInboxItem>;
371
+ markInboxItemRead?(input: {
372
+ itemId: number;
373
+ }): Promise<AgentChatInboxItem>;
374
+ acknowledgeInboxItem?(input: {
375
+ itemId: number;
376
+ }): Promise<AgentChatInboxItem>;
377
+ deleteInboxItem?(input: {
378
+ itemId: number;
379
+ }): Promise<void>;
380
+ respondGovernanceInboxItem?(input: {
381
+ itemId: number;
382
+ decision: "approve" | "reject";
383
+ }): Promise<AgentChatInboxItem>;
384
+ respondActionRequiredInboxItem?(input: {
385
+ itemId: number;
386
+ }): Promise<AgentChatInboxItem>;
387
+ openInboxStream?(): AgentChatInboxEventStream;
324
388
  getArtifact(input: {
325
389
  sessionId: string;
326
390
  artifactId: string;
@@ -374,6 +438,7 @@ interface AgentChatAdapter {
374
438
  after: number;
375
439
  }): AgentChatEventStream;
376
440
  getBrowserState(sessionId: string): Promise<AgentChatBrowserStateResponse | null>;
441
+ getBrowserPreviewSnapshot?(sessionId: string): Promise<AgentChatBrowserPreviewSnapshot | null>;
377
442
  acquireBrowserControl(sessionId: string): Promise<AgentChatBrowserControlResponse>;
378
443
  releaseBrowserControl(sessionId: string): Promise<void>;
379
444
  browserLiveViewUrl(sessionId: string): string;
@@ -398,6 +463,8 @@ type SessionTreeNode = AgentChatSessionTreeNode;
398
463
  type SessionTree = AgentChatSessionTree;
399
464
  type ScheduledWorkItem = AgentChatScheduledWorkItem;
400
465
  type ScheduledWorkList = AgentChatScheduledWorkList;
466
+ type InboxItem = AgentChatInboxItem;
467
+ type InboxList = AgentChatInboxList;
401
468
  type ToolCallInfo = AgentChatToolCallInfo;
402
469
  type TokenUsage = AgentChatTokenUsage;
403
470
  type RetryIndicator = AgentChatRetryIndicator;
@@ -448,6 +515,24 @@ declare function useAgentChatRuntime({ adapter, agentId, sessionId, onSessionCha
448
515
  type MessageResponseProps = ComponentProps<typeof Streamdown>;
449
516
  declare const MessageResponse: React.MemoExoticComponent<({ className, ...props }: MessageResponseProps) => react_jsx_runtime.JSX.Element>;
450
517
 
518
+ interface InboxPanelProps {
519
+ adapter: AgentChatAdapter;
520
+ title?: string;
521
+ selectedId?: number | null;
522
+ onSelectedIdChange?: (itemId: number | null) => void;
523
+ onSessionSelect?: (sessionId: string) => void;
524
+ hideHeader?: boolean;
525
+ limit?: number;
526
+ }
527
+ declare function InboxPanel({ adapter, title, selectedId, onSelectedIdChange, onSessionSelect, hideHeader, limit, }: InboxPanelProps): react_jsx_runtime.JSX.Element;
528
+
529
+ interface InboxUnreadCountState {
530
+ unreadCount: number;
531
+ hasLoaded: boolean;
532
+ error: string | null;
533
+ }
534
+ declare function useInboxUnreadCount(adapter: AgentChatAdapter): InboxUnreadCountState;
535
+
451
536
  interface ScheduledWorkPanelProps {
452
537
  adapter: AgentChatAdapter;
453
538
  agentId?: string;
@@ -484,4 +569,4 @@ interface SessionTreePanelProps {
484
569
  }
485
570
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
486
571
 
487
- 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 AgentChatImageAttachment, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, 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, useAgentChatAdapterContext, useAgentChatRuntime };
572
+ 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 AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, 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 ChartArtifactSpec, type ChatMessage, type ClarifyAnswer, type ClarifyArgs, type ClarifyChoice, type ClarifyQuestion, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, 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, useAgentChatAdapterContext, useAgentChatRuntime, useInboxUnreadCount };