@invergent/agent-chat-react 2.5.8 → 2.5.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
@@ -235,6 +235,7 @@ interface AgentChatMissionTask {
235
235
  parentIds: string[];
236
236
  currentSessionId: string | null;
237
237
  createdAt: string | null;
238
+ startedAt: string | null;
238
239
  completedAt: string | null;
239
240
  }
240
241
  type AgentChatMissionWorkerKind = "task" | "worker" | "delegation";
@@ -261,9 +262,35 @@ interface AgentChatMissionWorker {
261
262
  latestEventSummary: string | null;
262
263
  transcriptUrl: string;
263
264
  }
265
+ interface AgentChatMissionEvent {
266
+ id: number;
267
+ sessionId: string;
268
+ type: string;
269
+ data: Record<string, unknown> | null;
270
+ createdAt: string | null;
271
+ }
272
+ /** Label for one session contributing to a mission's event feed.
273
+ * ``kind`` mirrors the server: the coordinator chat session, a
274
+ * task-attempt session (spawn_task), or a direct spawn_worker /
275
+ * delegate_task child. */
276
+ interface AgentChatMissionEventSession {
277
+ taskId: string | null;
278
+ agentDefName: string | null;
279
+ kind: "coordinator" | "task" | "worker" | "delegation";
280
+ }
281
+ interface AgentChatMissionEventsPage {
282
+ events: AgentChatMissionEvent[];
283
+ sessions: Record<string, AgentChatMissionEventSession>;
284
+ }
264
285
  interface AgentChatMissionList {
265
286
  missions: AgentChatMissionSummary[];
266
287
  }
288
+ interface CodingAgentConnection {
289
+ provider: "anthropic" | "openai";
290
+ connected: boolean;
291
+ auth_mode: "oauth" | "api_key" | null;
292
+ expires_at: number | null;
293
+ }
267
294
  type AgentChatInboxKind = "input_required" | "action_required" | "task_complete" | "governance_gate" | "progress_checkin" | (string & {});
268
295
  type AgentChatInboxStatus = "pending" | "acknowledged" | "responded" | "expired" | (string & {});
269
296
  interface AgentChatInboxItem {
@@ -303,7 +330,7 @@ interface AgentChatInboxEventStream {
303
330
  close(): void;
304
331
  onerror: (() => void) | null;
305
332
  }
306
- 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.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
333
+ 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.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
307
334
  interface AgentChatRuntimeEvent {
308
335
  type: AgentChatEventType;
309
336
  eventId: number;
@@ -351,7 +378,7 @@ interface AgentChatState {
351
378
  researchSources: AgentChatResearchSource[];
352
379
  }
353
380
  type AgentChatViewMode = "simple" | "expert";
354
- type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg";
381
+ type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg" | "image" | "video";
355
382
  interface AgentChatArtifactMeta {
356
383
  artifact_id: string;
357
384
  session_id: string;
@@ -381,6 +408,17 @@ interface AgentChatSvgArtifactSpec {
381
408
  svg: string;
382
409
  caption?: string | null;
383
410
  }
411
+ /**
412
+ * File-backed media artifact (generated images/videos). ``path`` is
413
+ * workspace-relative; the renderer streams the bytes through
414
+ * ``adapter.getWorkspaceDownloadUrl`` — the artifact store only holds
415
+ * this reference, never the media bytes.
416
+ */
417
+ interface AgentChatMediaArtifactSpec {
418
+ path: string;
419
+ mime_type?: string | null;
420
+ caption?: string | null;
421
+ }
384
422
  type AgentChatArtifactPayload = {
385
423
  meta: AgentChatArtifactMeta;
386
424
  kind: "markdown";
@@ -401,6 +439,14 @@ type AgentChatArtifactPayload = {
401
439
  meta: AgentChatArtifactMeta;
402
440
  kind: "svg";
403
441
  spec: AgentChatSvgArtifactSpec;
442
+ } | {
443
+ meta: AgentChatArtifactMeta;
444
+ kind: "image";
445
+ spec: AgentChatMediaArtifactSpec;
446
+ } | {
447
+ meta: AgentChatArtifactMeta;
448
+ kind: "video";
449
+ spec: AgentChatMediaArtifactSpec;
404
450
  };
405
451
  interface AgentChatAskUserQuestionChoice {
406
452
  label: string;
@@ -551,6 +597,15 @@ interface AgentChatAdapter {
551
597
  }): Promise<{
552
598
  workers: AgentChatMissionWorker[];
553
599
  }>;
600
+ /** Mission-wide event feed (Activity tab + per-task history /
601
+ * live output). Optional — unlike the other mission methods the
602
+ * dashboard probes for this at runtime and hides the event-driven
603
+ * sections when absent, so older host adapters keep working. */
604
+ listMissionEvents?(input: {
605
+ missionId: string;
606
+ afterId?: number;
607
+ limit?: number;
608
+ }): Promise<AgentChatMissionEventsPage>;
554
609
  pauseMission?(input: {
555
610
  missionId: string;
556
611
  reason?: string;
@@ -587,6 +642,25 @@ interface AgentChatAdapter {
587
642
  agentId?: string;
588
643
  toolkit: string;
589
644
  }): Promise<void>;
645
+ listCodingAgentConnections?(input: {
646
+ agentId?: string;
647
+ }): Promise<{
648
+ connections: CodingAgentConnection[];
649
+ }>;
650
+ submitCodingAgentCredential?(input: {
651
+ agentId?: string;
652
+ provider: string;
653
+ mode: "oauth" | "api_key";
654
+ value: string;
655
+ }): Promise<{
656
+ provider: string;
657
+ connected: boolean;
658
+ auth_mode: string;
659
+ }>;
660
+ disconnectCodingAgentProvider?(input: {
661
+ agentId?: string;
662
+ provider: string;
663
+ }): Promise<void>;
590
664
  listInbox?(input?: AgentChatInboxListInput): Promise<AgentChatInboxList>;
591
665
  getInboxItem?(input: {
592
666
  itemId: number;
@@ -785,6 +859,11 @@ interface AgentChatProps {
785
859
  * that domain.
786
860
  */
787
861
  deepResearchEnabled?: boolean;
862
+ /**
863
+ * When true, the composer exposes the `/code` coding-agent slash commands.
864
+ * Like `deepResearchEnabled`, the host owns the capability gate.
865
+ */
866
+ codeAgentsEnabled?: boolean;
788
867
  /**
789
868
  * Called when the user clicks the integrations band under the composer.
790
869
  * Hosts navigate to their Integrations route. When omitted, the band is
@@ -792,7 +871,7 @@ interface AgentChatProps {
792
871
  */
793
872
  onOpenIntegrations?: () => void;
794
873
  }
795
- declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
874
+ declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, codeAgentsEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
796
875
 
797
876
  interface AgentChatAdapterContextValue {
798
877
  adapter: AgentChatAdapter;
@@ -852,6 +931,21 @@ interface IntegrationsPageProps {
852
931
  */
853
932
  declare function IntegrationsPage({ agentId, adapter, onBack }: IntegrationsPageProps): react_jsx_runtime.JSX.Element;
854
933
 
934
+ interface CodingAgentsPanelProps {
935
+ agentId?: string;
936
+ adapter: AgentChatAdapter;
937
+ /** Optional. When omitted (e.g. embedded as a settings tab) the
938
+ * "Back" affordance is not rendered. */
939
+ onBack?: () => void;
940
+ }
941
+ /**
942
+ * "Connect your coding plan" view. One card per provider (Claude / Codex)
943
+ * with a subscription-vs-API-key toggle and a masked paste box. Mirrors the
944
+ * IntegrationsPage shell. Renders nothing if the adapter doesn't expose the
945
+ * coding-agent methods.
946
+ */
947
+ declare function CodingAgentsPanel({ agentId, adapter, onBack }: CodingAgentsPanelProps): react_jsx_runtime.JSX.Element | null;
948
+
855
949
  interface InboxPanelProps {
856
950
  adapter: AgentChatAdapter;
857
951
  title?: string;
@@ -915,6 +1009,68 @@ declare function groupMissionTasksByBucket(tasks: AgentChatMissionTask[]): Recor
915
1009
  * llm.response, else the worker's session status.
916
1010
  */
917
1011
  declare function deriveMissionWorkerActivityLabel(worker: AgentChatMissionWorker): string;
1012
+ type MissionEventCategory = "spawn" | "output" | "done" | "verdict" | "system";
1013
+ declare const MISSION_EVENT_CATEGORIES: readonly MissionEventCategory[];
1014
+ declare function missionEventCategory(type: string): MissionEventCategory;
1015
+ /** Strip harness loop-control markup from user-facing mission text. */
1016
+ declare function stripMissionControlMarkup(text: string): string;
1017
+ /** One human line per event row. Keys match the harness emit sites:
1018
+ * worker.spawned {goal}, worker.complete {result}, iteration.summary
1019
+ * {summary}, mission.evaluation.end {result, feedback, explanation},
1020
+ * task.blocked {reason}. Control markup is always stripped. */
1021
+ declare function missionEventSummary(event: AgentChatMissionEvent): string;
1022
+ /** Attribute an event to a mission task: explicit ``data.task_id``
1023
+ * (coordinator-side worker.spawned / worker.complete / task.failed)
1024
+ * wins, else the session→task label map from the events endpoint. */
1025
+ declare function missionEventTaskId(event: AgentChatMissionEvent, sessions: Record<string, AgentChatMissionEventSession>): string | null;
1026
+ declare function missionEventActorLabel(event: AgentChatMissionEvent, sessions: Record<string, AgentChatMissionEventSession>): string;
1027
+ /** Invert parentIds: taskId → ids of tasks that depend on it. */
1028
+ declare function missionTaskBlocks(tasks: AgentChatMissionTask[]): Record<string, string[]>;
1029
+ /** Tasks only have a full ``goal`` — derive a short display title from
1030
+ * its first non-empty line. */
1031
+ declare function missionTaskTitle(goal: string, max?: number): string;
1032
+ type MissionTaskRailGroupKey = "running" | "blocked" | "queued" | "done" | "failed";
1033
+ type MissionTaskRailGroup = {
1034
+ key: MissionTaskRailGroupKey;
1035
+ label: string;
1036
+ tasks: AgentChatMissionTask[];
1037
+ };
1038
+ /** Left-rail grouping for the Tasks tab — rail order, empty groups
1039
+ * dropped. Statuses outside the known set land in "queued" so new
1040
+ * server states never make tasks vanish from the rail. */
1041
+ declare function missionTaskRailGroups(tasks: AgentChatMissionTask[]): MissionTaskRailGroup[];
1042
+ /** First non-terminal task in rail order, else the first task. */
1043
+ declare function defaultSelectedMissionTaskId(tasks: AgentChatMissionTask[]): string | null;
1044
+ /** Merge an event page into the accumulated feed: dedupe by id (the
1045
+ * incoming row wins), sorted ascending. Returns the existing array
1046
+ * unchanged for an empty page so React state doesn't churn. */
1047
+ declare function mergeMissionEvents(existing: AgentChatMissionEvent[], incoming: AgentChatMissionEvent[]): AgentChatMissionEvent[];
1048
+ declare function missionTaskStatusDotClass(status: string): string;
1049
+ /** Completed / in-flight counts for a task-kind worker card, grouping
1050
+ * mission tasks by the worker's agentDefName. Null for worker /
1051
+ * delegation kinds (they have no Task rows to count). */
1052
+ declare function missionWorkerTaskCounts(worker: AgentChatMissionWorker, tasks: AgentChatMissionTask[]): {
1053
+ completed: number;
1054
+ inFlight: number;
1055
+ } | null;
1056
+ declare function formatMissionTimestamp(iso: string | null): string;
1057
+
1058
+ type MissionEventsFeed = {
1059
+ /** False when the adapter doesn't implement listMissionEvents —
1060
+ * callers hide the event-driven UI sections entirely. */
1061
+ supported: boolean;
1062
+ /** Ascending by event id. */
1063
+ events: AgentChatMissionEvent[];
1064
+ sessions: Record<string, AgentChatMissionEventSession>;
1065
+ };
1066
+ declare function useMissionEvents(input: {
1067
+ adapter: AgentChatAdapter;
1068
+ missionId: string;
1069
+ /** Null until the mission summary has loaded. */
1070
+ missionStatus: string | null;
1071
+ isTerminal: boolean;
1072
+ pollIntervalMs: number;
1073
+ }): MissionEventsFeed;
918
1074
 
919
1075
  declare function ResearchSourcesPanel({ sources, }: {
920
1076
  sources: AgentChatResearchSource[];
@@ -982,4 +1138,4 @@ interface SessionTreePanelProps {
982
1138
  }
983
1139
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
984
1140
 
985
- 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, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, 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 };
1141
+ 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, 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
@@ -235,6 +235,7 @@ interface AgentChatMissionTask {
235
235
  parentIds: string[];
236
236
  currentSessionId: string | null;
237
237
  createdAt: string | null;
238
+ startedAt: string | null;
238
239
  completedAt: string | null;
239
240
  }
240
241
  type AgentChatMissionWorkerKind = "task" | "worker" | "delegation";
@@ -261,9 +262,35 @@ interface AgentChatMissionWorker {
261
262
  latestEventSummary: string | null;
262
263
  transcriptUrl: string;
263
264
  }
265
+ interface AgentChatMissionEvent {
266
+ id: number;
267
+ sessionId: string;
268
+ type: string;
269
+ data: Record<string, unknown> | null;
270
+ createdAt: string | null;
271
+ }
272
+ /** Label for one session contributing to a mission's event feed.
273
+ * ``kind`` mirrors the server: the coordinator chat session, a
274
+ * task-attempt session (spawn_task), or a direct spawn_worker /
275
+ * delegate_task child. */
276
+ interface AgentChatMissionEventSession {
277
+ taskId: string | null;
278
+ agentDefName: string | null;
279
+ kind: "coordinator" | "task" | "worker" | "delegation";
280
+ }
281
+ interface AgentChatMissionEventsPage {
282
+ events: AgentChatMissionEvent[];
283
+ sessions: Record<string, AgentChatMissionEventSession>;
284
+ }
264
285
  interface AgentChatMissionList {
265
286
  missions: AgentChatMissionSummary[];
266
287
  }
288
+ interface CodingAgentConnection {
289
+ provider: "anthropic" | "openai";
290
+ connected: boolean;
291
+ auth_mode: "oauth" | "api_key" | null;
292
+ expires_at: number | null;
293
+ }
267
294
  type AgentChatInboxKind = "input_required" | "action_required" | "task_complete" | "governance_gate" | "progress_checkin" | (string & {});
268
295
  type AgentChatInboxStatus = "pending" | "acknowledged" | "responded" | "expired" | (string & {});
269
296
  interface AgentChatInboxItem {
@@ -303,7 +330,7 @@ interface AgentChatInboxEventStream {
303
330
  close(): void;
304
331
  onerror: (() => void) | null;
305
332
  }
306
- 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.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
333
+ 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.delegation" | "expert.result" | "expert.failure" | "expert.endorse" | "expert.override" | "code.run_started" | "code.run_progress" | "code.run_result" | "user.feedback" | "artifact.created" | "artifact.updated" | "browser.provisioned" | "browser.destroyed" | "browser.control_granted" | "browser.control_returned" | "ask_user_question.response" | "iteration.summary" | "turn.summary";
307
334
  interface AgentChatRuntimeEvent {
308
335
  type: AgentChatEventType;
309
336
  eventId: number;
@@ -351,7 +378,7 @@ interface AgentChatState {
351
378
  researchSources: AgentChatResearchSource[];
352
379
  }
353
380
  type AgentChatViewMode = "simple" | "expert";
354
- type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg";
381
+ type AgentChatArtifactKind = "markdown" | "table" | "chart" | "html" | "svg" | "image" | "video";
355
382
  interface AgentChatArtifactMeta {
356
383
  artifact_id: string;
357
384
  session_id: string;
@@ -381,6 +408,17 @@ interface AgentChatSvgArtifactSpec {
381
408
  svg: string;
382
409
  caption?: string | null;
383
410
  }
411
+ /**
412
+ * File-backed media artifact (generated images/videos). ``path`` is
413
+ * workspace-relative; the renderer streams the bytes through
414
+ * ``adapter.getWorkspaceDownloadUrl`` — the artifact store only holds
415
+ * this reference, never the media bytes.
416
+ */
417
+ interface AgentChatMediaArtifactSpec {
418
+ path: string;
419
+ mime_type?: string | null;
420
+ caption?: string | null;
421
+ }
384
422
  type AgentChatArtifactPayload = {
385
423
  meta: AgentChatArtifactMeta;
386
424
  kind: "markdown";
@@ -401,6 +439,14 @@ type AgentChatArtifactPayload = {
401
439
  meta: AgentChatArtifactMeta;
402
440
  kind: "svg";
403
441
  spec: AgentChatSvgArtifactSpec;
442
+ } | {
443
+ meta: AgentChatArtifactMeta;
444
+ kind: "image";
445
+ spec: AgentChatMediaArtifactSpec;
446
+ } | {
447
+ meta: AgentChatArtifactMeta;
448
+ kind: "video";
449
+ spec: AgentChatMediaArtifactSpec;
404
450
  };
405
451
  interface AgentChatAskUserQuestionChoice {
406
452
  label: string;
@@ -551,6 +597,15 @@ interface AgentChatAdapter {
551
597
  }): Promise<{
552
598
  workers: AgentChatMissionWorker[];
553
599
  }>;
600
+ /** Mission-wide event feed (Activity tab + per-task history /
601
+ * live output). Optional — unlike the other mission methods the
602
+ * dashboard probes for this at runtime and hides the event-driven
603
+ * sections when absent, so older host adapters keep working. */
604
+ listMissionEvents?(input: {
605
+ missionId: string;
606
+ afterId?: number;
607
+ limit?: number;
608
+ }): Promise<AgentChatMissionEventsPage>;
554
609
  pauseMission?(input: {
555
610
  missionId: string;
556
611
  reason?: string;
@@ -587,6 +642,25 @@ interface AgentChatAdapter {
587
642
  agentId?: string;
588
643
  toolkit: string;
589
644
  }): Promise<void>;
645
+ listCodingAgentConnections?(input: {
646
+ agentId?: string;
647
+ }): Promise<{
648
+ connections: CodingAgentConnection[];
649
+ }>;
650
+ submitCodingAgentCredential?(input: {
651
+ agentId?: string;
652
+ provider: string;
653
+ mode: "oauth" | "api_key";
654
+ value: string;
655
+ }): Promise<{
656
+ provider: string;
657
+ connected: boolean;
658
+ auth_mode: string;
659
+ }>;
660
+ disconnectCodingAgentProvider?(input: {
661
+ agentId?: string;
662
+ provider: string;
663
+ }): Promise<void>;
590
664
  listInbox?(input?: AgentChatInboxListInput): Promise<AgentChatInboxList>;
591
665
  getInboxItem?(input: {
592
666
  itemId: number;
@@ -785,6 +859,11 @@ interface AgentChatProps {
785
859
  * that domain.
786
860
  */
787
861
  deepResearchEnabled?: boolean;
862
+ /**
863
+ * When true, the composer exposes the `/code` coding-agent slash commands.
864
+ * Like `deepResearchEnabled`, the host owns the capability gate.
865
+ */
866
+ codeAgentsEnabled?: boolean;
788
867
  /**
789
868
  * Called when the user clicks the integrations band under the composer.
790
869
  * Hosts navigate to their Integrations route. When omitted, the band is
@@ -792,7 +871,7 @@ interface AgentChatProps {
792
871
  */
793
872
  onOpenIntegrations?: () => void;
794
873
  }
795
- declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
874
+ declare function AgentChat({ adapter, agentId, sessionId, onSessionChange, onFileSelect, onMessagesChange, disabled, onComposerError, deepResearchEnabled, codeAgentsEnabled, onOpenIntegrations, }: AgentChatProps): react_jsx_runtime.JSX.Element;
796
875
 
797
876
  interface AgentChatAdapterContextValue {
798
877
  adapter: AgentChatAdapter;
@@ -852,6 +931,21 @@ interface IntegrationsPageProps {
852
931
  */
853
932
  declare function IntegrationsPage({ agentId, adapter, onBack }: IntegrationsPageProps): react_jsx_runtime.JSX.Element;
854
933
 
934
+ interface CodingAgentsPanelProps {
935
+ agentId?: string;
936
+ adapter: AgentChatAdapter;
937
+ /** Optional. When omitted (e.g. embedded as a settings tab) the
938
+ * "Back" affordance is not rendered. */
939
+ onBack?: () => void;
940
+ }
941
+ /**
942
+ * "Connect your coding plan" view. One card per provider (Claude / Codex)
943
+ * with a subscription-vs-API-key toggle and a masked paste box. Mirrors the
944
+ * IntegrationsPage shell. Renders nothing if the adapter doesn't expose the
945
+ * coding-agent methods.
946
+ */
947
+ declare function CodingAgentsPanel({ agentId, adapter, onBack }: CodingAgentsPanelProps): react_jsx_runtime.JSX.Element | null;
948
+
855
949
  interface InboxPanelProps {
856
950
  adapter: AgentChatAdapter;
857
951
  title?: string;
@@ -915,6 +1009,68 @@ declare function groupMissionTasksByBucket(tasks: AgentChatMissionTask[]): Recor
915
1009
  * llm.response, else the worker's session status.
916
1010
  */
917
1011
  declare function deriveMissionWorkerActivityLabel(worker: AgentChatMissionWorker): string;
1012
+ type MissionEventCategory = "spawn" | "output" | "done" | "verdict" | "system";
1013
+ declare const MISSION_EVENT_CATEGORIES: readonly MissionEventCategory[];
1014
+ declare function missionEventCategory(type: string): MissionEventCategory;
1015
+ /** Strip harness loop-control markup from user-facing mission text. */
1016
+ declare function stripMissionControlMarkup(text: string): string;
1017
+ /** One human line per event row. Keys match the harness emit sites:
1018
+ * worker.spawned {goal}, worker.complete {result}, iteration.summary
1019
+ * {summary}, mission.evaluation.end {result, feedback, explanation},
1020
+ * task.blocked {reason}. Control markup is always stripped. */
1021
+ declare function missionEventSummary(event: AgentChatMissionEvent): string;
1022
+ /** Attribute an event to a mission task: explicit ``data.task_id``
1023
+ * (coordinator-side worker.spawned / worker.complete / task.failed)
1024
+ * wins, else the session→task label map from the events endpoint. */
1025
+ declare function missionEventTaskId(event: AgentChatMissionEvent, sessions: Record<string, AgentChatMissionEventSession>): string | null;
1026
+ declare function missionEventActorLabel(event: AgentChatMissionEvent, sessions: Record<string, AgentChatMissionEventSession>): string;
1027
+ /** Invert parentIds: taskId → ids of tasks that depend on it. */
1028
+ declare function missionTaskBlocks(tasks: AgentChatMissionTask[]): Record<string, string[]>;
1029
+ /** Tasks only have a full ``goal`` — derive a short display title from
1030
+ * its first non-empty line. */
1031
+ declare function missionTaskTitle(goal: string, max?: number): string;
1032
+ type MissionTaskRailGroupKey = "running" | "blocked" | "queued" | "done" | "failed";
1033
+ type MissionTaskRailGroup = {
1034
+ key: MissionTaskRailGroupKey;
1035
+ label: string;
1036
+ tasks: AgentChatMissionTask[];
1037
+ };
1038
+ /** Left-rail grouping for the Tasks tab — rail order, empty groups
1039
+ * dropped. Statuses outside the known set land in "queued" so new
1040
+ * server states never make tasks vanish from the rail. */
1041
+ declare function missionTaskRailGroups(tasks: AgentChatMissionTask[]): MissionTaskRailGroup[];
1042
+ /** First non-terminal task in rail order, else the first task. */
1043
+ declare function defaultSelectedMissionTaskId(tasks: AgentChatMissionTask[]): string | null;
1044
+ /** Merge an event page into the accumulated feed: dedupe by id (the
1045
+ * incoming row wins), sorted ascending. Returns the existing array
1046
+ * unchanged for an empty page so React state doesn't churn. */
1047
+ declare function mergeMissionEvents(existing: AgentChatMissionEvent[], incoming: AgentChatMissionEvent[]): AgentChatMissionEvent[];
1048
+ declare function missionTaskStatusDotClass(status: string): string;
1049
+ /** Completed / in-flight counts for a task-kind worker card, grouping
1050
+ * mission tasks by the worker's agentDefName. Null for worker /
1051
+ * delegation kinds (they have no Task rows to count). */
1052
+ declare function missionWorkerTaskCounts(worker: AgentChatMissionWorker, tasks: AgentChatMissionTask[]): {
1053
+ completed: number;
1054
+ inFlight: number;
1055
+ } | null;
1056
+ declare function formatMissionTimestamp(iso: string | null): string;
1057
+
1058
+ type MissionEventsFeed = {
1059
+ /** False when the adapter doesn't implement listMissionEvents —
1060
+ * callers hide the event-driven UI sections entirely. */
1061
+ supported: boolean;
1062
+ /** Ascending by event id. */
1063
+ events: AgentChatMissionEvent[];
1064
+ sessions: Record<string, AgentChatMissionEventSession>;
1065
+ };
1066
+ declare function useMissionEvents(input: {
1067
+ adapter: AgentChatAdapter;
1068
+ missionId: string;
1069
+ /** Null until the mission summary has loaded. */
1070
+ missionStatus: string | null;
1071
+ isTerminal: boolean;
1072
+ pollIntervalMs: number;
1073
+ }): MissionEventsFeed;
918
1074
 
919
1075
  declare function ResearchSourcesPanel({ sources, }: {
920
1076
  sources: AgentChatResearchSource[];
@@ -982,4 +1138,4 @@ interface SessionTreePanelProps {
982
1138
  }
983
1139
  declare function SessionTreePanel({ adapter, sessionId, activeSessionId, agentId, title, sessionListLimit, hideRoot, hideHeader, loadList, onSessionSelect, onSessionDelete, }: SessionTreePanelProps): react_jsx_runtime.JSX.Element | null;
984
1140
 
985
- 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, ComposioConnectCard, type ComposioConnectCardProps, type ErrorInfo, type HtmlArtifactSpec, type InboxItem, type InboxList, InboxPanel, type InboxPanelProps, type InboxUnreadCountState, IntegrationsBand, type IntegrationsBandProps, IntegrationsPage, type IntegrationsPageProps, 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 };
1141
+ 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, 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 };