@xpert-ai/chatkit-types 0.3.12 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +118 -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;
@@ -1731,6 +1742,7 @@ export declare type ThreadGoal = {
1731
1742
  threadId: string;
1732
1743
  objective: string;
1733
1744
  status: ThreadGoalStatus;
1745
+ goalSpec?: ThreadGoalSpec | null;
1734
1746
  tokensUsed: number;
1735
1747
  elapsedSeconds: number;
1736
1748
  continuationCount: number;
@@ -1739,6 +1751,17 @@ export declare type ThreadGoal = {
1739
1751
  blockedAt?: string | Date | null;
1740
1752
  };
1741
1753
 
1754
+ export declare type ThreadGoalSpec = {
1755
+ originalObjective: string;
1756
+ executableGoal: string;
1757
+ successCriteria: string[];
1758
+ constraints: string[];
1759
+ verificationChecklist: string[];
1760
+ recommendedStrategy: string;
1761
+ source: 'system' | 'llm';
1762
+ generatedAt: string;
1763
+ };
1764
+
1742
1765
  export declare type ThreadGoalStatus = 'active' | 'paused' | 'blocked' | 'usage_limited' | 'budget_limited' | 'complete';
1743
1766
 
1744
1767
  /**
@@ -1760,6 +1783,42 @@ export declare type Title = {
1760
1783
 
1761
1784
  declare type TitleSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
1762
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
+ /**
1817
+ * Declares who may use an MCP tool. `model` exposes the tool to the LLM;
1818
+ * `app` allows the rendered MCP App iframe to call it through the host bridge.
1819
+ */
1820
+ export declare type TMcpAppVisibility = 'model' | 'app';
1821
+
1763
1822
  /**
1764
1823
  * Defines the data type of the sub-message of `component` type in the message `content` {@link MessageContentComplex}
1765
1824
  */
@@ -1779,6 +1838,59 @@ export declare type TMessageComponentIframe = {
1779
1838
  };
1780
1839
  };
1781
1840
 
1841
+ /**
1842
+ * MCP App data embedded as a ChatKit component message.
1843
+ */
1844
+ export declare type TMessageComponentMcpApp = TMessageComponent<TMessageComponentMcpAppData>;
1845
+
1846
+ /**
1847
+ * Safe metadata needed to render an MCP App message. Chat history stores this
1848
+ * descriptor only; the app HTML is fetched from the short-lived backend app
1849
+ * instance using `appInstanceId`.
1850
+ */
1851
+ export declare type TMessageComponentMcpAppData = {
1852
+ /** Component discriminator used by ChatKit renderers. */
1853
+ type: 'McpApp';
1854
+ /** Short-lived host-side instance that scopes resource and bridge access. */
1855
+ appInstanceId: string;
1856
+ /** Signed host token used to revive and authorize this app instance. */
1857
+ appInstanceToken?: string;
1858
+ /** MCP resource URI, normally `ui://...`, used to load the app HTML. */
1859
+ resourceUri: string;
1860
+ /** Tool that produced this app surface. */
1861
+ toolName: string;
1862
+ /** Provider/model tool-call id associated with the triggering call. */
1863
+ toolCallId?: string;
1864
+ /** Xpert toolset id used for authorization and MCP client lookup. */
1865
+ toolsetId?: string;
1866
+ /** MCP server name within a multi-server toolset. */
1867
+ serverName?: string;
1868
+ /** Xpert execution id that produced this message component. */
1869
+ executionId?: string;
1870
+ /** Display title shown by the ChatKit shell around the app. */
1871
+ title?: LocalizedText;
1872
+ /** Optional display description shown by the ChatKit shell around the app. */
1873
+ description?: LocalizedText;
1874
+ /** Optional display icon shown by the ChatKit shell around the app. */
1875
+ icon?: IconDefinition;
1876
+ /** Resource-level content security policy metadata. */
1877
+ csp?: TMcpAppCsp;
1878
+ /** Resource-level browser permission metadata. */
1879
+ permissions?: TMcpAppPermissions;
1880
+ /** Optional dedicated origin requested by the resource; may be ignored by v1 hosts. */
1881
+ domain?: string;
1882
+ /** Resource hint for whether the host should render a visible border. */
1883
+ prefersBorder?: boolean;
1884
+ /** Original tool input sent to the MCP App via `ui/notifications/tool-input`. */
1885
+ toolInput?: Record<string, unknown>;
1886
+ /** Visibility declared by the originating MCP tool. */
1887
+ visibility?: TMcpAppVisibility[];
1888
+ /** Current lifecycle status of the tool/app message. */
1889
+ status?: 'running' | 'success' | 'fail';
1890
+ /** Human-readable error captured while creating or rendering the app. */
1891
+ error?: string;
1892
+ };
1893
+
1782
1894
  export declare type TMessageComponentStep<T = unknown> = {
1783
1895
  type: ChatMessageStepCategory;
1784
1896
  toolset: string;
@@ -1857,6 +1969,12 @@ export declare type TMessageContentComponent<T extends object = object> = {
1857
1969
  runId?: string;
1858
1970
  };
1859
1971
 
1972
+ /**
1973
+ * MCP App component item in a LangChain-compatible complex message content
1974
+ * array.
1975
+ */
1976
+ export declare type TMessageContentMcpApp = TMessageContentComponent<TMessageComponentMcpAppData>;
1977
+
1860
1978
  export declare type TMessageContentMemory = {
1861
1979
  id?: string;
1862
1980
  agentKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/chatkit-types",
3
- "version": "0.3.12",
3
+ "version": "0.4.0",
4
4
  "description": "Type definitions for the ChatKit.",
5
5
  "sideEffects": false,
6
6
  "type": "module",