@creature-ai/sdk 0.1.1 → 0.1.2
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/core/index.d.ts +18 -3
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.d.ts +32 -3
- package/dist/react/index.js +114 -1
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/{types-DcoqlK46.d.ts → types-JBEuUzEi.d.ts} +25 -2
- package/package.json +1 -1
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* Environment types for host detection.
|
|
7
7
|
*/
|
|
8
8
|
type Environment = "chatgpt" | "mcp-apps" | "standalone";
|
|
9
|
+
/**
|
|
10
|
+
* Display modes for UI resources.
|
|
11
|
+
* - "inline": Embedded within the conversation flow
|
|
12
|
+
* - "pip": Picture-in-picture floating panel
|
|
13
|
+
* - "fullscreen": Full-screen overlay
|
|
14
|
+
*/
|
|
15
|
+
type DisplayMode = "inline" | "pip" | "fullscreen";
|
|
9
16
|
/**
|
|
10
17
|
* Log severity levels matching MCP protocol LoggingLevel.
|
|
11
18
|
* These are displayed in the host's DevConsole with appropriate colors.
|
|
@@ -75,7 +82,8 @@ interface HostContext {
|
|
|
75
82
|
styles?: {
|
|
76
83
|
variables?: Record<string, string>;
|
|
77
84
|
};
|
|
78
|
-
displayMode?:
|
|
85
|
+
displayMode?: DisplayMode;
|
|
86
|
+
availableDisplayModes?: DisplayMode[];
|
|
79
87
|
viewport?: {
|
|
80
88
|
width: number;
|
|
81
89
|
height: number;
|
|
@@ -141,6 +149,21 @@ interface HostClient {
|
|
|
141
149
|
sendNotification(method: string, params: unknown): void;
|
|
142
150
|
/** Set widget state */
|
|
143
151
|
setWidgetState(state: WidgetState | null): void;
|
|
152
|
+
/**
|
|
153
|
+
* Request a display mode change from the host.
|
|
154
|
+
*
|
|
155
|
+
* The host may refuse or coerce the request (e.g., "pip" → "fullscreen" on mobile).
|
|
156
|
+
* Always check `availableDisplayModes` in host context before calling, and handle
|
|
157
|
+
* the returned mode differing from the requested mode.
|
|
158
|
+
*
|
|
159
|
+
* @param params - Object containing the requested display mode
|
|
160
|
+
* @returns Promise resolving to the actual display mode granted by the host
|
|
161
|
+
*/
|
|
162
|
+
requestDisplayMode(params: {
|
|
163
|
+
mode: DisplayMode;
|
|
164
|
+
}): Promise<{
|
|
165
|
+
mode: DisplayMode;
|
|
166
|
+
}>;
|
|
144
167
|
/**
|
|
145
168
|
* Send a log message to the host's DevConsole.
|
|
146
169
|
*
|
|
@@ -160,4 +183,4 @@ interface HostClient {
|
|
|
160
183
|
disconnect(): void;
|
|
161
184
|
}
|
|
162
185
|
|
|
163
|
-
export type { AppSessionOptions as A, Environment as E, HostClient as H, LogLevel as L, StructuredWidgetState as S, ToolResult as T, WidgetState as W, AppSessionState as a, AppSessionListener as b, HostContext as c, HostClientConfig as d, HostClientState as e, HostClientEvents as f, StateListener as g };
|
|
186
|
+
export type { AppSessionOptions as A, DisplayMode as D, Environment as E, HostClient as H, LogLevel as L, StructuredWidgetState as S, ToolResult as T, WidgetState as W, AppSessionState as a, AppSessionListener as b, HostContext as c, HostClientConfig as d, HostClientState as e, HostClientEvents as f, StateListener as g };
|