@getcatalystiq/agent-plane-ui 0.1.30 → 0.1.32

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
@@ -6,6 +6,7 @@ import { ClassValue } from 'clsx';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import { DailyAgentStat } from './charts.cjs';
9
+ import * as ToastPrimitives from '@radix-ui/react-toast';
9
10
 
10
11
  /** Skills directory types. */
11
12
  interface SkillDirectoryEntry {
@@ -64,6 +65,11 @@ type PlaygroundStreamEvent = PlaygroundTextDeltaEvent | PlaygroundRunStartedEven
64
65
  type: string;
65
66
  [key: string]: unknown;
66
67
  };
68
+ /** Minimal stream event type for run streaming (compatible with SDK StreamEvent). */
69
+ interface StreamEventLike {
70
+ type: string;
71
+ [key: string]: unknown;
72
+ }
67
73
  /** Async iterable stream of events (compatible with SDK RunStream). */
68
74
  interface PlaygroundStream extends AsyncIterable<PlaygroundStreamEvent> {
69
75
  run_id: string | null;
@@ -101,9 +107,21 @@ interface AgentPlaneClient {
101
107
  runs: {
102
108
  list(params?: Record<string, unknown>): Promise<unknown>;
103
109
  get(runId: string): Promise<unknown>;
110
+ create(params: {
111
+ agent_id: string;
112
+ prompt: string;
113
+ }, options?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<AsyncIterable<StreamEventLike> & {
116
+ run_id?: string | null;
117
+ }>;
104
118
  cancel(runId: string): Promise<unknown>;
105
119
  transcript(runId: string): Promise<unknown>;
106
120
  transcriptArray(runId: string): Promise<unknown[]>;
121
+ stream(runId: string, options?: {
122
+ offset?: number;
123
+ signal?: AbortSignal;
124
+ }): Promise<AsyncIterable<StreamEventLike>>;
107
125
  };
108
126
  sessions: {
109
127
  list(params?: Record<string, unknown>): Promise<unknown>;
@@ -261,6 +279,28 @@ declare function useNavigation(): NavigationContextValue;
261
279
  */
262
280
  declare function useApi<T = unknown>(key: string | null, fetcher: (client: AgentPlaneClient) => Promise<T>, options?: SWRConfiguration<T>): SWRResponse<T>;
263
281
 
282
+ interface UseRunStreamResult {
283
+ /** Accumulated stream events (grows during streaming). */
284
+ events: StreamEventLike[];
285
+ /** Whether the stream is currently active. */
286
+ isStreaming: boolean;
287
+ /** The terminal event (result or error) if the stream has ended. */
288
+ terminalEvent: StreamEventLike | null;
289
+ /** Accumulated text from text_delta events (cleared when assistant event arrives). */
290
+ streamingText: string;
291
+ /** Stream error, if any. */
292
+ error: Error | null;
293
+ }
294
+ /**
295
+ * React hook that streams events from an in-progress run using the SDK client.
296
+ *
297
+ * - Only streams when `status` is "running" or "pending"
298
+ * - Returns accumulated events, streaming state, and terminal event
299
+ * - Handles cleanup on unmount or when runId/status changes
300
+ * - Accumulates text_delta events into streamingText
301
+ */
302
+ declare function useRunStream(runId: string | null, status: string): UseRunStreamResult;
303
+
264
304
  declare function cn(...inputs: ClassValue[]): string;
265
305
 
266
306
  declare const buttonVariants: (props?: ({
@@ -522,9 +562,10 @@ interface TranscriptEvent {
522
562
  type: string;
523
563
  [key: string]: unknown;
524
564
  }
525
- declare function TranscriptViewer({ transcript, prompt }: {
565
+ declare function TranscriptViewer({ transcript, prompt, isStreaming }: {
526
566
  transcript: TranscriptEvent[];
527
567
  prompt?: string;
568
+ isStreaming?: boolean;
528
569
  }): react_jsx_runtime.JSX.Element;
529
570
 
530
571
  interface McpServer {
@@ -739,4 +780,44 @@ interface Props {
739
780
  }
740
781
  declare function ToolkitMultiselect({ value, onChange }: Props): react_jsx_runtime.JSX.Element;
741
782
 
742
- export { AdminTable, AdminTableHead, AdminTableRow, AgentA2aInfo, AgentConnectorsManager, AgentDetailPage, AgentEditForm, AgentListPage, type AgentPlaneClient, AgentPlaneProvider, type AgentPlaneProviderProps, AgentPluginManager, AgentRuns, AgentScheduleForm, AgentSkillManager, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, CopyButton, DashboardPage, type DashboardPageProps, DetailPageHeader, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyRow, FormError, FormField, Input, type LinkComponentProps, LocalDate, McpServerListPage, type McpServerListPageProps, MetricCard, ModelSelector, type NavigationProps, PaginationBar, PlaygroundPage, type PlaygroundPageProps, type PlaygroundStream, type PlaygroundStreamEvent, PluginDetailPage, type PluginDetailPageProps, PluginMarketplaceDetailPage, type PluginMarketplaceDetailPageProps, PluginMarketplaceListPage, type PluginMarketplaceListPageProps, RunDetailPage, type RunDetailPageProps, RunListPage, type RunListPageProps, RunSourceBadge, RunStatusBadge, SectionHeader, Select, SettingsPage, type SettingsPageProps, Skeleton, Tabs, Textarea, type TextareaProps, Th, ToolkitMultiselect, TranscriptViewer, badgeVariants, buttonVariants, cn, parsePaginationParams, useAgentPlaneClient, useApi, useAuthError, useNavigation };
783
+ declare function Toaster(): react_jsx_runtime.JSX.Element;
784
+
785
+ type ToastVariant = "default" | "success" | "destructive";
786
+ type ToasterToast = {
787
+ id: string;
788
+ title?: string;
789
+ description?: string;
790
+ variant?: ToastVariant;
791
+ action?: React$1.ReactNode;
792
+ open?: boolean;
793
+ onOpenChange?: (open: boolean) => void;
794
+ };
795
+ type ToastInput = Omit<ToasterToast, "id" | "open" | "onOpenChange">;
796
+ declare function toast(props: ToastInput): {
797
+ id: string;
798
+ dismiss: () => void;
799
+ update: (updateProps: Partial<ToasterToast>) => void;
800
+ };
801
+ declare function dismiss(toastId?: string): void;
802
+ declare function useToast(): {
803
+ toast: typeof toast;
804
+ dismiss: typeof dismiss;
805
+ toasts: ToasterToast[];
806
+ };
807
+
808
+ declare const ToastProvider: React$1.FC<ToastPrimitives.ToastProviderProps>;
809
+ declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React$1.RefAttributes<HTMLOListElement>, "ref"> & React$1.RefAttributes<HTMLOListElement>>;
810
+ declare const toastVariants: (props?: ({
811
+ variant?: "default" | "destructive" | "success" | null | undefined;
812
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
813
+ declare const Toast: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
814
+ variant?: "default" | "destructive" | "success" | null | undefined;
815
+ } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLLIElement>>;
816
+ declare const ToastAction: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
817
+ declare const ToastClose: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
818
+ declare const ToastTitle: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
819
+ declare const ToastDescription: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
820
+ type ToastProps = React$1.ComponentPropsWithoutRef<typeof Toast>;
821
+ type ToastActionElement = React$1.ReactElement<typeof ToastAction>;
822
+
823
+ export { AdminTable, AdminTableHead, AdminTableRow, AgentA2aInfo, AgentConnectorsManager, AgentDetailPage, AgentEditForm, AgentListPage, type AgentPlaneClient, AgentPlaneProvider, type AgentPlaneProviderProps, AgentPluginManager, AgentRuns, AgentScheduleForm, AgentSkillManager, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, CopyButton, DashboardPage, type DashboardPageProps, DetailPageHeader, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyRow, FormError, FormField, Input, type LinkComponentProps, LocalDate, McpServerListPage, type McpServerListPageProps, MetricCard, ModelSelector, type NavigationProps, PaginationBar, PlaygroundPage, type PlaygroundPageProps, type PlaygroundStream, type PlaygroundStreamEvent, PluginDetailPage, type PluginDetailPageProps, PluginMarketplaceDetailPage, type PluginMarketplaceDetailPageProps, PluginMarketplaceListPage, type PluginMarketplaceListPageProps, RunDetailPage, type RunDetailPageProps, RunListPage, type RunListPageProps, RunSourceBadge, RunStatusBadge, SectionHeader, Select, SettingsPage, type SettingsPageProps, Skeleton, type StreamEventLike, Tabs, Textarea, type TextareaProps, Th, Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, type ToastVariant, ToastViewport, Toaster, type ToasterToast, ToolkitMultiselect, TranscriptViewer, badgeVariants, buttonVariants, cn, parsePaginationParams, toast, toastVariants, useAgentPlaneClient, useApi, useAuthError, useNavigation, useRunStream, useToast };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ClassValue } from 'clsx';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import { DailyAgentStat } from './charts.js';
9
+ import * as ToastPrimitives from '@radix-ui/react-toast';
9
10
 
10
11
  /** Skills directory types. */
11
12
  interface SkillDirectoryEntry {
@@ -64,6 +65,11 @@ type PlaygroundStreamEvent = PlaygroundTextDeltaEvent | PlaygroundRunStartedEven
64
65
  type: string;
65
66
  [key: string]: unknown;
66
67
  };
68
+ /** Minimal stream event type for run streaming (compatible with SDK StreamEvent). */
69
+ interface StreamEventLike {
70
+ type: string;
71
+ [key: string]: unknown;
72
+ }
67
73
  /** Async iterable stream of events (compatible with SDK RunStream). */
68
74
  interface PlaygroundStream extends AsyncIterable<PlaygroundStreamEvent> {
69
75
  run_id: string | null;
@@ -101,9 +107,21 @@ interface AgentPlaneClient {
101
107
  runs: {
102
108
  list(params?: Record<string, unknown>): Promise<unknown>;
103
109
  get(runId: string): Promise<unknown>;
110
+ create(params: {
111
+ agent_id: string;
112
+ prompt: string;
113
+ }, options?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<AsyncIterable<StreamEventLike> & {
116
+ run_id?: string | null;
117
+ }>;
104
118
  cancel(runId: string): Promise<unknown>;
105
119
  transcript(runId: string): Promise<unknown>;
106
120
  transcriptArray(runId: string): Promise<unknown[]>;
121
+ stream(runId: string, options?: {
122
+ offset?: number;
123
+ signal?: AbortSignal;
124
+ }): Promise<AsyncIterable<StreamEventLike>>;
107
125
  };
108
126
  sessions: {
109
127
  list(params?: Record<string, unknown>): Promise<unknown>;
@@ -261,6 +279,28 @@ declare function useNavigation(): NavigationContextValue;
261
279
  */
262
280
  declare function useApi<T = unknown>(key: string | null, fetcher: (client: AgentPlaneClient) => Promise<T>, options?: SWRConfiguration<T>): SWRResponse<T>;
263
281
 
282
+ interface UseRunStreamResult {
283
+ /** Accumulated stream events (grows during streaming). */
284
+ events: StreamEventLike[];
285
+ /** Whether the stream is currently active. */
286
+ isStreaming: boolean;
287
+ /** The terminal event (result or error) if the stream has ended. */
288
+ terminalEvent: StreamEventLike | null;
289
+ /** Accumulated text from text_delta events (cleared when assistant event arrives). */
290
+ streamingText: string;
291
+ /** Stream error, if any. */
292
+ error: Error | null;
293
+ }
294
+ /**
295
+ * React hook that streams events from an in-progress run using the SDK client.
296
+ *
297
+ * - Only streams when `status` is "running" or "pending"
298
+ * - Returns accumulated events, streaming state, and terminal event
299
+ * - Handles cleanup on unmount or when runId/status changes
300
+ * - Accumulates text_delta events into streamingText
301
+ */
302
+ declare function useRunStream(runId: string | null, status: string): UseRunStreamResult;
303
+
264
304
  declare function cn(...inputs: ClassValue[]): string;
265
305
 
266
306
  declare const buttonVariants: (props?: ({
@@ -522,9 +562,10 @@ interface TranscriptEvent {
522
562
  type: string;
523
563
  [key: string]: unknown;
524
564
  }
525
- declare function TranscriptViewer({ transcript, prompt }: {
565
+ declare function TranscriptViewer({ transcript, prompt, isStreaming }: {
526
566
  transcript: TranscriptEvent[];
527
567
  prompt?: string;
568
+ isStreaming?: boolean;
528
569
  }): react_jsx_runtime.JSX.Element;
529
570
 
530
571
  interface McpServer {
@@ -739,4 +780,44 @@ interface Props {
739
780
  }
740
781
  declare function ToolkitMultiselect({ value, onChange }: Props): react_jsx_runtime.JSX.Element;
741
782
 
742
- export { AdminTable, AdminTableHead, AdminTableRow, AgentA2aInfo, AgentConnectorsManager, AgentDetailPage, AgentEditForm, AgentListPage, type AgentPlaneClient, AgentPlaneProvider, type AgentPlaneProviderProps, AgentPluginManager, AgentRuns, AgentScheduleForm, AgentSkillManager, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, CopyButton, DashboardPage, type DashboardPageProps, DetailPageHeader, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyRow, FormError, FormField, Input, type LinkComponentProps, LocalDate, McpServerListPage, type McpServerListPageProps, MetricCard, ModelSelector, type NavigationProps, PaginationBar, PlaygroundPage, type PlaygroundPageProps, type PlaygroundStream, type PlaygroundStreamEvent, PluginDetailPage, type PluginDetailPageProps, PluginMarketplaceDetailPage, type PluginMarketplaceDetailPageProps, PluginMarketplaceListPage, type PluginMarketplaceListPageProps, RunDetailPage, type RunDetailPageProps, RunListPage, type RunListPageProps, RunSourceBadge, RunStatusBadge, SectionHeader, Select, SettingsPage, type SettingsPageProps, Skeleton, Tabs, Textarea, type TextareaProps, Th, ToolkitMultiselect, TranscriptViewer, badgeVariants, buttonVariants, cn, parsePaginationParams, useAgentPlaneClient, useApi, useAuthError, useNavigation };
783
+ declare function Toaster(): react_jsx_runtime.JSX.Element;
784
+
785
+ type ToastVariant = "default" | "success" | "destructive";
786
+ type ToasterToast = {
787
+ id: string;
788
+ title?: string;
789
+ description?: string;
790
+ variant?: ToastVariant;
791
+ action?: React$1.ReactNode;
792
+ open?: boolean;
793
+ onOpenChange?: (open: boolean) => void;
794
+ };
795
+ type ToastInput = Omit<ToasterToast, "id" | "open" | "onOpenChange">;
796
+ declare function toast(props: ToastInput): {
797
+ id: string;
798
+ dismiss: () => void;
799
+ update: (updateProps: Partial<ToasterToast>) => void;
800
+ };
801
+ declare function dismiss(toastId?: string): void;
802
+ declare function useToast(): {
803
+ toast: typeof toast;
804
+ dismiss: typeof dismiss;
805
+ toasts: ToasterToast[];
806
+ };
807
+
808
+ declare const ToastProvider: React$1.FC<ToastPrimitives.ToastProviderProps>;
809
+ declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React$1.RefAttributes<HTMLOListElement>, "ref"> & React$1.RefAttributes<HTMLOListElement>>;
810
+ declare const toastVariants: (props?: ({
811
+ variant?: "default" | "destructive" | "success" | null | undefined;
812
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
813
+ declare const Toast: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
814
+ variant?: "default" | "destructive" | "success" | null | undefined;
815
+ } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLLIElement>>;
816
+ declare const ToastAction: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
817
+ declare const ToastClose: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
818
+ declare const ToastTitle: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
819
+ declare const ToastDescription: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
820
+ type ToastProps = React$1.ComponentPropsWithoutRef<typeof Toast>;
821
+ type ToastActionElement = React$1.ReactElement<typeof ToastAction>;
822
+
823
+ export { AdminTable, AdminTableHead, AdminTableRow, AgentA2aInfo, AgentConnectorsManager, AgentDetailPage, AgentEditForm, AgentListPage, type AgentPlaneClient, AgentPlaneProvider, type AgentPlaneProviderProps, AgentPluginManager, AgentRuns, AgentScheduleForm, AgentSkillManager, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, CopyButton, DashboardPage, type DashboardPageProps, DetailPageHeader, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyRow, FormError, FormField, Input, type LinkComponentProps, LocalDate, McpServerListPage, type McpServerListPageProps, MetricCard, ModelSelector, type NavigationProps, PaginationBar, PlaygroundPage, type PlaygroundPageProps, type PlaygroundStream, type PlaygroundStreamEvent, PluginDetailPage, type PluginDetailPageProps, PluginMarketplaceDetailPage, type PluginMarketplaceDetailPageProps, PluginMarketplaceListPage, type PluginMarketplaceListPageProps, RunDetailPage, type RunDetailPageProps, RunListPage, type RunListPageProps, RunSourceBadge, RunStatusBadge, SectionHeader, Select, SettingsPage, type SettingsPageProps, Skeleton, type StreamEventLike, Tabs, Textarea, type TextareaProps, Th, Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, type ToastVariant, ToastViewport, Toaster, type ToasterToast, ToolkitMultiselect, TranscriptViewer, badgeVariants, buttonVariants, cn, parsePaginationParams, toast, toastVariants, useAgentPlaneClient, useApi, useAuthError, useNavigation, useRunStream, useToast };