Skip to content

feat: Framework-agnostic build pipeline (v1 backport)#1336

Draft
Huijiro wants to merge 4 commits intov1from
feat/buildpack-build-v1
Draft

feat: Framework-agnostic build pipeline (v1 backport)#1336
Huijiro wants to merge 4 commits intov1from
feat/buildpack-build-v1

Conversation

@Huijiro
Copy link
Copy Markdown
Member

@Huijiro Huijiro commented Apr 2, 2026

Backport of #1334 (buildpack build pipeline) to v1.

Same changes as the v3 PR but without the dev command rewrite. The existing dev command is preserved.

See #1334 for full description and backend integration guide.

102 tests, all passing.

Huijiro added 4 commits April 2, 2026 17:57
Rework the build command to detect and build ANY JS framework, not just
Agentuity native apps. This is the foundation for Cloud Native Buildpack
(CNB) support.

New architecture:
- detect/  — Framework detection (Next.js, Vite, SvelteKit, Astro, Nuxt, Remix, generic)
- adapters/ — Framework-specific build logic (delegates to framework's own build)
- package/  — Launch metadata generation (Procfile, launch.json)

The build command now follows: detect → install → build → package

Existing Agentuity native apps (app.ts + @agentuity/runtime) continue to
work via the 'agentuity' adapter which delegates to the existing viteBundle
pipeline.

Framework detection checks (in priority order):
1. Agentuity native (app.ts + @agentuity/runtime)
2. Next.js (next.config.* or 'next' dep)
3. Nuxt (nuxt.config.* or 'nuxt' dep)
4. Remix (@remix-run/* deps)
5. SvelteKit (svelte.config.* or @sveltejs/kit)
6. Astro (astro.config.* or 'astro' dep)
7. Vite (vite.config.* — SPA or SSR)
8. Generic fallback (package.json with build/start scripts)

Output includes:
- launch.json — Machine-readable launch metadata
- Procfile — Heroku/Railway/Render compatible
- .agentuity-build — Build marker with framework info

Tests: 93 tests across 4 files (all passing):
- detect/framework-detection.test.ts — 34 tests for all detectors + priority
- detect/util.test.ts — 29 tests for utility functions
- adapters/registry.test.ts — 9 tests for adapter lookup
- package/launch.test.ts — 21 tests for launch metadata + packaging
Add 11 end-to-end contract tests that create real minimal projects, run
them through the full detect → build → package pipeline, and validate
the output meets the buildpack contract:

- launch.json exists with valid schema (processes, framework, runtime, build)
- Procfile exists and follows standard 'type: command' format
- .agentuity-build marker exists with correct metadata
- Server apps have a 'web' process with non-empty command
- Procfile and launch.json agree on start commands
- Framework name/runtime/mode consistent across all output files
- Build failure propagates as error
- Static builds don't copy node_modules
- Build duration is non-zero

Fix: infinite recursion in generic adapter's cpSync
When buildOutput is '.' (project root) and outputDir is inside it
(e.g., '.agentuity'), cpSync would recursively copy .agentuity into
itself infinitely. Fixed by resolving paths and checking containment
before copying, plus adding a filter to exclude the output dir.
Replace 6 individual detector files (nextjs.ts, nuxt.ts, remix.ts,
sveltekit.ts, astro.ts, vite.ts) with a single framework database
(frameworks.ts) and generic detection engine (engine.ts).

Detection rules are informed by @vercel/frameworks v3.22.0 (Apache-2.0).
All Vercel-specific properties (logos, CDN URLs, runtime config, routing
rules, deploy targets) have been stripped — only generic framework facts
remain: package names, config filenames, default build commands, and
output directories as documented by each framework's own docs.

The database covers 25 JS/TS frameworks:
- Meta-frameworks: Next.js, Nuxt, Remix, React Router, SvelteKit,
  Astro, SolidStart, TanStack Start, RedwoodJS
- Static generators: Gatsby, Eleventy, VitePress, VuePress,
  Docusaurus, Hexo
- UI frameworks: Angular, Vue.js, Create React App, Preact
- Server: Nitro
- Bundlers: Vite, Parcel

The detection engine evaluates detectors.every (all must match) and
detectors.some (at least one must match) rules against project files
and package.json dependencies.

This fixes several wrong assumptions from the hand-rolled approach:
- Remix: now uses @remix-run/dev (not @remix-run/node) for detection
- Nuxt: uses package match (not config file) as primary detector
- SvelteKit: uses package.json content regex (matches Vercel's approach)
- Vite: uses package match (not config file) as primary detector

Tests updated: 102 passing (was 104 — removed tests for features we
no longer implement per-framework like static/SSR mode detection).
@agentuity-agent
Copy link
Copy Markdown

agentuity-agent bot commented Apr 2, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🟢 Ready (deploy_af44670b109033ac62c30a455d7beca8) - 2026-04-02T21:13:55Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 36bda429-3c02-462c-ae30-e073390fb7ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

📦 Canary Packages Published

version: 1.0.63-d3c4584

Packages
Package Version URL
@agentuity/core 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-core-1.0.63-d3c4584.tgz
@agentuity/schema 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schema-1.0.63-d3c4584.tgz
@agentuity/frontend 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-frontend-1.0.63-d3c4584.tgz
@agentuity/claude-code 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-claude-code-1.0.63-d3c4584.tgz
@agentuity/auth 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-auth-1.0.63-d3c4584.tgz
@agentuity/db 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-db-1.0.63-d3c4584.tgz
@agentuity/coder 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-coder-1.0.63-d3c4584.tgz
@agentuity/runtime 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-runtime-1.0.63-d3c4584.tgz
@agentuity/email 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-email-1.0.63-d3c4584.tgz
@agentuity/keyvalue 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-keyvalue-1.0.63-d3c4584.tgz
@agentuity/server 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-server-1.0.63-d3c4584.tgz
@agentuity/schedule 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schedule-1.0.63-d3c4584.tgz
@agentuity/postgres 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-postgres-1.0.63-d3c4584.tgz
@agentuity/queue 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-queue-1.0.63-d3c4584.tgz
@agentuity/drizzle 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-drizzle-1.0.63-d3c4584.tgz
@agentuity/react 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-react-1.0.63-d3c4584.tgz
@agentuity/sandbox 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-sandbox-1.0.63-d3c4584.tgz
@agentuity/evals 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-evals-1.0.63-d3c4584.tgz
@agentuity/vector 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-vector-1.0.63-d3c4584.tgz
@agentuity/cli 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-cli-1.0.63-d3c4584.tgz
@agentuity/webhook 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-webhook-1.0.63-d3c4584.tgz
@agentuity/opencode 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-opencode-1.0.63-d3c4584.tgz
@agentuity/task 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-task-1.0.63-d3c4584.tgz
@agentuity/workbench 1.0.63-d3c4584 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-workbench-1.0.63-d3c4584.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-core-1.0.63-d3c4584.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schema-1.0.63-d3c4584.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-frontend-1.0.63-d3c4584.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-claude-code-1.0.63-d3c4584.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-auth-1.0.63-d3c4584.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-db-1.0.63-d3c4584.tgz",
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-coder-1.0.63-d3c4584.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-runtime-1.0.63-d3c4584.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-email-1.0.63-d3c4584.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-keyvalue-1.0.63-d3c4584.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-server-1.0.63-d3c4584.tgz",
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schedule-1.0.63-d3c4584.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-postgres-1.0.63-d3c4584.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-queue-1.0.63-d3c4584.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-drizzle-1.0.63-d3c4584.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-react-1.0.63-d3c4584.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-sandbox-1.0.63-d3c4584.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-evals-1.0.63-d3c4584.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-vector-1.0.63-d3c4584.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-cli-1.0.63-d3c4584.tgz",
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-webhook-1.0.63-d3c4584.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-opencode-1.0.63-d3c4584.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-task-1.0.63-d3c4584.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-workbench-1.0.63-d3c4584.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-core-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schema-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-frontend-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-claude-code-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-auth-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-db-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-coder-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-runtime-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-email-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-keyvalue-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-server-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-schedule-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-postgres-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-queue-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-drizzle-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-react-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-sandbox-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-evals-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-vector-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-cli-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-webhook-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-opencode-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-task-1.0.63-d3c4584.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.63-d3c4584/agentuity-workbench-1.0.63-d3c4584.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant