@superatomai/application-react 0.0.1-node12 → 0.0.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/index.cjs +1674 -1109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +252 -18
- package/dist/index.d.ts +252 -18
- package/dist/index.js +1671 -1110
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { Component as Component$1, ReactNode } from 'react';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
declare const ExpressionSchema$1: z.ZodObject<{
|
|
@@ -244,6 +245,36 @@ declare const UserPromptRequestMessageSchema: z.ZodObject<{
|
|
|
244
245
|
}, z.core.$strip>;
|
|
245
246
|
}, z.core.$strip>;
|
|
246
247
|
type UserPromptRequestMessage = z.infer<typeof UserPromptRequestMessageSchema>;
|
|
248
|
+
/**
|
|
249
|
+
* User prompt abort request payload schema
|
|
250
|
+
* Synced with sdk-nodejs: UserPromptAbortRequestPayloadSchema
|
|
251
|
+
*/
|
|
252
|
+
declare const UserPromptAbortRequestPayloadSchema: z.ZodObject<{
|
|
253
|
+
uiBlockId: z.ZodString;
|
|
254
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
type UserPromptAbortRequestPayload = z.infer<typeof UserPromptAbortRequestPayloadSchema>;
|
|
257
|
+
/**
|
|
258
|
+
* User prompt abort request message schema
|
|
259
|
+
* Synced with sdk-nodejs: UserPromptAbortRequestMessageSchema
|
|
260
|
+
*/
|
|
261
|
+
declare const UserPromptAbortRequestMessageSchema: z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
type: z.ZodLiteral<"USER_PROMPT_ABORT_REQ">;
|
|
264
|
+
from: z.ZodObject<{
|
|
265
|
+
id: z.ZodOptional<z.ZodString>;
|
|
266
|
+
type: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
to: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
id: z.ZodOptional<z.ZodString>;
|
|
270
|
+
type: z.ZodOptional<z.ZodString>;
|
|
271
|
+
}, z.core.$strip>>;
|
|
272
|
+
payload: z.ZodObject<{
|
|
273
|
+
uiBlockId: z.ZodString;
|
|
274
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
type UserPromptAbortRequestMessage = z.infer<typeof UserPromptAbortRequestMessageSchema>;
|
|
247
278
|
/**
|
|
248
279
|
* Component schema (from backend)
|
|
249
280
|
* Synced with sdk-nodejs: ComponentSchema
|
|
@@ -1026,6 +1057,7 @@ declare const ClientConfigSchema: z.ZodObject<{
|
|
|
1026
1057
|
maxReconnectDelay: z.ZodDefault<z.ZodNumber>;
|
|
1027
1058
|
defaultTimeout: z.ZodDefault<z.ZodNumber>;
|
|
1028
1059
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
1060
|
+
token: z.ZodOptional<z.ZodString>;
|
|
1029
1061
|
}, z.core.$strip>;
|
|
1030
1062
|
type ClientConfig = z.input<typeof ClientConfigSchema>;
|
|
1031
1063
|
type ResolvedClientConfig = z.output<typeof ClientConfigSchema>;
|
|
@@ -1048,6 +1080,20 @@ type ResolvedClientConfig = z.output<typeof ClientConfigSchema>;
|
|
|
1048
1080
|
* @returns Server response message
|
|
1049
1081
|
*/
|
|
1050
1082
|
declare function sendUserPromptRequest(client: SuperatomClient, prompt: string, threadId: string, uiBlockId: string, userId?: string, responseMode?: 'component' | 'text', onStream?: (chunk: string) => void, timeout?: number): Promise<Message>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Abort an in-flight user prompt request.
|
|
1085
|
+
*
|
|
1086
|
+
* Fire-and-forget: sends a USER_PROMPT_ABORT_REQ identifying the question by its
|
|
1087
|
+
* uiBlockId. The backend cancels the matching in-flight request (LLM stream,
|
|
1088
|
+
* source agents, any running script) and acks with USER_PROMPT_ABORTED. There's
|
|
1089
|
+
* no response to await — the caller has already marked the message "stopped" on
|
|
1090
|
+
* its side; this just stops the server-side work.
|
|
1091
|
+
*
|
|
1092
|
+
* @param client - SuperatomClient instance
|
|
1093
|
+
* @param uiBlockId - The uiBlockId of the question to cancel
|
|
1094
|
+
* @param threadId - The thread the question belongs to (optional context)
|
|
1095
|
+
*/
|
|
1096
|
+
declare function abortUserPromptRequest(client: SuperatomClient, uiBlockId: string, threadId?: string): void;
|
|
1051
1097
|
/**
|
|
1052
1098
|
* Send a user prompt suggestions request
|
|
1053
1099
|
* @param client - SuperatomClient instance
|
|
@@ -1740,6 +1786,86 @@ declare function queryMenus(client: SuperatomClient, options?: QueryMenusOptions
|
|
|
1740
1786
|
message?: string;
|
|
1741
1787
|
}>;
|
|
1742
1788
|
|
|
1789
|
+
/**
|
|
1790
|
+
* User Conversations Service
|
|
1791
|
+
* Thread list + thread history via the `user-conversations` data collection
|
|
1792
|
+
* (same calls as Runtime-react's services/wsMessages/userConversations.ts)
|
|
1793
|
+
*/
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* A single conversation thread summary, as returned by getUserThreads.
|
|
1797
|
+
* `title` is the opening question of the thread (its earliest prompt).
|
|
1798
|
+
*/
|
|
1799
|
+
interface ThreadSummary {
|
|
1800
|
+
threadId: string;
|
|
1801
|
+
title: string;
|
|
1802
|
+
messageCount: number;
|
|
1803
|
+
createdAt: string;
|
|
1804
|
+
updatedAt: string;
|
|
1805
|
+
archived: boolean;
|
|
1806
|
+
config?: {
|
|
1807
|
+
dashboardId?: string;
|
|
1808
|
+
} | null;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* One persisted Q&A row inside a thread (the user_conversations table shape).
|
|
1812
|
+
* The full assistant response lives inside `response`.
|
|
1813
|
+
*/
|
|
1814
|
+
interface ThreadConversationRow {
|
|
1815
|
+
id: number;
|
|
1816
|
+
userId: string;
|
|
1817
|
+
threadid: string | null;
|
|
1818
|
+
userprompt: string;
|
|
1819
|
+
status?: 'success' | 'error' | 'aborted';
|
|
1820
|
+
response: {
|
|
1821
|
+
id?: string;
|
|
1822
|
+
component?: any;
|
|
1823
|
+
analysis?: string | null;
|
|
1824
|
+
user_prompt?: string;
|
|
1825
|
+
error?: unknown;
|
|
1826
|
+
[key: string]: any;
|
|
1827
|
+
};
|
|
1828
|
+
createdAt: string;
|
|
1829
|
+
updatedAt: string;
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* List the user's conversation threads, most-recently-active first.
|
|
1833
|
+
* `total` is the user's full thread count (independent of the page window).
|
|
1834
|
+
*/
|
|
1835
|
+
declare function getUserThreads(client: SuperatomClient, userId: string, limit?: number, offset?: number, timeout?: number): Promise<{
|
|
1836
|
+
success: boolean;
|
|
1837
|
+
threads: ThreadSummary[];
|
|
1838
|
+
total: number;
|
|
1839
|
+
error?: string;
|
|
1840
|
+
}>;
|
|
1841
|
+
/**
|
|
1842
|
+
* Delete a whole thread (all its conversations).
|
|
1843
|
+
*/
|
|
1844
|
+
declare function deleteThread(client: SuperatomClient, userId: string, threadId: string, clearCache?: boolean, timeout?: number): Promise<{
|
|
1845
|
+
success: boolean;
|
|
1846
|
+
error?: string;
|
|
1847
|
+
message?: string;
|
|
1848
|
+
deletedCount?: number;
|
|
1849
|
+
}>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Rename a thread's title.
|
|
1852
|
+
*/
|
|
1853
|
+
declare function updateThreadTitle(client: SuperatomClient, userId: string, threadId: string, title: string, timeout?: number): Promise<{
|
|
1854
|
+
success: boolean;
|
|
1855
|
+
error?: string;
|
|
1856
|
+
title?: string;
|
|
1857
|
+
}>;
|
|
1858
|
+
/**
|
|
1859
|
+
* Fetch a page of conversations within a thread, newest-first (offset 0 = the
|
|
1860
|
+
* most recent `limit` messages). `total` is the thread's full message count.
|
|
1861
|
+
*/
|
|
1862
|
+
declare function getThreadConversations(client: SuperatomClient, userId: string, threadId: string, limit?: number, offset?: number, timeout?: number): Promise<{
|
|
1863
|
+
success: boolean;
|
|
1864
|
+
rows: ThreadConversationRow[];
|
|
1865
|
+
total: number;
|
|
1866
|
+
error?: string;
|
|
1867
|
+
}>;
|
|
1868
|
+
|
|
1743
1869
|
/**
|
|
1744
1870
|
* Services Index
|
|
1745
1871
|
* Re-exports all service functions for easy importing
|
|
@@ -1761,12 +1887,16 @@ type index_QueryReportsOptions = QueryReportsOptions;
|
|
|
1761
1887
|
type index_QueryUIsOptions = QueryUIsOptions;
|
|
1762
1888
|
type index_QueryUsersOptions = QueryUsersOptions;
|
|
1763
1889
|
type index_Report = Report;
|
|
1890
|
+
type index_ThreadConversationRow = ThreadConversationRow;
|
|
1891
|
+
type index_ThreadSummary = ThreadSummary;
|
|
1764
1892
|
type index_UI = UI;
|
|
1765
1893
|
type index_UpdateBookmarkOptions = UpdateBookmarkOptions;
|
|
1766
1894
|
type index_User = User;
|
|
1895
|
+
declare const index_abortUserPromptRequest: typeof abortUserPromptRequest;
|
|
1767
1896
|
declare const index_createBookmark: typeof createBookmark;
|
|
1768
1897
|
declare const index_deleteArtifact: typeof deleteArtifact;
|
|
1769
1898
|
declare const index_deleteBookmark: typeof deleteBookmark;
|
|
1899
|
+
declare const index_deleteThread: typeof deleteThread;
|
|
1770
1900
|
declare const index_getActions: typeof getActions;
|
|
1771
1901
|
declare const index_getAllArtifacts: typeof getAllArtifacts;
|
|
1772
1902
|
declare const index_getAllBookmarks: typeof getAllBookmarks;
|
|
@@ -1782,7 +1912,9 @@ declare const index_getMenu: typeof getMenu;
|
|
|
1782
1912
|
declare const index_getMenusHierarchy: typeof getMenusHierarchy;
|
|
1783
1913
|
declare const index_getReport: typeof getReport;
|
|
1784
1914
|
declare const index_getRootMenus: typeof getRootMenus;
|
|
1915
|
+
declare const index_getThreadConversations: typeof getThreadConversations;
|
|
1785
1916
|
declare const index_getUI: typeof getUI;
|
|
1917
|
+
declare const index_getUserThreads: typeof getUserThreads;
|
|
1786
1918
|
declare const index_injectBundleStyles: typeof injectBundleStyles;
|
|
1787
1919
|
declare const index_queryArtifacts: typeof queryArtifacts;
|
|
1788
1920
|
declare const index_queryBookmarks: typeof queryBookmarks;
|
|
@@ -1797,8 +1929,9 @@ declare const index_sendComponents: typeof sendComponents;
|
|
|
1797
1929
|
declare const index_sendUserPromptRequest: typeof sendUserPromptRequest;
|
|
1798
1930
|
declare const index_sendUserPromptSuggestionsRequest: typeof sendUserPromptSuggestionsRequest;
|
|
1799
1931
|
declare const index_updateBookmark: typeof updateBookmark;
|
|
1932
|
+
declare const index_updateThreadTitle: typeof updateThreadTitle;
|
|
1800
1933
|
declare namespace index {
|
|
1801
|
-
export { type index_Artifact as Artifact, type Binding$1 as Binding, BindingSchema$1 as BindingSchema, type index_Bookmark as Bookmark, type index_CreateBookmarkOptions as CreateBookmarkOptions, type DSLRendererProps$3 as DSLRendererProps, DSLRendererPropsSchema$3 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type Expression$1 as Expression, ExpressionSchema$1 as ExpressionSchema, type ForDirective$1 as ForDirective, ForDirectiveSchema$1 as ForDirectiveSchema, type index_Menu as Menu, type index_Page as Page, index_PageSchema as PageSchema, type index_QueryArtifactsFilters as QueryArtifactsFilters, type index_QueryArtifactsOptions as QueryArtifactsOptions, type index_QueryBookmarksOptions as QueryBookmarksOptions, type index_QueryDashboardsOptions as QueryDashboardsOptions, type index_QueryMenusOptions as QueryMenusOptions, type index_QueryReportsOptions as QueryReportsOptions, type QuerySpec$1 as QuerySpec, QuerySpecSchema$1 as QuerySpecSchema, type index_QueryUIsOptions as QueryUIsOptions, type index_QueryUsersOptions as QueryUsersOptions, type index_Report as Report, type DSLRendererProps$2 as ReportDSLRendererProps, type index_UI as UI, type UIComponent$1 as UIComponent, UIComponentSchema$1 as UIComponentSchema, type DSLRendererProps$1 as UIDSLRendererProps, type UIElement$1 as UIElement, UIElementSchema$1 as UIElementSchema, type index_UpdateBookmarkOptions as UpdateBookmarkOptions, type index_User as User, index_createBookmark as createBookmark, index_deleteArtifact as deleteArtifact, index_deleteBookmark as deleteBookmark, index_getActions as getActions, index_getAllArtifacts as getAllArtifacts, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllMenus as getAllMenus, index_getAllReports as getAllReports, index_getAllUIs as getAllUIs, index_getArtifact as getArtifact, index_getBookmark as getBookmark, index_getChildMenus as getChildMenus, index_getDashboard as getDashboard, index_getMenu as getMenu, index_getMenusHierarchy as getMenusHierarchy, index_getReport as getReport, index_getRootMenus as getRootMenus, index_getUI as getUI, index_injectBundleStyles as injectBundleStyles, index_queryArtifacts as queryArtifacts, index_queryBookmarks as queryBookmarks, index_queryDashboards as queryDashboards, index_queryMenus as queryMenus, index_queryReports as queryReports, index_queryUIs as queryUIs, index_queryUsers as queryUsers, index_requestBundle as requestBundle, index_requestData as requestData, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark };
|
|
1934
|
+
export { type index_Artifact as Artifact, type Binding$1 as Binding, BindingSchema$1 as BindingSchema, type index_Bookmark as Bookmark, type index_CreateBookmarkOptions as CreateBookmarkOptions, type DSLRendererProps$3 as DSLRendererProps, DSLRendererPropsSchema$3 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type Expression$1 as Expression, ExpressionSchema$1 as ExpressionSchema, type ForDirective$1 as ForDirective, ForDirectiveSchema$1 as ForDirectiveSchema, type index_Menu as Menu, type index_Page as Page, index_PageSchema as PageSchema, type index_QueryArtifactsFilters as QueryArtifactsFilters, type index_QueryArtifactsOptions as QueryArtifactsOptions, type index_QueryBookmarksOptions as QueryBookmarksOptions, type index_QueryDashboardsOptions as QueryDashboardsOptions, type index_QueryMenusOptions as QueryMenusOptions, type index_QueryReportsOptions as QueryReportsOptions, type QuerySpec$1 as QuerySpec, QuerySpecSchema$1 as QuerySpecSchema, type index_QueryUIsOptions as QueryUIsOptions, type index_QueryUsersOptions as QueryUsersOptions, type index_Report as Report, type DSLRendererProps$2 as ReportDSLRendererProps, type index_ThreadConversationRow as ThreadConversationRow, type index_ThreadSummary as ThreadSummary, type index_UI as UI, type UIComponent$1 as UIComponent, UIComponentSchema$1 as UIComponentSchema, type DSLRendererProps$1 as UIDSLRendererProps, type UIElement$1 as UIElement, UIElementSchema$1 as UIElementSchema, type index_UpdateBookmarkOptions as UpdateBookmarkOptions, type index_User as User, index_abortUserPromptRequest as abortUserPromptRequest, index_createBookmark as createBookmark, index_deleteArtifact as deleteArtifact, index_deleteBookmark as deleteBookmark, index_deleteThread as deleteThread, index_getActions as getActions, index_getAllArtifacts as getAllArtifacts, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllMenus as getAllMenus, index_getAllReports as getAllReports, index_getAllUIs as getAllUIs, index_getArtifact as getArtifact, index_getBookmark as getBookmark, index_getChildMenus as getChildMenus, index_getDashboard as getDashboard, index_getMenu as getMenu, index_getMenusHierarchy as getMenusHierarchy, index_getReport as getReport, index_getRootMenus as getRootMenus, index_getThreadConversations as getThreadConversations, index_getUI as getUI, index_getUserThreads as getUserThreads, index_injectBundleStyles as injectBundleStyles, index_queryArtifacts as queryArtifacts, index_queryBookmarks as queryBookmarks, index_queryDashboards as queryDashboards, index_queryMenus as queryMenus, index_queryReports as queryReports, index_queryUIs as queryUIs, index_queryUsers as queryUsers, index_requestBundle as requestBundle, index_requestData as requestData, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark, index_updateThreadTitle as updateThreadTitle };
|
|
1802
1935
|
}
|
|
1803
1936
|
|
|
1804
1937
|
type MessageHandler = (message: Message) => void;
|
|
@@ -1839,6 +1972,12 @@ declare class SuperatomClient {
|
|
|
1839
1972
|
* Get WebSocket URL with query parameters
|
|
1840
1973
|
*/
|
|
1841
1974
|
private getWebSocketUrl;
|
|
1975
|
+
/**
|
|
1976
|
+
* Swap the session token used on the next (re)connect.
|
|
1977
|
+
* Deliberately does NOT re-dial a live socket: the relay only checks the
|
|
1978
|
+
* token at handshake, so an open connection stays valid.
|
|
1979
|
+
*/
|
|
1980
|
+
setToken(token: string): void;
|
|
1842
1981
|
/**
|
|
1843
1982
|
* Calculate reconnection delay with exponential backoff
|
|
1844
1983
|
*/
|
|
@@ -1994,6 +2133,11 @@ declare class SuperatomClient {
|
|
|
1994
2133
|
* @param onStream - Optional callback for streaming text chunks (only for text mode)
|
|
1995
2134
|
*/
|
|
1996
2135
|
sendUserPromptRequest(prompt: string, threadId: string, uiBlockId: string, userId?: string, responseMode?: 'component' | 'text', onStream?: (chunk: string) => void, timeout?: number): Promise<Message>;
|
|
2136
|
+
/**
|
|
2137
|
+
* Abort an in-flight user prompt request (frontend "Stop" button).
|
|
2138
|
+
* Fire-and-forget — cancels the backend work for the given uiBlockId.
|
|
2139
|
+
*/
|
|
2140
|
+
abortUserPromptRequest(uiBlockId: string, threadId?: string): void;
|
|
1997
2141
|
/**
|
|
1998
2142
|
* Send a user prompt suggestions request
|
|
1999
2143
|
* Delegates to user prompt service
|
|
@@ -2007,6 +2151,8 @@ declare class SuperatomClient {
|
|
|
2007
2151
|
requestBundle(options?: {
|
|
2008
2152
|
timeout?: number;
|
|
2009
2153
|
onProgress?: (progress: number) => void;
|
|
2154
|
+
devbundlereq?: boolean;
|
|
2155
|
+
/** @deprecated Use `devbundlereq` */
|
|
2010
2156
|
devbundle?: boolean;
|
|
2011
2157
|
}): Promise<string>;
|
|
2012
2158
|
/**
|
|
@@ -3423,13 +3569,13 @@ interface ExtendedDSLRendererProps extends DSLRendererProps {
|
|
|
3423
3569
|
onNavigate?: NavigationHandler;
|
|
3424
3570
|
handlers?: Record<string, Function>;
|
|
3425
3571
|
}
|
|
3426
|
-
declare const DSLRenderer:
|
|
3572
|
+
declare const DSLRenderer: React__default.FC<ExtendedDSLRendererProps>;
|
|
3427
3573
|
|
|
3428
3574
|
interface ComponentDefinition {
|
|
3429
3575
|
id: string;
|
|
3430
3576
|
name: string;
|
|
3431
3577
|
head: string;
|
|
3432
|
-
COMP:
|
|
3578
|
+
COMP: React__default.ComponentType<any>;
|
|
3433
3579
|
dependencies?: string[];
|
|
3434
3580
|
version?: string;
|
|
3435
3581
|
}
|
|
@@ -3449,10 +3595,10 @@ declare const useDynamicComponent: (componentType: string) => {
|
|
|
3449
3595
|
isLoaded: boolean;
|
|
3450
3596
|
error: string | null;
|
|
3451
3597
|
};
|
|
3452
|
-
declare const DynamicComponent:
|
|
3598
|
+
declare const DynamicComponent: React__default.FC<{
|
|
3453
3599
|
type: string;
|
|
3454
3600
|
props?: any;
|
|
3455
|
-
children?:
|
|
3601
|
+
children?: React__default.ReactNode;
|
|
3456
3602
|
}>;
|
|
3457
3603
|
|
|
3458
3604
|
interface DSLErrorBoundaryProps {
|
|
@@ -3460,7 +3606,7 @@ interface DSLErrorBoundaryProps {
|
|
|
3460
3606
|
fallback?: ReactNode;
|
|
3461
3607
|
elementType?: string;
|
|
3462
3608
|
elementKey?: string | number;
|
|
3463
|
-
onError?: (error: Error, errorInfo:
|
|
3609
|
+
onError?: (error: Error, errorInfo: React__default.ErrorInfo) => void;
|
|
3464
3610
|
skipBoundary?: boolean;
|
|
3465
3611
|
}
|
|
3466
3612
|
interface DSLErrorBoundaryState {
|
|
@@ -3471,12 +3617,19 @@ interface DSLErrorBoundaryState {
|
|
|
3471
3617
|
declare class DSLErrorBoundary extends Component$1<DSLErrorBoundaryProps, DSLErrorBoundaryState> {
|
|
3472
3618
|
constructor(props: DSLErrorBoundaryProps);
|
|
3473
3619
|
static getDerivedStateFromError(error: Error): DSLErrorBoundaryState;
|
|
3474
|
-
componentDidCatch(error: Error, errorInfo:
|
|
3475
|
-
render(): string | number | boolean | Iterable<
|
|
3620
|
+
componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
|
|
3621
|
+
render(): string | number | boolean | Iterable<React__default.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
3476
3622
|
}
|
|
3477
3623
|
declare const withConditionalErrorBoundary: (component: ReactNode, elementType: string, elementKey?: string | number, forceWrap?: boolean) => ReactNode;
|
|
3478
3624
|
|
|
3625
|
+
/**
|
|
3626
|
+
* Register every component exposed on window.SUPERATOM.COMPONENTS into COMP_REGISTRY.
|
|
3627
|
+
* Safe to call repeatedly — each call reflects the currently loaded bundle.
|
|
3628
|
+
*/
|
|
3479
3629
|
declare function registerBundleComponents(): number;
|
|
3630
|
+
/**
|
|
3631
|
+
* Remove all bundle components added by registerBundleComponents from COMP_REGISTRY.
|
|
3632
|
+
*/
|
|
3480
3633
|
declare function resetRegistration(): void;
|
|
3481
3634
|
|
|
3482
3635
|
interface ChatMessage {
|
|
@@ -3491,6 +3644,8 @@ interface ChatMessage {
|
|
|
3491
3644
|
isLoading?: boolean;
|
|
3492
3645
|
isStreaming?: boolean;
|
|
3493
3646
|
isTextOnlyResponse?: boolean;
|
|
3647
|
+
aborted?: boolean;
|
|
3648
|
+
fromHistory?: boolean;
|
|
3494
3649
|
}
|
|
3495
3650
|
|
|
3496
3651
|
interface UseSuperAtomOptions {
|
|
@@ -3507,6 +3662,30 @@ interface UseSuperAtomReturn {
|
|
|
3507
3662
|
setInput: (value: string) => void;
|
|
3508
3663
|
sendMessage: () => void;
|
|
3509
3664
|
isSending: boolean;
|
|
3665
|
+
/** Stop the in-flight response (keeps any partial answer, labels it "Stopped") */
|
|
3666
|
+
abortRequest: () => void;
|
|
3667
|
+
/** The user's conversation threads, most recent first */
|
|
3668
|
+
threads: ThreadSummary[];
|
|
3669
|
+
/** Thread the chat is currently in */
|
|
3670
|
+
activeThreadId: string;
|
|
3671
|
+
/** Open a saved thread and load its messages */
|
|
3672
|
+
openThread: (threadId: string) => void;
|
|
3673
|
+
/** Start a fresh chat (new thread) */
|
|
3674
|
+
newChat: () => void;
|
|
3675
|
+
/** A saved thread's messages are loading */
|
|
3676
|
+
isLoadingThread: boolean;
|
|
3677
|
+
/** Re-fetch the thread list */
|
|
3678
|
+
refreshThreads: () => void;
|
|
3679
|
+
/** Delete a thread and all its messages; if it's the open one, starts a new chat */
|
|
3680
|
+
deleteThread: (threadId: string) => Promise<{
|
|
3681
|
+
success: boolean;
|
|
3682
|
+
error?: string;
|
|
3683
|
+
}>;
|
|
3684
|
+
/** Rename a thread */
|
|
3685
|
+
renameThread: (threadId: string, title: string) => Promise<{
|
|
3686
|
+
success: boolean;
|
|
3687
|
+
error?: string;
|
|
3688
|
+
}>;
|
|
3510
3689
|
}
|
|
3511
3690
|
declare function useSuperAtom({ token, userId, projectId, debug, streaming }: UseSuperAtomOptions): UseSuperAtomReturn;
|
|
3512
3691
|
|
|
@@ -3518,8 +3697,11 @@ interface ChatInputProps {
|
|
|
3518
3697
|
placeholder?: string;
|
|
3519
3698
|
primaryColor?: string;
|
|
3520
3699
|
className?: string;
|
|
3700
|
+
/** A response is in flight — swaps Send for Stop and enables Esc-to-stop */
|
|
3701
|
+
isResponding?: boolean;
|
|
3702
|
+
onStop?: () => void;
|
|
3521
3703
|
}
|
|
3522
|
-
declare function ChatInput({ input, setInput, onSend, disabled, placeholder, primaryColor, className, }: ChatInputProps): react_jsx_runtime.JSX.Element;
|
|
3704
|
+
declare function ChatInput({ input, setInput, onSend, disabled, placeholder, primaryColor, className, isResponding, onStop, }: ChatInputProps): react_jsx_runtime.JSX.Element;
|
|
3523
3705
|
|
|
3524
3706
|
interface MessageListProps {
|
|
3525
3707
|
messages: ChatMessage[];
|
|
@@ -3527,13 +3709,21 @@ interface MessageListProps {
|
|
|
3527
3709
|
connectingText?: string;
|
|
3528
3710
|
emptyText?: string;
|
|
3529
3711
|
className?: string;
|
|
3712
|
+
/** A response is in flight — shows a Stop button on the latest assistant message */
|
|
3713
|
+
isResponding?: boolean;
|
|
3714
|
+
onStop?: () => void;
|
|
3715
|
+
/** A saved thread is being opened — shows a loading state instead of the empty text */
|
|
3716
|
+
isLoadingThread?: boolean;
|
|
3717
|
+
loadingThreadText?: string;
|
|
3530
3718
|
}
|
|
3531
|
-
declare function MessageList({ messages, bundleReady, connectingText, emptyText, className, }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
3719
|
+
declare function MessageList({ messages, bundleReady, connectingText, emptyText, className, isResponding, onStop, isLoadingThread, loadingThreadText, }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
3532
3720
|
|
|
3533
3721
|
interface MessageBubbleProps {
|
|
3534
3722
|
message: ChatMessage;
|
|
3723
|
+
/** When set, this message's response is in flight and a Stop button is shown */
|
|
3724
|
+
onStop?: () => void;
|
|
3535
3725
|
}
|
|
3536
|
-
declare function MessageBubble({ message }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
3726
|
+
declare function MessageBubble({ message, onStop }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
3537
3727
|
|
|
3538
3728
|
interface MenuV1Item {
|
|
3539
3729
|
id: string;
|
|
@@ -3561,29 +3751,73 @@ interface MenuV1Root {
|
|
|
3561
3751
|
}
|
|
3562
3752
|
|
|
3563
3753
|
interface SidebarProps {
|
|
3564
|
-
children?:
|
|
3754
|
+
children?: React__default.ReactNode;
|
|
3565
3755
|
className?: string;
|
|
3566
3756
|
onItemClick?: (item: MenuV1Item) => void;
|
|
3757
|
+
/** Shows the "New chat" button when provided (pass `newChat` from useSuperAtom) */
|
|
3758
|
+
onNewChat?: () => void;
|
|
3759
|
+
/** Conversation threads for the "Chats" section (pass `threads` from useSuperAtom) */
|
|
3760
|
+
threads?: ThreadSummary[];
|
|
3761
|
+
/** Highlighted thread (pass `activeThreadId` from useSuperAtom) */
|
|
3762
|
+
activeThreadId?: string;
|
|
3763
|
+
/** Open a thread (pass `openThread` from useSuperAtom) */
|
|
3764
|
+
onSelectThread?: (threadId: string) => void;
|
|
3765
|
+
/** Enables "Delete chat" in each thread's menu (pass `deleteThread` from useSuperAtom) */
|
|
3766
|
+
onDeleteThread?: (threadId: string) => Promise<{
|
|
3767
|
+
success: boolean;
|
|
3768
|
+
error?: string;
|
|
3769
|
+
}>;
|
|
3770
|
+
/** Enables "Rename" in each thread's menu (pass `renameThread` from useSuperAtom) */
|
|
3771
|
+
onRenameThread?: (threadId: string, title: string) => Promise<{
|
|
3772
|
+
success: boolean;
|
|
3773
|
+
error?: string;
|
|
3774
|
+
}>;
|
|
3775
|
+
primaryColor?: string;
|
|
3776
|
+
}
|
|
3777
|
+
declare function Sidebar({ children, className, onItemClick, onNewChat, threads, activeThreadId, onSelectThread, onDeleteThread, onRenameThread, primaryColor, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
3778
|
+
|
|
3779
|
+
interface NewChatHeroProps {
|
|
3780
|
+
/** The chat input to center, e.g. <ChatInput ... /> */
|
|
3781
|
+
children: React__default.ReactNode;
|
|
3782
|
+
title?: string;
|
|
3783
|
+
subtitle?: string;
|
|
3784
|
+
className?: string;
|
|
3785
|
+
}
|
|
3786
|
+
/**
|
|
3787
|
+
* Centered "new chat" empty state (like most chat apps): a greeting with the
|
|
3788
|
+
* chat box in the middle of the screen. Same as Runtime-react's NewChatHero.
|
|
3789
|
+
* Render it instead of <MessageList /> + bottom <ChatInput /> while the chat is empty.
|
|
3790
|
+
*/
|
|
3791
|
+
declare function NewChatHero({ children, title, subtitle, className, }: NewChatHeroProps): react_jsx_runtime.JSX.Element;
|
|
3792
|
+
|
|
3793
|
+
interface ConfirmDeleteModalProps {
|
|
3794
|
+
isOpen: boolean;
|
|
3795
|
+
onClose: () => void;
|
|
3796
|
+
onConfirm: () => void;
|
|
3797
|
+
isDeleting: boolean;
|
|
3798
|
+
title?: string;
|
|
3799
|
+
message?: string;
|
|
3567
3800
|
}
|
|
3568
|
-
|
|
3801
|
+
/** Same as Runtime-react's components/chat/ConfirmDeleteModal */
|
|
3802
|
+
declare function ConfirmDeleteModal({ isOpen, onClose, onConfirm, isDeleting, title, message, }: ConfirmDeleteModalProps): React.ReactPortal | null;
|
|
3569
3803
|
|
|
3570
3804
|
interface MenuV1RendererProps {
|
|
3571
3805
|
items: MenuV1Item[];
|
|
3572
3806
|
onItemClick: (item: MenuV1Item) => void;
|
|
3573
3807
|
isCollapsed: boolean;
|
|
3574
3808
|
}
|
|
3575
|
-
declare const MenuV1Renderer:
|
|
3809
|
+
declare const MenuV1Renderer: React__default.FC<MenuV1RendererProps>;
|
|
3576
3810
|
|
|
3577
3811
|
interface MenuV1RendererCollapsedProps {
|
|
3578
3812
|
items: MenuV1Item[];
|
|
3579
3813
|
onItemClick: (item: MenuV1Item) => void;
|
|
3580
3814
|
}
|
|
3581
|
-
declare const MenuV1RendererCollapsed:
|
|
3815
|
+
declare const MenuV1RendererCollapsed: React__default.FC<MenuV1RendererCollapsedProps>;
|
|
3582
3816
|
|
|
3583
3817
|
/**
|
|
3584
3818
|
* @superatomai/application-sdk
|
|
3585
3819
|
* SuperAtom Application SDK - WebSocket client, DSL renderer, and pre-built chat UI
|
|
3586
3820
|
*/
|
|
3587
|
-
declare const SDK_VERSION = "0.0.
|
|
3821
|
+
declare const SDK_VERSION = "0.0.2";
|
|
3588
3822
|
|
|
3589
|
-
export { type ActionsRequestMessage, ActionsRequestMessageSchema, type ActionsRequestPayload, ActionsRequestPayloadSchema, type ActionsResponseMessage, ActionsResponseMessageSchema, type ActionsResponsePayload, ActionsResponsePayloadSchema, type Binding, BindingSchema, type BundleChunkMessage, BundleChunkMessageSchema, type BundleChunkPayload, BundleChunkPayloadSchema, type BundleErrorMessage, BundleErrorMessageSchema, type BundleErrorPayload, BundleErrorPayloadSchema, type BundleRequestMessage, BundleRequestMessageSchema, type BundleRequestPayload, BundleRequestPayloadSchema, COMP_REGISTRY, ChatInput, type ChatInputProps, type ChatMessage, type ClientConfig, ClientConfigSchema, type Component, type ComponentDefinition, type ComponentRegistryType, ComponentSchema, type ComponentsRegistry, type ComponentsSendMessage, ComponentsSendMessageSchema, type ComponentsSendPayload, ComponentsSendPayloadSchema, DSLErrorBoundary, DSLRenderer, type DSLRendererProps, DSLRendererPropsSchema, type DataRequestMessage, DataRequestMessageSchema, type DataRequestPayload, DataRequestPayloadSchema, type DataResponseMessage, DataResponseMessageSchema, type DataResponsePayload, DataResponsePayloadSchema, DynamicComponent, type Expression, ExpressionSchema, type ForDirective, ForDirectiveSchema, type MenuData, MenuDataSchema, type MenuQueryFilters, MenuQueryFiltersSchema, type MenuV1Item, MenuV1Renderer, MenuV1RendererCollapsed, type MenuV1Root, type MenusRequestMessage, MenusRequestMessageSchema, type MenusRequestPayload, MenusRequestPayloadSchema, type MenusResponseMessage, MenusResponseMessageSchema, type MenusResponsePayload, MenusResponsePayloadSchema, type Message, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MessageParticipant, MessageParticipantSchema, MessageSchema, type MountFunction, type QuerySpec, QuerySpecSchema, type ResolvedClientConfig, SDK_VERSION, Sidebar, type SidebarProps, type SuperAtomGlobal, SuperatomClient, type UIComponent, UIComponentSchema, type UIElement, UIElementSchema, type UILogEntry, UILogEntrySchema, type UILogsMessage, UILogsMessageSchema, type UILogsPayload, UILogsPayloadSchema, type UseSuperAtomOptions, type UseSuperAtomReturn, type UserPromptRequestMessage, UserPromptRequestMessageSchema, type UserPromptRequestPayload, UserPromptRequestPayloadSchema, type UserPromptResponseMessage, UserPromptResponseMessageSchema, type UserPromptResponsePayload, UserPromptResponsePayloadSchema, type UserPromptSuggestionsRequestMessage, UserPromptSuggestionsRequestMessageSchema, type UserPromptSuggestionsRequestPayload, UserPromptSuggestionsRequestPayloadSchema, type UserPromptSuggestionsResponseMessage, UserPromptSuggestionsResponseMessageSchema, type UserPromptSuggestionsResponsePayload, UserPromptSuggestionsResponsePayloadSchema, getComponent, getComponentStates, getComponents, hasComponents, registerBundleComponents, resetAllFailedComponents, resetFailedComponent, resetRegistration, sanitizeDSL, index as services, setup, useDynamicComponent, useSuperAtom, validateDSL, validateUIComponent, validateUIElement, withConditionalErrorBoundary };
|
|
3823
|
+
export { type ActionsRequestMessage, ActionsRequestMessageSchema, type ActionsRequestPayload, ActionsRequestPayloadSchema, type ActionsResponseMessage, ActionsResponseMessageSchema, type ActionsResponsePayload, ActionsResponsePayloadSchema, type Binding, BindingSchema, type BundleChunkMessage, BundleChunkMessageSchema, type BundleChunkPayload, BundleChunkPayloadSchema, type BundleErrorMessage, BundleErrorMessageSchema, type BundleErrorPayload, BundleErrorPayloadSchema, type BundleRequestMessage, BundleRequestMessageSchema, type BundleRequestPayload, BundleRequestPayloadSchema, COMP_REGISTRY, ChatInput, type ChatInputProps, type ChatMessage, type ClientConfig, ClientConfigSchema, type Component, type ComponentDefinition, type ComponentRegistryType, ComponentSchema, type ComponentsRegistry, type ComponentsSendMessage, ComponentsSendMessageSchema, type ComponentsSendPayload, ComponentsSendPayloadSchema, ConfirmDeleteModal, type ConfirmDeleteModalProps, DSLErrorBoundary, DSLRenderer, type DSLRendererProps, DSLRendererPropsSchema, type DataRequestMessage, DataRequestMessageSchema, type DataRequestPayload, DataRequestPayloadSchema, type DataResponseMessage, DataResponseMessageSchema, type DataResponsePayload, DataResponsePayloadSchema, DynamicComponent, type Expression, ExpressionSchema, type ForDirective, ForDirectiveSchema, type MenuData, MenuDataSchema, type MenuQueryFilters, MenuQueryFiltersSchema, type MenuV1Item, MenuV1Renderer, MenuV1RendererCollapsed, type MenuV1Root, type MenusRequestMessage, MenusRequestMessageSchema, type MenusRequestPayload, MenusRequestPayloadSchema, type MenusResponseMessage, MenusResponseMessageSchema, type MenusResponsePayload, MenusResponsePayloadSchema, type Message, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MessageParticipant, MessageParticipantSchema, MessageSchema, type MountFunction, NewChatHero, type NewChatHeroProps, type QuerySpec, QuerySpecSchema, type ResolvedClientConfig, SDK_VERSION, Sidebar, type SidebarProps, type SuperAtomGlobal, SuperatomClient, type ThreadConversationRow, type ThreadSummary, type UIComponent, UIComponentSchema, type UIElement, UIElementSchema, type UILogEntry, UILogEntrySchema, type UILogsMessage, UILogsMessageSchema, type UILogsPayload, UILogsPayloadSchema, type UseSuperAtomOptions, type UseSuperAtomReturn, type UserPromptAbortRequestMessage, UserPromptAbortRequestMessageSchema, type UserPromptAbortRequestPayload, UserPromptAbortRequestPayloadSchema, type UserPromptRequestMessage, UserPromptRequestMessageSchema, type UserPromptRequestPayload, UserPromptRequestPayloadSchema, type UserPromptResponseMessage, UserPromptResponseMessageSchema, type UserPromptResponsePayload, UserPromptResponsePayloadSchema, type UserPromptSuggestionsRequestMessage, UserPromptSuggestionsRequestMessageSchema, type UserPromptSuggestionsRequestPayload, UserPromptSuggestionsRequestPayloadSchema, type UserPromptSuggestionsResponseMessage, UserPromptSuggestionsResponseMessageSchema, type UserPromptSuggestionsResponsePayload, UserPromptSuggestionsResponsePayloadSchema, getComponent, getComponentStates, getComponents, hasComponents, registerBundleComponents, resetAllFailedComponents, resetFailedComponent, resetRegistration, sanitizeDSL, index as services, setup, useDynamicComponent, useSuperAtom, validateDSL, validateUIComponent, validateUIElement, withConditionalErrorBoundary };
|