@copilotkit/bot-ui 0.0.1 → 0.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/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -8,11 +8,49 @@ export interface PlatformUser {
|
|
|
8
8
|
handle?: string;
|
|
9
9
|
email?: string;
|
|
10
10
|
}
|
|
11
|
+
/** A base64 data source, shared by every binary media part. */
|
|
12
|
+
export type MediaDataSource = {
|
|
13
|
+
type: "data";
|
|
14
|
+
value: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* AG-UI multimodal content parts. Defined here (the lowest shared layer) so
|
|
19
|
+
* platform adapters can carry built multimodal content through the framework
|
|
20
|
+
* to the agent without a circular dependency — `@copilotkit/bot` depends on
|
|
21
|
+
* `@copilotkit/bot-ui`, not the reverse. Identical in shape to bot-slack's so
|
|
22
|
+
* the agent sees the same multimodal input across every adapter.
|
|
23
|
+
*
|
|
24
|
+
* Binary media (image/audio/video/document) is passed straight through as a
|
|
25
|
+
* data part; the agent's model decides what it can actually consume.
|
|
26
|
+
*/
|
|
27
|
+
export type AgentContentPart = {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: "image";
|
|
32
|
+
source: MediaDataSource;
|
|
33
|
+
} | {
|
|
34
|
+
type: "audio";
|
|
35
|
+
source: MediaDataSource;
|
|
36
|
+
} | {
|
|
37
|
+
type: "video";
|
|
38
|
+
source: MediaDataSource;
|
|
39
|
+
} | {
|
|
40
|
+
type: "document";
|
|
41
|
+
source: MediaDataSource;
|
|
42
|
+
};
|
|
11
43
|
export interface IncomingMessage {
|
|
12
44
|
text: string;
|
|
13
45
|
user: PlatformUser;
|
|
14
46
|
ref: MessageRef;
|
|
15
47
|
platform: string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional multimodal content parts (e.g. inbound image/file attachments)
|
|
50
|
+
* built by the adapter. When present, the app should prefer these over
|
|
51
|
+
* `text` as the agent prompt so the model receives the attachments.
|
|
52
|
+
*/
|
|
53
|
+
contentParts?: AgentContentPart[];
|
|
16
54
|
}
|
|
17
55
|
export interface ThreadMessage {
|
|
18
56
|
user?: PlatformUser;
|
|
@@ -48,6 +86,21 @@ export interface Thread {
|
|
|
48
86
|
getMessages(): Promise<ThreadMessage[]>;
|
|
49
87
|
/** Resolve a platform user by a free-form query (capability-gated; returns `undefined` when unsupported). */
|
|
50
88
|
lookupUser(query: string): Promise<PlatformUser | undefined>;
|
|
89
|
+
/** Pin suggested prompts (capability-gated; returns `{ ok: false }` on surfaces without support). */
|
|
90
|
+
setSuggestedPrompts(prompts: ReadonlyArray<{
|
|
91
|
+
title: string;
|
|
92
|
+
message: string;
|
|
93
|
+
}>, opts?: {
|
|
94
|
+
title?: string;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
ok: boolean;
|
|
97
|
+
error?: string;
|
|
98
|
+
}>;
|
|
99
|
+
/** Name this conversation (capability-gated; returns `{ ok: false }` on surfaces without support). */
|
|
100
|
+
setTitle(title: string): Promise<{
|
|
101
|
+
ok: boolean;
|
|
102
|
+
error?: string;
|
|
103
|
+
}>;
|
|
51
104
|
}
|
|
52
105
|
export interface InteractionContext<TValue = unknown> {
|
|
53
106
|
thread: Thread;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KA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O,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAC7D,qGAAqG;IACrG,mBAAmB,CACjB,OAAO,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EAC1D,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GACxB,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AACD,MAAM,WAAW,kBAAkB,CAAC,MAAM,GAAG,OAAO;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,2FAA2F;IAC3F,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,YAAY,CAAC,MAAM,GAAG,OAAO,IAAI,CAC3C,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAC5B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/bot-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "JSX runtime, IR, and cross-platform component vocabulary for CopilotKit bots.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@copilotkit/shared": "^1.
|
|
45
|
+
"@copilotkit/shared": "^1.61.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.10.0",
|