@xpert-ai/chatkit-types 0.3.13 → 0.4.1

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +126 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1097,10 +1097,21 @@ export declare type Icon = {
1097
1097
  size?: IconSize;
1098
1098
  };
1099
1099
 
1100
+ export declare type IconDefinition = {
1101
+ type: IconType;
1102
+ value: string;
1103
+ color?: string;
1104
+ size?: number;
1105
+ alt?: string;
1106
+ style?: Record<string, string>;
1107
+ };
1108
+
1100
1109
  export declare type IconName = 'agent' | 'analytics' | 'atom' | 'batch' | 'bolt' | 'book-open' | 'book-closed' | 'bug' | 'calendar' | 'chart' | 'circle-question' | 'compass' | 'cube' | 'globe' | 'keys' | 'lab' | 'images' | 'lifesaver' | 'lightbulb' | 'map-pin' | 'name' | 'notebook' | 'notebook-pencil' | 'page-blank' | 'profile' | 'profile-card' | 'search' | 'sparkle' | 'sparkle-double' | 'square-code' | 'square-image' | 'square-text' | 'suitcase' | 'write' | 'write-alt' | 'write-alt2';
1101
1110
 
1102
1111
  declare type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
1103
1112
 
1113
+ export declare type IconType = 'image' | 'svg' | 'font' | 'emoji' | 'lottie';
1114
+
1104
1115
  declare type Image_2 = {
1105
1116
  type: 'Image';
1106
1117
  key?: string;
@@ -1772,6 +1783,53 @@ export declare type Title = {
1772
1783
 
1773
1784
  declare type TitleSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
1774
1785
 
1786
+ /**
1787
+ * CSP domains declared by an MCP App resource. The backend validates and
1788
+ * normalizes these values before ChatKit applies them to the iframe response.
1789
+ */
1790
+ export declare type TMcpAppCsp = {
1791
+ connectDomains?: string[];
1792
+ resourceDomains?: string[];
1793
+ frameDomains?: string[];
1794
+ baseUriDomains?: string[];
1795
+ };
1796
+
1797
+ /**
1798
+ * Permission grant value for browser features requested by an MCP App resource.
1799
+ * A boolean is enough for simple allow/deny cases; object values preserve
1800
+ * future protocol details without forcing ChatKit message migrations.
1801
+ */
1802
+ export declare type TMcpAppPermissionGrant = boolean | Record<string, unknown>;
1803
+
1804
+ /**
1805
+ * Browser feature permissions requested by an MCP App resource. ChatKit should
1806
+ * keep deny-by-default behavior and only translate supported grants to iframe
1807
+ * `allow` attributes.
1808
+ */
1809
+ export declare type TMcpAppPermissions = {
1810
+ camera?: TMcpAppPermissionGrant;
1811
+ microphone?: TMcpAppPermissionGrant;
1812
+ geolocation?: TMcpAppPermissionGrant;
1813
+ clipboardWrite?: TMcpAppPermissionGrant;
1814
+ };
1815
+
1816
+ export declare type TMcpAppToolResult = {
1817
+ content: TMcpAppToolResultContentBlock[];
1818
+ structuredContent?: Record<string, unknown>;
1819
+ isError?: boolean;
1820
+ _meta?: Record<string, unknown>;
1821
+ };
1822
+
1823
+ export declare type TMcpAppToolResultContentBlock = Record<string, unknown> & {
1824
+ type: string;
1825
+ };
1826
+
1827
+ /**
1828
+ * Declares who may use an MCP tool. `model` exposes the tool to the LLM;
1829
+ * `app` allows the rendered MCP App iframe to call it through the host bridge.
1830
+ */
1831
+ export declare type TMcpAppVisibility = 'model' | 'app';
1832
+
1775
1833
  /**
1776
1834
  * Defines the data type of the sub-message of `component` type in the message `content` {@link MessageContentComplex}
1777
1835
  */
@@ -1791,6 +1849,68 @@ export declare type TMessageComponentIframe = {
1791
1849
  };
1792
1850
  };
1793
1851
 
1852
+ /**
1853
+ * MCP App data embedded as a ChatKit component message.
1854
+ */
1855
+ export declare type TMessageComponentMcpApp = TMessageComponent<TMessageComponentMcpAppData>;
1856
+
1857
+ /**
1858
+ * Safe metadata needed to render an MCP App message. Chat history stores this
1859
+ * descriptor and the initial tool input/result only; the app HTML is fetched
1860
+ * from the backend app instance using `appInstanceId`.
1861
+ */
1862
+ export declare type TMessageComponentMcpAppData = {
1863
+ /** Component discriminator used by ChatKit renderers. */
1864
+ type: 'McpApp';
1865
+ /** Short-lived host-side instance that scopes resource and bridge access. */
1866
+ appInstanceId: string;
1867
+ /** Signed host token used to revive and authorize this app instance. */
1868
+ appInstanceToken?: string;
1869
+ /** MCP resource URI, normally `ui://...`, used to load the app HTML. */
1870
+ resourceUri: string;
1871
+ /** Tool that produced this app surface. */
1872
+ toolName: string;
1873
+ /** Provider/model tool-call id associated with the triggering call. */
1874
+ toolCallId?: string;
1875
+ /** Xpert toolset id used for authorization and MCP client lookup. */
1876
+ toolsetId?: string;
1877
+ /** MCP server name within a multi-server toolset. */
1878
+ serverName?: string;
1879
+ /** Xpert execution id that produced this message component. */
1880
+ executionId?: string;
1881
+ /** Display title shown by the ChatKit shell around the app. */
1882
+ title?: LocalizedText;
1883
+ /** Optional display description shown by the ChatKit shell around the app. */
1884
+ description?: LocalizedText;
1885
+ /** Optional display icon shown by the ChatKit shell around the app. */
1886
+ icon?: IconDefinition;
1887
+ /** Resource-level content security policy metadata. */
1888
+ csp?: TMcpAppCsp;
1889
+ /** Resource-level browser permission metadata. */
1890
+ permissions?: TMcpAppPermissions;
1891
+ /** Optional dedicated origin requested by the resource; may be ignored by v1 hosts. */
1892
+ domain?: string;
1893
+ /** Resource hint for whether the host should render a visible border. */
1894
+ prefersBorder?: boolean;
1895
+ /** Original tool input sent to the MCP App via `ui/notifications/tool-input`. */
1896
+ toolInput?: Record<string, unknown>;
1897
+ /**
1898
+ * Standardized initial CallToolResult used to replay MCP App history without
1899
+ * re-running the originating tool. Raw app HTML is never persisted here.
1900
+ */
1901
+ toolResult?: TMcpAppToolResult;
1902
+ /** Serialized byte size of the initial tool result when known. */
1903
+ toolResultSize?: number;
1904
+ /** True when the initial tool result was too large to inline in chat history. */
1905
+ toolResultTruncated?: boolean;
1906
+ /** Visibility declared by the originating MCP tool. */
1907
+ visibility?: TMcpAppVisibility[];
1908
+ /** Current lifecycle status of the tool/app message. */
1909
+ status?: 'running' | 'success' | 'fail';
1910
+ /** Human-readable error captured while creating or rendering the app. */
1911
+ error?: string;
1912
+ };
1913
+
1794
1914
  export declare type TMessageComponentStep<T = unknown> = {
1795
1915
  type: ChatMessageStepCategory;
1796
1916
  toolset: string;
@@ -1869,6 +1989,12 @@ export declare type TMessageContentComponent<T extends object = object> = {
1869
1989
  runId?: string;
1870
1990
  };
1871
1991
 
1992
+ /**
1993
+ * MCP App component item in a LangChain-compatible complex message content
1994
+ * array.
1995
+ */
1996
+ export declare type TMessageContentMcpApp = TMessageContentComponent<TMessageComponentMcpAppData>;
1997
+
1872
1998
  export declare type TMessageContentMemory = {
1873
1999
  id?: string;
1874
2000
  agentKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/chatkit-types",
3
- "version": "0.3.13",
3
+ "version": "0.4.1",
4
4
  "description": "Type definitions for the ChatKit.",
5
5
  "sideEffects": false,
6
6
  "type": "module",