@guuey/create-agentic-app 0.9.0 → 0.11.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/README.md +22 -2
- package/dist/{chunk-JD4RAKEG.js → chunk-5V2IFXD4.js} +96 -21
- package/dist/cli.cjs +145 -17
- package/dist/cli.js +60 -5
- package/dist/index.cjs +97 -21
- package/dist/index.d.cts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +3 -1
- package/dist/templates/{openai-agents-sdk → agentic-app/claude-agent-sdk}/AGENTS.md +2 -2
- package/dist/templates/{openai-agents-sdk → agentic-app/claude-agent-sdk}/README.md +23 -7
- package/dist/templates/agentic-app/claude-agent-sdk/gitignore +5 -0
- package/dist/templates/agentic-app/claude-agent-sdk/guuey.app.json +28 -0
- package/dist/templates/agentic-app/claude-agent-sdk/guuey.app.schema.json +119 -0
- package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/package.json +6 -3
- package/dist/templates/agentic-app/claude-agent-sdk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/web/index.html +0 -1
- package/dist/templates/agentic-app/claude-agent-sdk/web/package.json +29 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/components/AppShell.tsx +139 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/config.ts +148 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/lib/identity.ts +67 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/lib/status.ts +45 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/lib/widget.ts +96 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/main.tsx +51 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/Dashboard.tsx +33 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/Reports.tsx +9 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/pages/TalkOnMobile.tsx +34 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/routes.ts +7 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/styles-app.css +130 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/styles.css +248 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/tsconfig.json +18 -0
- package/dist/templates/agentic-app/claude-agent-sdk/web/vite.config.ts +46 -0
- package/dist/templates/{google-adk → agentic-app/google-adk}/AGENTS.md +2 -2
- package/dist/templates/agentic-app/google-adk/gitignore +5 -0
- package/dist/templates/agentic-app/google-adk/guuey.app.json +28 -0
- package/dist/templates/agentic-app/google-adk/guuey.app.schema.json +119 -0
- package/dist/templates/{google-adk → agentic-app/google-adk}/package.json +6 -3
- package/dist/templates/agentic-app/google-adk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/{google-adk → agentic-app/google-adk}/web/index.html +0 -1
- package/dist/templates/agentic-app/google-adk/web/package.json +29 -0
- package/dist/templates/agentic-app/google-adk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/agentic-app/google-adk/web/src/components/AppShell.tsx +139 -0
- package/dist/templates/agentic-app/google-adk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/agentic-app/google-adk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/agentic-app/google-adk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/agentic-app/google-adk/web/src/config.ts +148 -0
- package/dist/templates/agentic-app/google-adk/web/src/lib/identity.ts +67 -0
- package/dist/templates/agentic-app/google-adk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/agentic-app/google-adk/web/src/lib/status.ts +45 -0
- package/dist/templates/agentic-app/google-adk/web/src/lib/widget.ts +96 -0
- package/dist/templates/agentic-app/google-adk/web/src/main.tsx +51 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/Dashboard.tsx +33 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/Reports.tsx +9 -0
- package/dist/templates/agentic-app/google-adk/web/src/pages/TalkOnMobile.tsx +34 -0
- package/dist/templates/agentic-app/google-adk/web/src/routes.ts +7 -0
- package/dist/templates/agentic-app/google-adk/web/src/styles-app.css +130 -0
- package/dist/templates/agentic-app/google-adk/web/src/styles.css +248 -0
- package/dist/templates/agentic-app/google-adk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/agentic-app/google-adk/web/tsconfig.json +18 -0
- package/dist/templates/agentic-app/google-adk/web/vite.config.ts +46 -0
- package/dist/templates/{claude-agent-sdk → agentic-app/openai-agents-sdk}/AGENTS.md +2 -2
- package/dist/templates/{claude-agent-sdk → agentic-app/openai-agents-sdk}/README.md +23 -7
- package/dist/templates/agentic-app/openai-agents-sdk/gitignore +5 -0
- package/dist/templates/agentic-app/openai-agents-sdk/guuey.app.json +28 -0
- package/dist/templates/agentic-app/openai-agents-sdk/guuey.app.schema.json +119 -0
- package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/package.json +6 -3
- package/dist/templates/agentic-app/openai-agents-sdk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/web/index.html +0 -1
- package/dist/templates/agentic-app/openai-agents-sdk/web/package.json +29 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/components/AppShell.tsx +139 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/config.ts +148 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/lib/identity.ts +67 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/lib/status.ts +45 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/lib/widget.ts +96 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/main.tsx +51 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/Dashboard.tsx +33 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/Reports.tsx +9 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/pages/TalkOnMobile.tsx +34 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/routes.ts +7 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/styles-app.css +130 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/styles.css +248 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/tsconfig.json +18 -0
- package/dist/templates/agentic-app/openai-agents-sdk/web/vite.config.ts +46 -0
- package/dist/templates/base/claude-agent-sdk/.env.example +4 -0
- package/dist/templates/base/claude-agent-sdk/.mcp.json +1 -0
- package/dist/templates/base/claude-agent-sdk/AGENTS.md +135 -0
- package/dist/templates/base/claude-agent-sdk/README.md +173 -0
- package/dist/templates/base/claude-agent-sdk/ggui/blueprints/.gitkeep +0 -0
- package/dist/templates/base/claude-agent-sdk/ggui/ggui.json +15 -0
- package/dist/templates/base/claude-agent-sdk/ggui/themes/.gitkeep +0 -0
- package/dist/templates/base/claude-agent-sdk/gitignore +5 -0
- package/dist/templates/base/claude-agent-sdk/guuey.app.json +28 -0
- package/dist/templates/base/claude-agent-sdk/guuey.app.schema.json +119 -0
- package/dist/templates/base/claude-agent-sdk/guuey.json +14 -0
- package/dist/templates/base/claude-agent-sdk/mcps/todo/Dockerfile +46 -0
- package/dist/templates/base/claude-agent-sdk/mcps/todo/package.json +22 -0
- package/dist/templates/base/claude-agent-sdk/mcps/todo/src/server.ts +173 -0
- package/dist/templates/base/claude-agent-sdk/mcps/todo/tsconfig.json +15 -0
- package/dist/templates/base/claude-agent-sdk/mcps/todo/tsup.config.ts +14 -0
- package/dist/templates/base/claude-agent-sdk/package.json +30 -0
- package/dist/templates/base/claude-agent-sdk/pnpm-workspace.yaml +24 -0
- package/dist/templates/base/claude-agent-sdk/prompts/system.md +4 -0
- package/dist/templates/base/claude-agent-sdk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/base/claude-agent-sdk/scripts/dev.mjs +45 -0
- package/dist/templates/base/claude-agent-sdk/src/agent-config.ts +77 -0
- package/dist/templates/base/claude-agent-sdk/src/worker.ts +89 -0
- package/dist/templates/base/claude-agent-sdk/tsconfig.json +15 -0
- package/dist/templates/base/claude-agent-sdk/tsup.config.ts +9 -0
- package/dist/templates/base/claude-agent-sdk/web/index.html +12 -0
- package/dist/templates/{claude-agent-sdk → base/claude-agent-sdk}/web/package.json +11 -8
- package/dist/templates/base/claude-agent-sdk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/base/claude-agent-sdk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/base/claude-agent-sdk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/base/claude-agent-sdk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/base/claude-agent-sdk/web/src/config.ts +148 -0
- package/dist/templates/base/claude-agent-sdk/web/src/lib/identity.ts +67 -0
- package/dist/templates/base/claude-agent-sdk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/base/claude-agent-sdk/web/src/lib/status.ts +45 -0
- package/dist/templates/base/claude-agent-sdk/web/src/lib/widget.ts +96 -0
- package/dist/templates/base/claude-agent-sdk/web/src/main.tsx +52 -0
- package/dist/templates/base/claude-agent-sdk/web/src/pages/Chat.tsx +15 -0
- package/dist/templates/base/claude-agent-sdk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/base/claude-agent-sdk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/base/claude-agent-sdk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/base/claude-agent-sdk/web/src/routes.ts +7 -0
- package/dist/templates/base/claude-agent-sdk/web/src/styles.css +248 -0
- package/dist/templates/base/claude-agent-sdk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/base/claude-agent-sdk/web/tsconfig.json +18 -0
- package/dist/templates/base/claude-agent-sdk/web/vite.config.ts +46 -0
- package/dist/templates/base/google-adk/.env.example +4 -0
- package/dist/templates/base/google-adk/.mcp.json +1 -0
- package/dist/templates/base/google-adk/AGENTS.md +135 -0
- package/dist/templates/base/google-adk/README.md +90 -0
- package/dist/templates/base/google-adk/ggui/blueprints/.gitkeep +0 -0
- package/dist/templates/base/google-adk/ggui/ggui.json +15 -0
- package/dist/templates/base/google-adk/ggui/themes/.gitkeep +0 -0
- package/dist/templates/base/google-adk/gitignore +5 -0
- package/dist/templates/base/google-adk/guuey.app.json +28 -0
- package/dist/templates/base/google-adk/guuey.app.schema.json +119 -0
- package/dist/templates/base/google-adk/guuey.json +15 -0
- package/dist/templates/base/google-adk/mcps/todo/Dockerfile +46 -0
- package/dist/templates/base/google-adk/mcps/todo/package.json +22 -0
- package/dist/templates/base/google-adk/mcps/todo/src/server.ts +173 -0
- package/dist/templates/base/google-adk/mcps/todo/tsconfig.json +15 -0
- package/dist/templates/base/google-adk/mcps/todo/tsup.config.ts +14 -0
- package/dist/templates/base/google-adk/package.json +30 -0
- package/dist/templates/base/google-adk/pnpm-workspace.yaml +34 -0
- package/dist/templates/base/google-adk/prompts/system.md +4 -0
- package/dist/templates/base/google-adk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/base/google-adk/scripts/dev.mjs +45 -0
- package/dist/templates/base/google-adk/src/agent.ts +43 -0
- package/dist/templates/base/google-adk/tsconfig.json +15 -0
- package/dist/templates/base/google-adk/tsup.config.ts +13 -0
- package/dist/templates/base/google-adk/web/index.html +12 -0
- package/dist/templates/{google-adk → base/google-adk}/web/package.json +11 -8
- package/dist/templates/base/google-adk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/base/google-adk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/base/google-adk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/base/google-adk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/base/google-adk/web/src/config.ts +148 -0
- package/dist/templates/base/google-adk/web/src/lib/identity.ts +67 -0
- package/dist/templates/base/google-adk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/base/google-adk/web/src/lib/status.ts +45 -0
- package/dist/templates/base/google-adk/web/src/lib/widget.ts +96 -0
- package/dist/templates/base/google-adk/web/src/main.tsx +52 -0
- package/dist/templates/base/google-adk/web/src/pages/Chat.tsx +15 -0
- package/dist/templates/base/google-adk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/base/google-adk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/base/google-adk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/base/google-adk/web/src/routes.ts +7 -0
- package/dist/templates/base/google-adk/web/src/styles.css +248 -0
- package/dist/templates/base/google-adk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/base/google-adk/web/tsconfig.json +18 -0
- package/dist/templates/base/google-adk/web/vite.config.ts +46 -0
- package/dist/templates/base/openai-agents-sdk/.env.example +4 -0
- package/dist/templates/base/openai-agents-sdk/.mcp.json +1 -0
- package/dist/templates/base/openai-agents-sdk/AGENTS.md +135 -0
- package/dist/templates/base/openai-agents-sdk/README.md +173 -0
- package/dist/templates/base/openai-agents-sdk/ggui/blueprints/.gitkeep +0 -0
- package/dist/templates/base/openai-agents-sdk/ggui/ggui.json +15 -0
- package/dist/templates/base/openai-agents-sdk/ggui/themes/.gitkeep +0 -0
- package/dist/templates/base/openai-agents-sdk/gitignore +5 -0
- package/dist/templates/base/openai-agents-sdk/guuey.app.json +28 -0
- package/dist/templates/base/openai-agents-sdk/guuey.app.schema.json +119 -0
- package/dist/templates/base/openai-agents-sdk/guuey.json +27 -0
- package/dist/templates/base/openai-agents-sdk/mcps/todo/Dockerfile +46 -0
- package/dist/templates/base/openai-agents-sdk/mcps/todo/package.json +22 -0
- package/dist/templates/base/openai-agents-sdk/mcps/todo/src/server.ts +173 -0
- package/dist/templates/base/openai-agents-sdk/mcps/todo/tsconfig.json +15 -0
- package/dist/templates/base/openai-agents-sdk/mcps/todo/tsup.config.ts +14 -0
- package/dist/templates/base/openai-agents-sdk/package.json +30 -0
- package/dist/templates/base/openai-agents-sdk/pnpm-workspace.yaml +24 -0
- package/dist/templates/base/openai-agents-sdk/prompts/system.md +4 -0
- package/dist/templates/base/openai-agents-sdk/scripts/bootstrap.mjs +398 -0
- package/dist/templates/base/openai-agents-sdk/scripts/dev.mjs +45 -0
- package/dist/templates/base/openai-agents-sdk/src/agent-config.ts +77 -0
- package/dist/templates/base/openai-agents-sdk/src/worker.ts +75 -0
- package/dist/templates/base/openai-agents-sdk/tsconfig.json +15 -0
- package/dist/templates/base/openai-agents-sdk/tsup.config.ts +16 -0
- package/dist/templates/base/openai-agents-sdk/web/index.html +12 -0
- package/dist/templates/{openai-agents-sdk → base/openai-agents-sdk}/web/package.json +11 -8
- package/dist/templates/base/openai-agents-sdk/web/src/components/AgentChat.tsx +91 -0
- package/dist/templates/base/openai-agents-sdk/web/src/components/BootstrapGate.tsx +30 -0
- package/dist/templates/base/openai-agents-sdk/web/src/components/QrLink.tsx +25 -0
- package/dist/templates/base/openai-agents-sdk/web/src/components/Shell.tsx +50 -0
- package/dist/templates/base/openai-agents-sdk/web/src/config.ts +148 -0
- package/dist/templates/base/openai-agents-sdk/web/src/lib/identity.ts +67 -0
- package/dist/templates/base/openai-agents-sdk/web/src/lib/oidc.ts +79 -0
- package/dist/templates/base/openai-agents-sdk/web/src/lib/status.ts +45 -0
- package/dist/templates/base/openai-agents-sdk/web/src/lib/widget.ts +96 -0
- package/dist/templates/base/openai-agents-sdk/web/src/main.tsx +52 -0
- package/dist/templates/base/openai-agents-sdk/web/src/pages/Chat.tsx +15 -0
- package/dist/templates/base/openai-agents-sdk/web/src/pages/Home.tsx +133 -0
- package/dist/templates/base/openai-agents-sdk/web/src/pages/Landing.tsx +65 -0
- package/dist/templates/base/openai-agents-sdk/web/src/pages/Login.tsx +81 -0
- package/dist/templates/base/openai-agents-sdk/web/src/routes.ts +7 -0
- package/dist/templates/base/openai-agents-sdk/web/src/styles.css +248 -0
- package/dist/templates/base/openai-agents-sdk/web/src/vite-env.d.ts +14 -0
- package/dist/templates/base/openai-agents-sdk/web/tsconfig.json +18 -0
- package/dist/templates/base/openai-agents-sdk/web/vite.config.ts +46 -0
- package/package.json +6 -3
- package/dist/templates/claude-agent-sdk/web/.env.example +0 -17
- package/dist/templates/claude-agent-sdk/web/sandbox-proxy.ts +0 -239
- package/dist/templates/claude-agent-sdk/web/src/App.tsx +0 -272
- package/dist/templates/claude-agent-sdk/web/src/main.tsx +0 -12
- package/dist/templates/claude-agent-sdk/web/src/useAgentChat.ts +0 -122
- package/dist/templates/claude-agent-sdk/web/src/vite-env.d.ts +0 -27
- package/dist/templates/claude-agent-sdk/web/tsconfig.json +0 -20
- package/dist/templates/claude-agent-sdk/web/vite.config.ts +0 -12
- package/dist/templates/google-adk/web/.env.example +0 -17
- package/dist/templates/google-adk/web/sandbox-proxy.ts +0 -239
- package/dist/templates/google-adk/web/src/App.tsx +0 -272
- package/dist/templates/google-adk/web/src/main.tsx +0 -12
- package/dist/templates/google-adk/web/src/useAgentChat.ts +0 -122
- package/dist/templates/google-adk/web/src/vite-env.d.ts +0 -27
- package/dist/templates/google-adk/web/tsconfig.json +0 -20
- package/dist/templates/google-adk/web/vite.config.ts +0 -12
- package/dist/templates/openai-agents-sdk/web/.env.example +0 -17
- package/dist/templates/openai-agents-sdk/web/sandbox-proxy.ts +0 -239
- package/dist/templates/openai-agents-sdk/web/src/App.tsx +0 -272
- package/dist/templates/openai-agents-sdk/web/src/main.tsx +0 -12
- package/dist/templates/openai-agents-sdk/web/src/useAgentChat.ts +0 -122
- package/dist/templates/openai-agents-sdk/web/src/vite-env.d.ts +0 -27
- package/dist/templates/openai-agents-sdk/web/tsconfig.json +0 -20
- package/dist/templates/openai-agents-sdk/web/vite.config.ts +0 -12
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/.env.example +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/.mcp.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/ggui/blueprints/.gitkeep +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/ggui/ggui.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/ggui/themes/.gitkeep +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/guuey.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/mcps/todo/Dockerfile +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/mcps/todo/package.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/mcps/todo/src/server.ts +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/mcps/todo/tsconfig.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/mcps/todo/tsup.config.ts +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/pnpm-workspace.yaml +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/prompts/system.md +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/scripts/dev.mjs +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/src/agent-config.ts +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/src/worker.ts +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/tsconfig.json +0 -0
- /package/dist/templates/{claude-agent-sdk → agentic-app/claude-agent-sdk}/tsup.config.ts +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/.env.example +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/.mcp.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/README.md +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/ggui/blueprints/.gitkeep +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/ggui/ggui.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/ggui/themes/.gitkeep +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/guuey.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/mcps/todo/Dockerfile +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/mcps/todo/package.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/mcps/todo/src/server.ts +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/mcps/todo/tsconfig.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/mcps/todo/tsup.config.ts +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/pnpm-workspace.yaml +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/prompts/system.md +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/scripts/dev.mjs +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/src/agent.ts +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/tsconfig.json +0 -0
- /package/dist/templates/{google-adk → agentic-app/google-adk}/tsup.config.ts +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/.env.example +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/.mcp.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/ggui/blueprints/.gitkeep +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/ggui/ggui.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/ggui/themes/.gitkeep +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/guuey.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/mcps/todo/Dockerfile +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/mcps/todo/package.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/mcps/todo/src/server.ts +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/mcps/todo/tsconfig.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/mcps/todo/tsup.config.ts +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/pnpm-workspace.yaml +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/prompts/system.md +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/scripts/dev.mjs +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/src/agent-config.ts +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/src/worker.ts +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/tsconfig.json +0 -0
- /package/dist/templates/{openai-agents-sdk → agentic-app/openai-agents-sdk}/tsup.config.ts +0 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* pnpm bootstrap — configure this app. Two phases, deliberately split:
|
|
4
|
+
*
|
|
5
|
+
* pnpm bootstrap local only, no account: brand, theme,
|
|
6
|
+
* copy → guuey.app.json + AGENTS.md
|
|
7
|
+
* pnpm bootstrap -- --link bind an EXISTING guuey app (creation
|
|
8
|
+
* stays `guuey apps create` — the moment
|
|
9
|
+
* billing/trial starts remains explicit)
|
|
10
|
+
*
|
|
11
|
+
* Contract: converging + idempotent (re-run any time), `--check` prints
|
|
12
|
+
* machine-readable JSON of what's configured and what's missing, `--yes`
|
|
13
|
+
* is fully non-interactive, secrets are NEVER printed (paths only), and
|
|
14
|
+
* every platform mutation goes through a `guuey` CLI primitive — this
|
|
15
|
+
* script is a thin orchestrator, not a second platform client.
|
|
16
|
+
*
|
|
17
|
+
* Flags:
|
|
18
|
+
* --yes accept defaults for every prompt
|
|
19
|
+
* --check report state as JSON and exit (0 = every required
|
|
20
|
+
* step done, 3 = a required step missing; optional
|
|
21
|
+
* steps are listed but never fail; never mutates)
|
|
22
|
+
* --link run the bind phase (implies the local phase ran)
|
|
23
|
+
* --app-id <id> the app to bind (default: guuey.json's appId,
|
|
24
|
+
* else prompted)
|
|
25
|
+
* --env <e> dev|staging|release when it cannot be derived
|
|
26
|
+
* --domains <d1,d2> allowed origins to push on --link (prompted when
|
|
27
|
+
* interactive; skipped under --yes without the flag)
|
|
28
|
+
* --name/--tagline/--accent/--mode/--headline local-phase overrides
|
|
29
|
+
*/
|
|
30
|
+
import { execFile } from "node:child_process";
|
|
31
|
+
import { promisify } from "node:util";
|
|
32
|
+
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
33
|
+
import { createInterface } from "node:readline/promises";
|
|
34
|
+
import { stdin, stdout } from "node:process";
|
|
35
|
+
import { join, dirname } from "node:path";
|
|
36
|
+
import { fileURLToPath } from "node:url";
|
|
37
|
+
|
|
38
|
+
const execFileAsync = promisify(execFile);
|
|
39
|
+
const projectRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
40
|
+
const CONFIG_PATH = join(projectRoot, "guuey.app.json");
|
|
41
|
+
const AGENTS_PATH = join(projectRoot, "AGENTS.md");
|
|
42
|
+
const CLAUDE_PATH = join(projectRoot, "CLAUDE.md");
|
|
43
|
+
const GUUEY_JSON_PATH = join(projectRoot, "guuey.json");
|
|
44
|
+
|
|
45
|
+
const START_MARK = "<!-- guuey:bootstrap:start -->";
|
|
46
|
+
const END_MARK = "<!-- guuey:bootstrap:end -->";
|
|
47
|
+
|
|
48
|
+
// Per-env public hosts. Two distinct "agents" domain families exist and must
|
|
49
|
+
// not be confused: SLUG pages live at <slug>.agents.guuey.com (prod) /
|
|
50
|
+
// <slug>.agents.<env>.sandbox.guuey.com — always read back from the platform
|
|
51
|
+
// as pageUrl, never derived here — while canonical appId ENDPOINTS live at
|
|
52
|
+
// <appId>.agents.us-east-1.guuey.com (prod) / <appId>.agents.<env>.sandbox
|
|
53
|
+
// .guuey.com. `endpointDomain` below is the ENDPOINT family, used only as
|
|
54
|
+
// the fallback when the app has no live deployment to read the URL from.
|
|
55
|
+
const ENV_HOSTS = {
|
|
56
|
+
release: {
|
|
57
|
+
apiBaseUrl: "https://api.us-east-1.guuey.com/v1",
|
|
58
|
+
widgetOrigin: "https://widget.guuey.com",
|
|
59
|
+
portalUrl: "https://app.guuey.com",
|
|
60
|
+
endpointDomain: "agents.us-east-1.guuey.com",
|
|
61
|
+
},
|
|
62
|
+
staging: {
|
|
63
|
+
apiBaseUrl: "https://api.staging.sandbox.guuey.com/v1",
|
|
64
|
+
widgetOrigin: "https://staging.widget.sandbox.guuey.com",
|
|
65
|
+
portalUrl: "https://staging.app.sandbox.guuey.com",
|
|
66
|
+
endpointDomain: "agents.staging.sandbox.guuey.com",
|
|
67
|
+
},
|
|
68
|
+
dev: {
|
|
69
|
+
apiBaseUrl: "https://api.dev.sandbox.guuey.com/v1",
|
|
70
|
+
widgetOrigin: "https://dev.widget.sandbox.guuey.com",
|
|
71
|
+
portalUrl: "https://dev.app.sandbox.guuey.com",
|
|
72
|
+
endpointDomain: "agents.dev.sandbox.guuey.com",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// ── plumbing ────────────────────────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
function parseArgs(argv) {
|
|
79
|
+
const flags = {};
|
|
80
|
+
for (let i = 0; i < argv.length; i++) {
|
|
81
|
+
const arg = argv[i];
|
|
82
|
+
if (!arg.startsWith("--")) continue;
|
|
83
|
+
const key = arg.slice(2);
|
|
84
|
+
const next = argv[i + 1];
|
|
85
|
+
if (next !== undefined && !next.startsWith("--")) {
|
|
86
|
+
flags[key] = next;
|
|
87
|
+
i++;
|
|
88
|
+
} else {
|
|
89
|
+
flags[key] = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return flags;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function readConfig() {
|
|
96
|
+
return JSON.parse(readFileSync(CONFIG_PATH, "utf8"));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function writeConfig(config) {
|
|
100
|
+
writeFileSync(CONFIG_PATH, `${JSON.stringify(config, null, 2)}\n`, "utf8");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function ask(rl, question, fallback, yes) {
|
|
104
|
+
if (yes) return fallback;
|
|
105
|
+
const answer = (await rl.question(`${question} [${fallback}]: `)).trim();
|
|
106
|
+
return answer || fallback;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Run a `guuey` CLI command; the CLI's own stderr passes through on failure. */
|
|
110
|
+
async function guuey(args) {
|
|
111
|
+
try {
|
|
112
|
+
const { stdout: out } = await execFileAsync("pnpm", ["exec", "guuey", ...args], {
|
|
113
|
+
cwd: projectRoot,
|
|
114
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
115
|
+
});
|
|
116
|
+
return { ok: true, stdout: out };
|
|
117
|
+
} catch (err) {
|
|
118
|
+
const stderr = typeof err?.stderr === "string" ? err.stderr.trim() : "";
|
|
119
|
+
const out = typeof err?.stdout === "string" ? err.stdout.trim() : "";
|
|
120
|
+
return { ok: false, stdout: out, error: stderr || out || String(err) };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ── ggui.json theme sync (guuey#302 scaffold hygiene) ───────────────────────
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Keep `ggui/ggui.json`'s theme MODE in step with guuey.app.json so the
|
|
128
|
+
* local `ggui serve` preview matches the site (the scaffold used to ship
|
|
129
|
+
* the two contradicting each other: light site, dark ggui preview). Only
|
|
130
|
+
* `mode` syncs — `preset` is ggui-side vocabulary and stays the author's
|
|
131
|
+
* choice. NOTE: the deployed render's theme is platform data (`guuey
|
|
132
|
+
* deploy` deliberately ignores this block; guuey#304 owns the production
|
|
133
|
+
* side) — this sync is about local-preview honesty.
|
|
134
|
+
*/
|
|
135
|
+
function syncGguiTheme(config) {
|
|
136
|
+
const gguiJsonPath = join(projectRoot, "ggui", "ggui.json");
|
|
137
|
+
if (!existsSync(gguiJsonPath)) return;
|
|
138
|
+
const ggui = JSON.parse(readFileSync(gguiJsonPath, "utf8"));
|
|
139
|
+
if (ggui.theme?.mode === config.theme.mode) return;
|
|
140
|
+
ggui.theme = { ...(ggui.theme ?? {}), mode: config.theme.mode };
|
|
141
|
+
writeFileSync(gguiJsonPath, `${JSON.stringify(ggui, null, 2)}\n`, "utf8");
|
|
142
|
+
console.log(`ggui/ggui.json theme mode → ${config.theme.mode} (local preview matches the site).`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// ── AGENTS.md managed block ─────────────────────────────────────────────────
|
|
146
|
+
|
|
147
|
+
function managedBlock(config) {
|
|
148
|
+
const link = config.link;
|
|
149
|
+
// The agent's shape steers the guidance: a declarative agent (an
|
|
150
|
+
// `--example` extraction, or a Studio pull) has NO worker build — its
|
|
151
|
+
// whole definition is guuey.json + the system prompt.
|
|
152
|
+
const guueyJson = existsSync(GUUEY_JSON_PATH)
|
|
153
|
+
? JSON.parse(readFileSync(GUUEY_JSON_PATH, "utf8"))
|
|
154
|
+
: {};
|
|
155
|
+
const declarative = guueyJson?.agent?.mode === "declarative";
|
|
156
|
+
const lines = [
|
|
157
|
+
START_MARK,
|
|
158
|
+
"## This project (generated by `pnpm bootstrap` — edit outside the markers)",
|
|
159
|
+
"",
|
|
160
|
+
`- **App**: ${config.brand.name} — ${config.brand.tagline}`,
|
|
161
|
+
declarative
|
|
162
|
+
? "- **Agent shape**: DECLARATIVE — the agent is entirely `guuey.json` + `prompts/`; there is no worker build and no `src/` agent code. Change behavior by editing the system prompt / mcpServers, then `guuey deploy`."
|
|
163
|
+
: "- **Agent shape**: code-mode — the agent entry under `src/` builds to the deployable worker (`pnpm build`).",
|
|
164
|
+
link
|
|
165
|
+
? `- **Bound guuey app**: \`${link.appId}\` (${link.env}). NEVER hand-edit this id — re-run \`pnpm bootstrap -- --link\` to rebind.`
|
|
166
|
+
: "- **Bound guuey app**: none yet — `pnpm bootstrap -- --link` binds one (create first with `guuey apps create --name ...`).",
|
|
167
|
+
link ? `- **Agent endpoint**: ${link.endpointUrl}` : "- **Agent endpoint (local dev)**: http://localhost:6790 via `pnpm dev`",
|
|
168
|
+
link && link.pageUrl ? `- **Agent's own page**: ${link.pageUrl}` : null,
|
|
169
|
+
"- **Commands**: `pnpm dev` (local stack) · `pnpm bootstrap` (reconfigure) · `pnpm status` (live app state) · `guuey deploy` (ship the agent)",
|
|
170
|
+
"- **Config**: `guuey.app.json` (frontend/brand — schema in `guuey.app.schema.json`) and `guuey.json` (the agent definition). Secrets live in `.env.local`, never in either file.",
|
|
171
|
+
"- **Frontend**: `web/` — Vite + React on `@guuey/chat`; identity is guest-secret or BYO-OIDC, never both on one surface.",
|
|
172
|
+
END_MARK,
|
|
173
|
+
].filter((line) => line !== null);
|
|
174
|
+
return lines.join("\n");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function regenerateAgentsMd(config) {
|
|
178
|
+
const block = managedBlock(config);
|
|
179
|
+
let content = existsSync(AGENTS_PATH) ? readFileSync(AGENTS_PATH, "utf8") : "# AGENTS.md\n";
|
|
180
|
+
const start = content.indexOf(START_MARK);
|
|
181
|
+
const end = content.indexOf(END_MARK);
|
|
182
|
+
if (start !== -1 && end !== -1 && end > start) {
|
|
183
|
+
content = content.slice(0, start) + block + content.slice(end + END_MARK.length);
|
|
184
|
+
} else {
|
|
185
|
+
// Insert after the H1 (first line), before everything else.
|
|
186
|
+
const nl = content.indexOf("\n");
|
|
187
|
+
const head = nl === -1 ? content : content.slice(0, nl + 1);
|
|
188
|
+
const rest = nl === -1 ? "" : content.slice(nl + 1);
|
|
189
|
+
content = `${head}\n${block}\n${rest}`;
|
|
190
|
+
}
|
|
191
|
+
writeFileSync(AGENTS_PATH, content, "utf8");
|
|
192
|
+
|
|
193
|
+
if (!existsSync(CLAUDE_PATH)) {
|
|
194
|
+
writeFileSync(
|
|
195
|
+
CLAUDE_PATH,
|
|
196
|
+
"# CLAUDE.md\n\nSee [AGENTS.md](./AGENTS.md) — the single source of agent guidance for this repo.\n",
|
|
197
|
+
"utf8",
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ── link-phase helpers ──────────────────────────────────────────────────────
|
|
203
|
+
|
|
204
|
+
function deriveEnv(app) {
|
|
205
|
+
const hosts = [app.pageUrl, app.endpointUrl].filter(Boolean).join(" ");
|
|
206
|
+
if (/\.agents\.guuey\.com|agents\.us-east-1\.guuey\.com/.test(hosts)) return "release";
|
|
207
|
+
const m = /\.agents\.(dev|staging)\.sandbox\.guuey\.com/.exec(hosts);
|
|
208
|
+
return m ? m[1] : null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async function linkPhase(config, flags, yes) {
|
|
212
|
+
const guueyJson = existsSync(GUUEY_JSON_PATH) ? JSON.parse(readFileSync(GUUEY_JSON_PATH, "utf8")) : {};
|
|
213
|
+
let appId = typeof flags["app-id"] === "string" ? flags["app-id"] : guueyJson.appId;
|
|
214
|
+
if (!appId && !yes) {
|
|
215
|
+
const rl = createInterface({ input: stdin, output: stdout });
|
|
216
|
+
appId = (await rl.question("App id to bind (guuey apps list): ")).trim();
|
|
217
|
+
rl.close();
|
|
218
|
+
}
|
|
219
|
+
if (!appId) {
|
|
220
|
+
console.error("--link needs an app id: pass --app-id <id> (create one with `guuey apps create --name ...`).");
|
|
221
|
+
process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const res = await guuey(["apps", "get", appId, "--json"]);
|
|
225
|
+
if (!res.ok) {
|
|
226
|
+
console.error(`Could not read app ${appId} via the guuey CLI:\n${res.error}`);
|
|
227
|
+
console.error("Log in first (`guuey login`) and check the id (`guuey apps list`).");
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
let app;
|
|
231
|
+
try {
|
|
232
|
+
app = JSON.parse(res.stdout);
|
|
233
|
+
} catch {
|
|
234
|
+
console.error(
|
|
235
|
+
"`guuey apps get --json` did not return parseable JSON. Raw output follows — " +
|
|
236
|
+
"if extra lines surround the JSON, that is a guuey CLI bug worth reporting:\n" +
|
|
237
|
+
res.stdout,
|
|
238
|
+
);
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const env = typeof flags.env === "string" ? flags.env : deriveEnv(app);
|
|
243
|
+
if (!env || !ENV_HOSTS[env]) {
|
|
244
|
+
console.error(
|
|
245
|
+
"Could not derive the environment from the app record (no page/endpoint yet). Pass --env dev|staging|release.",
|
|
246
|
+
);
|
|
247
|
+
process.exit(1);
|
|
248
|
+
}
|
|
249
|
+
const hosts = ENV_HOSTS[env];
|
|
250
|
+
|
|
251
|
+
// The platform's deployment records carry the full `…/agent/invoke` URL;
|
|
252
|
+
// the config contract stores the ORIGIN (the web app appends paths).
|
|
253
|
+
const endpointOrigin = (app.endpointUrl || `https://${appId}.${hosts.endpointDomain}`).replace(
|
|
254
|
+
/\/agent\/invoke\/?$/,
|
|
255
|
+
"",
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
config.link = {
|
|
259
|
+
appId,
|
|
260
|
+
env,
|
|
261
|
+
apiBaseUrl: hosts.apiBaseUrl,
|
|
262
|
+
endpointUrl: endpointOrigin,
|
|
263
|
+
widgetOrigin: hosts.widgetOrigin,
|
|
264
|
+
portalUrl: hosts.portalUrl,
|
|
265
|
+
slug: app.urlSlug ?? null,
|
|
266
|
+
pageUrl: app.pageUrl ?? null,
|
|
267
|
+
};
|
|
268
|
+
writeConfig(config);
|
|
269
|
+
console.log(`Linked ${config.brand.name} → ${appId} (${env}).`);
|
|
270
|
+
|
|
271
|
+
// Allowed domains: the origins this frontend will serve from (needed for
|
|
272
|
+
// the widget's frame-ancestors AND the pod's CORS). Flag wins; prompted
|
|
273
|
+
// when interactive; skipped (with the hint below) under --yes.
|
|
274
|
+
let domains = typeof flags.domains === "string" ? flags.domains : null;
|
|
275
|
+
if (domains === null && !yes) {
|
|
276
|
+
const rl = createInterface({ input: stdin, output: stdout });
|
|
277
|
+
domains = (
|
|
278
|
+
await rl.question("Allowed origins for this frontend (comma-separated, empty to skip): ")
|
|
279
|
+
).trim();
|
|
280
|
+
rl.close();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Platform pushes — each one a CLI primitive; failures are reported, not
|
|
284
|
+
// hidden, and the run keeps converging on the rest.
|
|
285
|
+
const pushes = [];
|
|
286
|
+
if (domains) {
|
|
287
|
+
pushes.push({
|
|
288
|
+
step: "allowed-domains",
|
|
289
|
+
result: await guuey(["apps", "update", appId, "--domains", domains]),
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
pushes.push({
|
|
293
|
+
step: "brand-accent",
|
|
294
|
+
result: await guuey(["apps", "update", appId, "--brand-accent", config.theme.accent]),
|
|
295
|
+
});
|
|
296
|
+
// Theme-as-platform-data push rides `guuey apps update --chat-theme-file`
|
|
297
|
+
// (filed as a platform CLI ask). Until that flag exists this step is
|
|
298
|
+
// reported as skipped — never silently omitted, never worked around here.
|
|
299
|
+
pushes.push({ step: "chat-theme", result: { ok: false, error: "skipped: needs `guuey apps update --chat-theme-file` (guuey#283)" } });
|
|
300
|
+
|
|
301
|
+
for (const { step, result } of pushes) {
|
|
302
|
+
if (result.ok) console.log(` ✓ ${step}`);
|
|
303
|
+
else console.log(` – ${step}: ${result.error}`);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
console.log("\nNext steps (each is one command — run when ready):");
|
|
307
|
+
if (!domains) {
|
|
308
|
+
console.log(` guuey apps update ${appId} --domains <https://your-site.example> # allow this frontend's origin`);
|
|
309
|
+
}
|
|
310
|
+
if (!config.link.slug) console.log(" guuey slug claim <name> # public short name → portal link + hosted page");
|
|
311
|
+
console.log(" guuey deploy # ship the agent definition in guuey.json");
|
|
312
|
+
if (config.auth.oidc) {
|
|
313
|
+
console.log(` guuey apps update ${appId} --auth-mode byo --issuer-url ${config.auth.oidc.issuer} --audience ${config.auth.oidc.clientId}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// ── check ───────────────────────────────────────────────────────────────────
|
|
318
|
+
|
|
319
|
+
function check(config) {
|
|
320
|
+
// Required steps gate the exit code; optional ones are informational.
|
|
321
|
+
const missing = [];
|
|
322
|
+
const optional = [];
|
|
323
|
+
if (!config.bootstrapped) missing.push({ step: "bootstrap", fix: "pnpm bootstrap" });
|
|
324
|
+
if (!config.link) missing.push({ step: "link", fix: "pnpm bootstrap -- --link --app-id <id>" });
|
|
325
|
+
if (config.link && !config.link.slug)
|
|
326
|
+
optional.push({ step: "slug", fix: "guuey slug claim <name> (portal link + hosted page)" });
|
|
327
|
+
if (!config.auth.oidc)
|
|
328
|
+
optional.push({ step: "oidc", fix: "set auth.oidc {issuer, clientId} for sign-in (guest works without it)" });
|
|
329
|
+
const report = {
|
|
330
|
+
bootstrapped: config.bootstrapped,
|
|
331
|
+
linked: config.link !== null,
|
|
332
|
+
appId: config.link?.appId ?? null,
|
|
333
|
+
env: config.link?.env ?? null,
|
|
334
|
+
oidcConfigured: config.auth.oidc !== null,
|
|
335
|
+
demoMode: config.demoMode,
|
|
336
|
+
missing,
|
|
337
|
+
optional,
|
|
338
|
+
};
|
|
339
|
+
console.log(JSON.stringify(report, null, 2));
|
|
340
|
+
process.exit(missing.length > 0 ? 3 : 0);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// ── main ────────────────────────────────────────────────────────────────────
|
|
344
|
+
|
|
345
|
+
async function main() {
|
|
346
|
+
const flags = parseArgs(process.argv.slice(2));
|
|
347
|
+
const yes = flags.yes === true;
|
|
348
|
+
const config = readConfig();
|
|
349
|
+
|
|
350
|
+
if (flags.check === true) return check(config);
|
|
351
|
+
|
|
352
|
+
if (flags.link === true) {
|
|
353
|
+
if (!config.bootstrapped) {
|
|
354
|
+
console.error("Run the local phase first: pnpm bootstrap");
|
|
355
|
+
process.exit(1);
|
|
356
|
+
}
|
|
357
|
+
await linkPhase(config, flags, yes);
|
|
358
|
+
regenerateAgentsMd(config);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Local phase — no account, no network.
|
|
363
|
+
const rl = yes ? null : createInterface({ input: stdin, output: stdout });
|
|
364
|
+
const name = typeof flags.name === "string" ? flags.name : await ask(rl, "App name", config.brand.name, yes);
|
|
365
|
+
const tagline = typeof flags.tagline === "string" ? flags.tagline : await ask(rl, "Tagline", config.brand.tagline, yes);
|
|
366
|
+
const accent = typeof flags.accent === "string" ? flags.accent : await ask(rl, "Accent color (#rrggbb)", config.theme.accent, yes);
|
|
367
|
+
const mode = typeof flags.mode === "string" ? flags.mode : await ask(rl, "Theme mode (light|dark)", config.theme.mode, yes);
|
|
368
|
+
const headline = typeof flags.headline === "string" ? flags.headline : await ask(rl, "Landing headline", config.copy.landing.headline, yes);
|
|
369
|
+
rl?.close();
|
|
370
|
+
|
|
371
|
+
if (!/^#[0-9a-fA-F]{6}$/.test(accent)) {
|
|
372
|
+
console.error(`Accent must be #rrggbb (got "${accent}").`);
|
|
373
|
+
process.exit(1);
|
|
374
|
+
}
|
|
375
|
+
if (mode !== "light" && mode !== "dark") {
|
|
376
|
+
console.error(`Theme mode must be light or dark (got "${mode}").`);
|
|
377
|
+
process.exit(1);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
config.brand.name = name;
|
|
381
|
+
config.brand.tagline = tagline;
|
|
382
|
+
config.brand.logoText = name.replace(/[^A-Za-z0-9]/g, "").slice(0, 2).toUpperCase() || "AA";
|
|
383
|
+
config.theme.accent = accent;
|
|
384
|
+
config.theme.mode = mode;
|
|
385
|
+
config.copy.landing.headline = headline;
|
|
386
|
+
config.bootstrapped = true;
|
|
387
|
+
// A bootstrap makes the app YOURS — if this started life as a demo
|
|
388
|
+
// extraction (`--example`), the demo chrome turns off here.
|
|
389
|
+
config.demoMode = false;
|
|
390
|
+
writeConfig(config);
|
|
391
|
+
syncGguiTheme(config);
|
|
392
|
+
regenerateAgentsMd(config);
|
|
393
|
+
|
|
394
|
+
console.log(`\nConfigured "${name}" — guuey.app.json written, AGENTS.md updated.`);
|
|
395
|
+
console.log("Next: pnpm dev (local stack) · pnpm bootstrap -- --link (bind a deployed app)");
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
await main();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// pnpm dev — boots the whole local stack. Ctrl-C tears everything down.
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
|
|
6
|
+
const procs = [];
|
|
7
|
+
function boot(name, command, args, opts = {}) {
|
|
8
|
+
const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"], ...opts });
|
|
9
|
+
const prefix = `[${name}]`.padEnd(9);
|
|
10
|
+
child.stdout.on("data", (d) => process.stdout.write(String(d).replace(/^/gm, prefix)));
|
|
11
|
+
child.stderr.on("data", (d) => process.stderr.write(String(d).replace(/^/gm, prefix)));
|
|
12
|
+
child.on("exit", (code) => {
|
|
13
|
+
if (code !== 0 && !shuttingDown) shutdown(`${name} exited (${code})`, 1);
|
|
14
|
+
});
|
|
15
|
+
procs.push(child);
|
|
16
|
+
}
|
|
17
|
+
let shuttingDown = false;
|
|
18
|
+
function shutdown(reason, code = 0) {
|
|
19
|
+
if (shuttingDown) return;
|
|
20
|
+
shuttingDown = true;
|
|
21
|
+
console.log(`\n${reason} — shutting down`);
|
|
22
|
+
for (const p of procs) p.kill("SIGTERM");
|
|
23
|
+
setTimeout(() => process.exit(code), 500);
|
|
24
|
+
}
|
|
25
|
+
process.on("SIGINT", () => shutdown("interrupted"));
|
|
26
|
+
process.on("SIGTERM", () => shutdown("terminated"));
|
|
27
|
+
|
|
28
|
+
if (!existsSync(".env.local"))
|
|
29
|
+
console.warn("hint: cp .env.example .env.local and set your LLM key");
|
|
30
|
+
|
|
31
|
+
boot("worker", "pnpm", ["exec", "tsup", "--watch"]); // rebuilds guuey.worker.js on change
|
|
32
|
+
// `guuey dev` auto-spawns every `kind: 'colocated'` mcpServers entry itself
|
|
33
|
+
// (name→localhost devPort resolution) — the todo MCP is colocated, so it no
|
|
34
|
+
// longer needs its own boot() here; a manual second spawn would double-bind
|
|
35
|
+
// :6782 and crash with EADDRINUSE.
|
|
36
|
+
boot("agent", "pnpm", ["exec", "guuey", "dev", "--serve", "--port", "6790"]);
|
|
37
|
+
boot("ggui", "pnpm", ["exec", "ggui", "serve", "--mcp-only", "--dev-allow-all", "--port", "6781"], {
|
|
38
|
+
cwd: "ggui",
|
|
39
|
+
});
|
|
40
|
+
boot("web", "pnpm", ["--filter", "@agentic-app-template/web", "dev"], {
|
|
41
|
+
env: { ...process.env, PORT: "6890" },
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
console.log("\n agent http://localhost:6790 todo-mcp http://localhost:6782");
|
|
45
|
+
console.log(" ggui http://localhost:6781 web http://localhost:6890\n");
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot + system-prompt + MCP-endpoint resolution shared by both framework
|
|
3
|
+
* overlays. Duplicated verbatim in `templates-src/frameworks/openai-agents-sdk`
|
|
4
|
+
* by design — template code must be self-contained (no cross-overlay imports),
|
|
5
|
+
* so keep the two copies byte-identical when editing either one.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { parseGuueyJson, type GuueyAgent } from "@guuey/config";
|
|
10
|
+
import { listCredentials, type Invoke } from "@guuey/worker";
|
|
11
|
+
|
|
12
|
+
/** GUUEY_AGENT_SNAPSHOT (set by the platform pod and by `guuey dev`) wins; guuey.json is the fallback. */
|
|
13
|
+
export function loadAgent(invoke: Invoke): GuueyAgent {
|
|
14
|
+
const env = process.env.GUUEY_AGENT_SNAPSHOT;
|
|
15
|
+
if (env) return JSON.parse(env) as GuueyAgent;
|
|
16
|
+
const raw = JSON.parse(readFileSync(join(invoke.fs.app, "guuey.json"), "utf8"));
|
|
17
|
+
return parseGuueyJson(raw).agent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function systemPrompt(invoke: Invoke, agent: GuueyAgent): string | undefined {
|
|
21
|
+
const sp = agent.systemPrompt;
|
|
22
|
+
if (typeof sp === "string") return sp;
|
|
23
|
+
if (sp?.file) return readFileSync(join(invoke.fs.app, sp.file), "utf8");
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* One resolved MCP endpoint this worker may connect to. `transport` rides
|
|
29
|
+
* alongside `url`/`headers` (not hardcoded to `"http"`) because a credential
|
|
30
|
+
* file — `<session>/.guuey/credentials/<name>.json`, shape
|
|
31
|
+
* `{url, transport, headers}` per `@guuey/worker`'s `CredentialFile` — may
|
|
32
|
+
* resolve a server onto the `sse` transport arm.
|
|
33
|
+
*/
|
|
34
|
+
export interface McpEndpoint {
|
|
35
|
+
url: string;
|
|
36
|
+
transport: "http" | "sse";
|
|
37
|
+
headers: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Endpoint set = broker-written credential DIRECTORY (source of truth for
|
|
42
|
+
* federated + platform-injected servers — incl. guuey-memory/guuey-profile,
|
|
43
|
+
* invisible to the declared map by design) ∪ declared external entries that
|
|
44
|
+
* have no credential file (plain endpoints, static headers). Credential wins
|
|
45
|
+
* per name. One honest log line names both sets — no silent fallback.
|
|
46
|
+
*/
|
|
47
|
+
export function mcpEndpoints(invoke: Invoke, agent: GuueyAgent): Record<string, McpEndpoint> {
|
|
48
|
+
const out: Record<string, McpEndpoint> = {};
|
|
49
|
+
for (const [name, entry] of Object.entries(agent.mcpServers ?? {})) {
|
|
50
|
+
if (entry === false) continue; // `ggui: false` is the generative-UI opt-out, not a server entry
|
|
51
|
+
if (entry.kind !== "external") continue; // hosted/colocated are lowered to external before a worker ever runs
|
|
52
|
+
out[name] = {
|
|
53
|
+
url: entry.url,
|
|
54
|
+
transport: entry.transport ?? "http",
|
|
55
|
+
headers: { ...(entry.headers ?? {}) },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const creds = listCredentials(invoke.fs)();
|
|
59
|
+
for (const { name, cred } of creds) {
|
|
60
|
+
out[name] = { url: cred.url, transport: cred.transport, headers: cred.headers };
|
|
61
|
+
}
|
|
62
|
+
const credentialed = creds.map((c) => c.name);
|
|
63
|
+
const declaredOnly = Object.keys(out).filter((n) => !credentialed.includes(n));
|
|
64
|
+
console.log(
|
|
65
|
+
`[guuey] mcp endpoints: credentialed=[${credentialed.join(",")}] declared-only=[${declaredOnly.join(",")}]`
|
|
66
|
+
);
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Fold prior turns into a prompt preamble (v1 keep-it-simple history handling). */
|
|
71
|
+
export function withHistory(invoke: Invoke): string {
|
|
72
|
+
if (invoke.history.length === 0) return invoke.input;
|
|
73
|
+
const lines = invoke.history.map(
|
|
74
|
+
(h) => `${h.role === "agent" ? "Assistant" : "User"}: ${h.text}`
|
|
75
|
+
);
|
|
76
|
+
return `<conversation_history>\n${lines.join("\n")}\n</conversation_history>\n\n${invoke.input}`;
|
|
77
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentic-app-template's code-mode worker entry (`@openai/agents`). Mirrors
|
|
3
|
+
* `@guuey/host`'s `run-openai.ts` — the platform's own OpenAI wiring over this
|
|
4
|
+
* exact snapshot shape: build an `Agent` from the resolved system prompt +
|
|
5
|
+
* MCP endpoints, run it streamed, emit every raw `RunStreamEvent` to the
|
|
6
|
+
* Router via `emit.native`, and resolve the turn's final text from
|
|
7
|
+
* `stream.finalOutput`.
|
|
8
|
+
*
|
|
9
|
+
* `MaxTurnsExceededError` handling mirrors `run-openai.ts`'s INTENT — there
|
|
10
|
+
* max-turns is a soft terminal (`done(finalText, "max_turns")` after a
|
|
11
|
+
* sentinel), NOT a hard `error`; the partial output is still the turn's
|
|
12
|
+
* result. `serveNative`'s handler contract has neither a stopReason nor a
|
|
13
|
+
* sentinel channel (a return is always `done(.., "end_turn")`; a throw is a
|
|
14
|
+
* hard `error` that would discard the partial text), so the cutoff is made
|
|
15
|
+
* visible by appending a note to the returned result instead of rethrowing.
|
|
16
|
+
*/
|
|
17
|
+
import { Agent, MaxTurnsExceededError, MCPServerStreamableHttp, run } from "@openai/agents";
|
|
18
|
+
import type { MCPServer } from "@openai/agents";
|
|
19
|
+
import { serveNative } from "@guuey/worker";
|
|
20
|
+
import { loadAgent, systemPrompt, mcpEndpoints, withHistory } from "./agent-config.js";
|
|
21
|
+
|
|
22
|
+
await serveNative(
|
|
23
|
+
async (invoke, emit) => {
|
|
24
|
+
const agent = loadAgent(invoke);
|
|
25
|
+
const endpoints = mcpEndpoints(invoke, agent);
|
|
26
|
+
const mcpServers: MCPServerStreamableHttp[] = Object.entries(endpoints).map(
|
|
27
|
+
([name, ep]) =>
|
|
28
|
+
new MCPServerStreamableHttp({
|
|
29
|
+
url: ep.url,
|
|
30
|
+
name,
|
|
31
|
+
...(Object.keys(ep.headers).length > 0 ? { requestInit: { headers: ep.headers } } : {}),
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
for (const server of mcpServers) {
|
|
37
|
+
await server.connect();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const sdkAgent = new Agent({
|
|
41
|
+
name: "guuey-agent",
|
|
42
|
+
instructions: systemPrompt(invoke, agent) ?? "You are a helpful assistant.",
|
|
43
|
+
mcpServers: mcpServers as MCPServer[],
|
|
44
|
+
...(agent.model ? { model: agent.model } : {}),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const stream = await run(sdkAgent, withHistory(invoke), {
|
|
48
|
+
stream: true,
|
|
49
|
+
...(agent.runtime?.maxTurns ? { maxTurns: agent.runtime.maxTurns } : {}),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
for await (const event of stream) {
|
|
53
|
+
emit.native(JSON.parse(JSON.stringify(event)));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
await stream.completed;
|
|
58
|
+
} catch (err) {
|
|
59
|
+
if (err instanceof MaxTurnsExceededError) {
|
|
60
|
+
// Soft terminal (see module doc): keep whatever partial output the
|
|
61
|
+
// stream produced and make the cutoff visible in the result text.
|
|
62
|
+
const partial = typeof stream.finalOutput === "string" ? stream.finalOutput : "";
|
|
63
|
+
const note = "[agent stopped: maxTurns limit reached]";
|
|
64
|
+
return partial ? `${partial}\n\n${note}` : note;
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return typeof stream.finalOutput === "string" ? stream.finalOutput : "";
|
|
70
|
+
} finally {
|
|
71
|
+
await Promise.allSettled(mcpServers.map((s) => s.close()));
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{ framework: "openai-agents-sdk", sdkName: "@openai/agents" }
|
|
75
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"],
|
|
14
|
+
"exclude": ["node_modules", "dist"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: { worker: "src/worker.ts" },
|
|
5
|
+
format: ["esm"],
|
|
6
|
+
outDir: ".",
|
|
7
|
+
clean: false,
|
|
8
|
+
// Dependencies stay EXTERNAL (tsup's default): @openai/agents' dependency
|
|
9
|
+
// tree is not ESM-bundle-safe (debug's dynamic require("tty"); circular
|
|
10
|
+
// class hierarchies in its MCP module — both crash a noExternal bundle at
|
|
11
|
+
// boot, caught by the first live openai pod gate). The platform installs
|
|
12
|
+
// deps from the lockfile at image-build time — the same registry-install
|
|
13
|
+
// path the google-adk graceful lane uses. The output is `worker.js` (via
|
|
14
|
+
// guuey.json#worker): the `guuey.worker.js` name specifically means
|
|
15
|
+
// "self-contained, skip install" to the platform's image build.
|
|
16
|
+
});
|
|
@@ -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>agentic-app-template</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|