skybridge 0.0.0-dev.efb6361 → 0.0.0-dev.efbdb09
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/README.md +8 -8
- package/dist/cli/header.js +1 -1
- package/dist/cli/header.js.map +1 -1
- package/dist/cli/use-messages.d.ts +3 -0
- package/dist/cli/use-messages.js +11 -0
- package/dist/cli/use-messages.js.map +1 -0
- package/dist/cli/use-nodemon.d.ts +2 -2
- package/dist/cli/use-nodemon.js +8 -24
- package/dist/cli/use-nodemon.js.map +1 -1
- package/dist/cli/use-tunnel.d.ts +13 -7
- package/dist/cli/use-tunnel.js +35 -39
- package/dist/cli/use-tunnel.js.map +1 -1
- package/dist/cli/use-typescript-check.d.ts +1 -0
- package/dist/cli/use-typescript-check.js +41 -6
- package/dist/cli/use-typescript-check.js.map +1 -1
- package/dist/commands/build.js +28 -7
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.js +10 -5
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/start.js +7 -10
- package/dist/commands/start.js.map +1 -1
- package/dist/server/asset-base-url-transform-plugin.d.ts +5 -6
- package/dist/server/asset-base-url-transform-plugin.js +8 -9
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -1
- package/dist/server/asset-base-url-transform-plugin.test.js +12 -13
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -1
- package/dist/server/content-helpers.d.ts +27 -0
- package/dist/server/content-helpers.js +46 -0
- package/dist/server/content-helpers.js.map +1 -0
- package/dist/server/content-helpers.test.js +70 -0
- package/dist/server/content-helpers.test.js.map +1 -0
- package/dist/server/express.d.ts +1 -1
- package/dist/server/express.js +3 -3
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.test.js +39 -2
- package/dist/server/express.test.js.map +1 -1
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/inferUtilityTypes.d.ts +6 -6
- package/dist/server/metric.d.ts +14 -0
- package/dist/server/metric.js +62 -0
- package/dist/server/metric.js.map +1 -0
- package/dist/server/middleware.test.js +12 -9
- package/dist/server/middleware.test.js.map +1 -1
- package/dist/server/server.d.ts +95 -72
- package/dist/server/server.js +214 -66
- package/dist/server/server.js.map +1 -1
- package/dist/server/templateHelper.d.ts +5 -5
- package/dist/server/templates/development.hbs +2 -2
- package/dist/server/templates/production.hbs +1 -1
- package/dist/server/viewsDevServer.d.ts +14 -0
- package/dist/server/viewsDevServer.js +45 -0
- package/dist/server/viewsDevServer.js.map +1 -0
- package/dist/test/utils.d.ts +13 -21
- package/dist/test/utils.js +42 -37
- package/dist/test/utils.js.map +1 -1
- package/dist/test/view.test.js +523 -0
- package/dist/test/view.test.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +5 -3
- package/dist/web/bridges/apps-sdk/adaptor.js +32 -14
- package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -1
- package/dist/web/bridges/apps-sdk/types.d.ts +10 -5
- package/dist/web/bridges/apps-sdk/types.js.map +1 -1
- package/dist/web/bridges/mcp-app/adaptor.d.ts +15 -5
- package/dist/web/bridges/mcp-app/adaptor.js +106 -22
- package/dist/web/bridges/mcp-app/adaptor.js.map +1 -1
- package/dist/web/bridges/types.d.ts +14 -8
- package/dist/web/components/modal-provider.js +2 -2
- package/dist/web/components/modal-provider.js.map +1 -1
- package/dist/web/create-store.js +17 -3
- package/dist/web/create-store.js.map +1 -1
- package/dist/web/create-store.test.js +14 -16
- package/dist/web/create-store.test.js.map +1 -1
- package/dist/web/data-llm.d.ts +1 -1
- package/dist/web/data-llm.js +3 -3
- package/dist/web/data-llm.js.map +1 -1
- package/dist/web/data-llm.test.js +22 -22
- package/dist/web/data-llm.test.js.map +1 -1
- package/dist/web/generate-helpers.d.ts +20 -18
- package/dist/web/generate-helpers.js +20 -18
- package/dist/web/generate-helpers.js.map +1 -1
- package/dist/web/generate-helpers.test-d.js +26 -26
- package/dist/web/generate-helpers.test-d.js.map +1 -1
- package/dist/web/helpers/state.d.ts +2 -2
- package/dist/web/helpers/state.js +11 -11
- package/dist/web/helpers/state.js.map +1 -1
- package/dist/web/helpers/state.test.js +9 -9
- package/dist/web/helpers/state.test.js.map +1 -1
- package/dist/web/hooks/index.d.ts +1 -1
- package/dist/web/hooks/index.js +1 -1
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/use-files.d.ts +2 -1
- package/dist/web/hooks/use-files.js +1 -0
- package/dist/web/hooks/use-files.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +22 -2
- package/dist/web/hooks/use-files.test.js.map +1 -1
- package/dist/web/hooks/use-request-modal.d.ts +1 -1
- package/dist/web/hooks/use-request-modal.js +4 -4
- package/dist/web/hooks/use-request-modal.js.map +1 -1
- package/dist/web/hooks/use-request-modal.test.js +1 -1
- package/dist/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/web/hooks/use-view-state.d.ts +4 -0
- package/dist/web/hooks/use-view-state.js +32 -0
- package/dist/web/hooks/use-view-state.js.map +1 -0
- package/dist/web/hooks/use-view-state.test.js +177 -0
- package/dist/web/hooks/use-view-state.test.js.map +1 -0
- package/dist/web/index.d.ts +1 -2
- package/dist/web/index.js +1 -2
- package/dist/web/index.js.map +1 -1
- package/dist/web/mount-view.d.ts +1 -0
- package/dist/web/{mount-widget.js → mount-view.js} +2 -2
- package/dist/web/mount-view.js.map +1 -0
- package/dist/web/plugin/plugin.d.ts +4 -1
- package/dist/web/plugin/plugin.js +112 -25
- package/dist/web/plugin/plugin.js.map +1 -1
- package/dist/web/plugin/scan-views.d.ts +8 -0
- package/dist/web/plugin/scan-views.js +70 -0
- package/dist/web/plugin/scan-views.js.map +1 -0
- package/dist/web/plugin/scan-views.test.d.ts +1 -0
- package/dist/web/plugin/scan-views.test.js +67 -0
- package/dist/web/plugin/scan-views.test.js.map +1 -0
- package/dist/web/plugin/validate-view.d.ts +1 -0
- package/dist/web/plugin/validate-view.js +9 -0
- package/dist/web/plugin/validate-view.js.map +1 -0
- package/dist/web/plugin/validate-view.test.d.ts +1 -0
- package/dist/web/plugin/validate-view.test.js +24 -0
- package/dist/web/plugin/validate-view.test.js.map +1 -0
- package/package.json +18 -10
- package/tsconfig.base.json +2 -0
- package/dist/server/widgetsDevServer.d.ts +0 -13
- package/dist/server/widgetsDevServer.js +0 -57
- package/dist/server/widgetsDevServer.js.map +0 -1
- package/dist/test/widget.test.js +0 -263
- package/dist/test/widget.test.js.map +0 -1
- package/dist/web/hooks/use-widget-state.d.ts +0 -4
- package/dist/web/hooks/use-widget-state.js +0 -32
- package/dist/web/hooks/use-widget-state.js.map +0 -1
- package/dist/web/hooks/use-widget-state.test.js +0 -64
- package/dist/web/hooks/use-widget-state.test.js.map +0 -1
- package/dist/web/mount-widget.d.ts +0 -1
- package/dist/web/mount-widget.js.map +0 -1
- package/dist/web/plugin/validate-widget.d.ts +0 -5
- package/dist/web/plugin/validate-widget.js +0 -27
- package/dist/web/plugin/validate-widget.js.map +0 -1
- package/dist/web/plugin/validate-widget.test.js +0 -42
- package/dist/web/plugin/validate-widget.test.js.map +0 -1
- /package/dist/{test/widget.test.d.ts → server/content-helpers.test.d.ts} +0 -0
- /package/dist/{web/hooks/use-widget-state.test.d.ts → test/view.test.d.ts} +0 -0
- /package/dist/web/{plugin/validate-widget.test.d.ts → hooks/use-view-state.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Build ChatGPT & MCP Apps. The Modern TypeScript Way.**
|
|
8
8
|
|
|
9
|
-
The fullstack TypeScript framework for AI-embedded
|
|
9
|
+
The fullstack TypeScript framework for AI-embedded views.<br />
|
|
10
10
|
**Type-safe. React-powered. Platform-agnostic.**
|
|
11
11
|
|
|
12
12
|
<br />
|
|
@@ -31,8 +31,8 @@ ChatGPT Apps and MCP Apps let you embed **rich, interactive UIs** directly in AI
|
|
|
31
31
|
|
|
32
32
|
| | |
|
|
33
33
|
|:--|:--|
|
|
34
|
-
| 🌐 **Write once, run everywhere** — Skybridge works seamlessly with ChatGPT (Apps SDK) and MCP-compatible clients. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to
|
|
35
|
-
| 🔄 **
|
|
34
|
+
| 🌐 **Write once, run everywhere** — Skybridge works seamlessly with ChatGPT (Apps SDK) and MCP-compatible clients. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to view. Autocomplete everywhere. |
|
|
35
|
+
| 🔄 **View-to-Model Sync** — Keep the model aware of UI state with `data-llm`. Dual surfaces, one source of truth. | ⚒️ **React Query-style Hooks** — `isPending`, `isError`, callbacks. State management you already know. |
|
|
36
36
|
| 👨💻 **Full dev environment** — HMR, debug traces, and local devtools. | 📦 **Showcase Examples** — Production-ready examples to learn from and build upon. |
|
|
37
37
|
|
|
38
38
|
<br />
|
|
@@ -67,7 +67,7 @@ deno add skybridge
|
|
|
67
67
|
|
|
68
68
|
Skybridge is a fullstack framework with unified server and client modules:
|
|
69
69
|
|
|
70
|
-
- **`skybridge/server`** — Define tools and
|
|
70
|
+
- **`skybridge/server`** — Define tools and views with full type inference. Extends the MCP SDK.
|
|
71
71
|
- **`skybridge/web`** — React hooks that consume your server types. Works with Apps SDK (ChatGPT) and MCP Apps.
|
|
72
72
|
- **Dev Environment** — Vite plugin with HMR, DevTools emulator, and optimized builds.
|
|
73
73
|
|
|
@@ -76,7 +76,7 @@ Skybridge is a fullstack framework with unified server and client modules:
|
|
|
76
76
|
```ts
|
|
77
77
|
import { McpServer } from "skybridge/server";
|
|
78
78
|
|
|
79
|
-
server.
|
|
79
|
+
server.registerView("flights", {}, {
|
|
80
80
|
inputSchema: { destination: z.string() },
|
|
81
81
|
}, async ({ destination }) => {
|
|
82
82
|
const flights = await searchFlights(destination);
|
|
@@ -84,12 +84,12 @@ server.registerWidget("flights", {}, {
|
|
|
84
84
|
});
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### View
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
90
|
import { useToolInfo } from "skybridge/web";
|
|
91
91
|
|
|
92
|
-
function
|
|
92
|
+
function FlightsView() {
|
|
93
93
|
const { output } = useToolInfo();
|
|
94
94
|
|
|
95
95
|
return output.structuredContent.flights.map(flight =>
|
|
@@ -104,7 +104,7 @@ function FlightsWidget() {
|
|
|
104
104
|
|
|
105
105
|
- **Live Reload** — Vite HMR. See changes instantly without reinstalling.
|
|
106
106
|
- **Typed Hooks** — Full autocomplete for tools, inputs, outputs.
|
|
107
|
-
- **
|
|
107
|
+
- **View → Tool Calls** — Trigger server actions from UI.
|
|
108
108
|
- **Dual Surface Sync** — Keep model aware of what users see with `data-llm`.
|
|
109
109
|
- **React Query-style API** — `isPending`, `isError`, callbacks.
|
|
110
110
|
- **Platform Agnostic** — Works with ChatGPT (Apps SDK) and MCP Apps clients (Goose, VSCode, etc.).
|
package/dist/cli/header.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
export const Header = ({ version, children, }) => {
|
|
4
|
-
return (_jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: ["\u26F0", " ", "
|
|
4
|
+
return (_jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: ["\u26F0", " ", "Skybridge"] }), _jsxs(Text, { color: "cyan", children: [" v", version] }), children] }));
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=header.js.map
|
package/dist/cli/header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/cli/header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,EACP,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IAAC,YAAY,EAAE,CAAC,aAClB,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,6BACnB,IAAI,
|
|
1
|
+
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/cli/header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,EACP,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IAAC,YAAY,EAAE,CAAC,aAClB,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,6BACnB,IAAI,iBACD,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,mBAAI,OAAO,IAAQ,EACpC,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
const MAX_MESSAGES = 10;
|
|
4
|
+
export function useMessages() {
|
|
5
|
+
const [messages, setMessages] = useState([]);
|
|
6
|
+
const push = useCallback((text, type) => {
|
|
7
|
+
setMessages((prev) => [...prev, { id: randomUUID(), text, type }].slice(-MAX_MESSAGES));
|
|
8
|
+
}, []);
|
|
9
|
+
return [messages, push];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=use-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-messages.js","sourceRoot":"","sources":["../../src/cli/use-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,MAAM,YAAY,GAAG,EAAE,CAAC;AAIxB,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAC;IAE7D,MAAM,IAAI,GAAG,WAAW,CAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QACnD,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CACnB,CAAC,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACjE,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function useNodemon(env: NodeJS.ProcessEnv):
|
|
1
|
+
import type { PushMessage } from "./use-messages.js";
|
|
2
|
+
export declare function useNodemon(env: NodeJS.ProcessEnv, pushMessage: PushMessage): void;
|
package/dist/cli/use-nodemon.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
1
|
import { existsSync } from "node:fs";
|
|
3
2
|
import { resolve } from "node:path";
|
|
4
3
|
import nodemonOriginal from "nodemon";
|
|
5
|
-
import { useEffect
|
|
4
|
+
import { useEffect } from "react";
|
|
6
5
|
const nodemon = nodemonOriginal;
|
|
7
|
-
export function useNodemon(env) {
|
|
8
|
-
const [messages, setMessages] = useState([]);
|
|
6
|
+
export function useNodemon(env, pushMessage) {
|
|
9
7
|
useEffect(() => {
|
|
10
8
|
const configFile = resolve(process.cwd(), "nodemon.json");
|
|
11
9
|
const config = existsSync(configFile)
|
|
@@ -13,31 +11,21 @@ export function useNodemon(env) {
|
|
|
13
11
|
configFile,
|
|
14
12
|
}
|
|
15
13
|
: {
|
|
16
|
-
watch: ["
|
|
14
|
+
watch: ["src"],
|
|
17
15
|
ext: "ts,json",
|
|
18
|
-
exec: "tsx
|
|
16
|
+
exec: "tsx src/server.ts",
|
|
19
17
|
};
|
|
20
18
|
nodemon({ ...config, env, stdout: false });
|
|
21
19
|
const handleStdoutData = (chunk) => {
|
|
22
20
|
const message = chunk.toString().trim();
|
|
23
21
|
if (message) {
|
|
24
|
-
|
|
25
|
-
...prev,
|
|
26
|
-
{ id: randomUUID(), text: message, type: "log" },
|
|
27
|
-
].slice(-10));
|
|
22
|
+
pushMessage(message, "log");
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
25
|
const handleStderrData = (chunk) => {
|
|
31
26
|
const message = chunk.toString().trim();
|
|
32
27
|
if (message) {
|
|
33
|
-
|
|
34
|
-
...prev,
|
|
35
|
-
{
|
|
36
|
-
id: randomUUID(),
|
|
37
|
-
text: message,
|
|
38
|
-
type: "error",
|
|
39
|
-
},
|
|
40
|
-
].slice(-10));
|
|
28
|
+
pushMessage(message, "error");
|
|
41
29
|
}
|
|
42
30
|
};
|
|
43
31
|
const setupStdoutListener = () => {
|
|
@@ -58,10 +46,7 @@ export function useNodemon(env) {
|
|
|
58
46
|
});
|
|
59
47
|
nodemon.on("restart", (files) => {
|
|
60
48
|
const restartMessage = `Server restarted due to file changes: ${files.join(", ")}`;
|
|
61
|
-
|
|
62
|
-
...prev,
|
|
63
|
-
{ id: randomUUID(), text: restartMessage, type: "restart" },
|
|
64
|
-
]);
|
|
49
|
+
pushMessage(restartMessage, "restart");
|
|
65
50
|
setupStdoutListener();
|
|
66
51
|
setupStderrListener();
|
|
67
52
|
});
|
|
@@ -74,7 +59,6 @@ export function useNodemon(env) {
|
|
|
74
59
|
}
|
|
75
60
|
nodemon.emit("quit");
|
|
76
61
|
};
|
|
77
|
-
}, [env]);
|
|
78
|
-
return messages;
|
|
62
|
+
}, [env, pushMessage]);
|
|
79
63
|
}
|
|
80
64
|
//# sourceMappingURL=use-nodemon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-nodemon.js","sourceRoot":"","sources":["../../src/cli/use-nodemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-nodemon.js","sourceRoot":"","sources":["../../src/cli/use-nodemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,eAAe,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,MAAM,OAAO,GAAG,eAAkC,CAAC;AAEnD,MAAM,UAAU,UAAU,CACxB,GAAsB,EACtB,WAAwB;IAExB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC;YACnC,CAAC,CAAC;gBACE,UAAU;aACX;YACH,CAAC,CAAC;gBACE,KAAK,EAAE,CAAC,KAAK,CAAC;gBACd,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE,mBAAmB;aAC1B,CAAC;QAEN,OAAO,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAE3C,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;YACxC,IAAI,OAAO,EAAE,CAAC;gBACZ,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,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AAO,CAAC,MAAM,EAAE,CAAC;gBACnB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC/C,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/cli/use-tunnel.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type TunnelState = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { PushMessage } from "./use-messages.js";
|
|
2
|
+
export type TunnelState = {
|
|
3
|
+
status: "idle";
|
|
4
|
+
} | {
|
|
5
|
+
status: "starting";
|
|
6
|
+
message: string;
|
|
7
|
+
} | {
|
|
8
|
+
status: "connected";
|
|
9
|
+
url: string;
|
|
10
|
+
} | {
|
|
11
|
+
status: "error";
|
|
12
|
+
message: string;
|
|
6
13
|
};
|
|
7
|
-
export declare function useTunnel(port: number | null): TunnelState;
|
|
8
|
-
export {};
|
|
14
|
+
export declare function useTunnel(port: number | null, pushMessage: PushMessage, verbose: boolean): TunnelState;
|
package/dist/cli/use-tunnel.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
2
|
import { useEffect, useState } from "react";
|
|
4
|
-
export function useTunnel(port) {
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
const [logs, setLogs] = useState([]);
|
|
3
|
+
export function useTunnel(port, pushMessage, verbose) {
|
|
4
|
+
const [state, setState] = useState(port === null
|
|
5
|
+
? { status: "idle" }
|
|
6
|
+
: { status: "starting", message: "Starting tunnel…" });
|
|
10
7
|
useEffect(() => {
|
|
11
8
|
if (port === null) {
|
|
12
9
|
return;
|
|
@@ -18,9 +15,9 @@ export function useTunnel(port) {
|
|
|
18
15
|
let connected = false;
|
|
19
16
|
const timeout = setTimeout(() => {
|
|
20
17
|
if (!connected) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
setState({
|
|
19
|
+
status: "error",
|
|
20
|
+
message: "Tunnel connection timed out after one minute",
|
|
24
21
|
});
|
|
25
22
|
tunnelProcess.kill();
|
|
26
23
|
}
|
|
@@ -32,42 +29,38 @@ export function useTunnel(port) {
|
|
|
32
29
|
second: "2-digit",
|
|
33
30
|
hour12: true,
|
|
34
31
|
});
|
|
35
|
-
|
|
36
|
-
...prev,
|
|
37
|
-
{
|
|
38
|
-
id: randomUUID(),
|
|
39
|
-
text: `${time} [tunnel] ${text}`,
|
|
40
|
-
type,
|
|
41
|
-
},
|
|
42
|
-
].slice(-10));
|
|
32
|
+
pushMessage(`${time} [tunnel] ${text}`, type);
|
|
43
33
|
};
|
|
44
34
|
const handleStdout = (data) => {
|
|
45
35
|
const lines = data.toString().trim().split("\n").filter(Boolean);
|
|
46
36
|
for (const line of lines) {
|
|
47
37
|
if (connected) {
|
|
48
|
-
|
|
38
|
+
if (verbose) {
|
|
39
|
+
pushLog(line, "log");
|
|
40
|
+
}
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const match = line.match(/Forwarding:\s+(https:\/\/\S+)\s*->\s*(\S+)/);
|
|
44
|
+
if (match?.[1]) {
|
|
45
|
+
connected = true;
|
|
46
|
+
clearTimeout(timeout);
|
|
47
|
+
const url = match[1].replace(/\/$/, "");
|
|
48
|
+
setState({ status: "connected", url });
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
|
|
52
|
-
if (match?.[1]) {
|
|
53
|
-
connected = true;
|
|
54
|
-
clearTimeout(timeout);
|
|
55
|
-
setLabel({ text: line, color: "white" });
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
setLabel({ text: line, color: "yellow" });
|
|
59
|
-
}
|
|
51
|
+
setState({ status: "starting", message: line });
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
54
|
};
|
|
63
55
|
const handleStderr = (data) => {
|
|
64
56
|
const text = data.toString().trim();
|
|
65
|
-
if (text) {
|
|
66
|
-
|
|
57
|
+
if (!text) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
stderrBuffer = (stderrBuffer + text).slice(-1024);
|
|
61
|
+
if (verbose && connected) {
|
|
67
62
|
for (const line of text.split("\n").filter(Boolean)) {
|
|
68
|
-
|
|
69
|
-
pushLog(line, "error");
|
|
70
|
-
}
|
|
63
|
+
pushLog(line, "error");
|
|
71
64
|
}
|
|
72
65
|
}
|
|
73
66
|
};
|
|
@@ -79,15 +72,18 @@ export function useTunnel(port) {
|
|
|
79
72
|
}
|
|
80
73
|
tunnelProcess.on("error", (err) => {
|
|
81
74
|
clearTimeout(timeout);
|
|
82
|
-
|
|
75
|
+
setState({ status: "error", message: err.message });
|
|
83
76
|
});
|
|
84
77
|
tunnelProcess.on("close", (code) => {
|
|
85
78
|
clearTimeout(timeout);
|
|
86
79
|
if (code !== 0 && code !== null) {
|
|
87
80
|
const detail = stderrBuffer.trim() || `exited with code ${code}`;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
const hint = verbose
|
|
82
|
+
? `Try manually: npx alpic tunnel --port ${port}`
|
|
83
|
+
: "Re-run with --verbose to see full tunnel logs";
|
|
84
|
+
setState({
|
|
85
|
+
status: "error",
|
|
86
|
+
message: `${detail}. ${hint}`,
|
|
91
87
|
});
|
|
92
88
|
}
|
|
93
89
|
});
|
|
@@ -95,7 +91,7 @@ export function useTunnel(port) {
|
|
|
95
91
|
clearTimeout(timeout);
|
|
96
92
|
tunnelProcess.kill();
|
|
97
93
|
};
|
|
98
|
-
}, [port]);
|
|
99
|
-
return
|
|
94
|
+
}, [port, pushMessage, verbose]);
|
|
95
|
+
return state;
|
|
100
96
|
}
|
|
101
97
|
//# sourceMappingURL=use-tunnel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tunnel.js","sourceRoot":"","sources":["../../src/cli/use-tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-tunnel.js","sourceRoot":"","sources":["../../src/cli/use-tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAS5C,MAAM,UAAU,SAAS,CACvB,IAAmB,EACnB,WAAwB,EACxB,OAAgB;IAEhB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAChC,IAAI,KAAK,IAAI;QACX,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;QACpB,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,CACxD,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,KAAK,CACzB,KAAK,EACL,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAC/D;YACE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CACF,CAAC;QAEF,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,QAAQ,CAAC;oBACP,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE,8CAA8C;iBACxD,CAAC,CAAC;gBACH,a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;gBAChC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,oBAAoB,IAAI,EAAE,CAAC;gBACjE,MAAM,IAAI,GAAG,OAAO;oBAClB,CAAC,CAAC,yCAAyC,IAAI,EAAE;oBACjD,CAAC,CAAC,+CAA+C,CAAC;gBACpD,QAAQ,CAAC;oBACP,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE,GAAG,MAAM,KAAK,IAAI,EAAE;iBAC9B,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,aAAa,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { isAbsolute, relative } from "node:path";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
// TypeScript nests from general to specific — the deepest line is the root cause.
|
|
5
|
+
function extractBestMessage(message, continuationLines) {
|
|
6
|
+
if (!continuationLines.length) {
|
|
7
|
+
return message;
|
|
8
|
+
}
|
|
9
|
+
let maxIndent = 0;
|
|
10
|
+
for (const line of continuationLines) {
|
|
11
|
+
const indent = line.length - line.trimStart().length;
|
|
12
|
+
if (indent > maxIndent) {
|
|
13
|
+
maxIndent = indent;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const deepest = continuationLines
|
|
17
|
+
.filter((l) => l.length - l.trimStart().length === maxIndent)
|
|
18
|
+
.map((l) => l.trim())
|
|
19
|
+
.filter(Boolean)[0];
|
|
20
|
+
return deepest ?? message;
|
|
21
|
+
}
|
|
4
22
|
export function useTypeScriptCheck() {
|
|
5
23
|
const tsProcessRef = useRef(null);
|
|
6
24
|
const [tsErrors, setTsErrors] = useState([]);
|
|
@@ -12,31 +30,48 @@ export function useTypeScriptCheck() {
|
|
|
12
30
|
tsProcessRef.current = tsProcess;
|
|
13
31
|
let outputBuffer = "";
|
|
14
32
|
let currentErrors = [];
|
|
33
|
+
let pendingError = null;
|
|
34
|
+
let continuationLines = [];
|
|
35
|
+
const flushPending = () => {
|
|
36
|
+
if (!pendingError) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
pendingError.message = extractBestMessage(pendingError.message, continuationLines);
|
|
40
|
+
currentErrors.push(pendingError);
|
|
41
|
+
pendingError = null;
|
|
42
|
+
continuationLines = [];
|
|
43
|
+
};
|
|
15
44
|
const processOutput = (data) => {
|
|
16
45
|
outputBuffer += data.toString();
|
|
17
46
|
const lines = outputBuffer.split("\n");
|
|
18
|
-
outputBuffer = lines.pop() || "";
|
|
47
|
+
outputBuffer = lines.pop() || "";
|
|
19
48
|
for (const line of lines) {
|
|
20
49
|
const trimmed = line.trim();
|
|
21
|
-
// Parse TypeScript error format: file.ts(10,5): error TS2322: message
|
|
22
|
-
// Match pattern: filename(line,col): error code: message
|
|
23
50
|
const errorMatch = trimmed.match(/^(.+?)\((\d+),(\d+)\):\s+error\s+(TS\d+)?\s*:?\s*(.+)$/);
|
|
24
51
|
if (errorMatch) {
|
|
25
|
-
|
|
52
|
+
flushPending();
|
|
53
|
+
const [, file, lineStr, colStr, code, message] = errorMatch;
|
|
26
54
|
if (file && lineStr && colStr && message) {
|
|
27
55
|
let cleanFile = file.trim();
|
|
28
56
|
if (isAbsolute(cleanFile)) {
|
|
29
57
|
cleanFile = relative(process.cwd(), cleanFile);
|
|
30
58
|
}
|
|
31
|
-
|
|
59
|
+
pendingError = {
|
|
32
60
|
file: cleanFile,
|
|
33
61
|
line: Number.parseInt(lineStr, 10),
|
|
34
62
|
col: Number.parseInt(colStr, 10),
|
|
63
|
+
code: code ?? "",
|
|
35
64
|
message: message.trim(),
|
|
36
|
-
}
|
|
65
|
+
};
|
|
37
66
|
}
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (pendingError && line.startsWith(" ")) {
|
|
70
|
+
continuationLines.push(line);
|
|
71
|
+
continue;
|
|
38
72
|
}
|
|
39
73
|
if (trimmed.includes("Found") && trimmed.includes("error")) {
|
|
74
|
+
flushPending();
|
|
40
75
|
setTsErrors(trimmed.match(/Found 0 error/) ? [] : [...currentErrors]);
|
|
41
76
|
currentErrors = [];
|
|
42
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-typescript-check.js","sourceRoot":"","sources":["../../src/cli/use-typescript-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-typescript-check.js","sourceRoot":"","sources":["../../src/cli/use-typescript-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUpD,kFAAkF;AAClF,SAAS,kBAAkB,CACzB,OAAe,EACf,iBAAgC;IAEhC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;QACrD,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;YAC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,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACzC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7B,SAAS;gBACX,CAAC;gBAED,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3D,YAAY,EAAE,CAAC;oBACf,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;oBACtE,aAAa,GAAG,EAAE,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBACzB,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,27 +1,48 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { rmSync } from "node:fs";
|
|
3
3
|
import { Command } from "@oclif/core";
|
|
4
4
|
import { Box, render, Text } from "ink";
|
|
5
5
|
import { useEffect } from "react";
|
|
6
6
|
import { Header } from "../cli/header.js";
|
|
7
7
|
import { useExecuteSteps } from "../cli/use-execute-steps.js";
|
|
8
|
+
import { scanAndWriteViewsDts } from "../web/plugin/scan-views.js";
|
|
9
|
+
async function resolveViewsDir(root) {
|
|
10
|
+
const { loadConfigFromFile } = await import("vite");
|
|
11
|
+
const loaded = await loadConfigFromFile({ command: "build", mode: "production" }, undefined, root);
|
|
12
|
+
const isPluginCandidate = (value) => typeof value === "object" && value !== null;
|
|
13
|
+
const plugins = [];
|
|
14
|
+
const walk = (value) => {
|
|
15
|
+
if (Array.isArray(value)) {
|
|
16
|
+
value.forEach(walk);
|
|
17
|
+
}
|
|
18
|
+
else if (isPluginCandidate(value)) {
|
|
19
|
+
plugins.push(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
walk(loaded?.config.plugins ?? []);
|
|
23
|
+
return plugins.find((p) => p.name === "skybridge")?.api?.viewsDir;
|
|
24
|
+
}
|
|
8
25
|
export const commandSteps = [
|
|
9
26
|
{
|
|
10
|
-
label: "
|
|
11
|
-
|
|
27
|
+
label: "Scanning views",
|
|
28
|
+
run: async () => {
|
|
29
|
+
const root = process.cwd();
|
|
30
|
+
const viewsDir = await resolveViewsDir(root);
|
|
31
|
+
scanAndWriteViewsDts(root, viewsDir);
|
|
32
|
+
},
|
|
12
33
|
},
|
|
13
34
|
{
|
|
14
35
|
label: "Compiling server",
|
|
15
36
|
run: () => rmSync("dist", { recursive: true, force: true }),
|
|
16
|
-
command: "tsc -b",
|
|
37
|
+
command: "tsc -b --force",
|
|
17
38
|
},
|
|
18
39
|
{
|
|
19
|
-
label: "
|
|
20
|
-
|
|
40
|
+
label: "Building views",
|
|
41
|
+
command: "vite build",
|
|
21
42
|
},
|
|
22
43
|
];
|
|
23
44
|
export default class Build extends Command {
|
|
24
|
-
static description = "Build the
|
|
45
|
+
static description = "Build the views and MCP server";
|
|
25
46
|
static examples = ["skybridge build"];
|
|
26
47
|
static flags = {};
|
|
27
48
|
async run() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,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,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,KAAK,UAAU,eAAe,CAAC,IAAY;IACzC,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CACrC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EACxC,SAAS,EACT,IAAI,CACL,CAAC;IAEF,MAAM,iBAAiB,GAAG,CACxB,KAAc,EAC2C,EAAE,CAC3D,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;IAE9C,MAAM,OAAO,GAA0D,EAAE,CAAC;IAC1E,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;aAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAC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IAAI,0CAEf,EACP,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/B,KAAC,IAAI,IAAY,KAAK,EAAC,KAAK,YACzB,IAAI,IADI,IAAI,CAER,CACR,CAAC,GACE,IACF,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE;YACd,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC"}
|
package/dist/commands/dev.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export default class Dev extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
port: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
tunnel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
};
|
|
9
10
|
run(): Promise<void>;
|
|
10
11
|
}
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Command, Flags } from "@oclif/core";
|
|
3
3
|
import { Box, render, Text } from "ink";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
4
|
import { resolvePort } from "../cli/detect-port.js";
|
|
6
5
|
import { Header } from "../cli/header.js";
|
|
6
|
+
import { useMessages } from "../cli/use-messages.js";
|
|
7
7
|
import { useNodemon } from "../cli/use-nodemon.js";
|
|
8
8
|
import { useTunnel } from "../cli/use-tunnel.js";
|
|
9
9
|
import { useTypeScriptCheck } from "../cli/use-typescript-check.js";
|
|
@@ -20,6 +20,11 @@ export default class Dev extends Command {
|
|
|
20
20
|
description: "Open an Alpic tunnel for remote testing",
|
|
21
21
|
default: false,
|
|
22
22
|
}),
|
|
23
|
+
verbose: Flags.boolean({
|
|
24
|
+
char: "v",
|
|
25
|
+
description: "Show tunnel logs",
|
|
26
|
+
default: false,
|
|
27
|
+
}),
|
|
23
28
|
};
|
|
24
29
|
async run() {
|
|
25
30
|
const { flags } = await this.parse(Dev);
|
|
@@ -33,10 +38,10 @@ export default class Dev extends Command {
|
|
|
33
38
|
};
|
|
34
39
|
const App = () => {
|
|
35
40
|
const tsErrors = useTypeScriptCheck();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }),
|
|
41
|
+
const [messages, pushMessage] = useMessages();
|
|
42
|
+
useNodemon(env, pushMessage);
|
|
43
|
+
const tunnelState = useTunnel(flags.tunnel ? port : null, pushMessage, flags.verbose);
|
|
44
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDFE0", " "] }), fallback ? (_jsx(Text, { color: "yellow", children: "3000 in use, running on " })) : (_jsx(Text, { children: "Running on " })), _jsx(Text, { color: "green", children: `http://localhost:${port}/mcp` })] }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Test locally with DevTools:", " "] }), _jsx(Text, { color: "green", children: `http://localhost:${port}/` })] }), tunnelState.status === "idle" && (_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { children: "Get a public URL and LLM Playground access with " }), _jsx(Text, { color: "cyan", bold: true, children: "--tunnel" }), _jsx(Text, { children: "." })] })), tunnelState.status === "starting" && (_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { color: "yellow", children: tunnelState.message })] })), tunnelState.status === "connected" && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { children: "Exposed on " }), _jsx(Text, { color: "green", children: `${tunnelState.url}/mcp` })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Test with an LLM on Playground:", " "] }), _jsx(Text, { color: "green", children: `${tunnelState.url}/try` })] })] })), tunnelState.status === "error" && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsxs(Text, { color: "red", children: ["Cannot open tunnel: ", tunnelState.message] })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "red", children: `Try manually: npx alpic tunnel --port ${port}` })] })] })), _jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83D\uDEDF", " "] }), _jsx(Text, { children: "Need help? Reach us on " }), _jsx(Text, { color: "white", underline: true, children: "https://discord.alpic.ai" })] }), tsErrors.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u26A0\uFE0F TypeScript errors found:" }), tsErrors.map((error) => (_jsxs(Box, { marginLeft: 2, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "white", children: error.file }), _jsxs(Text, { color: "grey", children: ["(", error.line, ",", error.col, "):", " "] })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "red", children: error.message }) })] }, `${error.file}:${error.line}:${error.col}`)))] })), messages.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "white", bold: true, children: "Logs:" }), messages.map((message) => (_jsx(Box, { marginLeft: 2, children: message.type === "restart" ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "green", children: ["\u2713", " "] }), _jsx(Text, { color: "white", children: message.text })] })) : message.type === "error" ? (_jsx(Text, { color: "red", children: message.text })) : (_jsx(Text, { children: message.text })) }, message.id)))] }))] }));
|
|
40
45
|
};
|
|
41
46
|
render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: true });
|
|
42
47
|
}
|