skybridge 0.17.4 → 0.18.0

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/bin/run.js CHANGED
@@ -2,4 +2,8 @@
2
2
 
3
3
  import { execute } from "@oclif/core";
4
4
 
5
+ if (process.argv.length === 2) {
6
+ process.argv.push("dev");
7
+ }
8
+
5
9
  await execute({ dir: import.meta.url });
@@ -0,0 +1 @@
1
+ export declare const useVersion: () => string | undefined;
@@ -0,0 +1,33 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { useEffect, useState } from "react";
5
+ function findPackageJson(startDir) {
6
+ let currentDir = startDir;
7
+ const root = path.parse(currentDir).root;
8
+ while (currentDir !== root) {
9
+ const packageJsonPath = path.join(currentDir, "package.json");
10
+ if (existsSync(packageJsonPath)) {
11
+ return packageJsonPath;
12
+ }
13
+ currentDir = path.dirname(currentDir);
14
+ }
15
+ return null;
16
+ }
17
+ function getPackageVersion() {
18
+ const currentFileDir = path.dirname(fileURLToPath(import.meta.url));
19
+ const packageJsonPath = findPackageJson(currentFileDir);
20
+ if (!packageJsonPath) {
21
+ return "";
22
+ }
23
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
24
+ return packageJson.version || "";
25
+ }
26
+ export const useVersion = () => {
27
+ const [version, setVersion] = useState();
28
+ useEffect(() => {
29
+ setVersion(getPackageVersion());
30
+ }, []);
31
+ return version;
32
+ };
33
+ //# sourceMappingURL=use-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-version.js","sourceRoot":"","sources":["../../src/cli/use-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAA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
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {};
6
+ run(): Promise<void>;
7
+ }
@@ -0,0 +1,30 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { spawn } from "node:child_process";
3
+ import { Command } from "@oclif/core";
4
+ import { Box, render, Text } from "ink";
5
+ import { useEffect } from "react";
6
+ import { useVersion } from "../cli/use-version.js";
7
+ export default class Dev extends Command {
8
+ static description = "Start development server";
9
+ static examples = ["skybridge dev"];
10
+ static flags = {};
11
+ async run() {
12
+ console.clear();
13
+ const App = () => {
14
+ const version = useVersion();
15
+ useEffect(() => {
16
+ const nodemon = spawn("nodemon", ["--quiet"], {
17
+ stdio: ["ignore", "ignore", "inherit"],
18
+ });
19
+ return () => {
20
+ if (nodemon && !nodemon.killed) {
21
+ nodemon.kill();
22
+ }
23
+ };
24
+ }, []);
25
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: ["\u26F0", " ", "Welcome to Skybridge"] }), _jsxs(Text, { color: "cyan", children: [" v", version] })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "green", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Open DevTools to test your app locally:", " "] }), _jsx(Text, { color: "green", children: "http://localhost:3000/" })] }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { children: ["MCP server running at:", " "] }), _jsx(Text, { color: "white", bold: true, children: "http://localhost:3000/mcp" })] }), _jsx(Text, { color: "white", underline: true, children: "To test on ChatGPT:" }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Make your local server accessible with " }), _jsx(Text, { color: "white", bold: true, children: "ngrok http 3000" })] }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Connect to ChatGPT with URL " }), _jsx(Text, { color: "white", bold: true, children: "https://xxxxxx.ngrok-free.app/mcp" })] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "Documentation: " }), _jsx(Text, { color: "white", bold: true, children: "https://skybridge.tech/" })] }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "If you like Skybridge, please " }), _jsxs(Text, { color: "white", bold: true, children: ["give it a star", " "] }), _jsx(Text, { children: "on GitHub: " }), _jsx(Text, { color: "white", underline: true, children: "https://github.com/alpic-ai/skybridge" }), _jsx(Text, { color: "grey", children: " \uD83D\uDE4F" })] }) })] }));
26
+ };
27
+ render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: false });
28
+ }
29
+ }
30
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAU,WAAW,GAAG,0BAA0B,CAAC;IACzD,MAAM,CAAU,QAAQ,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,CAAU,KAAK,GAAG,EAAE,CAAC;IAEpB,KAAK,CAAC,GAAG;QACd,OAAO,CAAC,KAAK,EAAE,CAAC;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0.18.0",
4
4
  "description": "Skybridge is a framework for building ChatGPT apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,6 +41,7 @@
41
41
  "es-toolkit": "^1.43.0",
42
42
  "express": "^5.2.1",
43
43
  "handlebars": "^4.7.8",
44
+ "ink": "^6.6.0",
44
45
  "superjson": "^2.2.6",
45
46
  "vite": "^7.3.1",
46
47
  "zustand": "^5.0.9"