Skip to content

fix(cli): wire Vite SPA deploys to CDN asset URLs - #1623

Merged
jhaynie merged 8 commits into
mainfrom
feat/vite-spa-cdn-base
Jul 22, 2026
Merged

fix(cli): wire Vite SPA deploys to CDN asset URLs#1623
jhaynie merged 8 commits into
mainfrom
feat/vite-spa-cdn-base

Conversation

@jhaynie

@jhaynie jhaynie commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a dedicated Vite build adapter that forces Vite base to the Agentuity CDN origin during cloud deploy builds (when a real deploymentId is present).
  • Hashed client assets already upload to CDN; without this, SPA index.html / JS keep using origin-relative /assets/… (e.g. Genesis on *.agentcompany.work).
  • Prefer vite build --base=https://cdn.agentuity.com/<deploymentId>/; fall back to a temporary vite.config patch when the build command does not invoke vite directly.
  • Skip CDN wiring for local builds and --pack-only (deploymentId === pack-only).
  • Inject AGENTUITY_CDN_ORIGIN / AGENTUITY_CLOUD_DEPLOYMENT_ID into the build env for configs that want them.

Complements #1571 (TanStack Start transformAssets); this covers plain Vite SPAs (Hono, custom servers, etc.) with no app code changes.

Test plan

  • bun test packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • bun test packages/cli/test/cmd/build/adapters/registry.test.ts
  • bun test packages/cli/test/cmd/build/adapters/tanstack-start.test.ts
  • bun run typecheck in packages/cli
  • Publish canary / release @agentuity/cli
  • Bump CLI in genesis-mono apps/web, redeploy, confirm Network tab loads https://cdn.agentuity.com/<deployId>/assets/…

Summary by CodeRabbit

  • New Features

    • Added dedicated Vite build support with automatic framework adapter selection.
    • Vite deploy builds now wire the correct CDN asset base and ensure Vite gets the appropriate base.
    • Monorepo detection is more precise for pnpm workspaces (only returns context for matching workspace packages).
    • Hono project template now binds to a configurable hostname (defaulting to 0.0.0.0).
  • Bug Fixes

    • Vite CDN build preparation now reliably cleans up temporary changes, even on failure.
  • Tests

    • Added Bun coverage for Vite CDN base resolution, --base injection, config patching, and cleanup behavior.
  • Chores

    • Updated CI test project scaffolding to use Bun for consistency.

When deploying a Vite app, set Vite base to the Agentuity CDN origin so
index.html and the client module graph load hashed assets from CDN instead
of the app origin. Pack-only and local builds are unchanged.
@agentuity-agent

agentuity-agent Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest Agentuity deployment details. Learn more about Agentuity.

Project Deployment Preview Updated (UTC)
docs 🟢 Ready Preview Jul 22, 2026 12:25 AM

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27157850-7aeb-4e96-abd1-a602b9ba68c5

📥 Commits

Reviewing files that changed from the base of the PR and between 40853f5 and 7db626a.

📒 Files selected for processing (12)
  • .github/workflows/test-windows-wsl.yaml
  • packages/cli/src/cmd/build/adapters/cdn-origin.ts
  • packages/cli/src/cmd/build/adapters/tanstack-start/cdn-build.ts
  • packages/cli/src/cmd/build/adapters/vite-cli-base.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/src/cmd/cloud/deploy/pack.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/test/cmd/build/wsl-smoke-layout.test.ts
  • packages/cli/test/cmd/build/wsl-smoke-local-validate.ts
📝 Walkthrough

Walkthrough

Changes

Vite builds now use a dedicated adapter that configures CDN asset bases, delegates to the generic adapter, and restores temporary changes. Monorepo detection validates workspace membership. The Hono template binds to a configurable hostname, and the WSL workflow explicitly scaffolds projects with Bun.

Vite CDN build flow

Vite CDN preparation

Layer / File(s) Summary
CDN resolution and configuration helpers
packages/cli/src/cmd/build/adapters/vite/cdn-build.ts, packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
Resolves CDN origins, injects Vite base flags, patches Vite configuration, and tests helper behavior.
Build preparation and cleanup
packages/cli/src/cmd/build/adapters/vite.ts, packages/cli/src/cmd/build/adapters/vite/cdn-build.ts, packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
Applies temporary environment, command, or config changes, runs the generic build, combines logs, and restores state on success or failure.
Adapter registry integration
packages/cli/src/cmd/build/adapters/index.ts, packages/cli/test/cmd/build/adapters/registry.test.ts, packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
Registers viteAdapter for Vite and verifies the registry result.

Workspace detection

Workspace membership validation

Layer / File(s) Summary
Workspace pattern matching and detection
packages/cli/src/cmd/build/detect/monorepo.ts, packages/cli/test/cmd/build/detect/monorepo.test.ts
Parses workspace patterns, validates project subpaths for pnpm and package.json workspaces, and tests member and non-member directories.

Runtime and workflow adjustments

Template and WSL setup

Layer / File(s) Summary
Hostname binding and Bun scaffolding
packages/cli/src/cmd/project/templates/hono/src/index.ts, .github/workflows/test-windows-wsl.yaml
Passes the configured hostname to the Hono server and explicitly selects Bun when creating the WSL test project.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

📦 Canary Packages Published

version: 3.1.12-7db626a

Packages
Package Version URL
@agentuity/coder 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-3.1.12-7db626a.tgz
@agentuity/email 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-email-3.1.12-7db626a.tgz
@agentuity/cli 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-cli-3.1.12-7db626a.tgz
@agentuity/claude-code 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-claude-code-3.1.12-7db626a.tgz
@agentuity/api 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-api-3.1.12-7db626a.tgz
@agentuity/aigateway 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-aigateway-3.1.12-7db626a.tgz
@agentuity/queue 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-queue-3.1.12-7db626a.tgz
@agentuity/task 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-task-3.1.12-7db626a.tgz
@agentuity/pi 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-pi-3.1.12-7db626a.tgz
@agentuity/webhook 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-webhook-3.1.12-7db626a.tgz
@agentuity/storage 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-storage-3.1.12-7db626a.tgz
@agentuity/coder-tui 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-tui-3.1.12-7db626a.tgz
@agentuity/drizzle 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-drizzle-3.1.12-7db626a.tgz
@agentuity/keyvalue 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-keyvalue-3.1.12-7db626a.tgz
@agentuity/server 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-server-3.1.12-7db626a.tgz
@agentuity/db 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-db-3.1.12-7db626a.tgz
@agentuity/schema 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schema-3.1.12-7db626a.tgz
@agentuity/hono 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-hono-3.1.12-7db626a.tgz
@agentuity/client 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-client-3.1.12-7db626a.tgz
@agentuity/opencode 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-opencode-3.1.12-7db626a.tgz
@agentuity/runtime 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-runtime-3.1.12-7db626a.tgz
@agentuity/vite 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vite-3.1.12-7db626a.tgz
@agentuity/schedule 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schedule-3.1.12-7db626a.tgz
@agentuity/sandbox 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-sandbox-3.1.12-7db626a.tgz
@agentuity/skills 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-skills-3.1.12-7db626a.tgz
@agentuity/core 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-core-3.1.12-7db626a.tgz
@agentuity/stream 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-stream-3.1.12-7db626a.tgz
@agentuity/telemetry 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-telemetry-3.1.12-7db626a.tgz
@agentuity/config 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-config-3.1.12-7db626a.tgz
@agentuity/migrate 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-migrate-3.1.12-7db626a.tgz
@agentuity/adapter 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-adapter-3.1.12-7db626a.tgz
create-agentuity 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/create-agentuity-3.1.12-7db626a.tgz
@agentuity/postgres 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-postgres-3.1.12-7db626a.tgz
@agentuity/vector 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vector-3.1.12-7db626a.tgz
@agentuity/analytics 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-analytics-3.1.12-7db626a.tgz
@agentuity/genesis 3.1.12-7db626a https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-genesis-3.1.12-7db626a.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-3.1.12-7db626a.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-email-3.1.12-7db626a.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-cli-3.1.12-7db626a.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-claude-code-3.1.12-7db626a.tgz",
    "@agentuity/api": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-api-3.1.12-7db626a.tgz",
    "@agentuity/aigateway": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-aigateway-3.1.12-7db626a.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-queue-3.1.12-7db626a.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-task-3.1.12-7db626a.tgz",
    "@agentuity/pi": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-pi-3.1.12-7db626a.tgz",
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-webhook-3.1.12-7db626a.tgz",
    "@agentuity/storage": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-storage-3.1.12-7db626a.tgz",
    "@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-tui-3.1.12-7db626a.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-drizzle-3.1.12-7db626a.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-keyvalue-3.1.12-7db626a.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-server-3.1.12-7db626a.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-db-3.1.12-7db626a.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schema-3.1.12-7db626a.tgz",
    "@agentuity/hono": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-hono-3.1.12-7db626a.tgz",
    "@agentuity/client": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-client-3.1.12-7db626a.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-opencode-3.1.12-7db626a.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-runtime-3.1.12-7db626a.tgz",
    "@agentuity/vite": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vite-3.1.12-7db626a.tgz",
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schedule-3.1.12-7db626a.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-sandbox-3.1.12-7db626a.tgz",
    "@agentuity/skills": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-skills-3.1.12-7db626a.tgz",
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-core-3.1.12-7db626a.tgz",
    "@agentuity/stream": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-stream-3.1.12-7db626a.tgz",
    "@agentuity/telemetry": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-telemetry-3.1.12-7db626a.tgz",
    "@agentuity/config": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-config-3.1.12-7db626a.tgz",
    "@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-migrate-3.1.12-7db626a.tgz",
    "@agentuity/adapter": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-adapter-3.1.12-7db626a.tgz",
    "create-agentuity": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/create-agentuity-3.1.12-7db626a.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-postgres-3.1.12-7db626a.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vector-3.1.12-7db626a.tgz",
    "@agentuity/analytics": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-analytics-3.1.12-7db626a.tgz",
    "@agentuity/genesis": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-genesis-3.1.12-7db626a.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-email-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-cli-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-claude-code-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-api-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-aigateway-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-queue-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-task-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-pi-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-webhook-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-storage-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-coder-tui-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-drizzle-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-keyvalue-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-server-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-db-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schema-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-hono-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-client-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-opencode-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-runtime-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vite-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-schedule-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-sandbox-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-skills-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-core-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-stream-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-telemetry-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-config-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-migrate-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-adapter-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/create-agentuity-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-postgres-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-vector-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-analytics-3.1.12-7db626a.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.12-7db626a/agentuity-genesis-3.1.12-7db626a.tgz

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/cli/src/cmd/build/adapters/vite/cdn-build.ts (1)

83-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Redundant idempotency shortcut (Lines 89-95) — remove; also clears the static-analysis hint.

Whenever the guard at Lines 89-95 returns changed: false, the catch-all /\bbase\s*:/.test(source) at Line 114 would return the exact same result anyway (any existing base: assignment is left alone). This block never produces a different outcome than falling through — it's dead logic that only adds the dynamic RegExp construction ast-grep flagged. Since it's escaped via escapeRegExp, that ReDoS hint is a false positive, but removing this block removes the flagged pattern entirely and simplifies the function (and makes escapeRegExp at Lines 129-131 removable too, as it becomes unused).

♻️ Suggested cleanup
 	const quoted = JSON.stringify(cdnBase);
 
-	// Already pointing at this CDN base.
-	if (source.includes(quoted) || source.includes(cdnBase.replace(/\/$/, ''))) {
-		// Only skip when an explicit base assignment already uses this value.
-		if (new RegExp(String.raw`\bbase\s*:\s*${escapeRegExp(quoted)}`).test(source)) {
-			return { content: source, changed: false };
-		}
-	}
-
 	// base: '/' → CDN

Remove the now-unused escapeRegExp helper as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts` around lines 83 - 131,
Remove the initial idempotency guard in patchViteConfigCdnBase, including its
dynamic RegExp check, since the later explicit base assignment branch already
returns unchanged. After removing that block, delete the now-unused escapeRegExp
helper and preserve the existing base replacement and insertion behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts`:
- Around line 149-236: Wrap the risky fallback I/O in prepareViteCdnBuild with
rollback handling so any readFileSync, writeFileSync, or related config-patching
error invokes the accumulated cleanup callbacks before rethrowing. Ensure
previously applied framework.buildEnv and framework.buildCommand mutations are
restored even when the function fails before returning its preparation object;
preserve normal return and cleanup behavior for successful builds.
- Around line 69-77: Update injectViteBaseFlag to append --base=${cdnBase} to
the command segment that invokes vite, rather than to the entire trimmed
command. Preserve existing behavior for empty commands, commands already
containing --base, and commands without vite, while keeping compound-command
segments after the vite invocation unchanged.
- Line 19: Replace synchronous filesystem usage in prepareViteCdnBuild and
cleanup with node:fs/promises operations and pathExists, making both functions
async. Update their callers in vite.ts and the tests to await preparation and
cleanup, including the restore path, while preserving existing file-read, write,
and cleanup behavior.

---

Nitpick comments:
In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts`:
- Around line 83-131: Remove the initial idempotency guard in
patchViteConfigCdnBase, including its dynamic RegExp check, since the later
explicit base assignment branch already returns unchanged. After removing that
block, delete the now-unused escapeRegExp helper and preserve the existing base
replacement and insertion behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29389e52-bebe-40a5-bb00-74e826b11305

📥 Commits

Reviewing files that changed from the base of the PR and between 4ffcf9c and 63150d9.

📒 Files selected for processing (5)
  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: Native install (Linux)
  • GitHub Check: Bun version checks
  • GitHub Check: Installer scenarios
  • GitHub Check: Linux distro install smoke
  • GitHub Check: Native install (macOS)
  • GitHub Check: Agentuity - docs-docs
  • GitHub Check: Queue CLI Tests (bun)
  • GitHub Check: Package Installation & Usage Test (bun)
  • GitHub Check: Package Installation & Usage Test (node)
  • GitHub Check: Queue CLI Tests (node)
  • GitHub Check: Testing Apps (local tests)
  • GitHub Check: Migrate Chain (v1 → v2 → v3)
  • GitHub Check: Framework Demo Tests
  • GitHub Check: Service Client Smoke Tests
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Build
  • GitHub Check: Windows WSL CLI Smoke Test
  • GitHub Check: Pack & Upload
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run bun run format using Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
**/packages/*/test/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/packages/*/test/**/*.{ts,tsx}: Place tests in test/ folder parallel to src/ directory, never inside src/ or under __tests__/
Import from ../src/ in test files
Use @agentuity/test-utils for shared mocks in tests

Files:

  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
packages/cli/src/cmd/**/index.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/cmd/**/index.ts: Each command must be a directory in src/cmd/ with an index.ts entry point
Always define interfaces for command options using Zod schemas; never use any for type safety

Files:

  • packages/cli/src/cmd/build/adapters/index.ts
packages/cli/src/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/**/*.ts: Use tui.* helpers for formatted output (header, info, success, warning, error, table, progress)
Use ctx.logger for logging; logger.fatal() logs and exits with code 1
Use await readFile(p, 'utf-8') and await writeFile(p, content) from node:fs/promises for file I/O
Import pathExists from node-compat/fs for file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file, Bun.spawn, Bun.color, Bun.stringWidth, etc.) in production source code; tsconfig.json type checking enforces this
Imports must use explicit .ts extensions for relative paths (e.g., from './foo.ts', not from './foo'); TypeScript's rewriteRelativeImportExtensions will rewrite them to .js in output
Always check isJSONMode() for machine-readable output in command handlers
Use requireAuth(ctx) or optionalAuth(ctx) for authenticated commands

Files:

  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
🧠 Learnings (3)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.

Applied to files:

  • packages/cli/test/cmd/build/adapters/registry.test.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.

Applied to files:

  • packages/cli/src/cmd/build/adapters/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
🪛 ast-grep (0.44.1)
packages/cli/src/cmd/build/adapters/vite/cdn-build.ts

[warning] 91-91: Do not use variable for regular expressions
Context: new RegExp(String.raw\bbase\s*:\s*${escapeRegExp(quoted)})
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)

🔇 Additional comments (4)
packages/cli/test/cmd/build/adapters/vite-cdn.test.ts (1)

1-179: LGTM!

packages/cli/src/cmd/build/adapters/vite.ts (1)

12-33: LGTM!

packages/cli/src/cmd/build/adapters/index.ts (1)

13-13: LGTM!

Also applies to: 22-22

packages/cli/test/cmd/build/adapters/registry.test.ts (1)

20-23: LGTM!

Comment thread packages/cli/src/cmd/build/adapters/vite/cdn-build.ts Outdated
Comment thread packages/cli/src/cmd/build/adapters/vite/cdn-build.ts Outdated
Comment thread packages/cli/src/cmd/build/adapters/vite/cdn-build.ts Outdated
Scaffold the WSL deploy smoke app under ~/agentuity-smoke instead of
~/sdk so monorepo detection does not treat it as a workspace subpackage
and package the entire SDK into the deploy.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-windows-wsl.yaml:
- Around line 177-187: Update the metadata extraction flow around PROJECT_ID and
PROJECT_DIR: persist PROJECT_DIR to ~/test-env.sh before reading agentuity.json,
and wrap the jq assignment in an if ! ...; then failure branch so malformed or
missing metadata reaches the diagnostic output despite set -e. Preserve the
existing validation and exit behavior, while ensuring cleanup retains the
project path even when PROJECT_ID extraction fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e5f81b1-e163-4bcd-88d5-4665b12bb12c

📥 Commits

Reviewing files that changed from the base of the PR and between 63150d9 and 223462d.

📒 Files selected for processing (1)
  • .github/workflows/test-windows-wsl.yaml
📜 Review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: Bun version checks
  • GitHub Check: Linux distro install smoke
  • GitHub Check: Installer scenarios
  • GitHub Check: Native install (macOS)
  • GitHub Check: Native install (Linux)
  • GitHub Check: Framework Demo Tests
  • GitHub Check: Service Client Smoke Tests
  • GitHub Check: Package Installation & Usage Test (bun)
  • GitHub Check: Queue CLI Tests (bun)
  • GitHub Check: Queue CLI Tests (node)
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Migrate Chain (v1 → v2 → v3)
  • GitHub Check: Package Installation & Usage Test (node)
  • GitHub Check: Build
  • GitHub Check: Windows WSL CLI Smoke Test
  • GitHub Check: Pack & Upload
  • GitHub Check: OSV Scanner PR
  • GitHub Check: Agentuity - docs-docs
🔇 Additional comments (4)
.github/workflows/test-windows-wsl.yaml (4)

142-157: LGTM!

Also applies to: 168-168


190-199: LGTM!


210-210: LGTM!


219-223: LGTM!

Comment thread .github/workflows/test-windows-wsl.yaml Outdated
jhaynie added 3 commits July 21, 2026 19:07
Make prepareViteCdnBuild async with fs/promises, roll back env/command
mutations on I/O failure, inject --base only on the vite command segment,
drop redundant patchViteConfigCdnBase idempotency guard, and persist
WSL smoke PROJECT_DIR before agentuity.json parse.
Isolating the smoke app under ~/agentuity-smoke avoided monorepo
packaging but made deploy fail faster (no server start, status failed
within seconds). Main has always nested the project under ~/sdk and
that path is still green. Keep the Vite CDN adapter; restore the
previous WSL layout so this job matches main.
WSL smoke creates apps as siblings of packages/ under the SDK tree.
Those are not workspace members, but monorepo detection still packaged
the entire monorepo and set workingDirectory to the smoke path — which
correlates with Hadron readiness never passing after the app starts.

Require workspace-pattern membership before returning monorepo context.
Bind the Hono template to 0.0.0.0 for container TCP health probes, and
create the WSL smoke app with --packageManager bun.
@agentuity-agent

agentuity-agent Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest Agentuity deployment details. Learn more about Agentuity.

Project Deployment Preview Updated (UTC)
docs 🟢 Ready Preview Jul 22, 2026 12:48 AM

jhaynie added 2 commits July 21, 2026 19:40
- Single mechanism: inject vite --base (drop disk config patch + cleanup)
- Pure prepare returns command/env overrides; adapter does not mutate detection
- Shared cdn-origin + PACK_ONLY_DEPLOYMENT_ID used by pack and TanStack host
- Monorepo pnpm membership fails closed like npm/yarn/bun
The CLI option is kebab-case --package-manager, not --packageManager.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/cli/src/cmd/build/adapters/vite/cdn-build.ts (1)

52-64: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Explicit AGENTUITY_CDN_ORIGIN bypasses the pack-only guard.

The pack-only sentinel check only runs on the deploymentId/AGENTUITY_CLOUD_DEPLOYMENT_ID fallback path (Line 60-61). If AGENTUITY_CDN_ORIGIN happens to be set in the environment while deploymentId is PACK_ONLY_DEPLOYMENT_ID, the function returns the explicit origin at Line 58 before ever reaching the pack-only check — silently wiring CDN base into a build the PR states should be unaffected ("Local builds and --pack-only builds are unchanged"). No test covers this combination (the existing "skips pack-only deployment id" test only sets env: {}).

🐛 Proposed fix: check the pack-only sentinel before the explicit-origin short-circuit
 export function resolveViteCdnBase(options: {
 	deploymentId?: string;
 	env?: NodeJS.ProcessEnv;
 }): string | undefined {
 	const env = options.env ?? process.env;
-	const explicit = env.AGENTUITY_CDN_ORIGIN?.trim().replace(/\/+$/, '');
-	if (explicit) return `${explicit}/`;
-
 	const id = (options.deploymentId ?? env.AGENTUITY_CLOUD_DEPLOYMENT_ID)?.trim();
-	if (!id || id === PACK_ONLY_DEPLOYMENT_ID) return undefined;
+	if (id === PACK_ONLY_DEPLOYMENT_ID) return undefined;
+
+	const explicit = env.AGENTUITY_CDN_ORIGIN?.trim().replace(/\/+$/, '');
+	if (explicit) return `${explicit}/`;
+
+	if (!id) return undefined;
 
 	return `https://cdn.agentuity.com/${id}/`;
 }

Also worth adding a regression test combining PACK_ONLY_DEPLOYMENT_ID with AGENTUITY_CDN_ORIGIN set, in packages/cli/test/cmd/build/adapters/vite-cdn.test.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts` around lines 52 - 64,
Update resolveViteCdnBase so PACK_ONLY_DEPLOYMENT_ID is checked before the
explicit AGENTUITY_CDN_ORIGIN short-circuit, returning undefined for pack-only
builds regardless of the configured origin. Add a regression test in the Vite
CDN tests covering the sentinel deployment ID with AGENTUITY_CDN_ORIGIN set.
🧹 Nitpick comments (1)
packages/cli/src/cmd/build/adapters/vite/cdn-build.ts (1)

251-255: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider wrapping the rethrown error in StructuredError.

The catch block rethrows the raw underlying error (e.g. an fs EISDIR) without additional context. As per path instructions, **/*.{ts,tsx} files should "Use StructuredError from @agentuity/core for error handling," which would let this failure carry a clearer message (e.g. which vite.config file failed to patch) through the CLI's error reporting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts` around lines 251 -
255, Update the catch block around the Vite config patching flow to rethrow the
failure as a StructuredError from `@agentuity/core`, preserving the original error
as its cause and adding context identifying the vite.config file being patched.
Keep runCleanup() execution before propagating the wrapped error.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts`:
- Around line 145-151: Update runCleanups to execute every cleanup in reverse
order even when one fails by isolating each cleanup failure, swallowing it, and
optionally reporting it through the existing debug logger. Ensure
prepareViteCdnBuild’s catch path still rethrows the original build error after
awaiting runCleanup, without allowing cleanup failures to replace it.

In `@packages/cli/src/cmd/build/detect/monorepo.ts`:
- Around line 83-128: Update readPnpmWorkspacePatterns and the workspace
matching flow to parse pnpm-workspace YAML with a YAML parser, including
flow-style packages entries, rather than manually scanning lines. Preserve
ordered pnpm glob semantics: include patterns add matches, while !-prefixed
patterns remove previously included paths; ensure matchesWorkspacePattern
handles exclusion patterns through this ordered evaluation instead of treating !
as a literal.

---

Outside diff comments:
In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts`:
- Around line 52-64: Update resolveViteCdnBase so PACK_ONLY_DEPLOYMENT_ID is
checked before the explicit AGENTUITY_CDN_ORIGIN short-circuit, returning
undefined for pack-only builds regardless of the configured origin. Add a
regression test in the Vite CDN tests covering the sentinel deployment ID with
AGENTUITY_CDN_ORIGIN set.

---

Nitpick comments:
In `@packages/cli/src/cmd/build/adapters/vite/cdn-build.ts`:
- Around line 251-255: Update the catch block around the Vite config patching
flow to rethrow the failure as a StructuredError from `@agentuity/core`,
preserving the original error as its cause and adding context identifying the
vite.config file being patched. Keep runCleanup() execution before propagating
the wrapped error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9df66366-c5f9-44ea-bcfc-b1cb4a7806b8

📥 Commits

Reviewing files that changed from the base of the PR and between 223462d and 40853f5.

📒 Files selected for processing (7)
  • .github/workflows/test-windows-wsl.yaml
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/test/cmd/build/detect/monorepo.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: Native install (macOS)
  • GitHub Check: Linux distro install smoke
  • GitHub Check: Native install (Linux)
  • GitHub Check: Bun version checks
  • GitHub Check: Installer scenarios
  • GitHub Check: Windows WSL CLI Smoke Test
  • GitHub Check: Package Installation & Usage Test (node)
  • GitHub Check: Queue CLI Tests (bun)
  • GitHub Check: Service Client Smoke Tests
  • GitHub Check: Migrate Chain (v1 → v2 → v3)
  • GitHub Check: Package Installation & Usage Test (bun)
  • GitHub Check: Queue CLI Tests (node)
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Framework Demo Tests
  • GitHub Check: Pack & Upload
  • GitHub Check: Build
  • GitHub Check: OSV Scanner PR
  • GitHub Check: Agentuity - docs-docs
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run bun run format using Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
packages/cli/src/cmd/**/index.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/cmd/**/index.ts: Each command must be a directory in src/cmd/ with an index.ts entry point
Always define interfaces for command options using Zod schemas; never use any for type safety

Files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
packages/cli/src/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/**/*.ts: Use tui.* helpers for formatted output (header, info, success, warning, error, table, progress)
Use ctx.logger for logging; logger.fatal() logs and exits with code 1
Use await readFile(p, 'utf-8') and await writeFile(p, content) from node:fs/promises for file I/O
Import pathExists from node-compat/fs for file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file, Bun.spawn, Bun.color, Bun.stringWidth, etc.) in production source code; tsconfig.json type checking enforces this
Imports must use explicit .ts extensions for relative paths (e.g., from './foo.ts', not from './foo'); TypeScript's rewriteRelativeImportExtensions will rewrite them to .js in output
Always check isJSONMode() for machine-readable output in command handlers
Use requireAuth(ctx) or optionalAuth(ctx) for authenticated commands

Files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
**/packages/*/test/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/packages/*/test/**/*.{ts,tsx}: Place tests in test/ folder parallel to src/ directory, never inside src/ or under __tests__/
Import from ../src/ in test files
Use @agentuity/test-utils for shared mocks in tests

Files:

  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
🧠 Learnings (3)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.

Applied to files:

  • packages/cli/src/cmd/project/templates/hono/src/index.ts
  • packages/cli/src/cmd/build/adapters/vite.ts
  • packages/cli/src/cmd/build/detect/monorepo.ts
  • packages/cli/src/cmd/build/adapters/vite/cdn-build.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.

Applied to files:

  • packages/cli/test/cmd/build/detect/monorepo.test.ts
  • packages/cli/test/cmd/build/adapters/vite-cdn.test.ts
🪛 ast-grep (0.44.1)
packages/cli/src/cmd/build/detect/monorepo.ts

[warning] 122-122: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(^${escaped}$)
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)

🔇 Additional comments (7)
.github/workflows/test-windows-wsl.yaml (2)

170-175: 🩺 Stability & Availability

Handle jq failures before set -e aborts the step.

If agentuity.json is missing or malformed, line 171 exits the step immediately, so the diagnostic output on lines 172-175 is skipped. Wrap the assignment in an if ! PROJECT_ID=$(jq ...); then branch before validating the extracted value.


139-168: LGTM!

Also applies to: 202-204

packages/cli/src/cmd/project/templates/hono/src/index.ts (1)

23-34: LGTM!

packages/cli/test/cmd/build/detect/monorepo.test.ts (1)

180-211: LGTM!

packages/cli/src/cmd/build/adapters/vite/cdn-build.ts (1)

19-46: LGTM!

Also applies to: 66-131, 157-250

packages/cli/test/cmd/build/adapters/vite-cdn.test.ts (1)

47-58: LGTM!

Also applies to: 93-97, 109-141, 143-168, 170-194, 196-208

packages/cli/src/cmd/build/adapters/vite.ts (1)

15-32: LGTM!

Comment thread packages/cli/src/cmd/build/adapters/vite/cdn-build.ts Outdated
Comment thread packages/cli/src/cmd/build/detect/monorepo.ts
Add a durable unit test that rebuilds the SDK-like monorepo + non-member
smoke app, asserts monorepo detection is null, generic adapter packaging
has no workingDirectory, and documents the bad monorepo-stage path.

Add wsl-smoke-local-validate.ts which runs real project create with
--package-manager bun under a temp monorepo and checks the same
detection + optional runBuildPipeline (WSL_SMOKE_PACK_ONLY=1).
@jhaynie
jhaynie merged commit 20e5939 into main Jul 22, 2026
29 of 30 checks passed
@jhaynie
jhaynie deleted the feat/vite-spa-cdn-base branch July 22, 2026 01:58
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