@rodrigocoliveira/agno-react 1.0.1 → 1.0.3
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 +363 -83
- package/dist/components/GenerativeUIRenderer.d.ts +21 -0
- package/dist/components/GenerativeUIRenderer.d.ts.map +1 -0
- package/dist/context/AgnoContext.d.ts +16 -0
- package/dist/context/AgnoContext.d.ts.map +1 -0
- package/dist/context/ToolHandlerContext.d.ts +44 -0
- package/dist/context/ToolHandlerContext.d.ts.map +1 -0
- package/dist/hooks/useAgnoActions.d.ts +25 -0
- package/dist/hooks/useAgnoActions.d.ts.map +1 -0
- package/dist/hooks/useAgnoChat.d.ts +22 -0
- package/dist/hooks/useAgnoChat.d.ts.map +1 -0
- package/dist/hooks/useAgnoCustomEvents.d.ts +38 -0
- package/dist/hooks/useAgnoCustomEvents.d.ts.map +1 -0
- package/dist/hooks/useAgnoEvals.d.ts +39 -0
- package/dist/hooks/useAgnoEvals.d.ts.map +1 -0
- package/dist/hooks/useAgnoKnowledge.d.ts +56 -0
- package/dist/hooks/useAgnoKnowledge.d.ts.map +1 -0
- package/dist/hooks/useAgnoMemory.d.ts +42 -0
- package/dist/hooks/useAgnoMemory.d.ts.map +1 -0
- package/dist/hooks/useAgnoMetrics.d.ts +51 -0
- package/dist/hooks/useAgnoMetrics.d.ts.map +1 -0
- package/dist/hooks/useAgnoSession.d.ts +38 -0
- package/dist/hooks/useAgnoSession.d.ts.map +1 -0
- package/dist/hooks/useAgnoToolExecution.d.ts +70 -0
- package/dist/hooks/useAgnoToolExecution.d.ts.map +1 -0
- package/dist/hooks/useAgnoTraces.d.ts +51 -0
- package/dist/hooks/useAgnoTraces.d.ts.map +1 -0
- package/dist/index.d.ts +27 -723
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +932 -1052
- package/dist/index.js.map +24 -0
- package/dist/index.mjs +816 -909
- package/dist/index.mjs.map +24 -0
- package/dist/ui/components/artifact.d.ts +24 -0
- package/dist/ui/components/artifact.d.ts.map +1 -0
- package/dist/ui/components/audio-recorder.d.ts +32 -0
- package/dist/ui/components/audio-recorder.d.ts.map +1 -0
- package/dist/ui/components/code-block.d.ts +15 -0
- package/dist/ui/components/code-block.d.ts.map +1 -0
- package/dist/ui/components/conversation.d.ts +17 -0
- package/dist/ui/components/conversation.d.ts.map +1 -0
- package/dist/ui/components/file-preview-card.d.ts +13 -0
- package/dist/ui/components/file-preview-card.d.ts.map +1 -0
- package/dist/ui/components/file-preview-modal.d.ts +8 -0
- package/dist/ui/components/file-preview-modal.d.ts.map +1 -0
- package/dist/ui/components/image-lightbox.d.ts +12 -0
- package/dist/ui/components/image-lightbox.d.ts.map +1 -0
- package/dist/ui/components/message.d.ts +19 -0
- package/dist/ui/components/message.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/attachments.d.ts +21 -0
- package/dist/ui/components/prompt-input/attachments.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/buttons.d.ts +19 -0
- package/dist/ui/components/prompt-input/buttons.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/command.d.ts +17 -0
- package/dist/ui/components/prompt-input/command.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/context.d.ts +36 -0
- package/dist/ui/components/prompt-input/context.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/drop-zone.d.ts +7 -0
- package/dist/ui/components/prompt-input/drop-zone.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/footer.d.ts +11 -0
- package/dist/ui/components/prompt-input/footer.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/index.d.ts +25 -0
- package/dist/ui/components/prompt-input/index.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/model-select.d.ts +13 -0
- package/dist/ui/components/prompt-input/model-select.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/prompt-input.d.ts +22 -0
- package/dist/ui/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/provider.d.ts +6 -0
- package/dist/ui/components/prompt-input/provider.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/speech.d.ts +51 -0
- package/dist/ui/components/prompt-input/speech.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/tabs.d.ts +12 -0
- package/dist/ui/components/prompt-input/tabs.d.ts.map +1 -0
- package/dist/ui/components/prompt-input/textarea.d.ts +5 -0
- package/dist/ui/components/prompt-input/textarea.d.ts.map +1 -0
- package/dist/ui/components/response.d.ts +5 -0
- package/dist/ui/components/response.d.ts.map +1 -0
- package/dist/ui/components/smart-timestamp.d.ts +8 -0
- package/dist/ui/components/smart-timestamp.d.ts.map +1 -0
- package/dist/ui/components/streaming-indicator.d.ts +8 -0
- package/dist/ui/components/streaming-indicator.d.ts.map +1 -0
- package/dist/ui/components/tool.d.ts +24 -0
- package/dist/ui/components/tool.d.ts.map +1 -0
- package/dist/ui/composed/AgnoChatInput.d.ts +44 -0
- package/dist/ui/composed/AgnoChatInput.d.ts.map +1 -0
- package/dist/ui/composed/AgnoChatInterface.d.ts +49 -0
- package/dist/ui/composed/AgnoChatInterface.d.ts.map +1 -0
- package/dist/ui/composed/AgnoMessageItem.d.ts +38 -0
- package/dist/ui/composed/AgnoMessageItem.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/agno-chat.d.ts +9 -0
- package/dist/ui/composed/agno-chat/agno-chat.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/context.d.ts +33 -0
- package/dist/ui/composed/agno-chat/context.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/empty-state.d.ts +6 -0
- package/dist/ui/composed/agno-chat/empty-state.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/error-bar.d.ts +5 -0
- package/dist/ui/composed/agno-chat/error-bar.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/index.d.ts +33 -0
- package/dist/ui/composed/agno-chat/index.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/input.d.ts +39 -0
- package/dist/ui/composed/agno-chat/input.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/messages.d.ts +21 -0
- package/dist/ui/composed/agno-chat/messages.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/suggested-prompts.d.ts +7 -0
- package/dist/ui/composed/agno-chat/suggested-prompts.d.ts.map +1 -0
- package/dist/ui/composed/agno-chat/tool-status.d.ts +5 -0
- package/dist/ui/composed/agno-chat/tool-status.d.ts.map +1 -0
- package/dist/ui/composed/index.d.ts +9 -0
- package/dist/ui/composed/index.d.ts.map +1 -0
- package/dist/ui/index.d.ts +59 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/lib/cn.d.ts +3 -0
- package/dist/ui/lib/cn.d.ts.map +1 -0
- package/dist/ui/lib/file-utils.d.ts +20 -0
- package/dist/ui/lib/file-utils.d.ts.map +1 -0
- package/dist/ui/lib/format-timestamp.d.ts +16 -0
- package/dist/ui/lib/format-timestamp.d.ts.map +1 -0
- package/dist/ui/primitives/accordion.d.ts +8 -0
- package/dist/ui/primitives/accordion.d.ts.map +1 -0
- package/dist/ui/primitives/avatar.d.ts +7 -0
- package/dist/ui/primitives/avatar.d.ts.map +1 -0
- package/dist/ui/primitives/badge.d.ts +10 -0
- package/dist/ui/primitives/badge.d.ts.map +1 -0
- package/dist/ui/primitives/button.d.ts +12 -0
- package/dist/ui/primitives/button.d.ts.map +1 -0
- package/dist/ui/primitives/collapsible.d.ts +6 -0
- package/dist/ui/primitives/collapsible.d.ts.map +1 -0
- package/dist/ui/primitives/command.d.ts +79 -0
- package/dist/ui/primitives/command.d.ts.map +1 -0
- package/dist/ui/primitives/dialog.d.ts +26 -0
- package/dist/ui/primitives/dialog.d.ts.map +1 -0
- package/dist/ui/primitives/dropdown-menu.d.ts +28 -0
- package/dist/ui/primitives/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/primitives/hover-card.d.ts +7 -0
- package/dist/ui/primitives/hover-card.d.ts.map +1 -0
- package/dist/ui/primitives/index.d.ts +16 -0
- package/dist/ui/primitives/index.d.ts.map +1 -0
- package/dist/ui/primitives/input-group.d.ts +17 -0
- package/dist/ui/primitives/input-group.d.ts.map +1 -0
- package/dist/ui/primitives/select.d.ts +14 -0
- package/dist/ui/primitives/select.d.ts.map +1 -0
- package/dist/ui/primitives/tooltip.d.ts +8 -0
- package/dist/ui/primitives/tooltip.d.ts.map +1 -0
- package/dist/ui/types.d.ts +56 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +4059 -0
- package/dist/ui.js.map +60 -0
- package/dist/ui.mjs +4044 -0
- package/dist/ui.mjs.map +60 -0
- package/dist/utils/component-registry.d.ts +63 -0
- package/dist/utils/component-registry.d.ts.map +1 -0
- package/dist/utils/ui-helpers.d.ts +165 -0
- package/dist/utils/ui-helpers.d.ts.map +1 -0
- package/package.json +122 -17
- package/LICENSE +0 -21
- package/dist/index.d.mts +0 -724
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoChat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG7E;;;GAGG;AACH,wBAAgB,WAAW;;2BAyEP,MAAM,GAAG,QAAQ,YAAY;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE;;;;;;;;;;EAgDrH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CustomEventData } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* React hook to subscribe to custom events emitted by the agent backend (yielding CustomEventData).
|
|
4
|
+
*
|
|
5
|
+
* Custom events are emitted when agent yeilds data not directly related to tool execution or chat messages,
|
|
6
|
+
* through the CustomEvent API event type.
|
|
7
|
+
*
|
|
8
|
+
* @param handler - Optional callback invoked for each custom event
|
|
9
|
+
* @returns Object containing accumulated custom events and a clear function
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Collect all custom events
|
|
13
|
+
* const { events } = useAgnoCustomEvents();
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Handle events as they arrive
|
|
17
|
+
* const { events } = useAgnoCustomEvents((event) => {
|
|
18
|
+
* if (event.greeting) {
|
|
19
|
+
* showToast(event.greeting);
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Filter for specific event types
|
|
25
|
+
* const { events } = useAgnoCustomEvents();
|
|
26
|
+
* const greetings = events.filter(e => 'greeting' in e);
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Clear accumulated events
|
|
30
|
+
* const { events, clearEvents } = useAgnoCustomEvents();
|
|
31
|
+
* // Later...
|
|
32
|
+
* clearEvents();
|
|
33
|
+
*/
|
|
34
|
+
export declare function useAgnoCustomEvents(handler?: (event: CustomEventData) => void): {
|
|
35
|
+
events: CustomEventData[];
|
|
36
|
+
clearEvents: () => void;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=useAgnoCustomEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoCustomEvents.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoCustomEvents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GACzC;IACD,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CA0BA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { EvalSchema, EvalRunsListResponse, ListEvalRunsParams, ExecuteEvalRequest, UpdateEvalRunRequest } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for evaluation management
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAgnoEvals(): {
|
|
6
|
+
evalRuns: EvalSchema[];
|
|
7
|
+
pagination: import("@rodrigocoliveira/agno-types").PaginationInfo | undefined;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | undefined;
|
|
10
|
+
listEvalRuns: (listParams?: ListEvalRunsParams, options?: {
|
|
11
|
+
params?: Record<string, string>;
|
|
12
|
+
}) => Promise<EvalRunsListResponse>;
|
|
13
|
+
getEvalRun: (evalRunId: string, options?: {
|
|
14
|
+
dbId?: string;
|
|
15
|
+
table?: string;
|
|
16
|
+
params?: Record<string, string>;
|
|
17
|
+
}) => Promise<EvalSchema>;
|
|
18
|
+
executeEval: (request: ExecuteEvalRequest, options?: {
|
|
19
|
+
dbId?: string;
|
|
20
|
+
table?: string;
|
|
21
|
+
params?: Record<string, string>;
|
|
22
|
+
}) => Promise<EvalSchema>;
|
|
23
|
+
updateEvalRun: (evalRunId: string, request: UpdateEvalRunRequest, options?: {
|
|
24
|
+
dbId?: string;
|
|
25
|
+
table?: string;
|
|
26
|
+
params?: Record<string, string>;
|
|
27
|
+
}) => Promise<EvalSchema>;
|
|
28
|
+
deleteEvalRuns: (evalRunIds: string[], options?: {
|
|
29
|
+
dbId?: string;
|
|
30
|
+
table?: string;
|
|
31
|
+
params?: Record<string, string>;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
renameEvalRun: (evalRunId: string, newName: string, options?: {
|
|
34
|
+
dbId?: string;
|
|
35
|
+
table?: string;
|
|
36
|
+
params?: Record<string, string>;
|
|
37
|
+
}) => Promise<EvalSchema>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useAgnoEvals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC3E,OAAO,CAAC,UAAU,CAAC;EAqBzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { KnowledgeConfigResponse, ContentResponse, ContentStatusResponse, ContentListResponse, ContentListOptions, VectorSearchRequest, VectorSearchResponse, ContentUpdateRequest } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for knowledge management
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAgnoKnowledge(): {
|
|
6
|
+
config: KnowledgeConfigResponse | undefined;
|
|
7
|
+
content: ContentResponse[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | undefined;
|
|
10
|
+
getConfig: (options?: {
|
|
11
|
+
dbId?: string;
|
|
12
|
+
params?: Record<string, string>;
|
|
13
|
+
}) => Promise<KnowledgeConfigResponse>;
|
|
14
|
+
listContent: (listOptions?: ContentListOptions, options?: {
|
|
15
|
+
params?: Record<string, string>;
|
|
16
|
+
}) => Promise<ContentListResponse>;
|
|
17
|
+
getContent: (contentId: string, options?: {
|
|
18
|
+
dbId?: string;
|
|
19
|
+
params?: Record<string, string>;
|
|
20
|
+
}) => Promise<ContentResponse>;
|
|
21
|
+
getContentStatus: (contentId: string, options?: {
|
|
22
|
+
dbId?: string;
|
|
23
|
+
params?: Record<string, string>;
|
|
24
|
+
}) => Promise<ContentStatusResponse>;
|
|
25
|
+
search: (request: VectorSearchRequest, options?: {
|
|
26
|
+
params?: Record<string, string>;
|
|
27
|
+
}) => Promise<VectorSearchResponse>;
|
|
28
|
+
uploadContent: (data: FormData | {
|
|
29
|
+
name?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
metadata?: Record<string, unknown>;
|
|
33
|
+
file?: File;
|
|
34
|
+
text_content?: string;
|
|
35
|
+
reader_id?: string;
|
|
36
|
+
chunker?: string;
|
|
37
|
+
chunk_size?: number;
|
|
38
|
+
chunk_overlap?: number;
|
|
39
|
+
}, options?: {
|
|
40
|
+
dbId?: string;
|
|
41
|
+
params?: Record<string, string>;
|
|
42
|
+
}) => Promise<ContentResponse>;
|
|
43
|
+
updateContent: (contentId: string, request: ContentUpdateRequest, options?: {
|
|
44
|
+
dbId?: string;
|
|
45
|
+
params?: Record<string, string>;
|
|
46
|
+
}) => Promise<ContentResponse>;
|
|
47
|
+
deleteAllContent: (options?: {
|
|
48
|
+
dbId?: string;
|
|
49
|
+
params?: Record<string, string>;
|
|
50
|
+
}) => Promise<void>;
|
|
51
|
+
deleteContent: (contentId: string, options?: {
|
|
52
|
+
dbId?: string;
|
|
53
|
+
params?: Record<string, string>;
|
|
54
|
+
}) => Promise<ContentResponse>;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=useAgnoKnowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoKnowledge.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoKnowledge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,wBAAgB,gBAAgB;;;;;0BAYhB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC3D,OAAO,CAAC,uBAAuB,CAAC;gCAuBnB,kBAAkB,YACtB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,mBAAmB,CAAC;4BAuBlB,MAAM,YACP;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC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AA;KAAE,KAC3D,OAAO,CAAC,IAAI,CAAC;+BAsBH,MAAM,YACP;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC3D,OAAO,CAAC,eAAe,CAAC;EAoC9B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { UserMemory, MemoriesListResponse, ListMemoriesParams, CreateMemoryRequest, UpdateMemoryRequest, UserMemoryStatsResponse, UserMemoryStatsParams } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for memory management
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAgnoMemory(): {
|
|
6
|
+
memories: UserMemory[];
|
|
7
|
+
topics: string[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string | undefined;
|
|
10
|
+
fetchMemories: (queryParams?: ListMemoriesParams, options?: {
|
|
11
|
+
params?: Record<string, string>;
|
|
12
|
+
}) => Promise<MemoriesListResponse>;
|
|
13
|
+
getMemoryById: (memoryId: string, options?: {
|
|
14
|
+
params?: Record<string, string>;
|
|
15
|
+
table?: string;
|
|
16
|
+
}) => Promise<UserMemory>;
|
|
17
|
+
getMemoryTopics: (options?: {
|
|
18
|
+
params?: Record<string, string>;
|
|
19
|
+
table?: string;
|
|
20
|
+
}) => Promise<string[]>;
|
|
21
|
+
getUserMemoryStats: (queryParams?: UserMemoryStatsParams, options?: {
|
|
22
|
+
params?: Record<string, string>;
|
|
23
|
+
}) => Promise<UserMemoryStatsResponse>;
|
|
24
|
+
createMemory: (request: CreateMemoryRequest, options?: {
|
|
25
|
+
params?: Record<string, string>;
|
|
26
|
+
table?: string;
|
|
27
|
+
}) => Promise<UserMemory>;
|
|
28
|
+
updateMemory: (memoryId: string, request: UpdateMemoryRequest, options?: {
|
|
29
|
+
params?: Record<string, string>;
|
|
30
|
+
table?: string;
|
|
31
|
+
}) => Promise<UserMemory>;
|
|
32
|
+
deleteMemory: (memoryId: string, options?: {
|
|
33
|
+
params?: Record<string, string>;
|
|
34
|
+
table?: string;
|
|
35
|
+
}) => Promise<void>;
|
|
36
|
+
deleteMultipleMemories: (memoryIds: string[], options?: {
|
|
37
|
+
params?: Record<string, string>;
|
|
38
|
+
table?: string;
|
|
39
|
+
userId?: string;
|
|
40
|
+
}) => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=useAgnoMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoMemory.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoMemory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,wBAAgB,aAAa;;;;;kCA2DT,kBAAkB,YACtB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,oBAAoB,CAAC;8BAuBpB,MAAM,YACN;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,UAAU,CAAC;gCAqBV;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,MAAM,EAAE,CAAC;uCAuBJ,qBAAqB,YACzB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,uBAAuB,CAAC;4BAqBxB,mBAAmB,YAClB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,UAAU,CAAC;6BAqBV,MAAM,WACP,mBAAmB,YAClB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,UAAU,CAAC;6BAqBV,MAAM,YACN;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,IAAI,CAAC;wCAqBH,MAAM,EAAE,YACT;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAC7E,OAAO,CAAC,IAAI,CAAC;EA8BnB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { MetricsResponse, DayAggregatedMetrics, MetricsOptions, RefreshMetricsOptions } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for metrics management
|
|
4
|
+
*
|
|
5
|
+
* Provides methods to fetch and refresh AgentOS metrics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* function MetricsDashboard() {
|
|
10
|
+
* const {
|
|
11
|
+
* metrics,
|
|
12
|
+
* fetchMetrics,
|
|
13
|
+
* refreshMetrics,
|
|
14
|
+
* isLoading,
|
|
15
|
+
* isRefreshing,
|
|
16
|
+
* error,
|
|
17
|
+
* } = useAgnoMetrics();
|
|
18
|
+
*
|
|
19
|
+
* useEffect(() => {
|
|
20
|
+
* fetchMetrics({
|
|
21
|
+
* startingDate: '2024-01-01',
|
|
22
|
+
* endingDate: '2024-01-31',
|
|
23
|
+
* });
|
|
24
|
+
* }, [fetchMetrics]);
|
|
25
|
+
*
|
|
26
|
+
* if (isLoading) return <div>Loading metrics...</div>;
|
|
27
|
+
* if (error) return <div>Error: {error}</div>;
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <div>
|
|
31
|
+
* {metrics?.metrics.map((day) => (
|
|
32
|
+
* <div key={day.id}>
|
|
33
|
+
* <h3>{day.date}</h3>
|
|
34
|
+
* <p>Agent Runs: {day.agent_runs_count}</p>
|
|
35
|
+
* </div>
|
|
36
|
+
* ))}
|
|
37
|
+
* </div>
|
|
38
|
+
* );
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useAgnoMetrics(): {
|
|
43
|
+
metrics: MetricsResponse | undefined;
|
|
44
|
+
fetchMetrics: (options?: MetricsOptions) => Promise<MetricsResponse>;
|
|
45
|
+
refreshMetrics: (options?: RefreshMetricsOptions) => Promise<DayAggregatedMetrics[]>;
|
|
46
|
+
clearMetrics: () => void;
|
|
47
|
+
isLoading: boolean;
|
|
48
|
+
isRefreshing: boolean;
|
|
49
|
+
error: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=useAgnoMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoMetrics.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoMetrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,cAAc;;6BAcT,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;+BAyBzC,qBAAqB,KAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;;;;EAuC3E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SessionEntry, ChatMessage, AgentSessionDetailSchema, TeamSessionDetailSchema, RunSchema, TeamRunSchema, CreateSessionRequest, UpdateSessionRequest } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for session management
|
|
4
|
+
*/
|
|
5
|
+
export declare function useAgnoSession(): {
|
|
6
|
+
sessions: SessionEntry[];
|
|
7
|
+
currentSessionId: string | undefined;
|
|
8
|
+
loadSession: (sessionId: string, options?: {
|
|
9
|
+
params?: Record<string, string>;
|
|
10
|
+
}) => Promise<ChatMessage[]>;
|
|
11
|
+
fetchSessions: (options?: {
|
|
12
|
+
params?: Record<string, string>;
|
|
13
|
+
}) => Promise<SessionEntry[]>;
|
|
14
|
+
getSessionById: (sessionId: string, options?: {
|
|
15
|
+
params?: Record<string, string>;
|
|
16
|
+
}) => Promise<AgentSessionDetailSchema | TeamSessionDetailSchema>;
|
|
17
|
+
getRunById: (sessionId: string, runId: string, options?: {
|
|
18
|
+
params?: Record<string, string>;
|
|
19
|
+
}) => Promise<RunSchema | TeamRunSchema>;
|
|
20
|
+
createSession: (request?: CreateSessionRequest, options?: {
|
|
21
|
+
params?: Record<string, string>;
|
|
22
|
+
}) => Promise<AgentSessionDetailSchema | TeamSessionDetailSchema>;
|
|
23
|
+
updateSession: (sessionId: string, request: UpdateSessionRequest, options?: {
|
|
24
|
+
params?: Record<string, string>;
|
|
25
|
+
}) => Promise<AgentSessionDetailSchema | TeamSessionDetailSchema>;
|
|
26
|
+
renameSession: (sessionId: string, newName: string, options?: {
|
|
27
|
+
params?: Record<string, string>;
|
|
28
|
+
}) => Promise<AgentSessionDetailSchema | TeamSessionDetailSchema>;
|
|
29
|
+
deleteSession: (sessionId: string, options?: {
|
|
30
|
+
params?: Record<string, string>;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
deleteMultipleSessions: (sessionIds: string[], options?: {
|
|
33
|
+
params?: Record<string, string>;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
error: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=useAgnoSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,wBAAgB,cAAc;;;6BA6CR,MAAM,YAAY;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAG,OAAO,CAAC,WAAW,EAAE,CAAC;8BAqB/C;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAG,OAAO,CAAC,YAAY,EAAE,CAAC;gCAqBjG,MAAM,YACP;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;4BAqBjD,MAAM,SACV,MAAM,YACH;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC;8BAqBzB,oBAAoB,YACpB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;+BAsBjD,MAAM,WACR,oBAAoB,YACnB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;+BAqBjD,MAAM,WACR,MAAM,YACL;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;+BAqBjD,MAAM,YACP;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,IAAI,CAAC;yCAqBF,MAAM,EAAE,YACV;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAC5C,OAAO,CAAC,IAAI,CAAC;;;EA+BnB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ToolCall, CustomRenderFunction } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
/**
|
|
3
|
+
* Tool handler function type (now supports generative UI)
|
|
4
|
+
*/
|
|
5
|
+
export type ToolHandler = (args: Record<string, any>) => Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Get a custom render function by key
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCustomRender(key: string): CustomRenderFunction | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Process tool handler result and extract data/UI
|
|
12
|
+
* Exported for use in session loading UI hydration
|
|
13
|
+
*/
|
|
14
|
+
export declare function processToolResult(result: any, _tool: ToolCall): {
|
|
15
|
+
resultData: string;
|
|
16
|
+
uiComponent?: any;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Tool execution event payload
|
|
20
|
+
*/
|
|
21
|
+
export interface ToolExecutionEvent {
|
|
22
|
+
runId?: string;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
tools: ToolCall[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Hook for handling frontend tool execution (HITL)
|
|
28
|
+
*
|
|
29
|
+
* **Note:** HITL (Human-in-the-Loop) frontend tool execution is only supported for agents.
|
|
30
|
+
* Teams do not support the continue endpoint. This hook will log a warning and no-op if used with team mode.
|
|
31
|
+
*
|
|
32
|
+
* @param handlers - Map of tool names to handler functions (local handlers)
|
|
33
|
+
* @param autoExecute - Whether to automatically execute tools when paused (default: true)
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const toolHandlers = {
|
|
38
|
+
* navigate_to_page: async (args) => {
|
|
39
|
+
* window.location.href = args.url;
|
|
40
|
+
* return { success: true };
|
|
41
|
+
* },
|
|
42
|
+
* fill_form: async (args) => {
|
|
43
|
+
* document.querySelector(args.selector).value = args.value;
|
|
44
|
+
* return { filled: true };
|
|
45
|
+
* }
|
|
46
|
+
* };
|
|
47
|
+
*
|
|
48
|
+
* const { isPaused, isExecuting, pendingTools } = useAgnoToolExecution(toolHandlers);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function useAgnoToolExecution(handlers?: Record<string, ToolHandler>, autoExecute?: boolean): {
|
|
52
|
+
/** Whether the run is currently paused awaiting tool execution */
|
|
53
|
+
isPaused: boolean;
|
|
54
|
+
/** Whether tools are currently being executed */
|
|
55
|
+
isExecuting: boolean;
|
|
56
|
+
/** Tools awaiting execution */
|
|
57
|
+
pendingTools: ToolCall[];
|
|
58
|
+
/** Execute all pending tools and continue the run */
|
|
59
|
+
executeAndContinue: () => Promise<void>;
|
|
60
|
+
/** Execute specific tools and return results without continuing */
|
|
61
|
+
executeTools: (tools: ToolCall[]) => Promise<ToolCall[]>;
|
|
62
|
+
/** Continue the run with manually provided tool results */
|
|
63
|
+
continueWithResults: (tools: ToolCall[], options?: {
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
params?: Record<string, string>;
|
|
66
|
+
}) => Promise<void>;
|
|
67
|
+
/** Error from tool execution, if any */
|
|
68
|
+
executionError: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=useAgnoToolExecution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoToolExecution.d.ts","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ceNode, TraceSessionStats, ListTracesOptions, GetTraceOptions, GetTraceSessionStatsOptions } from '@rodrigocoliveira/agno-types';
|
|
2
|
+
import type { PaginatedTracesResult, PaginatedTraceSessionStatsResult } from '@rodrigocoliveira/agno-client';
|
|
3
|
+
export type { PaginatedTracesResult, PaginatedTraceSessionStatsResult };
|
|
4
|
+
/**
|
|
5
|
+
* Hook for traces management
|
|
6
|
+
*
|
|
7
|
+
* Provides methods to:
|
|
8
|
+
* - List traces with filters (fetchTraces)
|
|
9
|
+
* - Get trace detail or specific span (getTraceDetail)
|
|
10
|
+
* - Get trace session statistics (fetchTraceSessionStats)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { traces, fetchTraces, isLoading, error } = useAgnoTraces();
|
|
15
|
+
*
|
|
16
|
+
* // Fetch traces for a specific session
|
|
17
|
+
* useEffect(() => {
|
|
18
|
+
* fetchTraces({ session_id: 'my-session-id' });
|
|
19
|
+
* }, []);
|
|
20
|
+
*
|
|
21
|
+
* // Fetch traces with pagination
|
|
22
|
+
* const result = await fetchTraces({ page: 1, limit: 10 });
|
|
23
|
+
* console.log(result.pagination.total_count);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useAgnoTraces(): {
|
|
27
|
+
/** Current list of traces (from last fetchTraces call) */
|
|
28
|
+
traces: TraceSummary[];
|
|
29
|
+
/** Current trace session statistics (from last fetchTraceSessionStats call) */
|
|
30
|
+
traceSessionStats: TraceSessionStats[];
|
|
31
|
+
/** Fetch traces with optional filters and pagination */
|
|
32
|
+
fetchTraces: (options?: ListTracesOptions, requestOptions?: {
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
params?: Record<string, string>;
|
|
35
|
+
}) => Promise<PaginatedTracesResult>;
|
|
36
|
+
/** Get trace detail or specific span */
|
|
37
|
+
getTraceDetail: (traceId: string, options?: GetTraceOptions, requestOptions?: {
|
|
38
|
+
headers?: Record<string, string>;
|
|
39
|
+
params?: Record<string, string>;
|
|
40
|
+
}) => Promise<TraceDetail | TraceNode>;
|
|
41
|
+
/** Fetch trace session statistics */
|
|
42
|
+
fetchTraceSessionStats: (options?: GetTraceSessionStatsOptions, requestOptions?: {
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
params?: Record<string, string>;
|
|
45
|
+
}) => Promise<PaginatedTraceSessionStatsResult>;
|
|
46
|
+
/** Loading state */
|
|
47
|
+
isLoading: boolean;
|
|
48
|
+
/** Error message if last operation failed */
|
|
49
|
+
error: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=useAgnoTraces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgnoTraces.d.ts","sourceRoot":"","sources":["../../src/hooks/useAgnoTraces.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,qBAAqB,EACrB,gCAAgC,EACjC,MAAM,+BAA+B,CAAC;AAIvC,YAAY,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa;IAmHzB,0DAA0D;;IAE1D,+EAA+E;;IAE/E,wDAAwD;4BAnF7C,iBAAiB,mBACT;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KACrF,OAAO,CAAC,qBAAqB,CAAC;IAmFjC,wCAAwC;8BAvD7B,MAAM,YACN,eAAe,mBACP;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KACrF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAsDnC,qCAAqC;uCA7B1B,2BAA2B,mBACnB;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KACrF,OAAO,CAAC,gCAAgC,CAAC;IA6B5C,oBAAoB;;IAEpB,6CAA6C;;EAGhD"}
|