skybridge 0.0.0-dev.786f7eb → 0.0.0-dev.78d86f0
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/src/server/index.d.ts +1 -1
- package/dist/src/server/server.d.ts +1 -0
- package/dist/src/server/server.js +12 -4
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/templateHelper.d.ts +3 -0
- package/dist/src/server/templateHelper.js.map +1 -1
- package/dist/src/server/templates/development.hbs +1 -0
- package/dist/src/server/templates/production.hbs +1 -0
- package/dist/src/server/widgetsDevServer.js +0 -1
- package/dist/src/server/widgetsDevServer.js.map +1 -1
- package/dist/src/test/widget.test.js +15 -3
- package/dist/src/test/widget.test.js.map +1 -1
- package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.d.ts +13 -0
- package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js +33 -0
- package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js.map +1 -0
- package/dist/src/web/bridges/adaptors/mcp-app-adaptor.d.ts +16 -0
- package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js +115 -0
- package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js.map +1 -0
- package/dist/src/web/bridges/apps-sdk-bridge.d.ts +10 -0
- package/dist/src/web/bridges/apps-sdk-bridge.js +46 -0
- package/dist/src/web/bridges/apps-sdk-bridge.js.map +1 -0
- package/dist/src/web/bridges/hooks/use-adaptor.d.ts +2 -0
- package/dist/src/web/bridges/hooks/use-adaptor.js +8 -0
- package/dist/src/web/bridges/hooks/use-adaptor.js.map +1 -0
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.d.ts +2 -0
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js +7 -0
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js.map +1 -0
- package/dist/src/web/bridges/hooks/use-bridge.d.ts +2 -0
- package/dist/src/web/bridges/hooks/use-bridge.js +8 -0
- package/dist/src/web/bridges/hooks/use-bridge.js.map +1 -0
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.d.ts +5 -0
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js +7 -0
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js.map +1 -0
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js +41 -0
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js.map +1 -0
- package/dist/src/web/bridges/index.d.ts +4 -0
- package/dist/src/web/bridges/index.js +5 -0
- package/dist/src/web/bridges/index.js.map +1 -0
- package/dist/src/web/bridges/mcp-app-bridge.d.ts +38 -0
- package/dist/src/web/bridges/mcp-app-bridge.js +162 -0
- package/dist/src/web/bridges/mcp-app-bridge.js.map +1 -0
- package/dist/src/web/bridges/types.d.ts +57 -0
- package/dist/src/web/bridges/types.js +2 -0
- package/dist/src/web/bridges/types.js.map +1 -0
- package/dist/src/web/data-llm.js +4 -2
- package/dist/src/web/data-llm.js.map +1 -1
- package/dist/src/web/generate-helpers.test-d.js +4 -1
- package/dist/src/web/generate-helpers.test-d.js.map +1 -1
- package/dist/src/web/hooks/index.d.ts +2 -3
- package/dist/src/web/hooks/index.js +2 -3
- package/dist/src/web/hooks/index.js.map +1 -1
- package/dist/src/web/hooks/test/utils.d.ts +10 -0
- package/dist/src/web/hooks/test/utils.js +40 -0
- package/dist/src/web/hooks/test/utils.js.map +1 -0
- package/dist/src/web/hooks/use-call-tool.js +12 -4
- package/dist/src/web/hooks/use-call-tool.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.test.js +26 -0
- package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.d.ts +1 -1
- package/dist/src/web/hooks/use-display-mode.js +6 -3
- package/dist/src/web/hooks/use-display-mode.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.test.js +1 -0
- package/dist/src/web/hooks/use-display-mode.test.js.map +1 -1
- package/dist/src/web/hooks/use-layout.d.ts +22 -0
- package/dist/src/web/hooks/use-layout.js +23 -0
- package/dist/src/web/hooks/use-layout.js.map +1 -0
- package/dist/src/web/hooks/use-layout.test.js +95 -0
- package/dist/src/web/hooks/use-layout.test.js.map +1 -0
- package/dist/src/web/hooks/use-open-external.js +5 -3
- package/dist/src/web/hooks/use-open-external.js.map +1 -1
- package/dist/src/web/hooks/use-open-external.test.js +41 -15
- package/dist/src/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/src/web/hooks/use-openai-global.d.ts +2 -1
- package/dist/src/web/hooks/use-openai-global.js +3 -22
- package/dist/src/web/hooks/use-openai-global.js.map +1 -1
- package/dist/src/web/hooks/use-request-modal.d.ts +6 -3
- package/dist/src/web/hooks/use-request-modal.js +6 -1
- package/dist/src/web/hooks/use-request-modal.js.map +1 -1
- package/dist/src/web/hooks/use-request-modal.test.js +35 -2
- package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/src/web/hooks/use-send-follow-up-message.js +3 -6
- package/dist/src/web/hooks/use-send-follow-up-message.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +12 -1
- package/dist/src/web/hooks/use-tool-info.js +15 -9
- package/dist/src/web/hooks/use-tool-info.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js +40 -4
- package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test.js +117 -46
- package/dist/src/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/src/web/hooks/use-user.d.ts +18 -0
- package/dist/src/web/hooks/use-user.js +19 -0
- package/dist/src/web/hooks/use-user.js.map +1 -0
- package/dist/src/web/hooks/use-user.test.js +93 -0
- package/dist/src/web/hooks/use-user.test.js.map +1 -0
- package/dist/src/web/hooks/use-widget-state.js +2 -2
- package/dist/src/web/hooks/use-widget-state.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.test.js +1 -0
- package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
- package/dist/src/web/index.d.ts +1 -0
- package/dist/src/web/index.js +1 -0
- package/dist/src/web/index.js.map +1 -1
- package/dist/src/web/plugin/transform-data-llm.js +6 -3
- package/dist/src/web/plugin/transform-data-llm.js.map +1 -1
- package/dist/src/web/proxy.js +5 -0
- package/dist/src/web/proxy.js.map +1 -1
- package/dist/src/web/types.d.ts +24 -8
- package/dist/src/web/types.js.map +1 -1
- package/package.json +11 -9
- package/LICENSE +0 -21
- package/README.md +0 -125
- package/dist/src/web/hooks/use-locale.d.ts +0 -1
- package/dist/src/web/hooks/use-locale.js +0 -5
- package/dist/src/web/hooks/use-locale.js.map +0 -1
- package/dist/src/web/hooks/use-locale.test.js +0 -21
- package/dist/src/web/hooks/use-locale.test.js.map +0 -1
- package/dist/src/web/hooks/use-theme.d.ts +0 -1
- package/dist/src/web/hooks/use-theme.js +0 -5
- package/dist/src/web/hooks/use-theme.js.map +0 -1
- package/dist/src/web/hooks/use-theme.test.js +0 -26
- package/dist/src/web/hooks/use-theme.test.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
- package/dist/src/web/hooks/use-user-agent.js +0 -5
- package/dist/src/web/hooks/use-user-agent.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.test.js +0 -31
- package/dist/src/web/hooks/use-user-agent.test.js.map +0 -1
- /package/dist/src/web/{hooks/use-locale.test.d.ts → bridges/hooks/use-mcp-app-bridge.test.d.ts} +0 -0
- /package/dist/src/web/hooks/{use-theme.test.d.ts → use-layout.test.d.ts} +0 -0
- /package/dist/src/web/hooks/{use-user-agent.test.d.ts → use-user.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.78d86f0",
|
|
4
4
|
"description": "Skybridge is a framework for building ChatGPT apps",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/alpic-ai/skybridge.git"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"files": [
|
|
7
11
|
"dist"
|
|
@@ -23,10 +27,7 @@
|
|
|
23
27
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
24
28
|
"test:unit": "vitest run",
|
|
25
29
|
"test:type": "tsc --noEmit",
|
|
26
|
-
"test:format": "biome ci"
|
|
27
|
-
"docs:dev": "pnpm --filter @skybridge/docs start",
|
|
28
|
-
"docs:build": "pnpm --filter @skybridge/docs build",
|
|
29
|
-
"docs:serve": "pnpm --filter @skybridge/docs serve"
|
|
30
|
+
"test:format": "biome ci"
|
|
30
31
|
},
|
|
31
32
|
"keywords": [
|
|
32
33
|
"chatgpt",
|
|
@@ -44,22 +45,23 @@
|
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@babel/core": "^7.28.5",
|
|
46
47
|
"cors": "^2.8.5",
|
|
48
|
+
"dequal": "^2.0.3",
|
|
47
49
|
"express": "^5.1.0",
|
|
48
50
|
"handlebars": "^4.7.8",
|
|
49
51
|
"superjson": "^2.2.6",
|
|
50
|
-
"vite": "^7.
|
|
52
|
+
"vite": "^7.3.0",
|
|
51
53
|
"zustand": "^5.0.9"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
|
-
"@
|
|
56
|
+
"@modelcontextprotocol/ext-apps": "^0.2.2",
|
|
55
57
|
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
56
58
|
"@testing-library/dom": "^10.4.1",
|
|
57
|
-
"@testing-library/react": "^16.3.
|
|
59
|
+
"@testing-library/react": "^16.3.1",
|
|
58
60
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
59
61
|
"@types/babel__core": "^7.20.5",
|
|
60
62
|
"@types/cors": "^2.8.19",
|
|
61
63
|
"@types/express": "^5.0.3",
|
|
62
|
-
"@types/jsdom": "^21.1.
|
|
64
|
+
"@types/jsdom": "^21.1.7",
|
|
63
65
|
"@types/node": "^22.15.30",
|
|
64
66
|
"@types/react": "^19.2.2",
|
|
65
67
|
"@types/react-dom": "^19.2.2",
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Alpic
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<img alt="Skybridge" src="docs/static/img/github-banner.png" width="100%">
|
|
4
|
-
|
|
5
|
-
<br />
|
|
6
|
-
|
|
7
|
-
# Skybridge
|
|
8
|
-
|
|
9
|
-
**Build ChatGPT Apps. The Modern TypeScript Way.**
|
|
10
|
-
|
|
11
|
-
The fullstack TypeScript framework for ChatGPT Apps.<br />
|
|
12
|
-
**Type-safe. React-powered. Zero config.**
|
|
13
|
-
|
|
14
|
-
<br />
|
|
15
|
-
|
|
16
|
-
[](https://www.npmjs.com/package/skybridge)
|
|
17
|
-
[](https://www.npmjs.com/package/skybridge)
|
|
18
|
-
[](https://github.com/alpic-ai/skybridge/blob/main/LICENSE)
|
|
19
|
-
|
|
20
|
-
<br />
|
|
21
|
-
|
|
22
|
-
[Documentation](https://skybridge.tech) · [Quick Start](https://github.com/new?template_name=apps-sdk-template&template_owner=alpic-ai) · [Examples](https://github.com/alpic-ai/apps-sdk-template)
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<br />
|
|
27
|
-
|
|
28
|
-
## ✨ Why Skybridge?
|
|
29
|
-
|
|
30
|
-
ChatGPT Apps let you embed **rich, interactive UIs** directly in conversations. But the raw SDK is low-level—no hooks, no type safety, no dev tools, and no HMR.
|
|
31
|
-
|
|
32
|
-
**Skybridge fixes that.**
|
|
33
|
-
|
|
34
|
-
| | |
|
|
35
|
-
|:--|:--|
|
|
36
|
-
| 👨💻 **Full Dev Environment** — HMR, debug traces, and local devtools. No more refresh loops. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to widget. Autocomplete everywhere. |
|
|
37
|
-
| 🔄 **Widget-to-Model Sync** — Keep the model aware of UI state with `data-llm`. Dual surfaces, one source of truth. | ⚒️ **React Query-style Hooks** — `isPending`, `isError`, callbacks. State management you already know. |
|
|
38
|
-
|
|
39
|
-
<br />
|
|
40
|
-
|
|
41
|
-
## 🚀 Get Started
|
|
42
|
-
|
|
43
|
-
**Create a new ChatGPT app:**
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
gh repo create my-app --template alpic-ai/apps-sdk-template --clone
|
|
47
|
-
cd my-app && pnpm install
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Or add to an existing project:**
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npm i skybridge
|
|
54
|
-
yarn add skybridge
|
|
55
|
-
pnpm add skybridge
|
|
56
|
-
bun add skybridge
|
|
57
|
-
deno add skybridge
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
<div align="center">
|
|
61
|
-
|
|
62
|
-
**👉 [Read the Docs](https://skybridge.tech) 👈**
|
|
63
|
-
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<br />
|
|
67
|
-
|
|
68
|
-
## 📦 The Stack
|
|
69
|
-
|
|
70
|
-
- **`skybridge/server`** — Drop-in MCP SDK replacement with widget registration and type inference.
|
|
71
|
-
- **`skybridge/web`** — React hooks and components for ChatGPT's runtime.
|
|
72
|
-
|
|
73
|
-
### Server
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
import { McpServer } from "skybridge/server";
|
|
77
|
-
|
|
78
|
-
server.registerWidget("flights", {}, {
|
|
79
|
-
inputSchema: { destination: z.string() },
|
|
80
|
-
}, async ({ destination }) => {
|
|
81
|
-
const flights = await searchFlights(destination);
|
|
82
|
-
return { structuredContent: { flights } };
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Widget
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
import { useToolInfo } from "skybridge/web";
|
|
90
|
-
|
|
91
|
-
function FlightsWidget() {
|
|
92
|
-
const { output } = useToolInfo();
|
|
93
|
-
|
|
94
|
-
return output.structuredContent.flights.map(f =>
|
|
95
|
-
<FlightCard key={f.id} flight={f} />
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
<br />
|
|
101
|
-
|
|
102
|
-
## 🎯 Features at a Glance
|
|
103
|
-
|
|
104
|
-
- **Live Reload** — Vite HMR. See changes instantly without reinstalling.
|
|
105
|
-
- **Typed Hooks** — Full autocomplete for tools, inputs, outputs.
|
|
106
|
-
- **Widget → Tool Calls** — Trigger server actions from UI.
|
|
107
|
-
- **Dual Surface Sync** — Keep model aware of what users see with `data-llm`.
|
|
108
|
-
- **React Query-style API** — `isPending`, `isError`, callbacks.
|
|
109
|
-
- **MCP Compatible** — Extends the official SDK. Works with any MCP client.
|
|
110
|
-
|
|
111
|
-
<br />
|
|
112
|
-
|
|
113
|
-
<div align="center">
|
|
114
|
-
|
|
115
|
-
[](https://github.com/alpic-ai/skybridge/discussions)
|
|
116
|
-
[](https://github.com/alpic-ai/skybridge/issues)
|
|
117
|
-
[](https://discord.com/invite/gNAazGueab)
|
|
118
|
-
|
|
119
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions
|
|
120
|
-
|
|
121
|
-
<br />
|
|
122
|
-
|
|
123
|
-
**[MIT License](LICENSE)** · Made with ❤️ by **[Alpic](https://alpic.ai)**
|
|
124
|
-
|
|
125
|
-
</div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocale(): string;
|
|
@@ -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,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { renderHook } from "@testing-library/react";
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { useLocale } from "./use-locale.js";
|
|
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,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,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 +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,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { renderHook } from "@testing-library/react";
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { useTheme } from "./use-theme.js";
|
|
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,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,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 +0,0 @@
|
|
|
1
|
-
export declare function useUserAgent(): import("../types.js").UserAgent;
|
|
@@ -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,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { renderHook } from "@testing-library/react";
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { useUserAgent } from "./use-user-agent.js";
|
|
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,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,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"}
|
/package/dist/src/web/{hooks/use-locale.test.d.ts → bridges/hooks/use-mcp-app-bridge.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|