@fencyai/react 0.1.93 → 0.1.94
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/hooks/useAgentTasks/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2030 -1866
- package/dist/types/CreateAgentTaskParams.d.ts +3 -0
- package/dist/types/CreateAgentTaskResponse.d.ts +9 -0
- package/dist/types/FencyContext.d.ts +2 -2
- package/dist/types/StreamData.d.ts +8 -1
- package/dist/types/StreamingAgentTask.d.ts +15 -0
- package/dist/types/StreamingAgentTaskData.d.ts +5 -0
- package/dist/types/UseAgentTasks.d.ts +8 -0
- package/dist/types/UseAgentTasksProps.d.ts +9 -0
- package/dist/types/UseStream.d.ts +2 -2
- package/dist/types/UseStreamProps.d.ts +2 -1
- package/dist/types/index.d.ts +6 -0
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FencyInstance, Stream } from '@fencyai/js';
|
|
2
2
|
export interface StreamCache {
|
|
3
3
|
stream: Stream;
|
|
4
4
|
createdAt: number;
|
|
@@ -8,5 +8,5 @@ export interface FencyContext {
|
|
|
8
8
|
loading: boolean;
|
|
9
9
|
error: Error | null;
|
|
10
10
|
activeStream: StreamCache | null;
|
|
11
|
-
getOrCreateStream: (
|
|
11
|
+
getOrCreateStream: (maxAge?: number) => Promise<Stream>;
|
|
12
12
|
}
|
|
@@ -55,4 +55,11 @@ export type FileSearchIndexReady = {
|
|
|
55
55
|
fileId: string;
|
|
56
56
|
timestamp: string;
|
|
57
57
|
};
|
|
58
|
-
export type
|
|
58
|
+
export type NewAgentTaskReasoningChunk = {
|
|
59
|
+
type: 'NewAgentTaskReasoningChunk';
|
|
60
|
+
streamId: string;
|
|
61
|
+
agentTaskId: string;
|
|
62
|
+
timestamp: string;
|
|
63
|
+
content: string;
|
|
64
|
+
};
|
|
65
|
+
export type StreamData = NewChatCompletionStreamChunk | ChatCompletionStreamCompleted | StreamTimeout | StreamNotFound | FileUploadCompleted | FileTextContentReady | WebsiteHtmlContentReady | WebsiteTextContentReady | FileSearchIndexReady | NewAgentTaskReasoningChunk;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiError } from '@fencyai/js';
|
|
2
|
+
import { CreateAgentTaskParams } from './CreateAgentTaskParams';
|
|
3
|
+
import { NewAgentTaskReasoningChunk } from './StreamData';
|
|
4
|
+
import { StreamingAgentTaskData } from './StreamingAgentTaskData';
|
|
5
|
+
export interface StreamingAgentTask {
|
|
6
|
+
streamId: string;
|
|
7
|
+
triggeredAt: string;
|
|
8
|
+
data: StreamingAgentTaskData | null;
|
|
9
|
+
error: ApiError | null;
|
|
10
|
+
prompt: CreateAgentTaskParams;
|
|
11
|
+
response: string;
|
|
12
|
+
chunks: NewAgentTaskReasoningChunk[];
|
|
13
|
+
loading: boolean;
|
|
14
|
+
doneStreaming: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CreateAgentTaskParams } from './CreateAgentTaskParams';
|
|
2
|
+
import { CreateAgentTaskResponse } from './CreateAgentTaskResponse';
|
|
3
|
+
import { StreamingAgentTask } from './StreamingAgentTask';
|
|
4
|
+
export interface UseAgentTasks {
|
|
5
|
+
agentTasks: StreamingAgentTask[];
|
|
6
|
+
createAgentTask: (params: CreateAgentTaskParams) => Promise<CreateAgentTaskResponse>;
|
|
7
|
+
latest?: StreamingAgentTask;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NewAgentTaskReasoningChunk, StreamNotFound, StreamTimeout } from './StreamData';
|
|
2
|
+
import { StreamError } from './StreamError';
|
|
3
|
+
export interface UseAgentTasksProps {
|
|
4
|
+
onAgentTaskReasoningChunk?: (streamData: NewAgentTaskReasoningChunk) => void;
|
|
5
|
+
onAgentTaskCompleted?: (streamId: string) => void;
|
|
6
|
+
onStreamError?: (error: StreamError) => void;
|
|
7
|
+
onStreamNotFound?: (error: StreamNotFound) => void;
|
|
8
|
+
onStreamTimeout?: (error: StreamTimeout) => void;
|
|
9
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Stream } from '@fencyai/js';
|
|
2
2
|
import { CreateStreamResponse } from './CreateStreamResponse';
|
|
3
3
|
export interface UseStream {
|
|
4
|
-
createStream: (
|
|
4
|
+
createStream: () => Promise<CreateStreamResponse>;
|
|
5
5
|
stream: Stream | null;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatCompletionStreamCompleted, NewChatCompletionStreamChunk, StreamNotFound, StreamTimeout, FileUploadCompleted, FileTextContentReady, WebsiteHtmlContentReady, WebsiteTextContentReady, FileSearchIndexReady } from './StreamData';
|
|
1
|
+
import { ChatCompletionStreamCompleted, NewChatCompletionStreamChunk, StreamNotFound, StreamTimeout, FileUploadCompleted, FileTextContentReady, WebsiteHtmlContentReady, WebsiteTextContentReady, FileSearchIndexReady, NewAgentTaskReasoningChunk } from './StreamData';
|
|
2
2
|
import { StreamError } from './StreamError';
|
|
3
3
|
export interface UseStreamProps {
|
|
4
4
|
onNewChatCompletionStreamChunk?: (streamData: NewChatCompletionStreamChunk) => void;
|
|
@@ -10,5 +10,6 @@ export interface UseStreamProps {
|
|
|
10
10
|
onWebsiteHtmlContentReady?: (error: WebsiteHtmlContentReady) => void;
|
|
11
11
|
onWebsiteTextContentReady?: (error: WebsiteTextContentReady) => void;
|
|
12
12
|
onFileSearchIndexReady?: (error: FileSearchIndexReady) => void;
|
|
13
|
+
onNewAgentTaskReasoningChunk?: (error: NewAgentTaskReasoningChunk) => void;
|
|
13
14
|
onStreamError?: (error: StreamError) => void;
|
|
14
15
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export * from './CreateStreamResponse';
|
|
|
23
23
|
export * from './StreamError';
|
|
24
24
|
export * from './UseStream';
|
|
25
25
|
export * from './UseStreamProps';
|
|
26
|
+
export * from './CreateAgentTaskParams';
|
|
27
|
+
export * from './CreateAgentTaskResponse';
|
|
28
|
+
export * from './StreamingAgentTask';
|
|
29
|
+
export * from './StreamingAgentTaskData';
|
|
30
|
+
export * from './UseAgentTasks';
|
|
31
|
+
export * from './UseAgentTasksProps';
|
|
26
32
|
export * from './ListMemoryTypesPage';
|
|
27
33
|
export * from './ListMemoryTypesParams';
|
|
28
34
|
export * from './ListMemoryTypesResult';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.94",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@fencyai/js": "^0.1.
|
|
35
|
+
"@fencyai/js": "^0.1.94",
|
|
36
36
|
"@types/jest": "^29.5.11",
|
|
37
37
|
"@types/node": "^20.10.5",
|
|
38
38
|
"@types/react": "^18.2.45",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@fencyai/js": "^0.1.
|
|
49
|
+
"@fencyai/js": "^0.1.94",
|
|
50
50
|
"@radix-ui/react-popover": "^1.1.15",
|
|
51
51
|
"react": ">=16.8.0",
|
|
52
52
|
"react-markdown": "^10.1.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"optional": false
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "51cd3642df31bd1fe84bfce6a7f1c128560cd83f"
|
|
64
64
|
}
|