@invergent/agent-chat-react 2.7.0 → 2.7.1
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.cjs +477 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -2
- package/dist/index.d.ts +101 -2
- package/dist/index.js +478 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -128,6 +128,11 @@ interface AgentChatErrorInfo {
|
|
|
128
128
|
title: string;
|
|
129
129
|
detail: string;
|
|
130
130
|
retryable: boolean;
|
|
131
|
+
/** True when the failure is the platform's token-credit gate returning
|
|
132
|
+
* 402 ``insufficient_credits`` (not a model-provider error). The UI
|
|
133
|
+
* renders a "buy credits / upgrade" card with a billing CTA instead of
|
|
134
|
+
* the generic error bubble. */
|
|
135
|
+
insufficientCredits?: boolean;
|
|
131
136
|
}
|
|
132
137
|
interface AgentChatSession {
|
|
133
138
|
id: string;
|
|
@@ -285,6 +290,45 @@ interface AgentChatMissionEventsPage {
|
|
|
285
290
|
interface AgentChatMissionList {
|
|
286
291
|
missions: AgentChatMissionSummary[];
|
|
287
292
|
}
|
|
293
|
+
interface AgentChatResearchRun {
|
|
294
|
+
id: string;
|
|
295
|
+
status: string;
|
|
296
|
+
repoPath: string;
|
|
297
|
+
trunkBranch: string;
|
|
298
|
+
objective: string | null;
|
|
299
|
+
metricDirection: string;
|
|
300
|
+
/** Dev-split scores: where the run started vs. the current trunk. */
|
|
301
|
+
baselineScore: number | null;
|
|
302
|
+
trunkScore: number | null;
|
|
303
|
+
/** Held-out test-split scores (authoritative for merge decisions). */
|
|
304
|
+
testBaselineScore: number | null;
|
|
305
|
+
testTrunkScore: number | null;
|
|
306
|
+
evalCmd: string | null;
|
|
307
|
+
evalCmdTest: string | null;
|
|
308
|
+
maxCycles: number | null;
|
|
309
|
+
maxParallel: number | null;
|
|
310
|
+
mergeThreshold: number | null;
|
|
311
|
+
}
|
|
312
|
+
interface AgentChatIdeaNode {
|
|
313
|
+
/** Dotted-decimal key: "ROOT", "1", "1.2". */
|
|
314
|
+
nodeKey: string;
|
|
315
|
+
parentKey: string | null;
|
|
316
|
+
depth: number;
|
|
317
|
+
status: string;
|
|
318
|
+
hypothesis: string;
|
|
319
|
+
/** Absolute dev-split score (never a delta); null until evaluated. */
|
|
320
|
+
score: number | null;
|
|
321
|
+
insight: string | null;
|
|
322
|
+
result: string | null;
|
|
323
|
+
codeRef: string | null;
|
|
324
|
+
taskId: string | null;
|
|
325
|
+
createdAt: string | null;
|
|
326
|
+
completedAt: string | null;
|
|
327
|
+
}
|
|
328
|
+
interface AgentChatMissionResearch {
|
|
329
|
+
run: AgentChatResearchRun;
|
|
330
|
+
nodes: AgentChatIdeaNode[];
|
|
331
|
+
}
|
|
288
332
|
interface CodingAgentConnection {
|
|
289
333
|
provider: "anthropic" | "openai";
|
|
290
334
|
connected: boolean;
|
|
@@ -370,6 +414,11 @@ interface AgentChatState {
|
|
|
370
414
|
sessionDone: boolean;
|
|
371
415
|
hadDeltas: boolean;
|
|
372
416
|
terminal: boolean;
|
|
417
|
+
/** True only after a user-initiated Stop. Gates the aborted turn's
|
|
418
|
+
* late in-flight events (and a redundant resume) from flashing
|
|
419
|
+
* "running" — unlike ``terminal``, a natural session.complete does not
|
|
420
|
+
* set it, so an autonomous mission/research resume keeps streaming. */
|
|
421
|
+
stopped: boolean;
|
|
373
422
|
workspaceRefreshKey: number;
|
|
374
423
|
browser: AgentChatBrowserState | null;
|
|
375
424
|
viewMode: AgentChatViewMode;
|
|
@@ -513,6 +562,19 @@ interface AgentChatSseMessageEvent {
|
|
|
513
562
|
data: string;
|
|
514
563
|
lastEventId: string;
|
|
515
564
|
}
|
|
565
|
+
/** A single session event pulled via {@link AgentChatAdapter.pollEvents}.
|
|
566
|
+
* Mirrors the persisted DB event: a monotonic ``id``, the event ``type``,
|
|
567
|
+
* and its JSON ``data`` payload. */
|
|
568
|
+
interface AgentChatPolledEvent {
|
|
569
|
+
id: number;
|
|
570
|
+
type: string;
|
|
571
|
+
data: Record<string, unknown>;
|
|
572
|
+
}
|
|
573
|
+
interface AgentChatEventsPage {
|
|
574
|
+
events: AgentChatPolledEvent[];
|
|
575
|
+
/** True when more events exist past this page (cursor < newest). */
|
|
576
|
+
hasMore: boolean;
|
|
577
|
+
}
|
|
516
578
|
interface AgentChatEventStream {
|
|
517
579
|
addEventListener(type: AgentChatEventType, listener: (event: AgentChatSseMessageEvent) => void): void;
|
|
518
580
|
close(): void;
|
|
@@ -597,6 +659,12 @@ interface AgentChatAdapter {
|
|
|
597
659
|
}): Promise<{
|
|
598
660
|
workers: AgentChatMissionWorker[];
|
|
599
661
|
}>;
|
|
662
|
+
/** Arbor Idea Tree for a research (`/auto-research`) mission. Optional
|
|
663
|
+
* and probed at runtime: the dashboard shows the Research tab only when
|
|
664
|
+
* this resolves; a rejection (404 for non-research missions) hides it. */
|
|
665
|
+
getMissionResearch?(input: {
|
|
666
|
+
missionId: string;
|
|
667
|
+
}): Promise<AgentChatMissionResearch>;
|
|
600
668
|
/** Mission-wide event feed (Activity tab + per-task history /
|
|
601
669
|
* live output). Optional — unlike the other mission methods the
|
|
602
670
|
* dashboard probes for this at runtime and hides the event-driven
|
|
@@ -743,6 +811,21 @@ interface AgentChatAdapter {
|
|
|
743
811
|
sessionId: string;
|
|
744
812
|
after: number;
|
|
745
813
|
}): AgentChatEventStream;
|
|
814
|
+
/**
|
|
815
|
+
* One-shot pull of session events after a cursor — the reconciliation
|
|
816
|
+
* safety net behind {@link openEventStream}. The runtime polls this on a
|
|
817
|
+
* timer independently of SSE health, so any stream failure (premature
|
|
818
|
+
* close, proxy idle-kill, a missed reconnect, a stale done-latch) self-
|
|
819
|
+
* heals: the next poll delivers whatever the live stream dropped and the
|
|
820
|
+
* stream is revived. Events are deduplicated by ``id`` against the SSE
|
|
821
|
+
* path, so the two channels run concurrently without double-applying.
|
|
822
|
+
* Optional — adapters that omit it degrade to SSE-only (no safety net).
|
|
823
|
+
*/
|
|
824
|
+
pollEvents?(input: {
|
|
825
|
+
sessionId: string;
|
|
826
|
+
after: number;
|
|
827
|
+
limit?: number;
|
|
828
|
+
}): Promise<AgentChatEventsPage>;
|
|
746
829
|
getBrowserState(sessionId: string): Promise<AgentChatBrowserStateResponse | null>;
|
|
747
830
|
getBrowserPreviewSnapshot?(sessionId: string): Promise<AgentChatBrowserPreviewSnapshot | null>;
|
|
748
831
|
acquireBrowserControl(sessionId: string): Promise<AgentChatBrowserControlResponse>;
|
|
@@ -859,6 +942,12 @@ interface AgentChatProps {
|
|
|
859
942
|
* that domain.
|
|
860
943
|
*/
|
|
861
944
|
deepResearchEnabled?: boolean;
|
|
945
|
+
/**
|
|
946
|
+
* When true, the composer surfaces the `/auto-research` slash command
|
|
947
|
+
* (research missions / Arbor). Like `deepResearchEnabled`, the host owns
|
|
948
|
+
* the capability gate.
|
|
949
|
+
*/
|
|
950
|
+
researchEnabled?: boolean;
|
|
862
951
|
/**
|
|
863
952
|
* When true, the composer exposes the `/code` coding-agent slash commands.
|
|
864
953
|
* Like `deepResearchEnabled`, the host owns the capability gate.
|
|
@@ -870,13 +959,23 @@ interface AgentChatProps {
|
|
|
870
959
|
* not rendered.
|
|
871
960
|
*/
|
|
872
961
|
onOpenIntegrations?: () => void;
|
|
962
|
+
/**
|
|
963
|
+
* Navigate to the host's billing page. When provided, a 402
|
|
964
|
+
* ``insufficient_credits`` failure renders a "buy credits / upgrade"
|
|
965
|
+
* card with a "Go to Billing" button that calls this. The host owns the
|
|
966
|
+
* billing route.
|
|
967
|
+
*/
|
|
968
|
+
onOpenBilling?: () => void;
|
|
873
969
|
}
|
|
874
|
-
declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, codeAgentsEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
970
|
+
declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, researchEnabled, codeAgentsEnabled, onOpenIntegrations, onOpenBilling, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
875
971
|
|
|
876
972
|
interface AgentChatAdapterContextValue {
|
|
877
973
|
adapter: AgentChatAdapter;
|
|
878
974
|
sessionId: string | null;
|
|
879
975
|
onFileSelect?: (path: string) => void;
|
|
976
|
+
/** Navigate to the host's billing page. Wired by the host through
|
|
977
|
+
* ``AgentChat``; consumed by the insufficient-credits card. */
|
|
978
|
+
onOpenBilling?: () => void;
|
|
880
979
|
}
|
|
881
980
|
declare const AgentChatAdapterProvider: React.Provider<AgentChatAdapterContextValue | null>;
|
|
882
981
|
declare function useAgentChatAdapterContext(): AgentChatAdapterContextValue;
|
|
@@ -1175,4 +1274,4 @@ interface SessionTreePanelProps {
|
|
|
1175
1274
|
}
|
|
1176
1275
|
declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
|
|
1177
1276
|
|
|
1178
|
-
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 AgentChatMissionEvent, type AgentChatMissionEventSession, type AgentChatMissionEventsPage, 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 CodingAgentConnection, CodingAgentsPanel, type CodingAgentsPanelProps, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, FetchSseEventStream, type FetchSseEventStreamOptions, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, MISSION_EVENT_CATEGORIES, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionEventCategory, type MissionEventsFeed, type MissionTaskBucket, type MissionTaskRailGroup, type MissionTaskRailGroupKey, 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, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, formatMissionTimestamp, groupMissionTasksByBucket, isTerminalMissionStatus, mergeMissionEvents, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|
|
1277
|
+
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 AgentChatEventsPage, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatIdeaNode, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionEvent, type AgentChatMissionEventSession, type AgentChatMissionEventsPage, type AgentChatMissionList, type AgentChatMissionResearch, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatPolledEvent, type AgentChatProps, type AgentChatResearchRun, 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 CodingAgentConnection, CodingAgentsPanel, type CodingAgentsPanelProps, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, FetchSseEventStream, type FetchSseEventStreamOptions, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, MISSION_EVENT_CATEGORIES, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionEventCategory, type MissionEventsFeed, type MissionTaskBucket, type MissionTaskRailGroup, type MissionTaskRailGroupKey, 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, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, formatMissionTimestamp, groupMissionTasksByBucket, isTerminalMissionStatus, mergeMissionEvents, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -128,6 +128,11 @@ interface AgentChatErrorInfo {
|
|
|
128
128
|
title: string;
|
|
129
129
|
detail: string;
|
|
130
130
|
retryable: boolean;
|
|
131
|
+
/** True when the failure is the platform's token-credit gate returning
|
|
132
|
+
* 402 ``insufficient_credits`` (not a model-provider error). The UI
|
|
133
|
+
* renders a "buy credits / upgrade" card with a billing CTA instead of
|
|
134
|
+
* the generic error bubble. */
|
|
135
|
+
insufficientCredits?: boolean;
|
|
131
136
|
}
|
|
132
137
|
interface AgentChatSession {
|
|
133
138
|
id: string;
|
|
@@ -285,6 +290,45 @@ interface AgentChatMissionEventsPage {
|
|
|
285
290
|
interface AgentChatMissionList {
|
|
286
291
|
missions: AgentChatMissionSummary[];
|
|
287
292
|
}
|
|
293
|
+
interface AgentChatResearchRun {
|
|
294
|
+
id: string;
|
|
295
|
+
status: string;
|
|
296
|
+
repoPath: string;
|
|
297
|
+
trunkBranch: string;
|
|
298
|
+
objective: string | null;
|
|
299
|
+
metricDirection: string;
|
|
300
|
+
/** Dev-split scores: where the run started vs. the current trunk. */
|
|
301
|
+
baselineScore: number | null;
|
|
302
|
+
trunkScore: number | null;
|
|
303
|
+
/** Held-out test-split scores (authoritative for merge decisions). */
|
|
304
|
+
testBaselineScore: number | null;
|
|
305
|
+
testTrunkScore: number | null;
|
|
306
|
+
evalCmd: string | null;
|
|
307
|
+
evalCmdTest: string | null;
|
|
308
|
+
maxCycles: number | null;
|
|
309
|
+
maxParallel: number | null;
|
|
310
|
+
mergeThreshold: number | null;
|
|
311
|
+
}
|
|
312
|
+
interface AgentChatIdeaNode {
|
|
313
|
+
/** Dotted-decimal key: "ROOT", "1", "1.2". */
|
|
314
|
+
nodeKey: string;
|
|
315
|
+
parentKey: string | null;
|
|
316
|
+
depth: number;
|
|
317
|
+
status: string;
|
|
318
|
+
hypothesis: string;
|
|
319
|
+
/** Absolute dev-split score (never a delta); null until evaluated. */
|
|
320
|
+
score: number | null;
|
|
321
|
+
insight: string | null;
|
|
322
|
+
result: string | null;
|
|
323
|
+
codeRef: string | null;
|
|
324
|
+
taskId: string | null;
|
|
325
|
+
createdAt: string | null;
|
|
326
|
+
completedAt: string | null;
|
|
327
|
+
}
|
|
328
|
+
interface AgentChatMissionResearch {
|
|
329
|
+
run: AgentChatResearchRun;
|
|
330
|
+
nodes: AgentChatIdeaNode[];
|
|
331
|
+
}
|
|
288
332
|
interface CodingAgentConnection {
|
|
289
333
|
provider: "anthropic" | "openai";
|
|
290
334
|
connected: boolean;
|
|
@@ -370,6 +414,11 @@ interface AgentChatState {
|
|
|
370
414
|
sessionDone: boolean;
|
|
371
415
|
hadDeltas: boolean;
|
|
372
416
|
terminal: boolean;
|
|
417
|
+
/** True only after a user-initiated Stop. Gates the aborted turn's
|
|
418
|
+
* late in-flight events (and a redundant resume) from flashing
|
|
419
|
+
* "running" — unlike ``terminal``, a natural session.complete does not
|
|
420
|
+
* set it, so an autonomous mission/research resume keeps streaming. */
|
|
421
|
+
stopped: boolean;
|
|
373
422
|
workspaceRefreshKey: number;
|
|
374
423
|
browser: AgentChatBrowserState | null;
|
|
375
424
|
viewMode: AgentChatViewMode;
|
|
@@ -513,6 +562,19 @@ interface AgentChatSseMessageEvent {
|
|
|
513
562
|
data: string;
|
|
514
563
|
lastEventId: string;
|
|
515
564
|
}
|
|
565
|
+
/** A single session event pulled via {@link AgentChatAdapter.pollEvents}.
|
|
566
|
+
* Mirrors the persisted DB event: a monotonic ``id``, the event ``type``,
|
|
567
|
+
* and its JSON ``data`` payload. */
|
|
568
|
+
interface AgentChatPolledEvent {
|
|
569
|
+
id: number;
|
|
570
|
+
type: string;
|
|
571
|
+
data: Record<string, unknown>;
|
|
572
|
+
}
|
|
573
|
+
interface AgentChatEventsPage {
|
|
574
|
+
events: AgentChatPolledEvent[];
|
|
575
|
+
/** True when more events exist past this page (cursor < newest). */
|
|
576
|
+
hasMore: boolean;
|
|
577
|
+
}
|
|
516
578
|
interface AgentChatEventStream {
|
|
517
579
|
addEventListener(type: AgentChatEventType, listener: (event: AgentChatSseMessageEvent) => void): void;
|
|
518
580
|
close(): void;
|
|
@@ -597,6 +659,12 @@ interface AgentChatAdapter {
|
|
|
597
659
|
}): Promise<{
|
|
598
660
|
workers: AgentChatMissionWorker[];
|
|
599
661
|
}>;
|
|
662
|
+
/** Arbor Idea Tree for a research (`/auto-research`) mission. Optional
|
|
663
|
+
* and probed at runtime: the dashboard shows the Research tab only when
|
|
664
|
+
* this resolves; a rejection (404 for non-research missions) hides it. */
|
|
665
|
+
getMissionResearch?(input: {
|
|
666
|
+
missionId: string;
|
|
667
|
+
}): Promise<AgentChatMissionResearch>;
|
|
600
668
|
/** Mission-wide event feed (Activity tab + per-task history /
|
|
601
669
|
* live output). Optional — unlike the other mission methods the
|
|
602
670
|
* dashboard probes for this at runtime and hides the event-driven
|
|
@@ -743,6 +811,21 @@ interface AgentChatAdapter {
|
|
|
743
811
|
sessionId: string;
|
|
744
812
|
after: number;
|
|
745
813
|
}): AgentChatEventStream;
|
|
814
|
+
/**
|
|
815
|
+
* One-shot pull of session events after a cursor — the reconciliation
|
|
816
|
+
* safety net behind {@link openEventStream}. The runtime polls this on a
|
|
817
|
+
* timer independently of SSE health, so any stream failure (premature
|
|
818
|
+
* close, proxy idle-kill, a missed reconnect, a stale done-latch) self-
|
|
819
|
+
* heals: the next poll delivers whatever the live stream dropped and the
|
|
820
|
+
* stream is revived. Events are deduplicated by ``id`` against the SSE
|
|
821
|
+
* path, so the two channels run concurrently without double-applying.
|
|
822
|
+
* Optional — adapters that omit it degrade to SSE-only (no safety net).
|
|
823
|
+
*/
|
|
824
|
+
pollEvents?(input: {
|
|
825
|
+
sessionId: string;
|
|
826
|
+
after: number;
|
|
827
|
+
limit?: number;
|
|
828
|
+
}): Promise<AgentChatEventsPage>;
|
|
746
829
|
getBrowserState(sessionId: string): Promise<AgentChatBrowserStateResponse | null>;
|
|
747
830
|
getBrowserPreviewSnapshot?(sessionId: string): Promise<AgentChatBrowserPreviewSnapshot | null>;
|
|
748
831
|
acquireBrowserControl(sessionId: string): Promise<AgentChatBrowserControlResponse>;
|
|
@@ -859,6 +942,12 @@ interface AgentChatProps {
|
|
|
859
942
|
* that domain.
|
|
860
943
|
*/
|
|
861
944
|
deepResearchEnabled?: boolean;
|
|
945
|
+
/**
|
|
946
|
+
* When true, the composer surfaces the `/auto-research` slash command
|
|
947
|
+
* (research missions / Arbor). Like `deepResearchEnabled`, the host owns
|
|
948
|
+
* the capability gate.
|
|
949
|
+
*/
|
|
950
|
+
researchEnabled?: boolean;
|
|
862
951
|
/**
|
|
863
952
|
* When true, the composer exposes the `/code` coding-agent slash commands.
|
|
864
953
|
* Like `deepResearchEnabled`, the host owns the capability gate.
|
|
@@ -870,13 +959,23 @@ interface AgentChatProps {
|
|
|
870
959
|
* not rendered.
|
|
871
960
|
*/
|
|
872
961
|
onOpenIntegrations?: () => void;
|
|
962
|
+
/**
|
|
963
|
+
* Navigate to the host's billing page. When provided, a 402
|
|
964
|
+
* ``insufficient_credits`` failure renders a "buy credits / upgrade"
|
|
965
|
+
* card with a "Go to Billing" button that calls this. The host owns the
|
|
966
|
+
* billing route.
|
|
967
|
+
*/
|
|
968
|
+
onOpenBilling?: () => void;
|
|
873
969
|
}
|
|
874
|
-
declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, codeAgentsEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
970
|
+
declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, researchEnabled, codeAgentsEnabled, onOpenIntegrations, onOpenBilling, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
875
971
|
|
|
876
972
|
interface AgentChatAdapterContextValue {
|
|
877
973
|
adapter: AgentChatAdapter;
|
|
878
974
|
sessionId: string | null;
|
|
879
975
|
onFileSelect?: (path: string) => void;
|
|
976
|
+
/** Navigate to the host's billing page. Wired by the host through
|
|
977
|
+
* ``AgentChat``; consumed by the insufficient-credits card. */
|
|
978
|
+
onOpenBilling?: () => void;
|
|
880
979
|
}
|
|
881
980
|
declare const AgentChatAdapterProvider: React.Provider<AgentChatAdapterContextValue | null>;
|
|
882
981
|
declare function useAgentChatAdapterContext(): AgentChatAdapterContextValue;
|
|
@@ -1175,4 +1274,4 @@ interface SessionTreePanelProps {
|
|
|
1175
1274
|
}
|
|
1176
1275
|
declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
|
|
1177
1276
|
|
|
1178
|
-
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 AgentChatMissionEvent, type AgentChatMissionEventSession, type AgentChatMissionEventsPage, 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 CodingAgentConnection, CodingAgentsPanel, type CodingAgentsPanelProps, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, FetchSseEventStream, type FetchSseEventStreamOptions, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, MISSION_EVENT_CATEGORIES, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionEventCategory, type MissionEventsFeed, type MissionTaskBucket, type MissionTaskRailGroup, type MissionTaskRailGroupKey, 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, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, formatMissionTimestamp, groupMissionTasksByBucket, isTerminalMissionStatus, mergeMissionEvents, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|
|
1277
|
+
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 AgentChatEventsPage, type AgentChatExpertFeedbackRating, type AgentChatHtmlArtifactSpec, type AgentChatIdeaNode, type AgentChatImageAttachment, type AgentChatInboxEventStream, type AgentChatInboxItem, type AgentChatInboxKind, type AgentChatInboxList, type AgentChatInboxListInput, type AgentChatInboxStatus, type AgentChatInboxStreamEvent, type AgentChatMarkdownArtifactSpec, type AgentChatMessage, type AgentChatMessageStatus, type AgentChatMissionEvent, type AgentChatMissionEventSession, type AgentChatMissionEventsPage, type AgentChatMissionList, type AgentChatMissionResearch, type AgentChatMissionStatus, type AgentChatMissionSummary, type AgentChatMissionTask, type AgentChatMissionWorker, type AgentChatPendingAttachment, type AgentChatPolledEvent, type AgentChatProps, type AgentChatResearchRun, 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 CodingAgentConnection, CodingAgentsPanel, type CodingAgentsPanelProps, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, FetchSseEventStream, type FetchSseEventStreamOptions, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, MISSION_EVENT_CATEGORIES, type MarkdownArtifactSpec, MessageResponse, type MessageResponseProps, MissionDashboard, type MissionDashboardProps, type MissionEventCategory, type MissionEventsFeed, type MissionTaskBucket, type MissionTaskRailGroup, type MissionTaskRailGroupKey, 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, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, formatMissionTimestamp, groupMissionTasksByBucket, isTerminalMissionStatus, mergeMissionEvents, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|