skybridge 0.0.0-dev.ed8e93c → 0.0.0-dev.edc0ede

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 (141) hide show
  1. package/dist/src/server/devtoolsStaticServer.d.ts +15 -0
  2. package/dist/src/server/devtoolsStaticServer.js +38 -0
  3. package/dist/src/server/devtoolsStaticServer.js.map +1 -0
  4. package/dist/src/server/index.d.ts +3 -2
  5. package/dist/src/server/index.js +1 -0
  6. package/dist/src/server/index.js.map +1 -1
  7. package/dist/src/server/inferUtilityTypes.d.ts +10 -0
  8. package/dist/src/server/server.d.ts +42 -16
  9. package/dist/src/server/server.js +51 -31
  10. package/dist/src/server/server.js.map +1 -1
  11. package/dist/src/server/templateHelper.d.ts +3 -0
  12. package/dist/src/server/templateHelper.js +3 -2
  13. package/dist/src/server/templateHelper.js.map +1 -1
  14. package/dist/src/server/templates/development.hbs +3 -2
  15. package/dist/src/server/templates/production.hbs +1 -0
  16. package/dist/src/server/widgetsDevServer.js +1 -1
  17. package/dist/src/server/widgetsDevServer.js.map +1 -1
  18. package/dist/src/test/utils.d.ts +54 -8
  19. package/dist/src/test/utils.js +81 -3
  20. package/dist/src/test/utils.js.map +1 -1
  21. package/dist/src/test/widget.test.js +82 -25
  22. package/dist/src/test/widget.test.js.map +1 -1
  23. package/dist/src/web/bridges/apps-sdk-adapter.d.ts +4 -0
  24. package/dist/src/web/bridges/apps-sdk-adapter.js +10 -0
  25. package/dist/src/web/bridges/apps-sdk-adapter.js.map +1 -0
  26. package/dist/src/web/bridges/apps-sdk-bridge.d.ts +8 -0
  27. package/dist/src/web/bridges/apps-sdk-bridge.js +41 -0
  28. package/dist/src/web/bridges/apps-sdk-bridge.js.map +1 -0
  29. package/dist/src/web/bridges/get-bridge-methods.d.ts +2 -0
  30. package/dist/src/web/bridges/get-bridge-methods.js +8 -0
  31. package/dist/src/web/bridges/get-bridge-methods.js.map +1 -0
  32. package/dist/src/web/bridges/hooks/types.d.ts +6 -0
  33. package/dist/src/web/bridges/hooks/types.js +2 -0
  34. package/dist/src/web/bridges/hooks/types.js.map +1 -0
  35. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.d.ts +2 -0
  36. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js +7 -0
  37. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js.map +1 -0
  38. package/dist/src/web/bridges/hooks/use-bridge.d.ts +2 -0
  39. package/dist/src/web/bridges/hooks/use-bridge.js +19 -0
  40. package/dist/src/web/bridges/hooks/use-bridge.js.map +1 -0
  41. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.d.ts +4 -0
  42. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js +7 -0
  43. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js.map +1 -0
  44. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js +58 -0
  45. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js.map +1 -0
  46. package/dist/src/web/bridges/index.d.ts +4 -0
  47. package/dist/src/web/bridges/index.js +5 -0
  48. package/dist/src/web/bridges/index.js.map +1 -0
  49. package/dist/src/web/bridges/mcp-app-adapter.d.ts +6 -0
  50. package/dist/src/web/bridges/mcp-app-adapter.js +77 -0
  51. package/dist/src/web/bridges/mcp-app-adapter.js.map +1 -0
  52. package/dist/src/web/bridges/mcp-app-bridge.d.ts +30 -0
  53. package/dist/src/web/bridges/mcp-app-bridge.js +139 -0
  54. package/dist/src/web/bridges/mcp-app-bridge.js.map +1 -0
  55. package/dist/src/web/bridges/types.d.ts +43 -0
  56. package/dist/src/web/bridges/types.js +2 -0
  57. package/dist/src/web/bridges/types.js.map +1 -0
  58. package/dist/src/web/data-llm.js +2 -2
  59. package/dist/src/web/data-llm.js.map +1 -1
  60. package/dist/src/web/data-llm.test.js.map +1 -1
  61. package/dist/src/web/generate-helpers.d.ts +7 -5
  62. package/dist/src/web/generate-helpers.js +4 -2
  63. package/dist/src/web/generate-helpers.js.map +1 -1
  64. package/dist/src/web/generate-helpers.test-d.js +55 -2
  65. package/dist/src/web/generate-helpers.test-d.js.map +1 -1
  66. package/dist/src/web/helpers/state.test.js +2 -2
  67. package/dist/src/web/helpers/state.test.js.map +1 -1
  68. package/dist/src/web/hooks/index.d.ts +2 -3
  69. package/dist/src/web/hooks/index.js +2 -3
  70. package/dist/src/web/hooks/index.js.map +1 -1
  71. package/dist/src/web/hooks/use-call-tool.d.ts +1 -1
  72. package/dist/src/web/hooks/use-call-tool.js +3 -1
  73. package/dist/src/web/hooks/use-call-tool.js.map +1 -1
  74. package/dist/src/web/hooks/use-call-tool.test.js +11 -14
  75. package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
  76. package/dist/src/web/hooks/use-display-mode.d.ts +2 -2
  77. package/dist/src/web/hooks/use-display-mode.js +6 -3
  78. package/dist/src/web/hooks/use-display-mode.js.map +1 -1
  79. package/dist/src/web/hooks/use-display-mode.test.js +1 -0
  80. package/dist/src/web/hooks/use-display-mode.test.js.map +1 -1
  81. package/dist/src/web/hooks/use-layout.d.ts +22 -0
  82. package/dist/src/web/hooks/use-layout.js +23 -0
  83. package/dist/src/web/hooks/use-layout.js.map +1 -0
  84. package/dist/src/web/hooks/use-layout.test.js +46 -0
  85. package/dist/src/web/hooks/use-layout.test.js.map +1 -0
  86. package/dist/src/web/hooks/use-openai-global.d.ts +3 -2
  87. package/dist/src/web/hooks/use-openai-global.js +3 -20
  88. package/dist/src/web/hooks/use-openai-global.js.map +1 -1
  89. package/dist/src/web/hooks/use-request-modal.d.ts +6 -3
  90. package/dist/src/web/hooks/use-request-modal.js +6 -1
  91. package/dist/src/web/hooks/use-request-modal.js.map +1 -1
  92. package/dist/src/web/hooks/use-request-modal.test.js +35 -2
  93. package/dist/src/web/hooks/use-request-modal.test.js.map +1 -1
  94. package/dist/src/web/hooks/use-send-follow-up-message.js +2 -7
  95. package/dist/src/web/hooks/use-send-follow-up-message.js.map +1 -1
  96. package/dist/src/web/hooks/use-tool-info.d.ts +1 -1
  97. package/dist/src/web/hooks/use-tool-info.js +5 -7
  98. package/dist/src/web/hooks/use-tool-info.js.map +1 -1
  99. package/dist/src/web/hooks/use-tool-info.test-d.js +0 -1
  100. package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -1
  101. package/dist/src/web/hooks/use-tool-info.test.js +1 -0
  102. package/dist/src/web/hooks/use-tool-info.test.js.map +1 -1
  103. package/dist/src/web/hooks/use-user.d.ts +18 -0
  104. package/dist/src/web/hooks/use-user.js +19 -0
  105. package/dist/src/web/hooks/use-user.js.map +1 -0
  106. package/dist/src/web/hooks/use-user.test.js +44 -0
  107. package/dist/src/web/hooks/use-user.test.js.map +1 -0
  108. package/dist/src/web/hooks/use-widget-state.js +2 -2
  109. package/dist/src/web/hooks/use-widget-state.js.map +1 -1
  110. package/dist/src/web/hooks/use-widget-state.test.js +1 -0
  111. package/dist/src/web/hooks/use-widget-state.test.js.map +1 -1
  112. package/dist/src/web/index.d.ts +1 -0
  113. package/dist/src/web/index.js +1 -0
  114. package/dist/src/web/index.js.map +1 -1
  115. package/dist/src/web/plugin/plugin.js +10 -4
  116. package/dist/src/web/plugin/plugin.js.map +1 -1
  117. package/dist/src/web/proxy.js +5 -0
  118. package/dist/src/web/proxy.js.map +1 -1
  119. package/dist/src/web/types.d.ts +27 -11
  120. package/dist/src/web/types.js.map +1 -1
  121. package/package.json +12 -9
  122. package/LICENSE +0 -674
  123. package/README.md +0 -28
  124. package/dist/src/web/hooks/use-locale.d.ts +0 -1
  125. package/dist/src/web/hooks/use-locale.js +0 -5
  126. package/dist/src/web/hooks/use-locale.js.map +0 -1
  127. package/dist/src/web/hooks/use-locale.test.js +0 -21
  128. package/dist/src/web/hooks/use-locale.test.js.map +0 -1
  129. package/dist/src/web/hooks/use-theme.d.ts +0 -1
  130. package/dist/src/web/hooks/use-theme.js +0 -5
  131. package/dist/src/web/hooks/use-theme.js.map +0 -1
  132. package/dist/src/web/hooks/use-theme.test.js +0 -26
  133. package/dist/src/web/hooks/use-theme.test.js.map +0 -1
  134. package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
  135. package/dist/src/web/hooks/use-user-agent.js +0 -5
  136. package/dist/src/web/hooks/use-user-agent.js.map +0 -1
  137. package/dist/src/web/hooks/use-user-agent.test.js +0 -31
  138. package/dist/src/web/hooks/use-user-agent.test.js.map +0 -1
  139. /package/dist/src/web/{hooks/use-locale.test.d.ts → bridges/hooks/use-mcp-app-bridge.test.d.ts} +0 -0
  140. /package/dist/src/web/hooks/{use-theme.test.d.ts → use-layout.test.d.ts} +0 -0
  141. /package/dist/src/web/hooks/{use-user-agent.test.d.ts → use-user.test.d.ts} +0 -0
@@ -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 widgetsPattern = resolve(projectRoot, "src/widgets/*.{js,ts,jsx,tsx,html}");
11
- const input = Object.fromEntries(globSync(widgetsPattern).map((file) => [
12
- file.match(/src\/widgets\/(.+)\.tsx$/)?.[1],
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,CA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AAC;KACF,CAAC;AACJ,CAAC"}
@@ -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) {
@@ -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,CAAC,GAAG,IAAe,EAAE,EAAE;gBAC5B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;gBAEhC,OAAO,CAAC,KAAK,CACX,yBAAyB,UAAU,EAAE,EACrC,UAAU,MAAM,CAAC,KAAK,uBAAuB,EAC7C,UAAU,MAAM,CAAC,IA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E,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"}
@@ -1,6 +1,8 @@
1
1
  import "react";
2
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
+ import type { WidgetHostType } from "../server/index.js";
2
4
  declare module "react" {
3
- interface HTMLAttributes<T extends Element = HTMLElement> {
5
+ interface HTMLAttributes<T> {
4
6
  "data-llm"?: string;
5
7
  }
6
8
  }
@@ -10,7 +12,7 @@ export type Prettify<T> = {
10
12
  } & {};
11
13
  export type Objectify<T> = T & UnknownObject;
12
14
  type RequiredKeys<T> = {
13
- [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
15
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
14
16
  }[keyof T];
15
17
  export type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
16
18
  type WidgetState = UnknownObject;
@@ -28,19 +30,24 @@ export declare class ToolResponseEvent extends CustomEvent<{
28
30
  }
29
31
  declare global {
30
32
  interface Window {
33
+ skybridge: SkybridgeProperties;
31
34
  openai: OpenAiMethods<WidgetState> & OpenAiProperties;
32
35
  }
33
36
  interface WindowEventMap {
34
37
  [SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
35
38
  }
36
39
  }
37
- export type OpenAiProperties<ToolInput extends UnknownObject = {}, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
40
+ export type SkybridgeProperties = {
41
+ hostType: WidgetHostType;
42
+ };
43
+ export type OpenAiProperties<ToolInput extends UnknownObject = Record<never, unknown>, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
38
44
  theme: Theme;
39
45
  userAgent: UserAgent;
40
46
  locale: string;
41
47
  maxHeight: number;
42
48
  displayMode: DisplayMode;
43
49
  safeArea: SafeArea;
50
+ view: View;
44
51
  toolInput: ToolInput;
45
52
  toolOutput: ToolOutput | {
46
53
  text: string;
@@ -50,15 +57,22 @@ export type OpenAiProperties<ToolInput extends UnknownObject = {}, ToolOutput ex
50
57
  };
51
58
  export type CallToolArgs = Record<string, unknown> | null;
52
59
  export type CallToolResponse = {
53
- content: {
54
- type: "text";
55
- text: string;
56
- }[];
60
+ content: CallToolResult["content"];
57
61
  structuredContent: Record<string, unknown>;
58
62
  isError: boolean;
59
63
  result: string;
60
64
  meta: Record<string, unknown>;
61
65
  };
66
+ export type RequestModalOptions = {
67
+ title?: string;
68
+ params?: Record<string, unknown>;
69
+ anchor?: {
70
+ top?: number;
71
+ left?: number;
72
+ width?: number;
73
+ height?: number;
74
+ };
75
+ };
62
76
  export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
63
77
  /** Calls a tool on your MCP. Returns the full response. */
64
78
  callTool: <ToolArgs extends CallToolArgs = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
@@ -89,9 +103,7 @@ export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
89
103
  * Opens a modal portaled outside of the widget iFrame.
90
104
  * This ensures the modal is correctly displayed and not limited to the widget's area.
91
105
  */
92
- requestModal: (args: {
93
- title: string;
94
- }) => Promise<void>;
106
+ requestModal: (args: RequestModalOptions) => Promise<void>;
95
107
  /** Uploads a new file to the host */
96
108
  uploadFile: (file: File) => Promise<FileMetadata>;
97
109
  /**
@@ -109,7 +121,11 @@ export declare class SetGlobalsEvent extends CustomEvent<{
109
121
  readonly type = "openai:set_globals";
110
122
  }
111
123
  export type CallTool = (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
112
- export type DisplayMode = "pip" | "inline" | "fullscreen";
124
+ export type DisplayMode = "pip" | "inline" | "fullscreen" | "modal";
125
+ export type View = {
126
+ mode: DisplayMode;
127
+ params?: Record<string, unknown>;
128
+ };
113
129
  export type Theme = "light" | "dark";
114
130
  export type SafeAreaInsets = {
115
131
  top: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AAsBf,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AA8FD,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,OAAO,eAAgB,SAAQ,WAEnC;IACkB,IAAI,GAAG,sBAAsB,CAAC;CACjD"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AAyBf,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AAuGD,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.ed8e93c",
3
+ "version": "0.0.0-dev.edc0ede",
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,14 +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
- "format": "biome check --write",
26
+ "format": "biome check --write --error-on-warnings",
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 check",
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",
@@ -37,22 +38,23 @@
37
38
  "author": "Frédéric Barthelet",
38
39
  "license": "ISC",
39
40
  "peerDependencies": {
41
+ "@modelcontextprotocol/sdk": ">=1.0.0",
40
42
  "react": ">=18.0.0",
41
43
  "react-dom": ">=18.0.0"
42
44
  },
43
45
  "dependencies": {
44
46
  "@babel/core": "^7.28.5",
45
- "@modelcontextprotocol/sdk": "^1.20.0",
46
47
  "cors": "^2.8.5",
47
48
  "express": "^5.1.0",
48
49
  "handlebars": "^4.7.8",
49
50
  "superjson": "^2.2.6",
50
51
  "vite": "^7.1.11",
51
- "zod": "^3.25.51",
52
52
  "zustand": "^5.0.9"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@biomejs/biome": "2.3.8",
56
+ "@modelcontextprotocol/ext-apps": "^0.2.2",
57
+ "@modelcontextprotocol/sdk": "^1.24.3",
56
58
  "@testing-library/dom": "^10.4.1",
57
59
  "@testing-library/react": "^16.3.0",
58
60
  "@total-typescript/tsconfig": "^1.0.4",
@@ -66,7 +68,8 @@
66
68
  "@vitest/ui": "^2.1.8",
67
69
  "jsdom": "^25.0.1",
68
70
  "typescript": "^5.9.3",
69
- "vitest": "^2.1.8"
71
+ "vitest": "^2.1.8",
72
+ "zod": "^4.1.13"
70
73
  },
71
74
  "packageManager": "pnpm@10.17.1"
72
75
  }