@assistant-ui/react 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +6 -15
- package/dist/AssistantRuntime-BM_jVV3g.d.mts +0 -23
- package/dist/AssistantRuntime-CBMSAJqH.d.mts +0 -23
- package/dist/AssistantRuntime-C_BvM7ZT.d.ts +0 -23
- package/dist/AssistantRuntime-DELpXWfG.d.ts +0 -23
- package/dist/ModelConfigTypes-B9UY4zxv.d.mts +0 -55
- package/dist/ModelConfigTypes-B9UY4zxv.d.ts +0 -55
- package/dist/ModelConfigTypes-BF5HxVrH.d.mts +0 -55
- package/dist/ModelConfigTypes-BF5HxVrH.d.ts +0 -55
- package/dist/ModelConfigTypes-Cf3yjaDu.d.mts +0 -55
- package/dist/ModelConfigTypes-Cf3yjaDu.d.ts +0 -55
- package/dist/ModelConfigTypes-CzmXY3sn.d.mts +0 -55
- package/dist/ModelConfigTypes-CzmXY3sn.d.ts +0 -55
- package/dist/Thread-BMASJT4a.d.ts +0 -15
- package/dist/Thread-UEVsUmvl.d.mts +0 -15
- package/dist/chunk-3XZUKECF.mjs +0 -207
- package/dist/chunk-3XZUKECF.mjs.map +0 -1
- package/dist/chunk-4DQ2CIAD.mjs +0 -69
- package/dist/chunk-4DQ2CIAD.mjs.map +0 -1
- package/dist/chunk-5YONSDN4.mjs +0 -200
- package/dist/chunk-5YONSDN4.mjs.map +0 -1
- package/dist/chunk-CY4TTHR7.mjs +0 -76
- package/dist/chunk-CY4TTHR7.mjs.map +0 -1
- package/dist/chunk-DKAWDNW5.mjs +0 -22
- package/dist/chunk-DKAWDNW5.mjs.map +0 -1
- package/dist/chunk-GQKH2ADD.mjs +0 -165
- package/dist/chunk-GQKH2ADD.mjs.map +0 -1
- package/dist/chunk-J5LGTIGS.mjs +0 -10
- package/dist/chunk-J5LGTIGS.mjs.map +0 -1
- package/dist/chunk-NSBOH42A.mjs +0 -200
- package/dist/chunk-NSBOH42A.mjs.map +0 -1
- package/dist/chunk-X4HBDEFP.mjs +0 -30
- package/dist/chunk-X4HBDEFP.mjs.map +0 -1
- package/dist/experimental.d.mts +0 -86
- package/dist/experimental.d.ts +0 -86
- package/dist/experimental.js +0 -123
- package/dist/experimental.js.map +0 -1
- package/dist/experimental.mjs +0 -34
- package/dist/experimental.mjs.map +0 -1
- package/dist/index.d.mts +0 -289
- package/dist/index.d.ts +0 -289
- package/dist/index.js +0 -1500
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1245
- package/dist/index.mjs.map +0 -1
- package/dist/internal-dlLjX30u.d.mts +0 -75
- package/dist/internal-dlLjX30u.d.ts +0 -75
- package/dist/internal.d.mts +0 -25
- package/dist/internal.d.ts +0 -25
- package/dist/internal.js +0 -225
- package/dist/internal.js.map +0 -1
- package/dist/internal.mjs +0 -10
- package/dist/internal.mjs.map +0 -1
package/package.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
"conversational-ui",
|
30
30
|
"conversational-ai"
|
31
31
|
],
|
32
|
-
"version": "0.1.
|
32
|
+
"version": "0.1.3",
|
33
33
|
"license": "MIT",
|
34
34
|
"exports": {
|
35
35
|
".": {
|
@@ -42,16 +42,6 @@
|
|
42
42
|
"default": "./dist/index.js"
|
43
43
|
}
|
44
44
|
},
|
45
|
-
"./internal": {
|
46
|
-
"import": {
|
47
|
-
"types": "./dist/internal.d.mts",
|
48
|
-
"default": "./dist/internal.mjs"
|
49
|
-
},
|
50
|
-
"require": {
|
51
|
-
"types": "./dist/internal.d.ts",
|
52
|
-
"default": "./dist/internal.js"
|
53
|
-
}
|
54
|
-
},
|
55
45
|
"./experimental": {
|
56
46
|
"import": {
|
57
47
|
"types": "./dist/experimental.d.mts",
|
@@ -92,15 +82,16 @@
|
|
92
82
|
"optional": true
|
93
83
|
}
|
94
84
|
},
|
95
|
-
"publishConfig": {
|
96
|
-
"access": "public"
|
97
|
-
},
|
98
85
|
"devDependencies": {
|
99
86
|
"@ai-sdk/react": "^0.0.2",
|
100
87
|
"@types/node": "^20.14.2",
|
101
88
|
"tsup": "^8.1.0",
|
102
89
|
"@assistant-ui/tsconfig": "0.0.0"
|
103
90
|
},
|
91
|
+
"publishConfig": {
|
92
|
+
"access": "public",
|
93
|
+
"provenance": true
|
94
|
+
},
|
104
95
|
"homepage": "https://assistant-ui.com/",
|
105
96
|
"repository": {
|
106
97
|
"type": "git",
|
@@ -110,7 +101,7 @@
|
|
110
101
|
"url": "https://github.com/Yonom/assistant-ui/issues"
|
111
102
|
},
|
112
103
|
"scripts": {
|
113
|
-
"build": "tsup src/index.ts src/
|
104
|
+
"build": "tsup src/index.ts src/experimental.ts --format cjs,esm --dts --sourcemap",
|
114
105
|
"prepublish": "cp ../../README.md ./README.md"
|
115
106
|
}
|
116
107
|
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { c as ThreadMessage, d as AppendMessage, b as ModelConfigProvider } from './ModelConfigTypes-BF5HxVrH.mjs';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
type ThreadRuntime = Readonly<ThreadState & {
|
16
|
-
subscribe: (callback: () => void) => Unsubscribe;
|
17
|
-
}>;
|
18
|
-
|
19
|
-
type AssistantRuntime = ThreadRuntime & {
|
20
|
-
registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
|
21
|
-
};
|
22
|
-
|
23
|
-
export type { AssistantRuntime as A, ThreadRuntime as T, Unsubscribe as U, ThreadState as a };
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { b as ThreadMessage, d as AppendMessage, h as ModelConfigProvider } from './ModelConfigTypes-B9UY4zxv.mjs';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
type ThreadRuntime = Readonly<ThreadState & {
|
16
|
-
subscribe: (callback: () => void) => Unsubscribe;
|
17
|
-
}>;
|
18
|
-
|
19
|
-
type AssistantRuntime = ThreadRuntime & {
|
20
|
-
registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
|
21
|
-
};
|
22
|
-
|
23
|
-
export type { AssistantRuntime as A, ThreadRuntime as T, Unsubscribe as U, ThreadState as a };
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { b as ThreadMessage, d as AppendMessage, h as ModelConfigProvider } from './ModelConfigTypes-B9UY4zxv.js';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
type ThreadRuntime = Readonly<ThreadState & {
|
16
|
-
subscribe: (callback: () => void) => Unsubscribe;
|
17
|
-
}>;
|
18
|
-
|
19
|
-
type AssistantRuntime = ThreadRuntime & {
|
20
|
-
registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
|
21
|
-
};
|
22
|
-
|
23
|
-
export type { AssistantRuntime as A, ThreadRuntime as T, Unsubscribe as U, ThreadState as a };
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { c as ThreadMessage, d as AppendMessage, b as ModelConfigProvider } from './ModelConfigTypes-BF5HxVrH.js';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
type ThreadRuntime = Readonly<ThreadState & {
|
16
|
-
subscribe: (callback: () => void) => Unsubscribe;
|
17
|
-
}>;
|
18
|
-
|
19
|
-
type AssistantRuntime = ThreadRuntime & {
|
20
|
-
registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
|
21
|
-
};
|
22
|
-
|
23
|
-
export type { AssistantRuntime as A, ThreadRuntime as T, Unsubscribe as U, ThreadState as a };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantMessage as A, ImageContentPart as I, ModelConfig as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, UserMessage as c, AppendMessage as d, AssistantContentPart as e, UserContentPart as f, AppendContentPart as g, ModelConfigProvider as h };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantMessage as A, ImageContentPart as I, ModelConfig as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, UserMessage as c, AppendMessage as d, AssistantContentPart as e, UserContentPart as f, AppendContentPart as g, ModelConfigProvider as h };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantContentPart as A, ImageContentPart as I, ModelConfig as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ModelConfigProvider as b, ThreadMessage as c, AppendMessage as d, AssistantMessage as e, UserMessage as f, UserContentPart as g, AppendContentPart as h };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantContentPart as A, ImageContentPart as I, ModelConfig as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ModelConfigProvider as b, ThreadMessage as c, AppendMessage as d, AssistantMessage as e, UserMessage as f, UserContentPart as g, AppendContentPart as h };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AppendMessage as A, ImageContentPart as I, ModelConfigProvider as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, ModelConfig as c };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AppendMessage as A, ImageContentPart as I, ModelConfigProvider as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, ModelConfig as c };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantContentPart as A, ImageContentPart as I, ModelConfigProvider as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, ModelConfig as c, AppendMessage as d, AssistantMessage as e, UserMessage as f, UserContentPart as g, AppendContentPart as h };
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
type TextContentPart = {
|
5
|
-
type: "text";
|
6
|
-
text: string;
|
7
|
-
};
|
8
|
-
type ImageContentPart = {
|
9
|
-
type: "image";
|
10
|
-
image: string;
|
11
|
-
};
|
12
|
-
type UIContentPart = {
|
13
|
-
type: "ui";
|
14
|
-
display: ReactNode;
|
15
|
-
};
|
16
|
-
type ToolCallContentPart = {
|
17
|
-
type: "tool-call";
|
18
|
-
name: string;
|
19
|
-
args: object;
|
20
|
-
result?: object;
|
21
|
-
};
|
22
|
-
type UserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
23
|
-
type AssistantContentPart = TextContentPart | UIContentPart | ToolCallContentPart;
|
24
|
-
type AppendContentPart = TextContentPart | ImageContentPart;
|
25
|
-
type BaseMessage = {
|
26
|
-
id: string;
|
27
|
-
createdAt: Date;
|
28
|
-
};
|
29
|
-
type UserMessage = BaseMessage & {
|
30
|
-
role: "user";
|
31
|
-
content: UserContentPart[];
|
32
|
-
};
|
33
|
-
type AssistantMessage = BaseMessage & {
|
34
|
-
role: "assistant";
|
35
|
-
content: AssistantContentPart[];
|
36
|
-
status: "in_progress" | "done" | "error";
|
37
|
-
};
|
38
|
-
type AppendMessage = {
|
39
|
-
parentId: string | null;
|
40
|
-
content: AppendContentPart[];
|
41
|
-
};
|
42
|
-
type ThreadMessage = UserMessage | AssistantMessage;
|
43
|
-
|
44
|
-
type Tool<TArgs> = {
|
45
|
-
description: string;
|
46
|
-
parameters: z.ZodSchema<TArgs>;
|
47
|
-
execute: (args: TArgs) => unknown;
|
48
|
-
};
|
49
|
-
type ModelConfig = {
|
50
|
-
system?: string;
|
51
|
-
tools?: Record<string, Tool<any>>;
|
52
|
-
};
|
53
|
-
type ModelConfigProvider = () => ModelConfig;
|
54
|
-
|
55
|
-
export type { AssistantContentPart as A, ImageContentPart as I, ModelConfigProvider as M, TextContentPart as T, UIContentPart as U, ToolCallContentPart as a, ThreadMessage as b, ModelConfig as c, AppendMessage as d, AssistantMessage as e, UserMessage as f, UserContentPart as g, AppendContentPart as h };
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { b as ThreadMessage, d as AppendMessage } from './ModelConfigTypes-CzmXY3sn.js';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
export type { ThreadState as T, Unsubscribe as U };
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { b as ThreadMessage, d as AppendMessage } from './ModelConfigTypes-CzmXY3sn.mjs';
|
2
|
-
|
3
|
-
type Unsubscribe = () => void;
|
4
|
-
|
5
|
-
type ThreadState = {
|
6
|
-
messages: readonly ThreadMessage[];
|
7
|
-
isRunning: boolean;
|
8
|
-
getBranches: (messageId: string) => readonly string[];
|
9
|
-
switchToBranch: (branchId: string) => void;
|
10
|
-
append: (message: AppendMessage) => void;
|
11
|
-
startRun: (parentId: string | null) => void;
|
12
|
-
cancelRun: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
export type { ThreadState as T, Unsubscribe as U };
|