@guuey/create-agentic-app 0.1.0 → 0.1.2
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/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/templates/claude-agent-sdk/package.json +3 -3
- package/dist/templates/claude-agent-sdk/web/package.json +1 -1
- package/dist/templates/google-adk/.env.example +4 -0
- package/dist/templates/google-adk/.mcp.json +1 -0
- package/dist/templates/google-adk/README.md +74 -0
- package/dist/templates/google-adk/ggui/blueprints/.gitkeep +0 -0
- package/dist/templates/google-adk/ggui/ggui.json +15 -0
- package/dist/templates/google-adk/ggui/themes/.gitkeep +0 -0
- package/dist/templates/google-adk/guuey.json +14 -0
- package/dist/templates/google-adk/mcps/todo/Dockerfile +46 -0
- package/dist/templates/google-adk/mcps/todo/package.json +22 -0
- package/dist/templates/google-adk/mcps/todo/src/server.ts +173 -0
- package/dist/templates/google-adk/mcps/todo/tsconfig.json +15 -0
- package/dist/templates/google-adk/package.json +22 -0
- package/dist/templates/google-adk/pnpm-workspace.yaml +34 -0
- package/dist/templates/google-adk/prompts/system.md +4 -0
- package/dist/templates/google-adk/scripts/dev.mjs +44 -0
- package/dist/templates/google-adk/src/agent.ts +39 -0
- package/dist/templates/google-adk/tsconfig.json +15 -0
- package/dist/templates/google-adk/tsup.config.ts +13 -0
- package/dist/templates/google-adk/web/.env.example +17 -0
- package/dist/templates/google-adk/web/index.html +13 -0
- package/dist/templates/google-adk/web/package.json +25 -0
- package/dist/templates/google-adk/web/sandbox-proxy.ts +239 -0
- package/dist/templates/google-adk/web/src/App.tsx +272 -0
- package/dist/templates/google-adk/web/src/main.tsx +12 -0
- package/dist/templates/google-adk/web/src/useAgentChat.ts +122 -0
- package/dist/templates/google-adk/web/src/vite-env.d.ts +27 -0
- package/dist/templates/google-adk/web/tsconfig.json +20 -0
- package/dist/templates/google-adk/web/vite.config.ts +12 -0
- package/dist/templates/openai-agents-sdk/package.json +3 -3
- package/dist/templates/openai-agents-sdk/web/package.json +1 -1
- package/package.json +2 -2
- package/dist/chunk-U7JDNY6B.js +0 -149
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Typed Vite env vars. `import.meta.env` is Vite's analog of Next.js's
|
|
5
|
+
* `process.env.NEXT_PUBLIC_*` — anything declared here is exposed to the
|
|
6
|
+
* browser bundle at build time.
|
|
7
|
+
*/
|
|
8
|
+
interface ImportMetaEnv {
|
|
9
|
+
/**
|
|
10
|
+
* The agent's base URL (e.g. `http://localhost:6790` in local dev, via
|
|
11
|
+
* `guuey dev`). Falls back to that same local-dev default when unset —
|
|
12
|
+
* see `useAgentChat.ts`.
|
|
13
|
+
*/
|
|
14
|
+
readonly VITE_AGENT_ENDPOINT_URL?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Second-origin MCP-Apps sandbox page URL for `<AppRenderer>` (e.g.
|
|
17
|
+
* `https://sandbox.example.com/sandbox.html`). Optional in dev — the
|
|
18
|
+
* `sandboxProxyPlugin` in `vite.config.ts` serves one on :6891. REQUIRED
|
|
19
|
+
* for deployed builds that render UI resources: without it the app shows
|
|
20
|
+
* a plain-text notice instead (see `App.tsx` + `../sandbox-proxy.ts`).
|
|
21
|
+
*/
|
|
22
|
+
readonly VITE_SANDBOX_URL?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ImportMeta {
|
|
26
|
+
readonly env: ImportMetaEnv;
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"types": ["vite/client"]
|
|
17
|
+
},
|
|
18
|
+
"include": ["src", "vite.config.ts", "sandbox-proxy.ts"],
|
|
19
|
+
"exclude": ["node_modules", "dist"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import { sandboxProxyPlugin } from "./sandbox-proxy";
|
|
4
|
+
|
|
5
|
+
// Port is passed via the `dev` script's `--port 6890` flag (see package.json)
|
|
6
|
+
// so it stays visible in one place; `scripts/dev.mjs` boots this on the same
|
|
7
|
+
// port. The sandbox proxy plugin serves the MCP-Apps sandbox page on :6891 —
|
|
8
|
+
// a SECOND origin, as the spec's double-iframe architecture requires (see
|
|
9
|
+
// ./sandbox-proxy.ts).
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
plugins: [react(), sandboxProxyPlugin()],
|
|
12
|
+
});
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@openai/agents": "^0.12.0",
|
|
13
|
-
"@guuey/config": "0.
|
|
14
|
-
"@guuey/worker": "0.
|
|
13
|
+
"@guuey/config": "0.1.1",
|
|
14
|
+
"@guuey/worker": "0.1.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@guuey/cli": "0.
|
|
17
|
+
"@guuey/cli": "0.1.2",
|
|
18
18
|
"tsup": "^8.5.0",
|
|
19
19
|
"tsx": "^4.19.0",
|
|
20
20
|
"typescript": "^5.8.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/create-agentic-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Scaffold a guuey agentic app: code-mode agent + custom MCP + ggui + web, local pnpm dev, one-command guuey deploy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"tsup": "^8.5.0",
|
|
23
23
|
"typescript": "^5.8.0",
|
|
24
24
|
"vitest": "^3.2.4",
|
|
25
|
-
"@guuey/config": "0.1.
|
|
25
|
+
"@guuey/config": "0.1.1"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
package/dist/chunk-U7JDNY6B.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// src/scaffold.ts
|
|
2
|
-
import { promises as fs } from "fs";
|
|
3
|
-
import { join, dirname, resolve } from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
import { execFile } from "child_process";
|
|
6
|
-
import { promisify } from "util";
|
|
7
|
-
|
|
8
|
-
// src/rename.ts
|
|
9
|
-
function renameContent(content, name, scope) {
|
|
10
|
-
return content.replaceAll("@agentic-app-template/", `@${scope}/`).replaceAll("agentic-app-template", name);
|
|
11
|
-
}
|
|
12
|
-
function isProbablyText(buf) {
|
|
13
|
-
const window = buf.subarray(0, 8192);
|
|
14
|
-
return !window.includes(0);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// src/scaffold.ts
|
|
18
|
-
var execFileAsync = promisify(execFile);
|
|
19
|
-
var NAME_PATTERN = /^[a-z0-9][a-z0-9._-]*$/;
|
|
20
|
-
var here = dirname(fileURLToPath(import.meta.url));
|
|
21
|
-
var packageRoot = join(here, "..");
|
|
22
|
-
var defaultTemplatesDir = join(packageRoot, "dist", "templates");
|
|
23
|
-
function isErrnoException(err) {
|
|
24
|
-
return err instanceof Error && "code" in err;
|
|
25
|
-
}
|
|
26
|
-
async function pathExists(path) {
|
|
27
|
-
try {
|
|
28
|
-
await fs.access(path);
|
|
29
|
-
return true;
|
|
30
|
-
} catch (err) {
|
|
31
|
-
if (isErrnoException(err) && err.code === "ENOENT") return false;
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async function listAvailableFrameworks(templatesDir) {
|
|
36
|
-
try {
|
|
37
|
-
const entries = await fs.readdir(templatesDir, { withFileTypes: true });
|
|
38
|
-
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
39
|
-
} catch (err) {
|
|
40
|
-
if (isErrnoException(err) && err.code === "ENOENT") return [];
|
|
41
|
-
throw err;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async function resolveTemplateDir(templatesDir, framework) {
|
|
45
|
-
const dir = join(templatesDir, framework);
|
|
46
|
-
if (await pathExists(dir)) return dir;
|
|
47
|
-
const available = await listAvailableFrameworks(templatesDir);
|
|
48
|
-
const list = available.length > 0 ? available.join(", ") : `(none found under ${templatesDir})`;
|
|
49
|
-
throw new Error(`No template for framework "${framework}". Available frameworks: ${list}`);
|
|
50
|
-
}
|
|
51
|
-
async function ensureTargetDir(targetDir, force) {
|
|
52
|
-
if (!await pathExists(targetDir)) {
|
|
53
|
-
await fs.mkdir(targetDir, { recursive: true });
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const entries = await fs.readdir(targetDir);
|
|
57
|
-
if (entries.length > 0 && !force) {
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Target directory "${targetDir}" is not empty. Pass force: true (or --force) to scaffold into it anyway.`
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async function copyTree(src, dest, name, scope) {
|
|
64
|
-
await fs.mkdir(dest, { recursive: true });
|
|
65
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
66
|
-
for (const entry of entries) {
|
|
67
|
-
const destName = renameContent(entry.name, name, scope);
|
|
68
|
-
const srcPath = join(src, entry.name);
|
|
69
|
-
const destPath = join(dest, destName);
|
|
70
|
-
if (entry.isDirectory()) {
|
|
71
|
-
await copyTree(srcPath, destPath, name, scope);
|
|
72
|
-
} else {
|
|
73
|
-
const buf = await fs.readFile(srcPath);
|
|
74
|
-
if (isProbablyText(buf)) {
|
|
75
|
-
await fs.writeFile(destPath, renameContent(buf.toString("utf8"), name, scope), "utf8");
|
|
76
|
-
} else {
|
|
77
|
-
await fs.writeFile(destPath, buf);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function seedEnvLocal(projectDir) {
|
|
83
|
-
const envExample = join(projectDir, ".env.example");
|
|
84
|
-
const envLocal = join(projectDir, ".env.local");
|
|
85
|
-
if (!await pathExists(envExample)) return;
|
|
86
|
-
if (await pathExists(envLocal)) return;
|
|
87
|
-
await fs.copyFile(envExample, envLocal);
|
|
88
|
-
}
|
|
89
|
-
async function initGit(projectDir) {
|
|
90
|
-
try {
|
|
91
|
-
await execFileAsync("git", ["init"], { cwd: projectDir });
|
|
92
|
-
await execFileAsync("git", ["add", "-A"], { cwd: projectDir });
|
|
93
|
-
await execFileAsync(
|
|
94
|
-
"git",
|
|
95
|
-
[
|
|
96
|
-
"-c",
|
|
97
|
-
"user.name=guuey",
|
|
98
|
-
"-c",
|
|
99
|
-
"user.email=scaffold@guuey.com",
|
|
100
|
-
"commit",
|
|
101
|
-
"-m",
|
|
102
|
-
"chore: scaffold"
|
|
103
|
-
],
|
|
104
|
-
{ cwd: projectDir }
|
|
105
|
-
);
|
|
106
|
-
} catch {
|
|
107
|
-
console.error(
|
|
108
|
-
`Warning: git init failed; the project was scaffolded without a repo. Initialize it manually:
|
|
109
|
-
cd ${projectDir}
|
|
110
|
-
git init && git add -A && git commit -m "chore: scaffold"`
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function runInstall(projectDir) {
|
|
115
|
-
try {
|
|
116
|
-
await execFileAsync("pnpm", ["install"], { cwd: projectDir });
|
|
117
|
-
} catch {
|
|
118
|
-
console.error(
|
|
119
|
-
`Warning: "pnpm install" failed to run automatically. Run it manually:
|
|
120
|
-
cd ${projectDir}
|
|
121
|
-
pnpm install`
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
async function scaffold(opts) {
|
|
126
|
-
if (!NAME_PATTERN.test(opts.name)) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
`Invalid project name "${opts.name}": must be npm-safe (match ${NAME_PATTERN.toString()}).`
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
const scope = opts.scope ?? opts.name;
|
|
132
|
-
const templatesDir = opts.templatesDir ?? defaultTemplatesDir;
|
|
133
|
-
const templateDir = await resolveTemplateDir(templatesDir, opts.framework);
|
|
134
|
-
const projectDir = resolve(opts.targetDir);
|
|
135
|
-
await ensureTargetDir(projectDir, opts.force);
|
|
136
|
-
await copyTree(templateDir, projectDir, opts.name, scope);
|
|
137
|
-
await seedEnvLocal(projectDir);
|
|
138
|
-
if (opts.git !== false) {
|
|
139
|
-
await initGit(projectDir);
|
|
140
|
-
}
|
|
141
|
-
if (opts.install) {
|
|
142
|
-
await runInstall(projectDir);
|
|
143
|
-
}
|
|
144
|
-
return { projectDir };
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export {
|
|
148
|
-
scaffold
|
|
149
|
-
};
|