skybridge 0.0.0-dev.ba902f0 → 0.0.0-dev.bb2eb8a

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.
@@ -2,10 +2,6 @@ import { type RequestHandler } from "express";
2
2
  /**
3
3
  * Serve the built devtools React app
4
4
  * This router serves static files from the devtools's dist directory.
5
- *
6
- * **Note:** This requires `@skybridge/devtools` to be installed as a peer dependency.
7
- * Install it with: `pnpm add -D @skybridge/devtools` (or `npm install -D @skybridge/devtools`)
8
- *
9
5
  * It should be installed at the application root, like so:
10
6
  *
11
7
  * const app = express();
@@ -1,15 +1,11 @@
1
- import { createRequire } from "node:module";
1
+ import { readFileSync } from "node:fs";
2
2
  import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
3
4
  import cors from "cors";
4
5
  import express, {} from "express";
5
- const require = createRequire(import.meta.url);
6
6
  /**
7
7
  * Serve the built devtools React app
8
8
  * This router serves static files from the devtools's dist directory.
9
- *
10
- * **Note:** This requires `@skybridge/devtools` to be installed as a peer dependency.
11
- * Install it with: `pnpm add -D @skybridge/devtools` (or `npm install -D @skybridge/devtools`)
12
- *
13
9
  * It should be installed at the application root, like so:
14
10
  *
15
11
  * const app = express();
@@ -22,26 +18,20 @@ const require = createRequire(import.meta.url);
22
18
  */
23
19
  export const devtoolsStaticServer = async () => {
24
20
  const router = express.Router();
25
- let devtoolsPath;
26
- try {
27
- const devtoolsPackagePath = require.resolve("@skybridge/devtools/package.json");
28
- devtoolsPath = path.join(path.dirname(devtoolsPackagePath), "dist");
29
- }
30
- catch (error) {
31
- throw new Error("@skybridge/devtools is not installed. Please install it as a dev dependency:\n" +
32
- " pnpm add -D @skybridge/devtools\n" +
33
- " or\n" +
34
- " npm install -D @skybridge/devtools", { cause: error });
35
- }
21
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
22
+ const devtoolsPath = path.join(currentDir, "..", "devtools");
36
23
  router.use(cors());
37
24
  router.use(express.static(devtoolsPath));
38
25
  router.get("/", (_req, res, next) => {
39
26
  const indexHtmlPath = path.join(devtoolsPath, "index.html");
40
- res.sendFile(indexHtmlPath, (error) => {
41
- if (error) {
42
- next(error);
43
- }
44
- });
27
+ try {
28
+ const indexHtml = readFileSync(indexHtmlPath, "utf-8");
29
+ res.setHeader("Content-Type", "text/html");
30
+ res.send(indexHtml);
31
+ }
32
+ catch (error) {
33
+ next(error);
34
+ }
45
35
  });
46
36
  return router;
47
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"devtoolsStaticServer.js","sourceRoot":"","sources":["../../../src/server/devtoolsStaticServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAuB,MAAM,SAAS,CAAC;AAEvD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,IAA6B,EAAE;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAChC,IAAI,YAAoB,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CACzC,kCAAkC,CACnC,CAAC;QACF,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,gFAAgF;YAC9E,qCAAqC;YACrC,QAAQ;YACR,sCAAsC,EACxC,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAA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M,CAAC,YAAY,CAAC,CAAC,CAAC;IAEzC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAClC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC5D,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YACvD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;YAC3C,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -17,7 +17,6 @@ export const widgetsDevServer = async () => {
17
17
  const workspaceRoot = searchForWorkspaceRoot(process.cwd());
18
18
  const webAppRoot = path.join(workspaceRoot, "web");
19
19
  const configResult = await loadConfigFromFile({ command: "serve", mode: "development" }, path.join(webAppRoot, "vite.config.ts"), webAppRoot);
20
- // biome-ignore lint/correctness/noUnusedVariables: Remove build-specific options that don't apply to dev server
21
20
  const { build, preview, ...devConfig } = configResult?.config || {};
22
21
  const vite = await createServer({
23
22
  ...devConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"widgetsDevServer.js","sourceRoot":"","sources":["../../../src/server/widgetsDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAuB,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,IAA6B,EAAE;IAClE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,E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0",
3
+ "version": "0.0.0-dev.bb2eb8a",
4
4
  "description": "Skybridge is a framework for building ChatGPT apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,6 +20,15 @@
20
20
  "default": "./dist/src/web/index.js"
21
21
  }
22
22
  },
23
+ "scripts": {
24
+ "build": "tsc && pnpm run build:templates",
25
+ "build:templates": "cp -r src/server/templates dist/src/server/",
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",
29
+ "test:type": "tsc --noEmit",
30
+ "test:format": "biome ci"
31
+ },
23
32
  "keywords": [
24
33
  "chatgpt",
25
34
  "app",
@@ -44,7 +53,6 @@
44
53
  "zustand": "^5.0.9"
45
54
  },
46
55
  "devDependencies": {
47
- "@biomejs/biome": "2.3.8",
48
56
  "@modelcontextprotocol/ext-apps": "^0.2.2",
49
57
  "@modelcontextprotocol/sdk": "^1.24.3",
50
58
  "@testing-library/dom": "^10.4.1",
@@ -63,13 +71,5 @@
63
71
  "vitest": "^2.1.8",
64
72
  "zod": "^4.1.13"
65
73
  },
66
- "scripts": {
67
- "build": "tsc && pnpm run build:templates",
68
- "build:templates": "cp -r src/server/templates dist/src/server/",
69
- "format": "biome check --write --error-on-warnings",
70
- "test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
71
- "test:unit": "vitest run",
72
- "test:type": "tsc --noEmit",
73
- "test:format": "biome ci"
74
- }
75
- }
74
+ "packageManager": "pnpm@10.17.1"
75
+ }
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.