@gram-ai/elements 1.1.1 → 1.2.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/dist/components/ui/popover.d.ts +7 -0
- package/dist/elements.css +1 -1
- package/dist/elements.js +4016 -3730
- package/dist/lib/models.d.ts +1 -0
- package/dist/{index-BfPvCJYI.js → models-DBbuJvSc.js} +34 -13
- package/dist/server.js +783 -782
- package/dist/types/index.d.ts +9 -7
- package/package.json +2 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MODELS } from '../lib/models';
|
|
1
2
|
import { ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -77,21 +78,20 @@ export interface ElementsConfig {
|
|
|
77
78
|
*/
|
|
78
79
|
tools?: ToolsConfig;
|
|
79
80
|
}
|
|
81
|
+
export type Model = (typeof MODELS)[number];
|
|
80
82
|
/**
|
|
81
83
|
* ModelConfig is used to configure model support in the Elements library.
|
|
82
84
|
*
|
|
83
|
-
* NOTE: Not yet implemented
|
|
84
85
|
*/
|
|
85
86
|
export interface ModelConfig {
|
|
86
|
-
/**
|
|
87
|
-
* The models available to the user.
|
|
88
|
-
* TODO: Update type
|
|
89
|
-
*/
|
|
90
|
-
availableModels: string[];
|
|
91
87
|
/**
|
|
92
88
|
* Whether to show the model picker in the composer.
|
|
93
89
|
*/
|
|
94
90
|
showModelPicker?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The default model to use for the Elements library.
|
|
93
|
+
*/
|
|
94
|
+
defaultModel?: Model;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* ToolsConfig is used to configure tool support in the Elements library.
|
|
@@ -137,7 +137,7 @@ export interface WelcomeConfig {
|
|
|
137
137
|
/**
|
|
138
138
|
* The suggestions to display when the thread is empty.
|
|
139
139
|
*/
|
|
140
|
-
suggestions
|
|
140
|
+
suggestions?: Suggestion[];
|
|
141
141
|
}
|
|
142
142
|
export interface Suggestion {
|
|
143
143
|
title: string;
|
|
@@ -173,6 +173,8 @@ export interface ComposerConfig {
|
|
|
173
173
|
}
|
|
174
174
|
export type ElementsContextType = {
|
|
175
175
|
config: ElementsConfig;
|
|
176
|
+
setModel: (model: Model) => void;
|
|
177
|
+
model: Model;
|
|
176
178
|
};
|
|
177
179
|
declare const ContentSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
178
180
|
type: z.ZodLiteral<"text">;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gram-ai/elements",
|
|
3
3
|
"description": "Gram Elements is a library of UI primitives for building chat-like experiences for MCP Servers.",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
54
54
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
55
55
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
56
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
56
57
|
"@radix-ui/react-slot": "^1.2.3",
|
|
57
58
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
58
59
|
"assistant-stream": "^0.2.42",
|