@vibest/cli 0.0.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/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@vibest/cli",
3
+ "type": "module",
4
+ "version": "0.0.0",
5
+ "bin": {
6
+ "vibest": "./dist/cli.js"
7
+ },
8
+ "scripts": {
9
+ "dev": "bun --watch src/cli.ts",
10
+ "build": "tsdown src/cli.ts --format esm --platform node --outdir ./dist",
11
+ "start": "NODE_ENV=production bun --bun dist/cli.js",
12
+ "typecheck": "tsc --noEmit",
13
+ "clean": "git clean -xdf node_modules .turbo dist"
14
+ },
15
+ "dependencies": {
16
+ "@anthropic-ai/claude-agent-sdk": "^0.1.12",
17
+ "@elysiajs/cors": "^1.4.0",
18
+ "@elysiajs/node": "^1.4.1",
19
+ "@elysiajs/static": "^1.4.2",
20
+ "@orpc/openapi": "^1.9.3",
21
+ "@orpc/server": "^1.9.1",
22
+ "ai": "^5.0.63",
23
+ "elysia": "^1.4.11",
24
+ "uuid": "^13.0.0",
25
+ "ws": "^8.18.3",
26
+ "zod": "^3.25.61"
27
+ },
28
+ "devDependencies": {
29
+ "@types/bun": "^1.3.0",
30
+ "@vibe-web/agents": "workspace:*",
31
+ "@vibe-web/server-rpc": "workspace:*",
32
+ "@vibe-web/typescript": "workspace:*",
33
+ "tsdown": "^0.13.5"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ }
38
+ }
package/src/cli.ts ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createServer } from "./server";
4
+
5
+ async function main() {
6
+ const server = createServer();
7
+
8
+ server.listen(4000, () => {
9
+ console.log("Server is running on port 4000");
10
+ });
11
+ }
12
+
13
+ main();
package/src/server.ts ADDED
@@ -0,0 +1,64 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { cors } from "@elysiajs/cors";
4
+ import { node } from "@elysiajs/node";
5
+ import { staticPlugin } from "@elysiajs/static";
6
+ import { RPCHandler } from "@orpc/server/fetch";
7
+ import { ClaudeCodeAgent } from "@vibe-web/agents/claude-code";
8
+ import { router } from "@vibe-web/server-rpc/routes";
9
+ import { Elysia, file } from "elysia";
10
+
11
+ const isBun = typeof Bun !== "undefined";
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = path.dirname(__filename);
15
+ const staticRoot = path.resolve(__dirname, "../../apps/web/.output/public");
16
+
17
+ export function createServer() {
18
+ const claudeCodeAgent = new ClaudeCodeAgent();
19
+ const rpcHandler = new RPCHandler(router, {
20
+ plugins: [],
21
+ eventIteratorKeepAliveComment: "ping",
22
+ });
23
+
24
+ return (
25
+ new Elysia({
26
+ adapter: isBun ? undefined : node(),
27
+ })
28
+ .use(cors())
29
+ .get("/api/health", () => ({
30
+ status: "ok",
31
+ timestamp: new Date().toISOString(),
32
+ }))
33
+ .all(
34
+ "/api/rpc*",
35
+ async ({ request }) => {
36
+ const { response } = await rpcHandler.handle(request, {
37
+ prefix: "/api/rpc",
38
+ context: { claudeCodeAgent },
39
+ });
40
+ return response ?? new Response("Not Found", { status: 404 });
41
+ },
42
+ {
43
+ parse: "none", // Disable Elysia body parser to prevent "body already used" error
44
+ },
45
+ )
46
+ // Static file serving (handles /assets/* and other static files)
47
+ .use(
48
+ staticPlugin({
49
+ assets: staticRoot,
50
+ prefix: "/",
51
+ indexHTML: false,
52
+ ignorePatterns: ["_shell.html"],
53
+ }),
54
+ )
55
+ // SPA fallback - serve _shell.html for all unmatched routes
56
+ .onError(({ code, set }) => {
57
+ if (code === "NOT_FOUND") {
58
+ set.status = 200;
59
+ set.headers["content-type"] = "text/html; charset=utf-8";
60
+ return file(path.join(staticRoot, "_shell.html"));
61
+ }
62
+ })
63
+ );
64
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@vibe-web/typescript/base.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
5
+ "incremental": true,
6
+ "composite": true,
7
+ "module": "ESNext",
8
+ "moduleResolution": "Bundler",
9
+ "outDir": "dist"
10
+ },
11
+ "include": ["src"]
12
+ }
package/turbo.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://turborepo.com/schema.v2.json",
3
+ "extends": ["//"],
4
+ "tasks": {
5
+ "dev": {
6
+ "dependsOn": ["web#build"]
7
+ }
8
+ }
9
+ }