skybridge 0.0.0-dev.d4e36b5 → 0.0.0-dev.d6a0040

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 (163) hide show
  1. package/LICENSE +21 -674
  2. package/README.md +77 -80
  3. package/dist/src/server/devtoolsStaticServer.d.ts +15 -0
  4. package/dist/src/server/devtoolsStaticServer.js +38 -0
  5. package/dist/src/server/devtoolsStaticServer.js.map +1 -0
  6. package/dist/src/server/index.d.ts +3 -0
  7. package/dist/src/server/index.js +1 -0
  8. package/dist/src/server/index.js.map +1 -1
  9. package/dist/src/server/inferUtilityTypes.d.ts +64 -0
  10. package/dist/src/server/inferUtilityTypes.js +2 -0
  11. package/dist/src/server/inferUtilityTypes.js.map +1 -0
  12. package/dist/src/server/server.d.ts +62 -9
  13. package/dist/src/server/server.js +56 -28
  14. package/dist/src/server/server.js.map +1 -1
  15. package/dist/src/server/templateHelper.d.ts +9 -8
  16. package/dist/src/server/templateHelper.js +5 -12
  17. package/dist/src/server/templateHelper.js.map +1 -1
  18. package/dist/src/server/templates/development.hbs +2 -2
  19. package/dist/src/server/templates/production.hbs +2 -2
  20. package/dist/src/server/widgetsDevServer.js +3 -3
  21. package/dist/src/server/widgetsDevServer.js.map +1 -1
  22. package/dist/src/test/utils.d.ts +97 -1
  23. package/dist/src/test/utils.js +182 -3
  24. package/dist/src/test/utils.js.map +1 -1
  25. package/dist/src/test/widget.test.js +62 -19
  26. package/dist/src/test/widget.test.js.map +1 -1
  27. package/dist/src/web/create-store.d.ts +3 -0
  28. package/dist/src/web/create-store.js +25 -0
  29. package/dist/src/web/create-store.js.map +1 -0
  30. package/dist/src/web/create-store.test.js +70 -0
  31. package/dist/src/web/create-store.test.js.map +1 -0
  32. package/dist/src/web/data-llm.d.ts +14 -0
  33. package/dist/src/web/data-llm.js +68 -0
  34. package/dist/src/web/data-llm.js.map +1 -0
  35. package/dist/src/web/data-llm.test.d.ts +1 -0
  36. package/dist/src/web/data-llm.test.js +76 -0
  37. package/dist/src/web/data-llm.test.js.map +1 -0
  38. package/dist/src/web/generate-helpers.d.ts +115 -0
  39. package/dist/src/web/generate-helpers.js +111 -0
  40. package/dist/src/web/generate-helpers.js.map +1 -0
  41. package/dist/src/web/generate-helpers.test-d.d.ts +1 -0
  42. package/dist/src/web/generate-helpers.test-d.js +180 -0
  43. package/dist/src/web/generate-helpers.test-d.js.map +1 -0
  44. package/dist/src/web/generate-helpers.test.d.ts +1 -0
  45. package/dist/src/web/generate-helpers.test.js +17 -0
  46. package/dist/src/web/generate-helpers.test.js.map +1 -0
  47. package/dist/src/web/helpers/state.d.ts +7 -0
  48. package/dist/src/web/helpers/state.js +40 -0
  49. package/dist/src/web/helpers/state.js.map +1 -0
  50. package/dist/src/web/helpers/state.test.d.ts +1 -0
  51. package/dist/src/web/helpers/state.test.js +53 -0
  52. package/dist/src/web/helpers/state.test.js.map +1 -0
  53. package/dist/src/web/hooks/index.d.ts +12 -0
  54. package/dist/src/web/hooks/index.js +13 -0
  55. package/dist/src/web/hooks/index.js.map +1 -0
  56. package/dist/src/web/hooks/use-call-tool.d.ts +100 -0
  57. package/dist/src/web/hooks/use-call-tool.js +60 -0
  58. package/dist/src/web/hooks/use-call-tool.js.map +1 -0
  59. package/dist/src/web/hooks/use-call-tool.test-d.d.ts +1 -0
  60. package/dist/src/web/hooks/use-call-tool.test-d.js +104 -0
  61. package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -0
  62. package/dist/src/web/hooks/use-call-tool.test.d.ts +1 -0
  63. package/dist/src/web/hooks/use-call-tool.test.js +165 -0
  64. package/dist/src/web/hooks/use-call-tool.test.js.map +1 -0
  65. package/dist/src/web/hooks/use-display-mode.d.ts +4 -0
  66. package/dist/src/web/hooks/use-display-mode.js +7 -0
  67. package/dist/src/web/hooks/use-display-mode.js.map +1 -0
  68. package/dist/src/web/hooks/use-display-mode.test.d.ts +1 -0
  69. package/dist/src/web/hooks/use-display-mode.test.js +40 -0
  70. package/dist/src/web/hooks/use-display-mode.test.js.map +1 -0
  71. package/dist/src/web/hooks/use-files.d.ts +10 -0
  72. package/dist/src/web/hooks/use-files.js +7 -0
  73. package/dist/src/web/hooks/use-files.js.map +1 -0
  74. package/dist/src/web/hooks/use-files.test.d.ts +1 -0
  75. package/dist/src/web/hooks/use-files.test.js +29 -0
  76. package/dist/src/web/hooks/use-files.test.js.map +1 -0
  77. package/dist/src/web/hooks/use-locale.d.ts +1 -0
  78. package/dist/src/web/hooks/use-locale.js +5 -0
  79. package/dist/src/web/hooks/use-locale.js.map +1 -0
  80. package/dist/src/web/hooks/use-locale.test.d.ts +1 -0
  81. package/dist/src/web/hooks/use-locale.test.js +21 -0
  82. package/dist/src/web/hooks/use-locale.test.js.map +1 -0
  83. package/dist/src/web/hooks/use-open-external.d.ts +1 -0
  84. package/dist/src/web/hooks/use-open-external.js +6 -0
  85. package/dist/src/web/hooks/use-open-external.js.map +1 -0
  86. package/dist/src/web/hooks/use-open-external.test.d.ts +1 -0
  87. package/dist/src/web/hooks/use-open-external.test.js +24 -0
  88. package/dist/src/web/hooks/use-open-external.test.js.map +1 -0
  89. package/dist/src/web/hooks/use-openai-global.d.ts +2 -0
  90. package/dist/src/web/{use-openai-global.js → hooks/use-openai-global.js} +7 -3
  91. package/dist/src/web/hooks/use-openai-global.js.map +1 -0
  92. package/dist/src/web/hooks/use-request-modal.d.ts +6 -0
  93. package/dist/src/web/hooks/use-request-modal.js +9 -0
  94. package/dist/src/web/hooks/use-request-modal.js.map +1 -0
  95. package/dist/src/web/hooks/use-request-modal.test.d.ts +1 -0
  96. package/dist/src/web/hooks/use-request-modal.test.js +24 -0
  97. package/dist/src/web/hooks/use-request-modal.test.js.map +1 -0
  98. package/dist/src/web/hooks/use-send-follow-up-message.d.ts +1 -0
  99. package/dist/src/web/hooks/use-send-follow-up-message.js +11 -0
  100. package/dist/src/web/hooks/use-send-follow-up-message.js.map +1 -0
  101. package/dist/src/web/hooks/use-theme.d.ts +1 -0
  102. package/dist/src/web/hooks/use-theme.js +5 -0
  103. package/dist/src/web/hooks/use-theme.js.map +1 -0
  104. package/dist/src/web/hooks/use-theme.test.d.ts +1 -0
  105. package/dist/src/web/hooks/use-theme.test.js +26 -0
  106. package/dist/src/web/hooks/use-theme.test.js.map +1 -0
  107. package/dist/src/web/hooks/use-tool-info.d.ts +25 -0
  108. package/dist/src/web/hooks/use-tool-info.js +20 -0
  109. package/dist/src/web/hooks/use-tool-info.js.map +1 -0
  110. package/dist/src/web/hooks/use-tool-info.test-d.d.ts +1 -0
  111. package/dist/src/web/hooks/use-tool-info.test-d.js +73 -0
  112. package/dist/src/web/hooks/use-tool-info.test-d.js.map +1 -0
  113. package/dist/src/web/hooks/use-tool-info.test.d.ts +1 -0
  114. package/dist/src/web/hooks/use-tool-info.test.js +59 -0
  115. package/dist/src/web/hooks/use-tool-info.test.js.map +1 -0
  116. package/dist/src/web/hooks/use-user-agent.d.ts +1 -0
  117. package/dist/src/web/hooks/use-user-agent.js +5 -0
  118. package/dist/src/web/hooks/use-user-agent.js.map +1 -0
  119. package/dist/src/web/hooks/use-user-agent.test.d.ts +1 -0
  120. package/dist/src/web/hooks/use-user-agent.test.js +31 -0
  121. package/dist/src/web/hooks/use-user-agent.test.js.map +1 -0
  122. package/dist/src/web/hooks/use-widget-state.d.ts +4 -0
  123. package/dist/src/web/hooks/use-widget-state.js +32 -0
  124. package/dist/src/web/hooks/use-widget-state.js.map +1 -0
  125. package/dist/src/web/hooks/use-widget-state.test.d.ts +1 -0
  126. package/dist/src/web/hooks/use-widget-state.test.js +60 -0
  127. package/dist/src/web/hooks/use-widget-state.test.js.map +1 -0
  128. package/dist/src/web/index.d.ts +6 -4
  129. package/dist/src/web/index.js +6 -4
  130. package/dist/src/web/index.js.map +1 -1
  131. package/dist/src/web/mount-widget.js +5 -0
  132. package/dist/src/web/mount-widget.js.map +1 -1
  133. package/dist/src/web/plugin/data-llm.test.d.ts +1 -0
  134. package/dist/src/web/plugin/data-llm.test.js +81 -0
  135. package/dist/src/web/plugin/data-llm.test.js.map +1 -0
  136. package/dist/src/web/plugin/plugin.js +39 -0
  137. package/dist/src/web/plugin/plugin.js.map +1 -0
  138. package/dist/src/web/plugin/transform-data-llm.d.ts +12 -0
  139. package/dist/src/web/plugin/transform-data-llm.js +93 -0
  140. package/dist/src/web/plugin/transform-data-llm.js.map +1 -0
  141. package/dist/src/web/plugin/transform-data-llm.test.d.ts +1 -0
  142. package/dist/src/web/plugin/transform-data-llm.test.js +81 -0
  143. package/dist/src/web/plugin/transform-data-llm.test.js.map +1 -0
  144. package/dist/src/web/proxy.d.ts +1 -0
  145. package/dist/src/web/proxy.js +48 -0
  146. package/dist/src/web/proxy.js.map +1 -0
  147. package/dist/src/web/types.d.ts +56 -18
  148. package/dist/src/web/types.js +1 -0
  149. package/dist/src/web/types.js.map +1 -1
  150. package/dist/vitest.config.js +0 -1
  151. package/dist/vitest.config.js.map +1 -1
  152. package/package.json +20 -5
  153. package/dist/src/test/setup.js +0 -9
  154. package/dist/src/test/setup.js.map +0 -1
  155. package/dist/src/web/plugin.js +0 -31
  156. package/dist/src/web/plugin.js.map +0 -1
  157. package/dist/src/web/use-openai-global.d.ts +0 -2
  158. package/dist/src/web/use-openai-global.js.map +0 -1
  159. package/dist/src/web/use-tool-output.d.ts +0 -3
  160. package/dist/src/web/use-tool-output.js +0 -5
  161. package/dist/src/web/use-tool-output.js.map +0 -1
  162. /package/dist/src/{test/setup.d.ts → web/create-store.test.d.ts} +0 -0
  163. /package/dist/src/web/{plugin.d.ts → plugin/plugin.d.ts} +0 -0
@@ -1,14 +1,22 @@
1
- type UnknownObject = Record<string, unknown>;
2
- export type WidgetState = UnknownObject;
3
- export type SetWidgetState = (state: WidgetState) => Promise<void>;
4
- export type SendFollowUpMessage = (args: {
5
- prompt: string;
6
- }) => Promise<void>;
7
- export type RequestDisplayMode = (args: {
8
- mode: DisplayMode;
9
- }) => Promise<{
10
- mode: DisplayMode;
11
- }>;
1
+ import "react";
2
+ declare module "react" {
3
+ interface HTMLAttributes<T> {
4
+ "data-llm"?: string;
5
+ }
6
+ }
7
+ export type UnknownObject = Record<string, unknown>;
8
+ export type Prettify<T> = {
9
+ [K in keyof T]: T[K];
10
+ } & {};
11
+ export type Objectify<T> = T & UnknownObject;
12
+ type RequiredKeys<T> = {
13
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
14
+ }[keyof T];
15
+ export type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
16
+ type WidgetState = UnknownObject;
17
+ type FileMetadata = {
18
+ fileId: string;
19
+ };
12
20
  export declare const TOOL_RESPONSE_EVENT_TYPE = "openai:tool_response";
13
21
  export declare class ToolResponseEvent extends CustomEvent<{
14
22
  tool: {
@@ -20,13 +28,13 @@ export declare class ToolResponseEvent extends CustomEvent<{
20
28
  }
21
29
  declare global {
22
30
  interface Window {
23
- openai: API<WidgetState> & OpenAiGlobals;
31
+ openai: OpenAiMethods<WidgetState> & OpenAiProperties;
24
32
  }
25
33
  interface WindowEventMap {
26
34
  [SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
27
35
  }
28
36
  }
29
- export type OpenAiGlobals<ToolInput extends UnknownObject = UnknownObject, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
37
+ export type OpenAiProperties<ToolInput extends UnknownObject = Record<never, unknown>, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
30
38
  theme: Theme;
31
39
  userAgent: UserAgent;
32
40
  locale: string;
@@ -34,22 +42,32 @@ export type OpenAiGlobals<ToolInput extends UnknownObject = UnknownObject, ToolO
34
42
  displayMode: DisplayMode;
35
43
  safeArea: SafeArea;
36
44
  toolInput: ToolInput;
37
- toolOutput: ToolOutput | null;
45
+ toolOutput: ToolOutput | {
46
+ text: string;
47
+ } | null;
38
48
  toolResponseMetadata: ToolResponseMetadata | null;
39
49
  widgetState: WidgetState | null;
40
50
  };
51
+ export type CallToolArgs = Record<string, unknown> | null;
41
52
  export type CallToolResponse = {
53
+ content: {
54
+ type: "text";
55
+ text: string;
56
+ }[];
57
+ structuredContent: Record<string, unknown>;
58
+ isError: boolean;
42
59
  result: string;
60
+ meta: Record<string, unknown>;
43
61
  };
44
- type API<WidgetState extends UnknownObject> = {
62
+ export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
45
63
  /** Calls a tool on your MCP. Returns the full response. */
46
- callTool: (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
64
+ callTool: <ToolArgs extends CallToolArgs = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
47
65
  /** Triggers a followup turn in the ChatGPT conversation */
48
66
  sendFollowUpMessage: (args: {
49
67
  prompt: string;
50
68
  }) => Promise<void>;
51
69
  /** Opens an external link, redirects web page or mobile app */
52
- openExternal(payload: {
70
+ openExternal(args: {
53
71
  href: string;
54
72
  }): void;
55
73
  /** For transitioning an app from inline to fullscreen or pip */
@@ -62,11 +80,31 @@ type API<WidgetState extends UnknownObject> = {
62
80
  */
63
81
  mode: DisplayMode;
64
82
  }>;
83
+ /**
84
+ * Sets the widget state.
85
+ * This state is persisted across widget renders.
86
+ */
65
87
  setWidgetState: (state: WidgetState) => Promise<void>;
88
+ /**
89
+ * Opens a modal portaled outside of the widget iFrame.
90
+ * This ensures the modal is correctly displayed and not limited to the widget's area.
91
+ */
92
+ requestModal: (args: {
93
+ title: string;
94
+ }) => Promise<void>;
95
+ /** Uploads a new file to the host */
96
+ uploadFile: (file: File) => Promise<FileMetadata>;
97
+ /**
98
+ * Downloads a file from the host that was previously uploaded.
99
+ * Only files uploaded by the same connector instance can be downloaded.
100
+ */
101
+ downloadFile: (file: FileMetadata) => Promise<{
102
+ downloadUrl: string;
103
+ }>;
66
104
  };
67
105
  export declare const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
68
106
  export declare class SetGlobalsEvent extends CustomEvent<{
69
- globals: Partial<OpenAiGlobals>;
107
+ globals: Partial<OpenAiProperties>;
70
108
  }> {
71
109
  readonly type = "openai:set_globals";
72
110
  }
@@ -1,3 +1,4 @@
1
+ import "react";
1
2
  export const TOOL_RESPONSE_EVENT_TYPE = "openai:tool_response";
2
3
  export class ToolResponseEvent extends CustomEvent {
3
4
  type = TOOL_RESPONSE_EVENT_TYPE;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AA+DD,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;AAuBf,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"}
@@ -3,7 +3,6 @@ export default defineConfig({
3
3
  test: {
4
4
  environment: "jsdom",
5
5
  globals: true,
6
- setupFiles: ["./src/test/setup.ts"],
7
6
  },
8
7
  });
9
8
  //# sourceMappingURL=vitest.config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAe,YAAY,CAAC;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,CAAC,qBAAqB,CAAC;KACpC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAe,YAAY,CAAC;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,IAAI;KACd;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skybridge",
3
- "version": "0.0.0-dev.d4e36b5",
3
+ "version": "0.0.0-dev.d6a0040",
4
4
  "description": "Skybridge is a framework for building ChatGPT apps",
5
5
  "type": "module",
6
6
  "files": [
@@ -19,7 +19,14 @@
19
19
  "scripts": {
20
20
  "build": "tsc && pnpm run build:templates",
21
21
  "build:templates": "cp -r src/server/templates dist/src/server/",
22
- "test": "vitest run --silent"
22
+ "format": "biome check --write --error-on-warnings",
23
+ "test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
24
+ "test:unit": "vitest run",
25
+ "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"
23
30
  },
24
31
  "keywords": [
25
32
  "chatgpt",
@@ -30,19 +37,26 @@
30
37
  "author": "Frédéric Barthelet",
31
38
  "license": "ISC",
32
39
  "peerDependencies": {
40
+ "@modelcontextprotocol/sdk": ">=1.0.0",
33
41
  "react": ">=18.0.0",
34
42
  "react-dom": ">=18.0.0"
35
43
  },
36
44
  "dependencies": {
37
- "@modelcontextprotocol/sdk": "^1.20.0",
45
+ "@babel/core": "^7.28.5",
38
46
  "cors": "^2.8.5",
39
47
  "express": "^5.1.0",
40
48
  "handlebars": "^4.7.8",
49
+ "superjson": "^2.2.6",
41
50
  "vite": "^7.1.11",
42
- "zod": "^3.25.51"
51
+ "zustand": "^5.0.9"
43
52
  },
44
53
  "devDependencies": {
54
+ "@biomejs/biome": "2.3.8",
55
+ "@modelcontextprotocol/sdk": "^1.24.3",
56
+ "@testing-library/dom": "^10.4.1",
57
+ "@testing-library/react": "^16.3.0",
45
58
  "@total-typescript/tsconfig": "^1.0.4",
59
+ "@types/babel__core": "^7.20.5",
46
60
  "@types/cors": "^2.8.19",
47
61
  "@types/express": "^5.0.3",
48
62
  "@types/jsdom": "^21.1.6",
@@ -52,7 +66,8 @@
52
66
  "@vitest/ui": "^2.1.8",
53
67
  "jsdom": "^25.0.1",
54
68
  "typescript": "^5.9.3",
55
- "vitest": "^2.1.8"
69
+ "vitest": "^2.1.8",
70
+ "zod": "^4.1.13"
56
71
  },
57
72
  "packageManager": "pnpm@10.17.1"
58
73
  }
@@ -1,9 +0,0 @@
1
- import { vi } from "vitest";
2
- // Mock console methods to avoid noise in tests
3
- global.console = {
4
- ...console,
5
- error: vi.fn(),
6
- warn: vi.fn(),
7
- log: vi.fn(),
8
- };
9
- //# sourceMappingURL=setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE5B,+CAA+C;AAC/C,MAAM,CAAC,OAAO,GAAG;IACf,GAAG,OAAO;IACV,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE;IACd,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;IACb,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;CACb,CAAC"}
@@ -1,31 +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
- minify: true,
18
- cssCodeSplit: false,
19
- rollupOptions: {
20
- input,
21
- output: {
22
- entryFileNames: "[name].js",
23
- assetFileNames: "[name][extname]",
24
- },
25
- },
26
- },
27
- };
28
- },
29
- };
30
- }
31
- //# 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,MAAM,EAAE,IAAI;oBACZ,YAAY,EAAE,KAAK;oBACnB,aAAa,EAAE;wBACb,KAAK;wBACL,MAAM,EAAE;4BACN,cAAc,EAAE,WAAW;4BAC3B,cAAc,EAAE,iBAAiB;yBAClC;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type OpenAiGlobals } from "./types.js";
2
- export declare function useOpenAiGlobal<K extends keyof OpenAiGlobals>(key: K): OpenAiGlobals[K] | undefined;
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-openai-global.js","sourceRoot":"","sources":["../../../src/web/use-openai-global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAsB,MAAM,YAAY,CAAC;AAEzF,MAAM,UAAU,eAAe,CAAgC,GAAM;IACnE,OAAO,oBAAoB,CACzB,CAAC,QAAQ,EAAE,EAAE;QACX,MAAM,eAAe,GAAG,CAAC,KAAsB,EAAE,EAAE;YACjD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO;YACT,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YACvD,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC;QAEF,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,eAAe,EAAE;YAC/D,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;QACtE,CAAC,CAAC;IACJ,CAAC,EACD,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAC3B,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare function useToolOutput(): {
2
- [x: string]: unknown;
3
- } | null | undefined;
@@ -1,5 +0,0 @@
1
- import { useOpenAiGlobal } from "./use-openai-global.js";
2
- export function useToolOutput() {
3
- return useOpenAiGlobal("toolOutput");
4
- }
5
- //# sourceMappingURL=use-tool-output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tool-output.js","sourceRoot":"","sources":["../../../src/web/use-tool-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,aAAa;IAC3B,OAAO,eAAe,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC"}