@rodrigocoliveira/agno-react 2.0.0 → 2.1.0
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/README.md +1 -1
- package/dist/hooks/useAgnoToolExecution.d.ts +7 -11
- package/dist/hooks/useAgnoToolExecution.d.ts.map +1 -1
- package/dist/index.d.ts +3 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +645 -986
- package/dist/index.js.map +7 -10
- package/dist/index.mjs +564 -905
- package/dist/index.mjs.map +7 -10
- package/dist/ui/components/chart.d.ts +63 -0
- package/dist/ui/components/chart.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/agno-chat.d.ts +6 -4
- package/dist/ui/composed/agno-chat/agno-chat.d.ts.map +1 -1
- package/dist/ui/composed/agno-chat/tool-building-blocks.d.ts +0 -4
- package/dist/ui/composed/agno-chat/tool-building-blocks.d.ts.map +1 -1
- package/dist/ui/composed/agno-message/tools.d.ts.map +1 -1
- package/dist/ui/composed/generative-components/card-grid.d.ts +4 -0
- package/dist/ui/composed/generative-components/card-grid.d.ts.map +1 -0
- package/dist/ui/composed/generative-components/charts.d.ts +7 -0
- package/dist/ui/composed/generative-components/charts.d.ts.map +1 -0
- package/dist/ui/composed/index.d.ts +6 -2
- package/dist/ui/composed/index.d.ts.map +1 -1
- package/dist/ui/index.d.ts +8 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui.js +586 -424
- package/dist/ui.js.map +9 -11
- package/dist/ui.mjs +606 -430
- package/dist/ui.mjs.map +9 -11
- package/package.json +8 -3
- package/dist/components/GenerativeUIRenderer.d.ts +0 -21
- package/dist/components/GenerativeUIRenderer.d.ts.map +0 -1
- package/dist/utils/component-registry.d.ts +0 -63
- package/dist/utils/component-registry.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rodrigocoliveira/agno-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "React hooks and pre-built UI components for Agno client",
|
|
5
5
|
"author": "rodrigocoliveira",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rodrigocoliveira/agno-client": "2.
|
|
50
|
-
"@rodrigocoliveira/agno-types": "2.
|
|
49
|
+
"@rodrigocoliveira/agno-client": "2.1.0",
|
|
50
|
+
"@rodrigocoliveira/agno-types": "2.1.0"
|
|
51
51
|
},
|
|
52
52
|
"typesVersions": {
|
|
53
53
|
"*": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"lucide-react": ">=0.400.0",
|
|
73
73
|
"react": "^18.0.0 || ^19.0.0",
|
|
74
74
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
75
|
+
"recharts": "^2.0.0 || ^3.0.0",
|
|
75
76
|
"shiki": "^1.0.0 || ^2.0.0 || ^3.0.0",
|
|
76
77
|
"streamdown": ">=1.3.0",
|
|
77
78
|
"tailwind-merge": "^2.0.0 || ^3.0.0",
|
|
@@ -131,6 +132,9 @@
|
|
|
131
132
|
},
|
|
132
133
|
"cmdk": {
|
|
133
134
|
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"recharts": {
|
|
137
|
+
"optional": true
|
|
134
138
|
}
|
|
135
139
|
},
|
|
136
140
|
"devDependencies": {
|
|
@@ -150,6 +154,7 @@
|
|
|
150
154
|
"cmdk": "^1.1.1",
|
|
151
155
|
"lucide-react": "^0.563.0",
|
|
152
156
|
"react": "^19.2.1",
|
|
157
|
+
"recharts": "^2.15.4",
|
|
153
158
|
"shiki": "^3.2.1",
|
|
154
159
|
"streamdown": "^2.2.0",
|
|
155
160
|
"tailwind-merge": "^3.0.2",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generative UI Renderer
|
|
3
|
-
*
|
|
4
|
-
* Renders UI components based on specifications from the agent.
|
|
5
|
-
* Supports both registry-based components and custom render functions.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { UIComponentSpec } from '@rodrigocoliveira/agno-types';
|
|
9
|
-
export interface GenerativeUIRendererProps {
|
|
10
|
-
/** The UI component specification to render */
|
|
11
|
-
spec: UIComponentSpec;
|
|
12
|
-
/** Optional className for styling */
|
|
13
|
-
className?: string;
|
|
14
|
-
/** Error boundary fallback */
|
|
15
|
-
onError?: (error: Error) => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Main Generative UI Renderer component
|
|
19
|
-
*/
|
|
20
|
-
export declare function GenerativeUIRenderer({ spec, className, onError, }: GenerativeUIRendererProps): React.ReactElement;
|
|
21
|
-
//# sourceMappingURL=GenerativeUIRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenerativeUIRenderer.d.ts","sourceRoot":"","sources":["../../src/components/GenerativeUIRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,MAAM,WAAW,yBAAyB;IACxC,+CAA+C;IAC/C,IAAI,EAAE,eAAe,CAAC;IACtB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAuCD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,SAAS,EACT,OAAO,GACR,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAmIhD"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Registry for Generative UI
|
|
3
|
-
*
|
|
4
|
-
* Maps component specifications to actual React components.
|
|
5
|
-
* Allows registering custom components at runtime.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Component renderer function type
|
|
9
|
-
*/
|
|
10
|
-
export type ComponentRenderer = (props: any) => any;
|
|
11
|
-
/**
|
|
12
|
-
* Component registry class
|
|
13
|
-
*/
|
|
14
|
-
export declare class ComponentRegistry {
|
|
15
|
-
private static instance;
|
|
16
|
-
private components;
|
|
17
|
-
private constructor();
|
|
18
|
-
/**
|
|
19
|
-
* Get the singleton instance
|
|
20
|
-
*/
|
|
21
|
-
static getInstance(): ComponentRegistry;
|
|
22
|
-
/**
|
|
23
|
-
* Register a component renderer
|
|
24
|
-
*/
|
|
25
|
-
register(type: string, renderer: ComponentRenderer): void;
|
|
26
|
-
/**
|
|
27
|
-
* Register multiple components at once
|
|
28
|
-
*/
|
|
29
|
-
registerBatch(components: Record<string, ComponentRenderer>): void;
|
|
30
|
-
/**
|
|
31
|
-
* Get a registered component renderer
|
|
32
|
-
*/
|
|
33
|
-
get(type: string): ComponentRenderer | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Check if a component is registered
|
|
36
|
-
*/
|
|
37
|
-
has(type: string): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Unregister a component
|
|
40
|
-
*/
|
|
41
|
-
unregister(type: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* Get all registered component types
|
|
44
|
-
*/
|
|
45
|
-
getRegisteredTypes(): string[];
|
|
46
|
-
/**
|
|
47
|
-
* Clear all registered components
|
|
48
|
-
*/
|
|
49
|
-
clear(): void;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get the global component registry instance
|
|
53
|
-
*/
|
|
54
|
-
export declare function getComponentRegistry(): ComponentRegistry;
|
|
55
|
-
/**
|
|
56
|
-
* Helper to register a chart component
|
|
57
|
-
*/
|
|
58
|
-
export declare function registerChartComponent(name: string, renderer: ComponentRenderer): void;
|
|
59
|
-
/**
|
|
60
|
-
* Helper to get a chart component
|
|
61
|
-
*/
|
|
62
|
-
export declare function getChartComponent(name: string): ComponentRenderer | undefined;
|
|
63
|
-
//# sourceMappingURL=component-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../src/utils/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAEpD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoB;IAC3C,OAAO,CAAC,UAAU,CAA6C;IAE/D,OAAO;IAIP;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,iBAAiB;IAOvC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAIzD;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,IAAI;IAMlE;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAIhD;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI9B;;OAEG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAEtF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE7E"}
|