skybridge 0.0.0-dev.e4c9359 → 0.0.0-dev.e55cd21

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 (190) hide show
  1. package/LICENSE +21 -674
  2. package/dist/src/server/devtoolsStaticServer.d.ts +19 -0
  3. package/dist/src/server/devtoolsStaticServer.js +48 -0
  4. package/dist/src/server/devtoolsStaticServer.js.map +1 -0
  5. package/dist/src/server/index.d.ts +3 -2
  6. package/dist/src/server/index.js +1 -0
  7. package/dist/src/server/index.js.map +1 -1
  8. package/dist/src/server/inferUtilityTypes.d.ts +22 -6
  9. package/dist/src/server/server.d.ts +55 -16
  10. package/dist/src/server/server.js +54 -34
  11. package/dist/src/server/server.js.map +1 -1
  12. package/dist/src/server/templateHelper.d.ts +3 -0
  13. package/dist/src/server/templateHelper.js +5 -4
  14. package/dist/src/server/templateHelper.js.map +1 -1
  15. package/dist/src/server/templates/development.hbs +42 -3
  16. package/dist/src/server/templates/production.hbs +1 -0
  17. package/dist/src/server/widgetsDevServer.js +2 -3
  18. package/dist/src/server/widgetsDevServer.js.map +1 -1
  19. package/dist/src/test/utils.d.ts +54 -8
  20. package/dist/src/test/utils.js +86 -8
  21. package/dist/src/test/utils.js.map +1 -1
  22. package/dist/src/test/widget.test.js +83 -27
  23. package/dist/src/test/widget.test.js.map +1 -1
  24. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.d.ts +13 -0
  25. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js +33 -0
  26. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js.map +1 -0
  27. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.d.ts +16 -0
  28. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js +115 -0
  29. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js.map +1 -0
  30. package/dist/src/web/bridges/apps-sdk-bridge.d.ts +10 -0
  31. package/dist/src/web/bridges/apps-sdk-bridge.js +46 -0
  32. package/dist/src/web/bridges/apps-sdk-bridge.js.map +1 -0
  33. package/dist/src/web/bridges/hooks/use-adaptor.d.ts +2 -0
  34. package/dist/src/web/bridges/hooks/use-adaptor.js +8 -0
  35. package/dist/src/web/bridges/hooks/use-adaptor.js.map +1 -0
  36. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.d.ts +2 -0
  37. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js +7 -0
  38. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js.map +1 -0
  39. package/dist/src/web/bridges/hooks/use-bridge.d.ts +2 -0
  40. package/dist/src/web/bridges/hooks/use-bridge.js +8 -0
  41. package/dist/src/web/bridges/hooks/use-bridge.js.map +1 -0
  42. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.d.ts +5 -0
  43. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js +7 -0
  44. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js.map +1 -0
  45. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js +41 -0
  46. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js.map +1 -0
  47. package/dist/src/web/bridges/index.d.ts +4 -0
  48. package/dist/src/web/bridges/index.js +5 -0
  49. package/dist/src/web/bridges/index.js.map +1 -0
  50. package/dist/src/web/bridges/mcp-app-bridge.d.ts +38 -0
  51. package/dist/src/web/bridges/mcp-app-bridge.js +162 -0
  52. package/dist/src/web/bridges/mcp-app-bridge.js.map +1 -0
  53. package/dist/src/web/bridges/types.d.ts +57 -0
  54. package/dist/src/web/bridges/types.js +2 -0
  55. package/dist/src/web/bridges/types.js.map +1 -0
  56. package/dist/src/web/create-store.d.ts +3 -0
  57. package/dist/src/web/create-store.js +25 -0
  58. package/dist/src/web/create-store.js.map +1 -0
  59. package/dist/src/web/create-store.test.js +70 -0
  60. package/dist/src/web/create-store.test.js.map +1 -0
  61. package/dist/src/web/data-llm.d.ts +14 -0
  62. package/dist/src/web/data-llm.js +70 -0
  63. package/dist/src/web/data-llm.js.map +1 -0
  64. package/dist/src/web/data-llm.test.js +76 -0
  65. package/dist/src/web/data-llm.test.js.map +1 -0
  66. package/dist/src/web/{typed-hooks.d.ts → generate-helpers.d.ts} +23 -20
  67. package/dist/src/web/{typed-hooks.js → generate-helpers.js} +14 -10
  68. package/dist/src/web/generate-helpers.js.map +1 -0
  69. package/dist/src/web/generate-helpers.test-d.js +209 -0
  70. package/dist/src/web/generate-helpers.test-d.js.map +1 -0
  71. package/dist/src/web/{typed-hooks.test.js → generate-helpers.test.js} +5 -5
  72. package/dist/src/web/generate-helpers.test.js.map +1 -0
  73. package/dist/src/web/helpers/state.d.ts +7 -0
  74. package/dist/src/web/helpers/state.js +40 -0
  75. package/dist/src/web/helpers/state.js.map +1 -0
  76. package/dist/src/web/helpers/state.test.d.ts +1 -0
  77. package/dist/src/web/helpers/state.test.js +53 -0
  78. package/dist/src/web/helpers/state.test.js.map +1 -0
  79. package/dist/src/web/hooks/index.d.ts +4 -7
  80. package/dist/src/web/hooks/index.js +4 -7
  81. package/dist/src/web/hooks/index.js.map +1 -1
  82. package/dist/src/web/hooks/test/utils.d.ts +10 -0
  83. package/dist/src/web/hooks/test/utils.js +40 -0
  84. package/dist/src/web/hooks/test/utils.js.map +1 -0
  85. package/dist/src/web/hooks/use-call-tool.d.ts +21 -20
  86. package/dist/src/web/hooks/use-call-tool.js +19 -19
  87. package/dist/src/web/hooks/use-call-tool.js.map +1 -1
  88. package/dist/src/web/hooks/use-call-tool.test-d.d.ts +1 -0
  89. package/dist/src/web/hooks/use-call-tool.test-d.js +104 -0
  90. package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -0
  91. package/dist/src/web/hooks/use-call-tool.test.js +40 -12
  92. package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
  93. package/dist/src/web/hooks/use-display-mode.d.ts +1 -1
  94. package/dist/src/web/hooks/use-display-mode.js +6 -3
  95. package/dist/src/web/hooks/use-display-mode.js.map +1 -1
  96. package/dist/src/web/hooks/use-display-mode.test.js +3 -2
  97. package/dist/src/web/hooks/use-display-mode.test.js.map +1 -1
  98. package/dist/src/web/hooks/use-files.test.js +1 -1
  99. package/dist/src/web/hooks/use-files.test.js.map +1 -1
  100. package/dist/src/web/hooks/use-layout.d.ts +22 -0
  101. package/dist/src/web/hooks/use-layout.js +23 -0
  102. package/dist/src/web/hooks/use-layout.js.map +1 -0
  103. package/dist/src/web/hooks/use-layout.test.d.ts +1 -0
  104. package/dist/src/web/hooks/use-layout.test.js +95 -0
  105. package/dist/src/web/hooks/use-layout.test.js.map +1 -0
  106. package/dist/src/web/hooks/use-open-external.js +5 -3
  107. package/dist/src/web/hooks/use-open-external.js.map +1 -1
  108. package/dist/src/web/hooks/use-open-external.test.js +43 -17
  109. package/dist/src/web/hooks/use-open-external.test.js.map +1 -1
  110. package/dist/src/web/hooks/use-openai-global.d.ts +3 -2
  111. package/dist/src/web/hooks/use-openai-global.js +3 -20
  112. package/dist/src/web/hooks/use-openai-global.js.map +1 -1
  113. package/dist/src/web/hooks/use-request-modal.d.ts +6 -3
  114. package/dist/src/web/hooks/use-request-modal.js +6 -1
  115. package/dist/src/web/hooks/use-request-modal.js.map +1 -1
  116. package/dist/src/web/hooks/use-request-modal.test.js +37 -4
  117. package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
  118. package/dist/src/web/hooks/use-send-follow-up-message.js +3 -6
  119. package/dist/src/web/hooks/use-send-follow-up-message.js.map +1 -1
  120. package/dist/src/web/hooks/use-tool-info.d.ts +13 -2
  121. package/dist/src/web/hooks/use-tool-info.js +15 -11
  122. package/dist/src/web/hooks/use-tool-info.js.map +1 -1
  123. package/dist/src/web/hooks/use-tool-info.test-d.js +40 -5
  124. package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -1
  125. package/dist/src/web/hooks/use-tool-info.test.js +119 -48
  126. package/dist/src/web/hooks/use-tool-info.test.js.map +1 -1
  127. package/dist/src/web/hooks/use-user.d.ts +18 -0
  128. package/dist/src/web/hooks/use-user.js +19 -0
  129. package/dist/src/web/hooks/use-user.js.map +1 -0
  130. package/dist/src/web/hooks/use-user.test.d.ts +1 -0
  131. package/dist/src/web/hooks/use-user.test.js +93 -0
  132. package/dist/src/web/hooks/use-user.test.js.map +1 -0
  133. package/dist/src/web/hooks/use-widget-state.js +11 -9
  134. package/dist/src/web/hooks/use-widget-state.js.map +1 -1
  135. package/dist/src/web/hooks/use-widget-state.test.js +3 -2
  136. package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
  137. package/dist/src/web/index.d.ts +7 -4
  138. package/dist/src/web/index.js +7 -4
  139. package/dist/src/web/index.js.map +1 -1
  140. package/dist/src/web/plugin/data-llm.test.d.ts +1 -0
  141. package/dist/src/web/plugin/data-llm.test.js +81 -0
  142. package/dist/src/web/plugin/data-llm.test.js.map +1 -0
  143. package/dist/src/web/plugin/plugin.js +39 -0
  144. package/dist/src/web/plugin/plugin.js.map +1 -0
  145. package/dist/src/web/plugin/transform-data-llm.d.ts +12 -0
  146. package/dist/src/web/plugin/transform-data-llm.js +96 -0
  147. package/dist/src/web/plugin/transform-data-llm.js.map +1 -0
  148. package/dist/src/web/plugin/transform-data-llm.test.d.ts +1 -0
  149. package/dist/src/web/plugin/transform-data-llm.test.js +81 -0
  150. package/dist/src/web/plugin/transform-data-llm.test.js.map +1 -0
  151. package/dist/src/web/proxy.js +6 -1
  152. package/dist/src/web/proxy.js.map +1 -1
  153. package/dist/src/web/types.d.ts +38 -12
  154. package/dist/src/web/types.js +1 -0
  155. package/dist/src/web/types.js.map +1 -1
  156. package/package.json +28 -19
  157. package/README.md +0 -323
  158. package/dist/src/web/hooks/use-locale.d.ts +0 -1
  159. package/dist/src/web/hooks/use-locale.js +0 -5
  160. package/dist/src/web/hooks/use-locale.js.map +0 -1
  161. package/dist/src/web/hooks/use-locale.test.js +0 -21
  162. package/dist/src/web/hooks/use-locale.test.js.map +0 -1
  163. package/dist/src/web/hooks/use-theme.d.ts +0 -1
  164. package/dist/src/web/hooks/use-theme.js +0 -5
  165. package/dist/src/web/hooks/use-theme.js.map +0 -1
  166. package/dist/src/web/hooks/use-theme.test.js +0 -26
  167. package/dist/src/web/hooks/use-theme.test.js.map +0 -1
  168. package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
  169. package/dist/src/web/hooks/use-tool-output.js +0 -9
  170. package/dist/src/web/hooks/use-tool-output.js.map +0 -1
  171. package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
  172. package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
  173. package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
  174. package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
  175. package/dist/src/web/hooks/use-user-agent.js +0 -5
  176. package/dist/src/web/hooks/use-user-agent.js.map +0 -1
  177. package/dist/src/web/hooks/use-user-agent.test.js +0 -31
  178. package/dist/src/web/hooks/use-user-agent.test.js.map +0 -1
  179. package/dist/src/web/plugin.js +0 -28
  180. package/dist/src/web/plugin.js.map +0 -1
  181. package/dist/src/web/typed-hooks.js.map +0 -1
  182. package/dist/src/web/typed-hooks.test-d.js +0 -90
  183. package/dist/src/web/typed-hooks.test-d.js.map +0 -1
  184. package/dist/src/web/typed-hooks.test.js.map +0 -1
  185. /package/dist/src/web/{hooks/use-locale.test.d.ts → bridges/hooks/use-mcp-app-bridge.test.d.ts} +0 -0
  186. /package/dist/src/web/{hooks/use-theme.test.d.ts → create-store.test.d.ts} +0 -0
  187. /package/dist/src/web/{hooks/use-user-agent.test.d.ts → data-llm.test.d.ts} +0 -0
  188. /package/dist/src/web/{typed-hooks.test-d.d.ts → generate-helpers.test-d.d.ts} +0 -0
  189. /package/dist/src/web/{typed-hooks.test.d.ts → generate-helpers.test.d.ts} +0 -0
  190. /package/dist/src/web/{plugin.d.ts → plugin/plugin.d.ts} +0 -0
package/README.md DELETED
@@ -1,323 +0,0 @@
1
- <div align="center">
2
-
3
- # Skybridge
4
-
5
- **Skybridge is the TypeScript framework for building ChatGPT apps**
6
-
7
- [![By Alpic](https://img.shields.io/badge/Made%20by%20Alpic-f6ffed?logo=alpic)](https://alpic.ai)
8
-
9
- ![NPM Downloads](https://img.shields.io/npm/dm/skybridge?color=e90060)
10
- ![NPM Version](https://img.shields.io/npm/v/skybridge?color=e90060)
11
- ![GitHub License](https://img.shields.io/github/license/alpic-ai/skybridge?color=e90060)
12
-
13
- </div>
14
-
15
- Skybridge comes with 2 packages:
16
-
17
- - `skybridge/server`: A drop-in replacement of the `@modelcontextprotocol/sdk` official `McpServer` class with extra features for widget development.
18
- - `skybridge/web`: A react library with hooks and components to build widgets on the underlying _OpenAI iFrame skybridge_ runtime.
19
-
20
- ## Quick start
21
-
22
- To get started in less than a minute, you can [create a new repository](https://github.com/new?template_name=apps-sdk-template&template_owner=alpic-ai) using our [ChatGPT SDK template](https://github.com/alpic-ai/apps-sdk-template). This template includes a basic setup for both the server and the widgets.
23
-
24
- ## Installation
25
-
26
- ```bash
27
- pnpm add skybridge
28
- ```
29
-
30
- ## Concepts
31
-
32
- ### Widgets
33
-
34
- > A widget is a UI component that turns structured tool results into a human-friendly UI. Those are built using React components. They are rendered inside an iframe inline with the conversation on ChatGPT.
35
-
36
- Each widget in your app must have a unique name. The name is used to bridge the tool invocation result with the widget React component.
37
-
38
- For example, in order to register a new widget named `pokemon` on your ChatGPT app. You should have the following file structure and file contents:
39
-
40
- _Project structure_
41
-
42
- ```
43
- server/
44
- └── src/
45
- └── index.ts // Register the widget with McpServer.widget()
46
- web/
47
- └── src/
48
- └── widgets/
49
- └── pokemon.tsx // Use the same widget name as the file name
50
- ```
51
-
52
- _server/src/index.ts_
53
-
54
- ```ts
55
- import { McpServer } from "skybridge/server";
56
-
57
- const server = new McpServer();
58
-
59
- server.widget(
60
- "pokemon"
61
- // Remaining arguments...
62
- );
63
- ```
64
-
65
- _web/src/widgets/pokemon.tsx_
66
-
67
- ```ts
68
- import { mountWidget } from "skybridge/web";
69
-
70
- const Pokemon: React.FunctionComponent = () => {
71
- // Your React component code goes here...
72
- };
73
-
74
- mountWidget(<Pokemon />);
75
- ```
76
-
77
- ## Packages
78
-
79
- ### skybridge/server
80
-
81
- The `skybridge/server` package is a drop-in replacement of the `@modelcontextprotocol/sdk` official `McpServer` class with extra features for widget development. If you're already using the `@modelcontextprotocol/sdk`, you can simply replace your `McpServer` import with `skybridge/server` and you're good to go.
82
-
83
- ### skybridge/web
84
-
85
- The `skybridge/web` package is a react library with hooks and components to build widgets on the underlying _OpenAI iFrame skybridge_ runtime.
86
-
87
- **Vite plugin**
88
-
89
- The `skybridge/web` package comes with a Vite plugin that allows you to build your widgets as regular Vite apps.
90
-
91
- ```ts
92
- import { defineConfig } from "vite";
93
- import { skybridge } from "skybridge/web";
94
-
95
- export default defineConfig({
96
- plugins: [skybridge()],
97
- });
98
- ```
99
-
100
- **Typed Hooks**
101
-
102
- Skybridge provides fully typed hooks that give you autocomplete for tool names and type inference for inputs/outputs - similar to tRPC. This is opt-in and requires exporting your server type.
103
-
104
- > **Tip:** For the best TypeScript experience, use typed hooks throughout your application. They provide autocomplete, type safety, and better IDE support.
105
-
106
- _Server setup (server/src/index.ts)_
107
-
108
- ```ts
109
- import { McpServer } from "skybridge/server";
110
- import { z } from "zod";
111
-
112
- const server = new McpServer({ name: "my-app", version: "1.0" }, {})
113
- .widget("search-voyage", {}, {
114
- description: "Search for trips",
115
- inputSchema: {
116
- destination: z.string(),
117
- departureDate: z.string().optional(),
118
- },
119
- outputSchema: {
120
- results: z.array(z.object({ id: z.string(), name: z.string() })),
121
- totalCount: z.number(),
122
- },
123
- }, async ({ destination }) => {
124
- // Your tool logic here...
125
- return { content: [{ type: "text", text: `Found trips to ${destination}` }] };
126
- })
127
- .widget("get-details", {}, {
128
- inputSchema: { tripId: z.string() },
129
- }, async ({ tripId }) => {
130
- return { content: [{ type: "text", text: `Details for ${tripId}` }] };
131
- });
132
-
133
- // Export the server type for the client
134
- export type AppType = typeof server;
135
- ```
136
-
137
- _One-time setup (web/src/skybridge.ts)_
138
-
139
- Create typed hooks once and export them for use across your app. This file acts as a bridge between your server types and your widgets:
140
-
141
- ```ts
142
- import type { AppType } from "../server"; // type-only import
143
- import { createTypedHooks } from "skybridge/web";
144
-
145
- export const { useCallTool, useToolInfo } = createTypedHooks<AppType>();
146
- ```
147
-
148
- _Usage in widgets (web/src/widgets/search.tsx)_
149
-
150
- ```tsx
151
- import { useCallTool, useToolInfo } from "../skybridge"; // import typed hooks
152
-
153
- export function SearchWidget() {
154
- const { callTool, data, isPending } = useCallTool("search-voyage");
155
- // ^ autocomplete for tool names
156
- const toolInfo = useToolInfo<"search-voyage">();
157
- // ^ autocomplete for widget names
158
-
159
- const handleSearch = () => {
160
- callTool({ destination: "Spain" });
161
- // ^ autocomplete for input fields
162
- };
163
-
164
- return (
165
- <div>
166
- <button onClick={handleSearch} disabled={isPending}>
167
- Search
168
- </button>
169
- {toolInfo.isSuccess && (
170
- <div>Found {toolInfo.output.totalCount} results</div>
171
- // ^ typed output
172
- )}
173
- </div>
174
- );
175
- }
176
- ```
177
-
178
- **Hooks**
179
-
180
- The `skybridge/web` package comes with a set of hooks to help you build your widgets :
181
-
182
- - `useOpenAiGlobal`: A generic hook to get any global data from the OpenAI iFrame skybridge runtime (in `window.openai`).
183
- - `useToolOutput`: A hook to get the initial tool `structuredContent` returned when rendering the widget for the first time. The data inside this hook is not updated when the tool is called again.
184
- - `useToolResponseMetadata`: A hook to get the initial tool `meta` returned when rendering the widget for the first time. The data inside this hook is not updated when the tool is called again.
185
- - `useToolInfo`: A hook to get the tool input, output, and response metadata with type inference. Provides a discriminated union based on status (pending/success).
186
- - `useCallTool`: A @tanstack/react-query inspired hook to send make additional tool calls inside a widget.
187
- - `createTypedHooks`: A factory that creates typed versions of `useCallTool` and `useToolInfo` with full type inference from your server type.
188
-
189
- _useOpenAiGlobal_
190
-
191
- ```ts
192
- import { useOpenAiGlobal } from "skybridge/web";
193
-
194
- const theme = useOpenAiGlobal("theme");
195
- ```
196
-
197
- _useToolOutput_
198
-
199
- ```ts
200
- import { useToolOutput } from "skybridge/web";
201
-
202
- const toolOutput = useToolOutput();
203
- ```
204
-
205
- _useToolResponseMetadata_
206
-
207
- ```ts
208
- import { useToolResponseMetadata } from "skybridge/web";
209
-
210
- const toolResponseMetadata = useToolResponseMetadata();
211
- ```
212
-
213
- _useToolInfo_
214
-
215
- ```ts
216
- import { useToolInfo } from "skybridge/web";
217
-
218
- const toolInfo = useToolInfo<{
219
- input: { query: string };
220
- output: { results: string[] };
221
- responseMetadata: { id: number };
222
- }>();
223
-
224
- // toolInfo.input is typed based on the input type
225
- // toolInfo.output is typed based on the output type (undefined when pending)
226
- // toolInfo.status narrows correctly: "pending" | "success"
227
-
228
- if (toolInfo.isPending) {
229
- // toolInfo.output is undefined here
230
- console.log(toolInfo.input.query);
231
- }
232
-
233
- if (toolInfo.isSuccess) {
234
- // toolInfo.output is typed here
235
- console.log(toolInfo.output.results);
236
- }
237
- ```
238
-
239
- _useToolInfo_ with typed hooks (recommended)
240
-
241
- ```tsx
242
- import { useToolInfo } from "../skybridge"; // import typed hooks
243
-
244
- export function SearchWidget() {
245
- const toolInfo = useToolInfo<"search-voyage">();
246
- // ^ autocomplete for widget names
247
- // toolInfo.input is typed as { destination: string; departureDate?: string; ... }
248
- // toolInfo.output is typed as { results: Array<...>; totalCount: number; } | undefined
249
-
250
- if (toolInfo.isSuccess) {
251
- return <div>Found {toolInfo.output.totalCount} results</div>;
252
- }
253
-
254
- return <div>Searching for {toolInfo.input.destination}...</div>;
255
- }
256
- ```
257
-
258
- _useCallTool_ in synchronous mode
259
-
260
- ```ts
261
- import { useCallTool } from "skybridge/web";
262
-
263
- export const TestTool: React.FunctionComponent = () => {
264
- const { callTool, isPending } = useCallTool("myToolName");
265
-
266
- return (
267
- <div>
268
- <button
269
- disabled={isPending}
270
- onClick={() => {
271
- callTool({ input: "test input" }, {
272
- onSuccess: (data) => {
273
- alert("Tool returned: " + data);
274
- },
275
- });
276
- >
277
- Call Tool inside a widget
278
- </button>
279
- </div>
280
- );
281
- };
282
- ```
283
-
284
- _useCallTool_ in asynchronous mode
285
-
286
- ```ts
287
- import { useCallTool } from "skybridge/web";
288
-
289
- export const TestTool: React.FunctionComponent = () => {
290
- const { callToolAsync, isPending } = useCallTool("myToolName");
291
-
292
- return (
293
- <div>
294
- <button
295
- disabled={isPending}
296
- onClick={async () => {
297
- const data = await callToolAsync({ input: "test input" });
298
- alert("Tool returned: " + data);
299
- }}
300
- >
301
- Call Tool inside a widget
302
- </button>
303
- </div>
304
- );
305
- };
306
- ```
307
-
308
- ## Migrate your existing MCP server to a ChatGPT app
309
-
310
- If you're already using the `@modelcontextprotocol/sdk` to build a MCP server, you can migrate to a ChatGPT app by following these steps:
311
-
312
- 1. Replace your `McpServer` import from `@modelcontextprotocol/sdk` with the same import from `skybridge/server`
313
- 2. Create a new vite project in a folder named `web` and install the `skybridge` package
314
- 3. Replace the `vite.config.ts` file with the following:
315
-
316
- ```ts
317
- import { defineConfig } from "vite";
318
- import { skybridge } from "skybridge/web";
319
-
320
- export default defineConfig({
321
- plugins: [skybridge()],
322
- });
323
- ```
@@ -1 +0,0 @@
1
- export declare function useLocale(): string;
@@ -1,5 +0,0 @@
1
- import { useOpenAiGlobal } from "./use-openai-global.js";
2
- export function useLocale() {
3
- return useOpenAiGlobal("locale");
4
- }
5
- //# sourceMappingURL=use-locale.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-locale.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,SAAS;IACvB,OAAO,eAAe,CAAC,QAAQ,CAAE,CAAC;AACpC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { useLocale } from "./use-locale.js";
2
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
3
- import { renderHook } from "@testing-library/react";
4
- describe("useLocale", () => {
5
- let OpenaiMock;
6
- beforeEach(() => {
7
- OpenaiMock = {
8
- locale: "en-US",
9
- };
10
- vi.stubGlobal("openai", OpenaiMock);
11
- });
12
- afterEach(() => {
13
- vi.unstubAllGlobals();
14
- vi.resetAllMocks();
15
- });
16
- it("should return the current locale from window.openai.locale", () => {
17
- const { result } = renderHook(() => useLocale());
18
- expect(result.current).toBe("en-US");
19
- });
20
- });
21
- //# sourceMappingURL=use-locale.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-locale.test.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-locale.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAI,UAEH,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,GAAG;YACX,MAAM,EAAE,OAAO;SAChB,CAAC;QACF,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QAEjD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare function useTheme(): import("../types.js").Theme;
@@ -1,5 +0,0 @@
1
- import { useOpenAiGlobal } from "./use-openai-global.js";
2
- export function useTheme() {
3
- return useOpenAiGlobal("theme");
4
- }
5
- //# sourceMappingURL=use-theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-theme.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,QAAQ;IACtB,OAAO,eAAe,CAAC,OAAO,CAAE,CAAC;AACnC,CAAC"}
@@ -1,26 +0,0 @@
1
- import { useTheme } from "./use-theme.js";
2
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
3
- import { renderHook } from "@testing-library/react";
4
- describe("useTheme", () => {
5
- let OpenaiMock;
6
- beforeEach(() => {
7
- OpenaiMock = {
8
- theme: "light",
9
- };
10
- vi.stubGlobal("openai", OpenaiMock);
11
- });
12
- afterEach(() => {
13
- vi.unstubAllGlobals();
14
- vi.resetAllMocks();
15
- });
16
- it("should return the current theme from window.openai.theme", () => {
17
- const { result } = renderHook(() => useTheme());
18
- expect(result.current).toBe("light");
19
- });
20
- it("should return dark theme when set to dark", () => {
21
- OpenaiMock.theme = "dark";
22
- const { result } = renderHook(() => useTheme());
23
- expect(result.current).toBe("dark");
24
- });
25
- });
26
- //# sourceMappingURL=use-theme.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-theme.test.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-theme.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,IAAI,UAEH,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,GAAG;YACX,KAAK,EAAE,OAAO;SACf,CAAC;QACF,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC;QAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `output` property.
3
- */
4
- export declare function useToolOutput(): import("../types.js").UnknownObject | undefined;
@@ -1,9 +0,0 @@
1
- import { useToolInfo } from "./use-tool-info.js";
2
- /**
3
- * @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `output` property.
4
- */
5
- export function useToolOutput() {
6
- const { output } = useToolInfo();
7
- return output;
8
- }
9
- //# sourceMappingURL=use-tool-output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tool-output.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-tool-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `responseMetadata` property.
3
- */
4
- export declare function useToolResponseMetadata(): import("../types.js").UnknownObject | null | undefined;
@@ -1,8 +0,0 @@
1
- import { useOpenAiGlobal } from "./use-openai-global.js";
2
- /**
3
- * @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `responseMetadata` property.
4
- */
5
- export function useToolResponseMetadata() {
6
- return useOpenAiGlobal("toolResponseMetadata");
7
- }
8
- //# sourceMappingURL=use-tool-response-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tool-response-metadata.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-tool-response-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACjD,CAAC"}
@@ -1 +0,0 @@
1
- export declare function useUserAgent(): import("../types.js").UserAgent;
@@ -1,5 +0,0 @@
1
- import { useOpenAiGlobal } from "./use-openai-global.js";
2
- export function useUserAgent() {
3
- return useOpenAiGlobal("userAgent");
4
- }
5
- //# sourceMappingURL=use-user-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-user-agent.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-user-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,YAAY;IAC1B,OAAO,eAAe,CAAC,WAAW,CAAE,CAAC;AACvC,CAAC"}
@@ -1,31 +0,0 @@
1
- import { useUserAgent } from "./use-user-agent.js";
2
- import { describe, it, expect, vi, beforeEach, afterEach, } from "vitest";
3
- import { renderHook } from "@testing-library/react";
4
- describe("useUserAgent", () => {
5
- let OpenaiMock;
6
- beforeEach(() => {
7
- OpenaiMock = {
8
- userAgent: {
9
- device: { type: "mobile" },
10
- capabilities: { hover: false, touch: true },
11
- },
12
- };
13
- vi.stubGlobal("openai", OpenaiMock);
14
- });
15
- afterEach(() => {
16
- vi.unstubAllGlobals();
17
- vi.resetAllMocks();
18
- });
19
- it("should return the current user agent from window.openai.userAgent", () => {
20
- OpenaiMock.userAgent = {
21
- device: { type: "mobile" },
22
- capabilities: { hover: false, touch: true },
23
- };
24
- const { result } = renderHook(() => useUserAgent());
25
- expect(result.current).toEqual({
26
- device: { type: "mobile" },
27
- capabilities: { hover: false, touch: true },
28
- });
29
- });
30
- });
31
- //# sourceMappingURL=use-user-agent.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-user-agent.test.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-user-agent.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,EAAE,EACF,MAAM,EACN,EAAE,EACF,UAAU,EACV,SAAS,GAEV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,UAEH,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,GAAG;YACX,SAAS,EAAE;gBACT,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC1B,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;aAC5C;SACF,CAAC;QACF,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,UAAU,CAAC,SAAS,GAAG;YACrB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;SAC5C,CAAC;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;QAEpD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;YAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,28 +0,0 @@
1
- export function skybridge() {
2
- return {
3
- name: "skybridge",
4
- async config(config) {
5
- // Dynamic imports to ensure Node modules are only loaded in Node.js context
6
- const { globSync } = await import("node:fs");
7
- const { resolve } = await import("node:path");
8
- const projectRoot = config.root || process.cwd();
9
- const widgetsPattern = resolve(projectRoot, "src/widgets/*.{js,ts,jsx,tsx,html}");
10
- const input = Object.fromEntries(globSync(widgetsPattern).map((file) => [
11
- file.match(/src\/widgets\/(.+)\.tsx$/)?.[1],
12
- file,
13
- ]));
14
- return {
15
- base: "/assets",
16
- build: {
17
- manifest: true,
18
- minify: true,
19
- cssCodeSplit: false,
20
- rollupOptions: {
21
- input,
22
- },
23
- },
24
- };
25
- },
26
- };
27
- }
28
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/web/plugin.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS;IACvB,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,KAAK,CAAC,MAAM,CAAC,MAAM;YACjB,4EAA4E;YAC5E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;YAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;YAE9C,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACjD,MAAM,cAAc,GAAG,OAAO,CAC5B,WAAW,EACX,oCAAoC,CACrC,CAAC;YAEF,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAC9B,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACrC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC3C,IAAI;aACL,CAAC,CACH,CAAC;YAEF,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAI;oBACZ,YAAY,EAAE,KAAK;oBACnB,aAAa,EAAE;wBACb,KAAK;qBACN;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-hooks.js","sourceRoot":"","sources":["../../../src/web/typed-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAsB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAkB,MAAM,0BAA0B,CAAC;AAuBvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,UAAU,gBAAgB;IAI9B,OAAO;QACL;;;;;;;;;;;;;;;;;;WAkBG;QACH,WAAW,EAAE,CACX,IAAO,EACqD,EAAE;YAC9D,OAAO,WAAW,CAAC,IAAI,CAGtB,CAAC;QACJ,CAAC;QAED;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH,WAAW,EAAE,GAGX,EAAE;YACF,OAAO,WAAW,EAGjB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,90 +0,0 @@
1
- import { expectTypeOf, test } from "vitest";
2
- import { createTypedHooks } from "./typed-hooks.js";
3
- import { createTestServer } from "../test/utils.js";
4
- const server = createTestServer();
5
- test("InferTools extracts the tool registry type (widgets + registerTool)", () => {
6
- expectTypeOf().toHaveProperty("search-voyage");
7
- expectTypeOf().toHaveProperty("get-trip-details");
8
- expectTypeOf().toHaveProperty("no-input-widget");
9
- expectTypeOf().toHaveProperty("calculate-price");
10
- expectTypeOf().toHaveProperty("inferred-output-widget");
11
- expectTypeOf().toHaveProperty("inferred-tool");
12
- });
13
- test("ToolNames returns a union of tool name literals (widgets + registerTool)", () => {
14
- expectTypeOf().toEqualTypeOf();
15
- });
16
- test("ToolInput extracts the correct input type from Zod schema", () => {
17
- expectTypeOf().toEqualTypeOf();
18
- expectTypeOf().toEqualTypeOf();
19
- expectTypeOf().toEqualTypeOf();
20
- });
21
- test("ToolOutput extracts the correct output type from callback's structuredContent", () => {
22
- expectTypeOf().toEqualTypeOf();
23
- expectTypeOf().toEqualTypeOf();
24
- expectTypeOf().toEqualTypeOf();
25
- expectTypeOf().toEqualTypeOf();
26
- });
27
- test("ToolOutput extracts the correct output type from callback (inferred)", () => {
28
- expectTypeOf().toEqualTypeOf();
29
- expectTypeOf().toEqualTypeOf();
30
- });
31
- test("createTypedHooks provides autocomplete for tool names (widgets + registerTool)", () => {
32
- const { useCallTool } = createTypedHooks();
33
- useCallTool("search-voyage");
34
- useCallTool("get-trip-details");
35
- useCallTool("no-input-widget");
36
- useCallTool("calculate-price");
37
- useCallTool("inferred-output-widget");
38
- useCallTool("inferred-tool");
39
- // @ts-expect-error - "invalid-name" is not a valid tool name
40
- useCallTool("invalid-name");
41
- });
42
- test("useCallTool returns correctly typed callTool function", () => {
43
- const { useCallTool } = createTypedHooks();
44
- const { callTool } = useCallTool("search-voyage");
45
- callTool({ destination: "Spain" });
46
- callTool({ destination: "France", departureDate: "2024-06-01" });
47
- callTool({ destination: "Italy", maxPrice: 1000 });
48
- const { callTool: calculateTool } = useCallTool("calculate-price");
49
- calculateTool({ tripId: "123", passengers: 2 });
50
- });
51
- test("useCallTool returns correctly typed data", () => {
52
- const { useCallTool } = createTypedHooks();
53
- const { data } = useCallTool("search-voyage");
54
- if (data) {
55
- expectTypeOf(data.structuredContent).toExtend();
56
- expectTypeOf(data.structuredContent.results).toBeArray();
57
- expectTypeOf(data.structuredContent.totalCount).toBeNumber();
58
- }
59
- });
60
- test("useCallTool returns correctly typed data for callback-inferred outputs", () => {
61
- const { useCallTool } = createTypedHooks();
62
- const { data: widgetData } = useCallTool("inferred-output-widget");
63
- if (widgetData) {
64
- expectTypeOf(widgetData.structuredContent).toExtend();
65
- }
66
- const { data: toolData } = useCallTool("inferred-tool");
67
- if (toolData) {
68
- expectTypeOf(toolData.structuredContent).toExtend();
69
- }
70
- });
71
- test("createTypedHooks provides autocomplete for tool names in useToolInfo (widgets + registerTool)", () => {
72
- const { useToolInfo } = createTypedHooks();
73
- useToolInfo();
74
- useToolInfo();
75
- useToolInfo();
76
- useToolInfo();
77
- useToolInfo();
78
- useToolInfo();
79
- // @ts-expect-error - "invalid-name" is not a valid tool name
80
- useToolInfo();
81
- });
82
- test("useToolInfo infers input and output types", () => {
83
- const { useToolInfo } = createTypedHooks();
84
- const toolInfo = useToolInfo();
85
- expectTypeOf(toolInfo.input).toExtend();
86
- if (toolInfo.status === "success") {
87
- expectTypeOf(toolInfo.output).toExtend();
88
- }
89
- });
90
- //# sourceMappingURL=typed-hooks.test-d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-hooks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