skybridge 0.0.0-dev.708154c → 0.0.0-dev.71dd5a3
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/LICENSE +21 -674
- package/README.md +74 -147
- 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 -0
- package/dist/src/server/index.js +1 -0
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/inferUtilityTypes.d.ts +64 -0
- package/dist/src/server/inferUtilityTypes.js +2 -0
- package/dist/src/server/inferUtilityTypes.js.map +1 -0
- package/dist/src/server/server.d.ts +70 -9
- package/dist/src/server/server.js +55 -30
- 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 +108 -1
- package/dist/src/test/utils.js +202 -3
- package/dist/src/test/utils.js.map +1 -1
- package/dist/src/test/widget.test.js +86 -27
- package/dist/src/test/widget.test.js.map +1 -1
- 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.d.ts +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 +1 -0
- package/dist/src/web/data-llm.js +4 -3
- package/dist/src/web/data-llm.js.map +1 -1
- package/dist/src/web/data-llm.test.js.map +1 -1
- package/dist/src/web/generate-helpers.d.ts +115 -0
- package/dist/src/web/generate-helpers.js +111 -0
- package/dist/src/web/generate-helpers.js.map +1 -0
- package/dist/src/web/generate-helpers.test-d.d.ts +1 -0
- package/dist/src/web/generate-helpers.test-d.js +206 -0
- package/dist/src/web/generate-helpers.test-d.js.map +1 -0
- package/dist/src/web/generate-helpers.test.d.ts +1 -0
- package/dist/src/web/generate-helpers.test.js +17 -0
- package/dist/src/web/generate-helpers.test.js.map +1 -0
- 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 +2 -2
- package/dist/src/web/hooks/index.js +2 -2
- package/dist/src/web/hooks/index.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.d.ts +58 -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 +9 -15
- package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.js.map +1 -1
- package/dist/src/web/hooks/use-display-mode.test.js +2 -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-locale.js.map +1 -1
- package/dist/src/web/hooks/use-locale.test.js +2 -2
- package/dist/src/web/hooks/use-locale.test.js.map +1 -1
- 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 +2 -2
- package/dist/src/web/hooks/use-openai-global.js +7 -5
- package/dist/src/web/hooks/use-openai-global.js.map +1 -1
- package/dist/src/web/hooks/use-request-modal.test.js +2 -2
- package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/src/web/hooks/use-theme.js.map +1 -1
- package/dist/src/web/hooks/use-theme.test.js +2 -2
- package/dist/src/web/hooks/use-theme.test.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +4 -4
- package/dist/src/web/hooks/use-tool-info.js +4 -6
- 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 +2 -2
- package/dist/src/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/src/web/hooks/use-user-agent.js.map +1 -1
- package/dist/src/web/hooks/use-user-agent.test.js +2 -2
- package/dist/src/web/hooks/use-user-agent.test.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.js +3 -25
- package/dist/src/web/hooks/use-widget-state.js.map +1 -1
- package/dist/src/web/hooks/use-widget-state.test.js +2 -2
- package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
- package/dist/src/web/index.d.ts +4 -2
- package/dist/src/web/index.js +4 -2
- package/dist/src/web/index.js.map +1 -1
- package/dist/src/web/plugin/plugin.js +10 -4
- package/dist/src/web/plugin/plugin.js.map +1 -1
- package/dist/src/web/proxy.js +6 -1
- package/dist/src/web/proxy.js.map +1 -1
- package/dist/src/web/types.d.ts +18 -5
- package/dist/src/web/types.js.map +1 -1
- package/package.json +11 -5
package/dist/src/web/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { createStore } from "./create-store.js";
|
|
2
2
|
export * from "./data-llm.js";
|
|
3
|
+
export { generateHelpers } from "./generate-helpers.js";
|
|
4
|
+
export * from "./hooks/index.js";
|
|
3
5
|
export { mountWidget } from "./mount-widget.js";
|
|
4
6
|
export { skybridge } from "./plugin/plugin.js";
|
|
5
|
-
export * from "./
|
|
7
|
+
export * from "./types.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,cAAc,YAAY,CAAC"}
|
|
@@ -7,11 +7,17 @@ export function skybridge() {
|
|
|
7
7
|
const { globSync } = await import("node:fs");
|
|
8
8
|
const { resolve } = await import("node:path");
|
|
9
9
|
const projectRoot = config.root || process.cwd();
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
const flatWidgetPattern = resolve(projectRoot, "src/widgets/*.{js,ts,jsx,tsx,html}");
|
|
11
|
+
const dirWidgetPattern = resolve(projectRoot, "src/widgets/*/index.tsx");
|
|
12
|
+
const flatWidgets = globSync(flatWidgetPattern).map((file) => [
|
|
13
|
+
file.match(/src\/widgets\/([^/]+)\.tsx$/)?.[1],
|
|
13
14
|
file,
|
|
14
|
-
])
|
|
15
|
+
]);
|
|
16
|
+
const dirWidgets = globSync(dirWidgetPattern).map((file) => [
|
|
17
|
+
file.match(/src\/widgets\/([^/]+)\/index\.tsx$/)?.[1],
|
|
18
|
+
file,
|
|
19
|
+
]);
|
|
20
|
+
const input = Object.fromEntries([...flatWidgets, ...dirWidgets]);
|
|
15
21
|
return {
|
|
16
22
|
base: "/assets",
|
|
17
23
|
build: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/web/plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,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,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/web/plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,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,iBAAiB,GAAG,OAAO,CAC/B,WAAW,EACX,oCAAoC,CACrC,CAAC;YACF,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAAC;YAEzE,MAAM,WAAW,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC5D,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9C,IAAI;aACL,CAAC,CAAC;YACH,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1D,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACrD,IAAI;aACL,CAAC,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;YAElE,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;QACD,OAAO,EAAE,KAAK;QACd,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;YACtB,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
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,CAAC,IAAI,CACV,qEAAqE,CACtE,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAErC,MAAM,OAAO,GAAwC;QACnD,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;YACxB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YAElD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;gBAChC,OAAO,KAAK,CAAC;YACf,CAAC;YAED,OAAO,
|
|
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,K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/types.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import "react";
|
|
2
|
+
import type { WidgetHostType } from "../server/index.js";
|
|
2
3
|
declare module "react" {
|
|
3
|
-
interface HTMLAttributes<T
|
|
4
|
+
interface HTMLAttributes<T> {
|
|
4
5
|
"data-llm"?: string;
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
export type UnknownObject = Record<string, unknown>;
|
|
9
|
+
export type Prettify<T> = {
|
|
10
|
+
[K in keyof T]: T[K];
|
|
11
|
+
} & {};
|
|
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;
|
|
8
17
|
type WidgetState = UnknownObject;
|
|
9
18
|
type FileMetadata = {
|
|
10
19
|
fileId: string;
|
|
@@ -20,13 +29,17 @@ export declare class ToolResponseEvent extends CustomEvent<{
|
|
|
20
29
|
}
|
|
21
30
|
declare global {
|
|
22
31
|
interface Window {
|
|
23
|
-
|
|
32
|
+
skybridge: SkybridgeProperties;
|
|
33
|
+
openai: OpenAiMethods<WidgetState> & OpenAiProperties;
|
|
24
34
|
}
|
|
25
35
|
interface WindowEventMap {
|
|
26
36
|
[SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
|
|
27
37
|
}
|
|
28
38
|
}
|
|
29
|
-
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> = {
|
|
30
43
|
theme: Theme;
|
|
31
44
|
userAgent: UserAgent;
|
|
32
45
|
locale: string;
|
|
@@ -51,7 +64,7 @@ export type CallToolResponse = {
|
|
|
51
64
|
result: string;
|
|
52
65
|
meta: Record<string, unknown>;
|
|
53
66
|
};
|
|
54
|
-
type
|
|
67
|
+
export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
|
|
55
68
|
/** Calls a tool on your MCP. Returns the full response. */
|
|
56
69
|
callTool: <ToolArgs extends CallToolArgs = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
|
|
57
70
|
/** Triggers a followup turn in the ChatGPT conversation */
|
|
@@ -96,7 +109,7 @@ type API<WidgetState extends UnknownObject> = {
|
|
|
96
109
|
};
|
|
97
110
|
export declare const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
98
111
|
export declare class SetGlobalsEvent extends CustomEvent<{
|
|
99
|
-
globals: Partial<
|
|
112
|
+
globals: Partial<OpenAiProperties>;
|
|
100
113
|
}> {
|
|
101
114
|
readonly type = "openai:set_globals";
|
|
102
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;
|
|
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;AAmGD,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.71dd5a3",
|
|
4
4
|
"description": "Skybridge is a framework for building ChatGPT apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -19,9 +19,11 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc && pnpm run build:templates",
|
|
21
21
|
"build:templates": "cp -r src/server/templates dist/src/server/",
|
|
22
|
-
"
|
|
22
|
+
"format": "biome check --write --error-on-warnings",
|
|
23
|
+
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
23
24
|
"test:unit": "vitest run",
|
|
24
25
|
"test:type": "tsc --noEmit",
|
|
26
|
+
"test:format": "biome ci",
|
|
25
27
|
"docs:dev": "pnpm --filter @skybridge/docs start",
|
|
26
28
|
"docs:build": "pnpm --filter @skybridge/docs build",
|
|
27
29
|
"docs:serve": "pnpm --filter @skybridge/docs serve"
|
|
@@ -35,19 +37,22 @@
|
|
|
35
37
|
"author": "Frédéric Barthelet",
|
|
36
38
|
"license": "ISC",
|
|
37
39
|
"peerDependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": ">=1.0.0",
|
|
38
41
|
"react": ">=18.0.0",
|
|
39
42
|
"react-dom": ">=18.0.0"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
45
|
"@babel/core": "^7.28.5",
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.20.0",
|
|
44
46
|
"cors": "^2.8.5",
|
|
45
47
|
"express": "^5.1.0",
|
|
46
48
|
"handlebars": "^4.7.8",
|
|
49
|
+
"superjson": "^2.2.6",
|
|
47
50
|
"vite": "^7.1.11",
|
|
48
|
-
"
|
|
51
|
+
"zustand": "^5.0.9"
|
|
49
52
|
},
|
|
50
53
|
"devDependencies": {
|
|
54
|
+
"@biomejs/biome": "2.3.8",
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
51
56
|
"@testing-library/dom": "^10.4.1",
|
|
52
57
|
"@testing-library/react": "^16.3.0",
|
|
53
58
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
@@ -61,7 +66,8 @@
|
|
|
61
66
|
"@vitest/ui": "^2.1.8",
|
|
62
67
|
"jsdom": "^25.0.1",
|
|
63
68
|
"typescript": "^5.9.3",
|
|
64
|
-
"vitest": "^2.1.8"
|
|
69
|
+
"vitest": "^2.1.8",
|
|
70
|
+
"zod": "^4.1.13"
|
|
65
71
|
},
|
|
66
72
|
"packageManager": "pnpm@10.17.1"
|
|
67
73
|
}
|