create-flamecast-app 0.1.1-alpha.84b4f47
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/dist/index.d.ts +2 -0
- package/dist/index.js +36 -0
- package/package.json +22 -0
- package/template/index.html +12 -0
- package/template/package.json +36 -0
- package/template/src/globals.css +7 -0
- package/template/src/lib/api.ts +12 -0
- package/template/src/lib/utils.ts +6 -0
- package/template/src/main.tsx +24 -0
- package/template/src/routes/__root.tsx +20 -0
- package/template/src/routes/index.tsx +35 -0
- package/template/tsconfig.json +17 -0
- package/template/vite.config.ts +30 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, cpSync, writeFileSync, readFileSync } from "node:fs";
|
|
3
|
+
import { resolve, join, basename } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import prompts from "prompts";
|
|
6
|
+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
7
|
+
const templateDir = resolve(__dirname, "../template");
|
|
8
|
+
async function main() {
|
|
9
|
+
const targetDir = process.argv[2];
|
|
10
|
+
const response = await prompts([
|
|
11
|
+
{
|
|
12
|
+
type: targetDir ? null : "text",
|
|
13
|
+
name: "projectName",
|
|
14
|
+
message: "Project name:",
|
|
15
|
+
initial: "my-flamecast-app",
|
|
16
|
+
},
|
|
17
|
+
], { onCancel: () => process.exit(1) });
|
|
18
|
+
const projectName = targetDir ?? response.projectName;
|
|
19
|
+
const root = resolve(process.cwd(), projectName);
|
|
20
|
+
console.log(`\nScaffolding Flamecast app in ${root}...\n`);
|
|
21
|
+
mkdirSync(root, { recursive: true });
|
|
22
|
+
cpSync(templateDir, root, { recursive: true });
|
|
23
|
+
// Update package.json name
|
|
24
|
+
const pkgPath = join(root, "package.json");
|
|
25
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
26
|
+
pkg.name = basename(projectName);
|
|
27
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
28
|
+
console.log("Done! Now run:\n");
|
|
29
|
+
console.log(` cd ${projectName}`);
|
|
30
|
+
console.log(" npm install");
|
|
31
|
+
console.log(" npm run dev\n");
|
|
32
|
+
}
|
|
33
|
+
main().catch((err) => {
|
|
34
|
+
console.error(err);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-flamecast-app",
|
|
3
|
+
"version": "0.1.1-alpha.84b4f47",
|
|
4
|
+
"bin": {
|
|
5
|
+
"create-flamecast-app": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"template"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"prompts": "^2.4.2"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/prompts": "^2.4.9"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"build:package": "tsc"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Flamecast</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "flamecast-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"preview": "vite preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@flamecast/protocol": "latest",
|
|
12
|
+
"@flamecast/sdk": "latest",
|
|
13
|
+
"@fontsource-variable/geist": "^5.2.8",
|
|
14
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
15
|
+
"@tanstack/react-query": "^5.91.0",
|
|
16
|
+
"@tanstack/react-router": "^1.167.5",
|
|
17
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
18
|
+
"clsx": "^2.1.1",
|
|
19
|
+
"lucide-react": "^0.577.0",
|
|
20
|
+
"react": "^19.2.4",
|
|
21
|
+
"react-dom": "^19.2.4",
|
|
22
|
+
"tailwind-merge": "^3.5.0",
|
|
23
|
+
"tailwindcss": "^4.2.2",
|
|
24
|
+
"tw-animate-css": "^1.4.0",
|
|
25
|
+
"vite": "^8.0.1",
|
|
26
|
+
"zod": "^4.3.6"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@tanstack/router-generator": "1.166.15",
|
|
30
|
+
"@tanstack/router-plugin": "^1.166.14",
|
|
31
|
+
"@types/node": "^20.11.17",
|
|
32
|
+
"@types/react": "^19.2.14",
|
|
33
|
+
"@types/react-dom": "^19.2.3",
|
|
34
|
+
"typescript": "^5.8.3"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFlamecastClient } from "@flamecast/sdk/client";
|
|
2
|
+
|
|
3
|
+
const client = createFlamecastClient({ baseUrl: "/api" });
|
|
4
|
+
|
|
5
|
+
export const {
|
|
6
|
+
createSession,
|
|
7
|
+
fetchAgentTemplates,
|
|
8
|
+
fetchRuntimes,
|
|
9
|
+
fetchSession,
|
|
10
|
+
fetchSessions,
|
|
11
|
+
terminateSession,
|
|
12
|
+
} = client;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
import { RouterProvider, createRouter } from "@tanstack/react-router";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { routeTree } from "./routeTree.gen";
|
|
6
|
+
import "./globals.css";
|
|
7
|
+
|
|
8
|
+
const queryClient = new QueryClient();
|
|
9
|
+
const router = createRouter({ routeTree });
|
|
10
|
+
|
|
11
|
+
declare module "@tanstack/react-router" {
|
|
12
|
+
interface Register {
|
|
13
|
+
router: typeof router;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// oxlint-disable-next-line no-type-assertion/no-type-assertion
|
|
18
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
19
|
+
<React.StrictMode>
|
|
20
|
+
<QueryClientProvider client={queryClient}>
|
|
21
|
+
<RouterProvider router={router} />
|
|
22
|
+
</QueryClientProvider>
|
|
23
|
+
</React.StrictMode>,
|
|
24
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRootRoute, Link, Outlet } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createRootRoute({
|
|
4
|
+
component: RootLayout,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
function RootLayout() {
|
|
8
|
+
return (
|
|
9
|
+
<div className="min-h-screen bg-background text-foreground">
|
|
10
|
+
<header className="flex h-14 items-center gap-4 border-b px-6">
|
|
11
|
+
<Link to="/" className="font-semibold">
|
|
12
|
+
Flamecast
|
|
13
|
+
</Link>
|
|
14
|
+
</header>
|
|
15
|
+
<main className="p-6">
|
|
16
|
+
<Outlet />
|
|
17
|
+
</main>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { fetchSessions } from "@/lib/api";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/")({
|
|
6
|
+
component: HomePage,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
function HomePage() {
|
|
10
|
+
const { data: sessions = [], isLoading } = useQuery({
|
|
11
|
+
queryKey: ["sessions"],
|
|
12
|
+
queryFn: fetchSessions,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
if (isLoading) {
|
|
16
|
+
return <p className="text-muted-foreground">Loading sessions...</p>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className="mx-auto max-w-3xl">
|
|
21
|
+
<h1 className="text-2xl font-bold">Sessions</h1>
|
|
22
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
23
|
+
{sessions.length} active session{sessions.length !== 1 ? "s" : ""}
|
|
24
|
+
</p>
|
|
25
|
+
<ul className="mt-4 space-y-2">
|
|
26
|
+
{sessions.map((session) => (
|
|
27
|
+
<li key={session.id} className="rounded-lg border p-4">
|
|
28
|
+
<p className="font-medium">{session.agentName}</p>
|
|
29
|
+
<code className="text-xs text-muted-foreground">{session.id}</code>
|
|
30
|
+
</li>
|
|
31
|
+
))}
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"outDir": "./dist",
|
|
10
|
+
"baseUrl": ".",
|
|
11
|
+
"paths": {
|
|
12
|
+
"@/*": ["./src/*"]
|
|
13
|
+
},
|
|
14
|
+
"types": ["node"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
4
|
+
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
|
5
|
+
import path from "path";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [
|
|
9
|
+
TanStackRouterVite({
|
|
10
|
+
routesDirectory: "./src/routes",
|
|
11
|
+
generatedRouteTree: "./src/routeTree.gen.ts",
|
|
12
|
+
}),
|
|
13
|
+
react(),
|
|
14
|
+
tailwindcss(),
|
|
15
|
+
],
|
|
16
|
+
resolve: {
|
|
17
|
+
alias: {
|
|
18
|
+
"@": path.resolve(__dirname, "./src"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
server: {
|
|
22
|
+
port: 3000,
|
|
23
|
+
proxy: {
|
|
24
|
+
"/api": {
|
|
25
|
+
target: "http://localhost:3001",
|
|
26
|
+
changeOrigin: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|