skybridge 0.0.0-dev.c210709 → 0.0.0-dev.c269e58
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/devtoolsStaticServer.d.ts +15 -0
- package/dist/src/server/devtoolsStaticServer.js +38 -0
- package/dist/src/server/devtoolsStaticServer.js.map +1 -0
- package/dist/src/server/index.d.ts +3 -2
- package/dist/src/server/index.js +1 -0
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/inferUtilityTypes.d.ts +22 -6
- package/dist/src/server/server.d.ts +55 -16
- package/dist/src/server/server.js +54 -34
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/templateHelper.d.ts +3 -0
- package/dist/src/server/templateHelper.js +5 -4
- package/dist/src/server/templateHelper.js.map +1 -1
- package/dist/src/server/templates/development.hbs +3 -2
- package/dist/src/server/templates/production.hbs +1 -0
- package/dist/src/server/widgetsDevServer.js +3 -3
- package/dist/src/server/widgetsDevServer.js.map +1 -1
- package/dist/src/test/utils.d.ts +54 -8
- package/dist/src/test/utils.js +86 -8
- package/dist/src/test/utils.js.map +1 -1
- package/dist/src/test/widget.test.js +83 -27
- package/dist/src/test/widget.test.js.map +1 -1
- package/dist/src/web/bridges/apps-sdk-adapter.d.ts +2 -0
- package/dist/src/web/bridges/apps-sdk-adapter.js +4 -0
- package/dist/src/web/bridges/apps-sdk-adapter.js.map +1 -0
- package/dist/src/web/bridges/apps-sdk-bridge.d.ts +8 -0
- package/dist/src/web/bridges/apps-sdk-bridge.js +41 -0
- package/dist/src/web/bridges/apps-sdk-bridge.js.map +1 -0
- package/dist/src/web/bridges/get-bridge-methods.d.ts +2 -0
- package/dist/src/web/bridges/get-bridge-methods.js +8 -0
- package/dist/src/web/bridges/get-bridge-methods.js.map +1 -0
- package/dist/src/web/bridges/hooks/types.d.ts +6 -0
- package/dist/src/web/bridges/hooks/types.js +2 -0
- package/dist/src/web/bridges/hooks/types.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 +19 -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 +4 -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 +58 -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-adapter.d.ts +4 -0
- package/dist/src/web/bridges/mcp-app-adapter.js +44 -0
- package/dist/src/web/bridges/mcp-app-adapter.js.map +1 -0
- package/dist/src/web/bridges/mcp-app-bridge.d.ts +30 -0
- package/dist/src/web/bridges/mcp-app-bridge.js +139 -0
- package/dist/src/web/bridges/mcp-app-bridge.js.map +1 -0
- package/dist/src/web/bridges/types.d.ts +32 -0
- package/dist/src/web/bridges/types.js +2 -0
- package/dist/src/web/bridges/types.js.map +1 -0
- package/dist/src/web/create-store.d.ts +3 -0
- package/dist/src/web/create-store.js +25 -0
- package/dist/src/web/create-store.js.map +1 -0
- package/dist/src/web/create-store.test.js +70 -0
- package/dist/src/web/create-store.test.js.map +1 -0
- package/dist/src/web/data-llm.d.ts +14 -0
- package/dist/src/web/data-llm.js +68 -0
- package/dist/src/web/data-llm.js.map +1 -0
- package/dist/src/web/data-llm.test.js +76 -0
- package/dist/src/web/data-llm.test.js.map +1 -0
- package/dist/src/web/generate-helpers.d.ts +21 -18
- package/dist/src/web/generate-helpers.js +10 -6
- package/dist/src/web/generate-helpers.js.map +1 -1
- package/dist/src/web/generate-helpers.test-d.js +117 -1
- package/dist/src/web/generate-helpers.test-d.js.map +1 -1
- package/dist/src/web/generate-helpers.test.js +1 -1
- package/dist/src/web/generate-helpers.test.js.map +1 -1
- package/dist/src/web/helpers/state.d.ts +7 -0
- package/dist/src/web/helpers/state.js +40 -0
- package/dist/src/web/helpers/state.js.map +1 -0
- package/dist/src/web/helpers/state.test.d.ts +1 -0
- package/dist/src/web/helpers/state.test.js +53 -0
- package/dist/src/web/helpers/state.test.js.map +1 -0
- package/dist/src/web/hooks/index.d.ts +4 -7
- package/dist/src/web/hooks/index.js +4 -7
- package/dist/src/web/hooks/index.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.d.ts +21 -20
- package/dist/src/web/hooks/use-call-tool.js +7 -15
- package/dist/src/web/hooks/use-call-tool.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.test-d.d.ts +1 -0
- package/dist/src/web/hooks/use-call-tool.test-d.js +104 -0
- package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -0
- package/dist/src/web/hooks/use-call-tool.test.js +14 -12
- package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.d.ts +2 -2
- 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 +3 -2
- package/dist/src/web/hooks/use-display-mode.test.js.map +1 -1
- package/dist/src/web/hooks/use-files.test.js +1 -1
- package/dist/src/web/hooks/use-files.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.d.ts +1 -0
- package/dist/src/web/hooks/use-layout.test.js +46 -0
- package/dist/src/web/hooks/use-layout.test.js.map +1 -0
- package/dist/src/web/hooks/use-open-external.test.js +2 -2
- package/dist/src/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/src/web/hooks/use-openai-global.d.ts +3 -2
- package/dist/src/web/hooks/use-openai-global.js +3 -20
- 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 +37 -4
- package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +1 -1
- package/dist/src/web/hooks/use-tool-info.js +5 -7
- package/dist/src/web/hooks/use-tool-info.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js +0 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.test.js +3 -2
- 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.d.ts +1 -0
- package/dist/src/web/hooks/use-user.test.js +44 -0
- package/dist/src/web/hooks/use-user.test.js.map +1 -0
- package/dist/src/web/hooks/use-widget-state.js +11 -9
- package/dist/src/web/hooks/use-widget-state.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.test.js +3 -2
- package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
- package/dist/src/web/index.d.ts +7 -4
- package/dist/src/web/index.js +7 -4
- package/dist/src/web/index.js.map +1 -1
- package/dist/src/web/plugin/data-llm.test.d.ts +1 -0
- package/dist/src/web/plugin/data-llm.test.js +81 -0
- package/dist/src/web/plugin/data-llm.test.js.map +1 -0
- package/dist/src/web/plugin/plugin.js +39 -0
- package/dist/src/web/plugin/plugin.js.map +1 -0
- package/dist/src/web/plugin/transform-data-llm.d.ts +12 -0
- package/dist/src/web/plugin/transform-data-llm.js +93 -0
- package/dist/src/web/plugin/transform-data-llm.js.map +1 -0
- package/dist/src/web/plugin/transform-data-llm.test.d.ts +1 -0
- package/dist/src/web/plugin/transform-data-llm.test.js +81 -0
- package/dist/src/web/plugin/transform-data-llm.test.js.map +1 -0
- package/dist/src/web/proxy.js +6 -1
- package/dist/src/web/proxy.js.map +1 -1
- package/dist/src/web/types.d.ts +36 -8
- package/dist/src/web/types.js +1 -0
- package/dist/src/web/types.js.map +1 -1
- package/package.json +19 -9
- package/LICENSE +0 -674
- package/README.md +0 -371
- 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-tool-output.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-output.js +0 -9
- package/dist/src/web/hooks/use-tool-output.js.map +0 -1
- package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
- package/dist/src/web/hooks/use-tool-response-metadata.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/plugin.js +0 -28
- package/dist/src/web/plugin.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 → create-store.test.d.ts} +0 -0
- /package/dist/src/web/{hooks/use-user-agent.test.d.ts → data-llm.test.d.ts} +0 -0
- /package/dist/src/web/{plugin.d.ts → plugin/plugin.d.ts} +0 -0
package/dist/src/web/proxy.js
CHANGED
|
@@ -9,6 +9,11 @@ export function installOpenAILoggingProxy() {
|
|
|
9
9
|
console.warn("[openai-proxy] window.openai not found, skipping proxy installation");
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
+
const descriptor = Object.getOwnPropertyDescriptor(window, "openai");
|
|
13
|
+
if (descriptor?.configurable === false || descriptor?.writable === false) {
|
|
14
|
+
console.warn("[openai-proxy] window.openai is not configurable or writable, skipping proxy installation");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
const originalOpenAI = window.openai;
|
|
13
18
|
const handler = {
|
|
14
19
|
get(target, prop, receiver) {
|
|
@@ -16,7 +21,7 @@ export function installOpenAILoggingProxy() {
|
|
|
16
21
|
if (typeof value !== "function") {
|
|
17
22
|
return value;
|
|
18
23
|
}
|
|
19
|
-
return
|
|
24
|
+
return (...args) => {
|
|
20
25
|
const methodName = String(prop);
|
|
21
26
|
console.group(`%c[openai] %cmethod %c${methodName}`, `color: ${colors.brand}; font-weight: normal`, `color: ${colors.info}; font-weight: normal`, `color: ${colors.success}`);
|
|
22
27
|
console.log("%c← args:", `color: ${colors.info}`, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../../src/web/proxy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX,MAAM,UAAU,yBAAyB;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,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J,CAAC;QAED,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ;YAC/B,OAAO,CAAC,GAAG,CACT,yBAAyB,MAAM,CAAC,IAAI,CAAC,EAAE,EACvC,UAAU,MAAM,CAAC,KAAK,EAAE,EACxB,UAAU,MAAM,CAAC,IAAI,EAAE,EACvB,UAAU,MAAM,CAAC,OAAO,qBAAqB,EAC7C,GAAG,EACH,KAAK,CACN,CAAC;YAEF,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAEnD,OAAO,CAAC,GAAG,CACT,8DAA8D,EAC9D,UAAU,MAAM,CAAC,KAAK,EAAE,EACxB,UAAU,MAAM,CAAC,IAAI,EAAE,CACxB,CAAC;AACJ,CAAC"}
|
package/dist/src/web/types.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import type { WidgetHostType } from "../server/index.js";
|
|
3
|
+
declare module "react" {
|
|
4
|
+
interface HTMLAttributes<T> {
|
|
5
|
+
"data-llm"?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
1
8
|
export type UnknownObject = Record<string, unknown>;
|
|
2
9
|
export type Prettify<T> = {
|
|
3
10
|
[K in keyof T]: T[K];
|
|
4
11
|
} & {};
|
|
5
12
|
export type Objectify<T> = T & UnknownObject;
|
|
13
|
+
type RequiredKeys<T> = {
|
|
14
|
+
[K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
|
|
15
|
+
}[keyof T];
|
|
16
|
+
export type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
|
|
6
17
|
type WidgetState = UnknownObject;
|
|
7
18
|
type FileMetadata = {
|
|
8
19
|
fileId: string;
|
|
@@ -18,19 +29,24 @@ export declare class ToolResponseEvent extends CustomEvent<{
|
|
|
18
29
|
}
|
|
19
30
|
declare global {
|
|
20
31
|
interface Window {
|
|
21
|
-
|
|
32
|
+
skybridge: SkybridgeProperties;
|
|
33
|
+
openai: OpenAiMethods<WidgetState> & OpenAiProperties;
|
|
22
34
|
}
|
|
23
35
|
interface WindowEventMap {
|
|
24
36
|
[SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
|
-
export type
|
|
39
|
+
export type SkybridgeProperties = {
|
|
40
|
+
hostType: WidgetHostType;
|
|
41
|
+
};
|
|
42
|
+
export type OpenAiProperties<ToolInput extends UnknownObject = Record<never, unknown>, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
|
|
28
43
|
theme: Theme;
|
|
29
44
|
userAgent: UserAgent;
|
|
30
45
|
locale: string;
|
|
31
46
|
maxHeight: number;
|
|
32
47
|
displayMode: DisplayMode;
|
|
33
48
|
safeArea: SafeArea;
|
|
49
|
+
view: View;
|
|
34
50
|
toolInput: ToolInput;
|
|
35
51
|
toolOutput: ToolOutput | {
|
|
36
52
|
text: string;
|
|
@@ -49,7 +65,17 @@ export type CallToolResponse = {
|
|
|
49
65
|
result: string;
|
|
50
66
|
meta: Record<string, unknown>;
|
|
51
67
|
};
|
|
52
|
-
type
|
|
68
|
+
export type RequestModalOptions = {
|
|
69
|
+
title?: string;
|
|
70
|
+
params?: Record<string, unknown>;
|
|
71
|
+
anchor?: {
|
|
72
|
+
top?: number;
|
|
73
|
+
left?: number;
|
|
74
|
+
width?: number;
|
|
75
|
+
height?: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
|
|
53
79
|
/** Calls a tool on your MCP. Returns the full response. */
|
|
54
80
|
callTool: <ToolArgs extends CallToolArgs = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
|
|
55
81
|
/** Triggers a followup turn in the ChatGPT conversation */
|
|
@@ -79,9 +105,7 @@ type API<WidgetState extends UnknownObject> = {
|
|
|
79
105
|
* Opens a modal portaled outside of the widget iFrame.
|
|
80
106
|
* This ensures the modal is correctly displayed and not limited to the widget's area.
|
|
81
107
|
*/
|
|
82
|
-
requestModal: (args:
|
|
83
|
-
title: string;
|
|
84
|
-
}) => Promise<void>;
|
|
108
|
+
requestModal: (args: RequestModalOptions) => Promise<void>;
|
|
85
109
|
/** Uploads a new file to the host */
|
|
86
110
|
uploadFile: (file: File) => Promise<FileMetadata>;
|
|
87
111
|
/**
|
|
@@ -94,12 +118,16 @@ type API<WidgetState extends UnknownObject> = {
|
|
|
94
118
|
};
|
|
95
119
|
export declare const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
96
120
|
export declare class SetGlobalsEvent extends CustomEvent<{
|
|
97
|
-
globals: Partial<
|
|
121
|
+
globals: Partial<OpenAiProperties>;
|
|
98
122
|
}> {
|
|
99
123
|
readonly type = "openai:set_globals";
|
|
100
124
|
}
|
|
101
125
|
export type CallTool = (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
|
|
102
|
-
export type DisplayMode = "pip" | "inline" | "fullscreen";
|
|
126
|
+
export type DisplayMode = "pip" | "inline" | "fullscreen" | "modal";
|
|
127
|
+
export type View = {
|
|
128
|
+
mode: DisplayMode;
|
|
129
|
+
params?: Record<string, unknown>;
|
|
130
|
+
};
|
|
103
131
|
export type Theme = "light" | "dark";
|
|
104
132
|
export type SafeAreaInsets = {
|
|
105
133
|
top: number;
|
package/dist/src/web/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AAwBf,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AA0GD,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,OAAO,eAAgB,SAAQ,WAEnC;IACkB,IAAI,GAAG,sBAAsB,CAAC;CACjD"}
|
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.c269e58",
|
|
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"
|
|
@@ -19,12 +23,11 @@
|
|
|
19
23
|
"scripts": {
|
|
20
24
|
"build": "tsc && pnpm run build:templates",
|
|
21
25
|
"build:templates": "cp -r src/server/templates dist/src/server/",
|
|
22
|
-
"
|
|
23
|
-
"test
|
|
26
|
+
"format": "biome check --write --error-on-warnings",
|
|
27
|
+
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
28
|
+
"test:unit": "vitest run",
|
|
24
29
|
"test:type": "tsc --noEmit",
|
|
25
|
-
"
|
|
26
|
-
"docs:build": "pnpm --filter @skybridge/docs build",
|
|
27
|
-
"docs:serve": "pnpm --filter @skybridge/docs serve"
|
|
30
|
+
"test:format": "biome ci"
|
|
28
31
|
},
|
|
29
32
|
"keywords": [
|
|
30
33
|
"chatgpt",
|
|
@@ -35,21 +38,27 @@
|
|
|
35
38
|
"author": "Frédéric Barthelet",
|
|
36
39
|
"license": "ISC",
|
|
37
40
|
"peerDependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": ">=1.0.0",
|
|
38
42
|
"react": ">=18.0.0",
|
|
39
43
|
"react-dom": ">=18.0.0"
|
|
40
44
|
},
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@
|
|
46
|
+
"@babel/core": "^7.28.5",
|
|
43
47
|
"cors": "^2.8.5",
|
|
44
48
|
"express": "^5.1.0",
|
|
45
49
|
"handlebars": "^4.7.8",
|
|
50
|
+
"superjson": "^2.2.6",
|
|
46
51
|
"vite": "^7.1.11",
|
|
47
|
-
"
|
|
52
|
+
"zustand": "^5.0.9"
|
|
48
53
|
},
|
|
49
54
|
"devDependencies": {
|
|
55
|
+
"@biomejs/biome": "2.3.8",
|
|
56
|
+
"@modelcontextprotocol/ext-apps": "^0.2.2",
|
|
57
|
+
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
50
58
|
"@testing-library/dom": "^10.4.1",
|
|
51
59
|
"@testing-library/react": "^16.3.0",
|
|
52
60
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
61
|
+
"@types/babel__core": "^7.20.5",
|
|
53
62
|
"@types/cors": "^2.8.19",
|
|
54
63
|
"@types/express": "^5.0.3",
|
|
55
64
|
"@types/jsdom": "^21.1.6",
|
|
@@ -59,7 +68,8 @@
|
|
|
59
68
|
"@vitest/ui": "^2.1.8",
|
|
60
69
|
"jsdom": "^25.0.1",
|
|
61
70
|
"typescript": "^5.9.3",
|
|
62
|
-
"vitest": "^2.1.8"
|
|
71
|
+
"vitest": "^2.1.8",
|
|
72
|
+
"zod": "^4.1.13"
|
|
63
73
|
},
|
|
64
74
|
"packageManager": "pnpm@10.17.1"
|
|
65
75
|
}
|