diff --git a/.github/workflows/deploy-changed-samples.yml b/.github/workflows/deploy-changed-samples.yml index b7053e6c0..80d7a7512 100644 --- a/.github/workflows/deploy-changed-samples.yml +++ b/.github/workflows/deploy-changed-samples.yml @@ -29,9 +29,15 @@ jobs: # This BYOC-only sample exceeds the retired Playground staging quota. git diff --name-only HEAD $LAST_ANCESTOR \ | grep '^samples/' \ - | awk -F'/' '$2 != "self-improving-mastra" {print $1"/"$2}' \ + | awk -F'/' '$2 != "self-improving" {print $1"/"$2}' \ | sort \ - | uniq > changed_samples.txt + | uniq \ + | while read -r sample; do + # A renamed or deleted sample still shows up in the diff, but + # there is nothing left to deploy. Without this the job fails + # with "no results found". + if [ -d "$sample" ]; then echo "$sample"; fi + done > changed_samples.txt if [ -s changed_samples.txt ]; then echo "should_continue=true" >> $GITHUB_ENV echo "The following samples have changed:" diff --git a/README.md b/README.md index 15f81db6c..d4d7c2cea 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ When you add a new sample, make sure to add any config vals to the `deploy-chang | [Rocket](./samples/rocket) | A simple Rocket app. | Rocket | Rust | | [Sails.js](./samples/sailsjs) | A short hello world application demonstrating how to deploy Sails.js onto Defang. | Sails.js, Node.js | nodejs | | [Sails.js & PostgreSQL](./samples/sailsjs-postgres) | A sample project demonstrating how to deploy a project with PostgreSQL and Sails.js. | PostgreSQL, Sails.js, SQL, JavaScript | nodejs | -| [Self-Improving Mastra Todo](./samples/self-improving-mastra) | A Next.js todo app where an admin can turn stored user feedback into live code changes with a Mastra coding agent. | Mastra, Next.js, PostgreSQL, Better Auth, AI, Agents | TypeScript, JavaScript, Docker | +| [Self-Improving Mastra Todo](./samples/self-improving) | A Next.js todo app where an admin can turn stored user feedback into live code changes with a Mastra coding agent. | Mastra, Next.js, PostgreSQL, Better Auth, AI, Agents | TypeScript, JavaScript, Docker | | [Svelte & Node.js & MySQL](./samples/svelte-mysql) | A full-stack application using Svelte for the frontend, Node.js for the backend, and MySQL for the database. | Svelte, Node.js, MySQL, Full-stack, JavaScript, TypeScript, SQL | nodejs | | [SvelteKit](./samples/sveltekit) | A minimal SvelteKit app running on Defang. | SvelteKit, TypeScript, JavaScript, Svelte, Node.js, Frontend, TypeScript, JavaScript | nodejs | | [SvelteKit & MongoDB](./samples/sveltekit-mongodb) | A full-stack application using SvelteKit for the frontend and MongoDB for the database. | SvelteKit, MongoDB, Full-stack, Node.js, JavaScript | nodejs | diff --git a/samples/self-improving-mastra/.dockerignore b/samples/self-improving/.dockerignore similarity index 100% rename from samples/self-improving-mastra/.dockerignore rename to samples/self-improving/.dockerignore diff --git a/samples/self-improving-mastra/.env.aws b/samples/self-improving/.env.aws similarity index 100% rename from samples/self-improving-mastra/.env.aws rename to samples/self-improving/.env.aws diff --git a/samples/self-improving-mastra/.env.gcp b/samples/self-improving/.env.gcp similarity index 100% rename from samples/self-improving-mastra/.env.gcp rename to samples/self-improving/.env.gcp diff --git a/samples/self-improving-mastra/.gitignore b/samples/self-improving/.gitignore similarity index 100% rename from samples/self-improving-mastra/.gitignore rename to samples/self-improving/.gitignore diff --git a/samples/self-improving-mastra/Caddyfile b/samples/self-improving/Caddyfile similarity index 100% rename from samples/self-improving-mastra/Caddyfile rename to samples/self-improving/Caddyfile diff --git a/samples/self-improving-mastra/Dockerfile.dev b/samples/self-improving/Dockerfile.dev similarity index 100% rename from samples/self-improving-mastra/Dockerfile.dev rename to samples/self-improving/Dockerfile.dev diff --git a/samples/self-improving-mastra/README.md b/samples/self-improving/README.md similarity index 99% rename from samples/self-improving-mastra/README.md rename to samples/self-improving/README.md index 53273fdfe..716fc19e8 100644 --- a/samples/self-improving-mastra/README.md +++ b/samples/self-improving/README.md @@ -1,6 +1,6 @@ # Self-Improving Mastra Todo -[![1-click-deploy](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Buttons/SVG/deploy-with-defang.svg)](https://portal.defang.io/sample/self-improving-mastra) +[![1-click-deploy](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Buttons/SVG/deploy-with-defang.svg)](https://portal.defang.io/sample/self-improving) This sample is a multi-user Next.js todo app that turns user feedback into live code changes. Better Auth and PostgreSQL provide accounts, private todo lists, diff --git a/samples/self-improving-mastra/agent/.gitignore b/samples/self-improving/agent/.gitignore similarity index 100% rename from samples/self-improving-mastra/agent/.gitignore rename to samples/self-improving/agent/.gitignore diff --git a/samples/self-improving-mastra/agent/package-lock.json b/samples/self-improving/agent/package-lock.json similarity index 99% rename from samples/self-improving-mastra/agent/package-lock.json rename to samples/self-improving/agent/package-lock.json index 0ed5525ce..aaac5ffd1 100644 --- a/samples/self-improving-mastra/agent/package-lock.json +++ b/samples/self-improving/agent/package-lock.json @@ -1,10 +1,10 @@ { - "name": "self-improving-mastra-agent", + "name": "self-improving-agent", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "self-improving-mastra-agent", + "name": "self-improving-agent", "dependencies": { "@hono/node-server": "^1.14.4", "@mastra/core": "^1.51.0", diff --git a/samples/self-improving-mastra/agent/package.json b/samples/self-improving/agent/package.json similarity index 90% rename from samples/self-improving-mastra/agent/package.json rename to samples/self-improving/agent/package.json index 6853cb3dc..1adb4772e 100644 --- a/samples/self-improving-mastra/agent/package.json +++ b/samples/self-improving/agent/package.json @@ -1,5 +1,5 @@ { - "name": "self-improving-mastra-agent", + "name": "self-improving-agent", "private": true, "type": "module", "scripts": { diff --git a/samples/self-improving-mastra/agent/src/admin.ts b/samples/self-improving/agent/src/admin.ts similarity index 99% rename from samples/self-improving-mastra/agent/src/admin.ts rename to samples/self-improving/agent/src/admin.ts index 368aed676..13a1ee564 100644 --- a/samples/self-improving-mastra/agent/src/admin.ts +++ b/samples/self-improving/agent/src/admin.ts @@ -220,7 +220,7 @@ function renderShell(who: string): string { } const CONSOLE_SCRIPT = ` - const KEY = "self-improving-mastra-active-run"; + const KEY = "self-improving-active-run"; const selected = new Set(); let pollTimer; const $ = (id) => document.getElementById(id); diff --git a/samples/self-improving-mastra/agent/src/auth.ts b/samples/self-improving/agent/src/auth.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/auth.ts rename to samples/self-improving/agent/src/auth.ts diff --git a/samples/self-improving-mastra/agent/src/coder.ts b/samples/self-improving/agent/src/coder.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/coder.ts rename to samples/self-improving/agent/src/coder.ts diff --git a/samples/self-improving-mastra/agent/src/db.ts b/samples/self-improving/agent/src/db.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/db.ts rename to samples/self-improving/agent/src/db.ts diff --git a/samples/self-improving-mastra/agent/src/deployments.ts b/samples/self-improving/agent/src/deployments.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/deployments.ts rename to samples/self-improving/agent/src/deployments.ts diff --git a/samples/self-improving-mastra/agent/src/execute.ts b/samples/self-improving/agent/src/execute.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/execute.ts rename to samples/self-improving/agent/src/execute.ts diff --git a/samples/self-improving-mastra/agent/src/git.ts b/samples/self-improving/agent/src/git.ts similarity index 99% rename from samples/self-improving-mastra/agent/src/git.ts rename to samples/self-improving/agent/src/git.ts index 2a3ae2c3f..a68b43807 100644 --- a/samples/self-improving-mastra/agent/src/git.ts +++ b/samples/self-improving/agent/src/git.ts @@ -24,7 +24,7 @@ const exec = promisify(execFile); */ export const REPO_DIR = LIVE_REPO; -const AGENT_IDENTITY = ["-c", "user.name=coding-agent", "-c", "user.email=agent@self-improving-mastra.local"]; +const AGENT_IDENTITY = ["-c", "user.name=coding-agent", "-c", "user.email=agent@self-improving.local"]; async function git( args: string[], diff --git a/samples/self-improving-mastra/agent/src/index.ts b/samples/self-improving/agent/src/index.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/index.ts rename to samples/self-improving/agent/src/index.ts diff --git a/samples/self-improving-mastra/agent/src/model.ts b/samples/self-improving/agent/src/model.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/model.ts rename to samples/self-improving/agent/src/model.ts diff --git a/samples/self-improving-mastra/agent/src/paths.ts b/samples/self-improving/agent/src/paths.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/paths.ts rename to samples/self-improving/agent/src/paths.ts diff --git a/samples/self-improving-mastra/agent/src/publish.ts b/samples/self-improving/agent/src/publish.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/publish.ts rename to samples/self-improving/agent/src/publish.ts diff --git a/samples/self-improving-mastra/agent/src/runs.ts b/samples/self-improving/agent/src/runs.ts similarity index 100% rename from samples/self-improving-mastra/agent/src/runs.ts rename to samples/self-improving/agent/src/runs.ts diff --git a/samples/self-improving-mastra/agent/tsconfig.json b/samples/self-improving/agent/tsconfig.json similarity index 100% rename from samples/self-improving-mastra/agent/tsconfig.json rename to samples/self-improving/agent/tsconfig.json diff --git a/samples/self-improving-mastra/compose.dev.yaml b/samples/self-improving/compose.dev.yaml similarity index 98% rename from samples/self-improving-mastra/compose.dev.yaml rename to samples/self-improving/compose.dev.yaml index 1a77e1f10..822bdcb6c 100644 --- a/samples/self-improving-mastra/compose.dev.yaml +++ b/samples/self-improving/compose.dev.yaml @@ -8,7 +8,7 @@ # coding agent's edits land in your working tree. The local model is a small # one so it runs on a laptop; expect much lower edit quality than the # deployed Vertex AI model — local is for testing the loop, not the quality. -name: self-improving-mastra-dev +name: self-improving-dev services: dev: build: diff --git a/samples/self-improving-mastra/compose.yaml b/samples/self-improving/compose.yaml similarity index 99% rename from samples/self-improving-mastra/compose.yaml rename to samples/self-improving/compose.yaml index c8762c1a1..77fd5065f 100644 --- a/samples/self-improving-mastra/compose.yaml +++ b/samples/self-improving/compose.yaml @@ -1,4 +1,4 @@ -name: self-improving-mastra +name: self-improving services: # The production to-do app. Runs a Next.js production build with no source # code, no agent, and no admin UI. Exactly one ingress port keeps it diff --git a/samples/self-improving-mastra/entrypoint.dev.sh b/samples/self-improving/entrypoint.dev.sh similarity index 99% rename from samples/self-improving-mastra/entrypoint.dev.sh rename to samples/self-improving/entrypoint.dev.sh index d3e836d53..fbf4b4ef9 100755 --- a/samples/self-improving-mastra/entrypoint.dev.sh +++ b/samples/self-improving/entrypoint.dev.sh @@ -15,7 +15,7 @@ cd /workspace if [ ! -d .git ]; then git init -q -b main git add -A - git -c user.name="coding-agent" -c user.email="agent@self-improving-mastra.local" \ + git -c user.name="coding-agent" -c user.email="agent@self-improving.local" \ commit -qm "baseline: as deployed" else echo "existing git history: $(git rev-list --count HEAD 2>/dev/null || echo 0) commit(s) at $(git rev-parse --short HEAD 2>/dev/null || echo '?')" diff --git a/samples/self-improving-mastra/todo-app/.dockerignore b/samples/self-improving/todo-app/.dockerignore similarity index 100% rename from samples/self-improving-mastra/todo-app/.dockerignore rename to samples/self-improving/todo-app/.dockerignore diff --git a/samples/self-improving-mastra/todo-app/.gitignore b/samples/self-improving/todo-app/.gitignore similarity index 100% rename from samples/self-improving-mastra/todo-app/.gitignore rename to samples/self-improving/todo-app/.gitignore diff --git a/samples/self-improving-mastra/todo-app/Dockerfile b/samples/self-improving/todo-app/Dockerfile similarity index 100% rename from samples/self-improving-mastra/todo-app/Dockerfile rename to samples/self-improving/todo-app/Dockerfile diff --git a/samples/self-improving-mastra/todo-app/README.md b/samples/self-improving/todo-app/README.md similarity index 100% rename from samples/self-improving-mastra/todo-app/README.md rename to samples/self-improving/todo-app/README.md diff --git a/samples/self-improving-mastra/todo-app/app/actions.ts b/samples/self-improving/todo-app/app/actions.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/app/actions.ts rename to samples/self-improving/todo-app/app/actions.ts diff --git a/samples/self-improving-mastra/todo-app/app/api/auth/[...all]/route.ts b/samples/self-improving/todo-app/app/api/auth/[...all]/route.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/app/api/auth/[...all]/route.ts rename to samples/self-improving/todo-app/app/api/auth/[...all]/route.ts diff --git a/samples/self-improving-mastra/todo-app/app/api/errors/route.ts b/samples/self-improving/todo-app/app/api/errors/route.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/app/api/errors/route.ts rename to samples/self-improving/todo-app/app/api/errors/route.ts diff --git a/samples/self-improving-mastra/todo-app/app/api/feedback/route.ts b/samples/self-improving/todo-app/app/api/feedback/route.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/app/api/feedback/route.ts rename to samples/self-improving/todo-app/app/api/feedback/route.ts diff --git a/samples/self-improving-mastra/todo-app/app/api/health/route.ts b/samples/self-improving/todo-app/app/api/health/route.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/app/api/health/route.ts rename to samples/self-improving/todo-app/app/api/health/route.ts diff --git a/samples/self-improving-mastra/todo-app/app/error.tsx b/samples/self-improving/todo-app/app/error.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/error.tsx rename to samples/self-improving/todo-app/app/error.tsx diff --git a/samples/self-improving-mastra/todo-app/app/favicon.ico b/samples/self-improving/todo-app/app/favicon.ico similarity index 100% rename from samples/self-improving-mastra/todo-app/app/favicon.ico rename to samples/self-improving/todo-app/app/favicon.ico diff --git a/samples/self-improving-mastra/todo-app/app/global-error.tsx b/samples/self-improving/todo-app/app/global-error.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/global-error.tsx rename to samples/self-improving/todo-app/app/global-error.tsx diff --git a/samples/self-improving-mastra/todo-app/app/globals.css b/samples/self-improving/todo-app/app/globals.css similarity index 100% rename from samples/self-improving-mastra/todo-app/app/globals.css rename to samples/self-improving/todo-app/app/globals.css diff --git a/samples/self-improving-mastra/todo-app/app/layout.tsx b/samples/self-improving/todo-app/app/layout.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/layout.tsx rename to samples/self-improving/todo-app/app/layout.tsx diff --git a/samples/self-improving-mastra/todo-app/app/login/page.tsx b/samples/self-improving/todo-app/app/login/page.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/login/page.tsx rename to samples/self-improving/todo-app/app/login/page.tsx diff --git a/samples/self-improving-mastra/todo-app/app/page.tsx b/samples/self-improving/todo-app/app/page.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/page.tsx rename to samples/self-improving/todo-app/app/page.tsx diff --git a/samples/self-improving-mastra/todo-app/app/signup/page.tsx b/samples/self-improving/todo-app/app/signup/page.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/app/signup/page.tsx rename to samples/self-improving/todo-app/app/signup/page.tsx diff --git a/samples/self-improving-mastra/todo-app/components/app-header.tsx b/samples/self-improving/todo-app/components/app-header.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/components/app-header.tsx rename to samples/self-improving/todo-app/components/app-header.tsx diff --git a/samples/self-improving-mastra/todo-app/components/auth-form.tsx b/samples/self-improving/todo-app/components/auth-form.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/components/auth-form.tsx rename to samples/self-improving/todo-app/components/auth-form.tsx diff --git a/samples/self-improving-mastra/todo-app/components/error-reporter.tsx b/samples/self-improving/todo-app/components/error-reporter.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/components/error-reporter.tsx rename to samples/self-improving/todo-app/components/error-reporter.tsx diff --git a/samples/self-improving-mastra/todo-app/components/feedback-bubble.tsx b/samples/self-improving/todo-app/components/feedback-bubble.tsx similarity index 100% rename from samples/self-improving-mastra/todo-app/components/feedback-bubble.tsx rename to samples/self-improving/todo-app/components/feedback-bubble.tsx diff --git a/samples/self-improving-mastra/todo-app/eslint.config.mjs b/samples/self-improving/todo-app/eslint.config.mjs similarity index 100% rename from samples/self-improving-mastra/todo-app/eslint.config.mjs rename to samples/self-improving/todo-app/eslint.config.mjs diff --git a/samples/self-improving-mastra/todo-app/instrumentation.ts b/samples/self-improving/todo-app/instrumentation.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/instrumentation.ts rename to samples/self-improving/todo-app/instrumentation.ts diff --git a/samples/self-improving-mastra/todo-app/lib/auth-client.ts b/samples/self-improving/todo-app/lib/auth-client.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/auth-client.ts rename to samples/self-improving/todo-app/lib/auth-client.ts diff --git a/samples/self-improving-mastra/todo-app/lib/auth.ts b/samples/self-improving/todo-app/lib/auth.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/auth.ts rename to samples/self-improving/todo-app/lib/auth.ts diff --git a/samples/self-improving-mastra/todo-app/lib/db.ts b/samples/self-improving/todo-app/lib/db.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/db.ts rename to samples/self-improving/todo-app/lib/db.ts diff --git a/samples/self-improving-mastra/todo-app/lib/report-client-error.ts b/samples/self-improving/todo-app/lib/report-client-error.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/report-client-error.ts rename to samples/self-improving/todo-app/lib/report-client-error.ts diff --git a/samples/self-improving-mastra/todo-app/lib/report-error.ts b/samples/self-improving/todo-app/lib/report-error.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/report-error.ts rename to samples/self-improving/todo-app/lib/report-error.ts diff --git a/samples/self-improving-mastra/todo-app/lib/schema.sql b/samples/self-improving/todo-app/lib/schema.sql similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/schema.sql rename to samples/self-improving/todo-app/lib/schema.sql diff --git a/samples/self-improving-mastra/todo-app/lib/session.ts b/samples/self-improving/todo-app/lib/session.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/lib/session.ts rename to samples/self-improving/todo-app/lib/session.ts diff --git a/samples/self-improving-mastra/todo-app/next.config.ts b/samples/self-improving/todo-app/next.config.ts similarity index 100% rename from samples/self-improving-mastra/todo-app/next.config.ts rename to samples/self-improving/todo-app/next.config.ts diff --git a/samples/self-improving-mastra/todo-app/package-lock.json b/samples/self-improving/todo-app/package-lock.json similarity index 100% rename from samples/self-improving-mastra/todo-app/package-lock.json rename to samples/self-improving/todo-app/package-lock.json diff --git a/samples/self-improving-mastra/todo-app/package.json b/samples/self-improving/todo-app/package.json similarity index 100% rename from samples/self-improving-mastra/todo-app/package.json rename to samples/self-improving/todo-app/package.json diff --git a/samples/self-improving-mastra/todo-app/postcss.config.mjs b/samples/self-improving/todo-app/postcss.config.mjs similarity index 100% rename from samples/self-improving-mastra/todo-app/postcss.config.mjs rename to samples/self-improving/todo-app/postcss.config.mjs diff --git a/samples/self-improving-mastra/todo-app/public/file.svg b/samples/self-improving/todo-app/public/file.svg similarity index 100% rename from samples/self-improving-mastra/todo-app/public/file.svg rename to samples/self-improving/todo-app/public/file.svg diff --git a/samples/self-improving-mastra/todo-app/public/globe.svg b/samples/self-improving/todo-app/public/globe.svg similarity index 100% rename from samples/self-improving-mastra/todo-app/public/globe.svg rename to samples/self-improving/todo-app/public/globe.svg diff --git a/samples/self-improving-mastra/todo-app/public/next.svg b/samples/self-improving/todo-app/public/next.svg similarity index 100% rename from samples/self-improving-mastra/todo-app/public/next.svg rename to samples/self-improving/todo-app/public/next.svg diff --git a/samples/self-improving-mastra/todo-app/public/vercel.svg b/samples/self-improving/todo-app/public/vercel.svg similarity index 100% rename from samples/self-improving-mastra/todo-app/public/vercel.svg rename to samples/self-improving/todo-app/public/vercel.svg diff --git a/samples/self-improving-mastra/todo-app/public/window.svg b/samples/self-improving/todo-app/public/window.svg similarity index 100% rename from samples/self-improving-mastra/todo-app/public/window.svg rename to samples/self-improving/todo-app/public/window.svg diff --git a/samples/self-improving-mastra/todo-app/tsconfig.json b/samples/self-improving/todo-app/tsconfig.json similarity index 100% rename from samples/self-improving-mastra/todo-app/tsconfig.json rename to samples/self-improving/todo-app/tsconfig.json