@sciol/xyzen 0.3.3 → 0.3.5

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.
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { ChartDisplayProps } from '../../types/chartTypes';
3
+ /**
4
+ * High-level component that decides whether to render data as a chart or JSON
5
+ */
6
+ export declare const ChartDisplay: React.FC<ChartDisplayProps>;
7
+ /**
8
+ * Simplified chart display component for cases where you know the data is chartable
9
+ */
10
+ export declare const SimpleChartDisplay: React.FC<{
11
+ data: unknown;
12
+ title?: string;
13
+ height?: number;
14
+ className?: string;
15
+ }>;
16
+ export default ChartDisplay;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { ChartRendererProps } from '../../types/chartTypes';
3
+ /**
4
+ * Core chart rendering component using ECharts
5
+ */
6
+ export declare const ChartRenderer: React.FC<ChartRendererProps>;
@@ -0,0 +1,5 @@
1
+ export { ChartRenderer } from './ChartRenderer';
2
+ export { ChartDisplay, SimpleChartDisplay } from './ChartDisplay';
3
+ export { detectChart, validateChartData, suggestChartType } from '../../utils/chartDetection';
4
+ export { createEChartsTheme, detectThemeFromDOM } from '../../utils/chartThemes';
5
+ export type { ChartConfig, ChartDataPoint, SeriesData, TimeSeriesPoint, ChartableOutput, ChartDetectionResult, ChartTheme, ChartRendererProps, ChartDisplayProps, ChartableData, DetectionPattern, } from '../../types/chartTypes';
@@ -0,0 +1 @@
1
+ export declare function CenteredInput(): import("react/jsx-runtime").JSX.Element | null;
@@ -2,3 +2,4 @@ export { AuthStatus } from './AuthStatus';
2
2
  export { SettingsButton } from './SettingsButton';
3
3
  export { ThemeToggle } from './ThemeToggle';
4
4
  export { LayoutToggle } from './LayoutToggle';
5
+ export { CenteredInput } from './CenteredInput';
@@ -2,7 +2,7 @@ export type Agent = {
2
2
  id: string;
3
3
  name: string;
4
4
  description: string;
5
- prompt: string;
5
+ prompt?: string;
6
6
  mcp_servers?: {
7
7
  id: string;
8
8
  }[];
@@ -10,5 +10,16 @@ export type Agent = {
10
10
  user_id: string;
11
11
  require_tool_confirmation?: boolean;
12
12
  provider_id?: string | null;
13
+ agent_type: 'regular' | 'graph';
14
+ avatar?: string | null;
15
+ tags?: string[] | null;
16
+ model?: string | null;
17
+ temperature?: number | null;
18
+ is_active?: boolean;
19
+ created_at: string;
20
+ updated_at: string;
21
+ state_schema?: any;
22
+ node_count?: number;
23
+ edge_count?: number;
13
24
  };
14
25
  export default function XyzenAgent(): import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,7 @@ interface ChatInputProps {
4
4
  disabled?: boolean;
5
5
  placeholder?: string;
6
6
  height?: number;
7
+ initialValue?: string;
7
8
  }
8
9
  export declare const ChatInput: React.FC<ChatInputProps>;
9
10
  export default ChatInput;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ interface JsonDisplayProps {
3
+ data: unknown;
4
+ className?: string;
5
+ compact?: boolean;
6
+ variant?: 'default' | 'success' | 'error';
7
+ hideHeader?: boolean;
8
+ enableCharts?: boolean;
9
+ }
10
+ export declare const JsonDisplay: React.FC<JsonDisplayProps>;
11
+ export default JsonDisplay;
package/dist/main.d.ts CHANGED
@@ -0,0 +1 @@
1
+ export {};
@@ -4,11 +4,22 @@ import { XyzenState } from '../types';
4
4
  export interface AgentSlice {
5
5
  agents: Agent[];
6
6
  agentsLoading: boolean;
7
+ hiddenGraphAgentIds: string[];
7
8
  fetchAgents: () => Promise<void>;
8
9
  createAgent: (agent: Omit<Agent, "id">) => Promise<void>;
10
+ createGraphAgent: (graphAgent: GraphAgentCreate) => Promise<void>;
9
11
  updateAgent: (agent: Agent) => Promise<void>;
10
12
  updateAgentProvider: (agentId: string, providerId: string | null) => Promise<void>;
11
13
  deleteAgent: (id: string) => Promise<void>;
14
+ removeGraphAgentFromSidebar: (id: string) => void;
15
+ addGraphAgentToSidebar: (id: string) => void;
16
+ getRegularAgents: () => Agent[];
17
+ getGraphAgents: () => Agent[];
18
+ }
19
+ export interface GraphAgentCreate {
20
+ name: string;
21
+ description: string;
22
+ state_schema?: any;
12
23
  }
13
24
  export declare const createAgentSlice: StateCreator<XyzenState, [
14
25
  ["zustand/immer", never]
@@ -13,6 +13,7 @@ export interface UiSlice {
13
13
  activeSettingsCategory: string;
14
14
  activeUiSetting: UiSettingType;
15
15
  selectedProviderId: string | null;
16
+ pendingInput: string;
16
17
  toggleXyzen: () => void;
17
18
  openXyzen: () => void;
18
19
  closeXyzen: () => void;
@@ -30,6 +31,8 @@ export interface UiSlice {
30
31
  setActiveSettingsCategory: (category: string) => void;
31
32
  setActiveUiSetting: (setting: UiSettingType) => void;
32
33
  setSelectedProvider: (id: string | null) => void;
34
+ setPendingInput: (input: string) => void;
35
+ submitInput: () => void;
33
36
  }
34
37
  export declare const createUiSlice: StateCreator<XyzenState, [
35
38
  ["zustand/immer", never]
@@ -5,7 +5,11 @@ export interface ToolCall {
5
5
  description?: string;
6
6
  arguments: Record<string, unknown>;
7
7
  status: "pending" | "waiting_confirmation" | "executing" | "completed" | "failed";
8
- result?: string;
8
+ result?: string | {
9
+ type: string;
10
+ content: unknown;
11
+ raw: string;
12
+ };
9
13
  error?: string;
10
14
  timestamp: string;
11
15
  }
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Test component to verify chart rendering works
4
+ */
5
+ export declare const ChartTestComponent: React.FC;
6
+ export default ChartTestComponent;
@@ -0,0 +1,78 @@
1
+ import { EChartsOption } from 'echarts';
2
+ export interface ChartDataPoint {
3
+ x: string | number;
4
+ y: number;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface SeriesData {
8
+ name: string;
9
+ data: number[] | ChartDataPoint[];
10
+ type?: 'line' | 'bar' | 'pie' | 'scatter' | 'area';
11
+ }
12
+ export interface TimeSeriesPoint {
13
+ timestamp: string | Date;
14
+ value: number;
15
+ [key: string]: unknown;
16
+ }
17
+ export interface ChartConfig {
18
+ type: 'line' | 'bar' | 'pie' | 'scatter' | 'area' | 'heatmap';
19
+ title?: string;
20
+ data: ChartDataPoint[] | SeriesData[] | TimeSeriesPoint[] | number[];
21
+ labels?: string[];
22
+ xAxis?: {
23
+ type?: 'category' | 'value' | 'time';
24
+ name?: string;
25
+ };
26
+ yAxis?: {
27
+ type?: 'category' | 'value' | 'log';
28
+ name?: string;
29
+ };
30
+ options?: Partial<EChartsOption>;
31
+ }
32
+ export interface ChartableOutput {
33
+ echarts?: EChartsOption;
34
+ chart?: ChartConfig;
35
+ data?: unknown[];
36
+ chart_type?: string;
37
+ visualization?: string;
38
+ title?: string;
39
+ description?: string;
40
+ }
41
+ export interface ChartDetectionResult {
42
+ isChartable: boolean;
43
+ chartType: ChartConfig['type'] | null;
44
+ confidence: number;
45
+ data: ChartConfig | null;
46
+ reason?: string;
47
+ }
48
+ export interface ChartTheme {
49
+ backgroundColor: string;
50
+ textColor: string;
51
+ axisColor: string;
52
+ gridColor: string;
53
+ colorPalette: string[];
54
+ }
55
+ export interface ChartRendererProps {
56
+ data: ChartConfig | EChartsOption;
57
+ theme?: 'light' | 'dark';
58
+ height?: string | number;
59
+ width?: string | number;
60
+ className?: string;
61
+ onChartReady?: (chart: unknown) => void;
62
+ }
63
+ export interface ChartDisplayProps {
64
+ data: unknown;
65
+ compact?: boolean;
66
+ variant?: 'default' | 'success' | 'error';
67
+ className?: string;
68
+ fallbackToJson?: boolean;
69
+ }
70
+ export type ChartableData = ChartDataPoint[] | SeriesData[] | TimeSeriesPoint[] | number[] | {
71
+ [key: string]: number;
72
+ }[] | EChartsOption;
73
+ export type DetectionPattern = {
74
+ name: string;
75
+ test: (data: unknown) => boolean;
76
+ transform: (data: unknown) => ChartConfig | null;
77
+ confidence: number;
78
+ };
@@ -0,0 +1,13 @@
1
+ import { ChartDetectionResult, ChartConfig } from '../types/chartTypes';
2
+ /**
3
+ * Detects if data can be rendered as a chart and transforms it accordingly
4
+ */
5
+ export declare function detectChart(data: unknown): ChartDetectionResult;
6
+ /**
7
+ * Validate that chart data is safe to render
8
+ */
9
+ export declare function validateChartData(config: ChartConfig): boolean;
10
+ /**
11
+ * Get chart type suggestions based on data characteristics
12
+ */
13
+ export declare function suggestChartType(data: unknown): ChartConfig['type'][];
@@ -0,0 +1,18 @@
1
+ import { ChartTheme } from '../types/chartTypes';
2
+ import { EChartsOption } from 'echarts';
3
+ /**
4
+ * Chart themes matching the application's design system
5
+ */
6
+ export declare const chartThemes: Record<'light' | 'dark', ChartTheme>;
7
+ /**
8
+ * Generate ECharts theme configuration
9
+ */
10
+ export declare function createEChartsTheme(theme: 'light' | 'dark'): Partial<EChartsOption>;
11
+ /**
12
+ * Hook to detect system theme preference
13
+ */
14
+ export declare function useSystemTheme(): 'light' | 'dark';
15
+ /**
16
+ * Detect theme from DOM classes (common pattern in Tailwind apps)
17
+ */
18
+ export declare function detectThemeFromDOM(): 'light' | 'dark';