Conversation
…ead AST code
- Workbench schema endpoint now generates TypeScript interface syntax
from JSON Schema (via runtime toJSONSchema) instead of requiring
Zod source strings from the AST-extracted metadata. Falls back to
metadata strings only when no runtime schema is available.
- Add jsonSchemaToTypeScript() utility in workbench.ts that converts
JSON Schema → clean TypeScript type notation for display:
{ name: string; age: number; tags?: string[] }
- Delete findCreateAppEndPosition() from ast.ts — dead code, exported
but never imported anywhere.
- 20 new tests covering all JSON Schema → TypeScript conversions:
primitives, objects, optionals, descriptions, arrays, unions,
intersections, enums, literals, nullables, records, nested objects.
…hemaToTypeScript Address CodeRabbit review feedback: - Escape quotes, backslashes, and newlines in const/enum string values - Quote property keys that aren't valid JS identifiers (hyphens, spaces, leading digits) - 3 new test cases covering both fixes
Remove 402 lines of dead code from the AST pipeline: - Delete analyzeWorkbench() + parseConfigObject() — only imported by the dead workbench.ts file, never used in production - Delete checkFunctionUsage() — exported but never imported anywhere - Delete checkRouteConflicts() — exported but never imported anywhere - Delete WorkbenchAnalysis interface — only used by dead code - Remove WorkbenchConfig import from ast.ts (no longer needed) - Delete packages/cli/src/cmd/build/workbench.ts entirely — the whole file was dead code (getWorkbench, generateWorkbenchMainTsx, etc. are superseded by vite/workbench-generator.ts) - Remove analyzeWorkbench tests from ast.test.ts (testing dead code) ast.ts: 3,526 → 3,124 lines (402 lines removed, cumulative with previous findCreateAppEndPosition deletion)
The lifecycle generator now uses TypeScript's own type checker to
extract the setup() return type instead of walking AST literals and
guessing types from values. This handles:
- Inline setup in createApp({ setup: () => ... })
- Exported setup functions (function decl or const arrow)
- Shorthand property: createApp({ setup })
- Variable references: setup: () => someVar
- Async functions (Promise unwrapping)
- Any pattern TypeScript itself can resolve
Also extract getDevmodeDeploymentId into ids.ts (pure hash, not AST).
ast.ts consumers remaining: only parseRoute (route-discovery.ts)
…iscovery + app-router-detector
createRouter() no longer wraps Hono methods — it's now just `new Hono()`
with Agentuity's Env type. This preserves Hono's full Schema type inference
chain, enabling `typeof router` to encode all route types.
The routeId lookup (for OTel spans) and returnResponse auto-conversion that
createRouter previously did will move to entry-file middleware in a follow-up.
agent-discovery.ts: rewritten to import() agent files at build time instead
of AST-parsing with acorn-loose. The agent instance already knows its own
metadata, schemas, and evals. Schemas are now extracted as JSON Schema
strings via toJSONSchema() instead of Zod source strings via astring.
app-router-detector.ts: rewritten to use TypeScript's compiler API instead
of acorn-loose. Detects createApp({ router }) patterns for explicit routing.
Both rewrites eliminate acorn-loose/astring usage from their respective files.
Only ast.ts itself still imports acorn-loose (for parseRoute, used by
route-discovery.ts).
Tests: 18 agent-discovery tests, 8 app-router-detector tests, 8 lifecycle
tests, dev-registry-generation tests all pass. Runtime: 665 tests pass.
- Delete ast.ts (3,120 lines) — entire acorn-loose + astring AST pipeline - Delete route-migration.ts (793 lines) — file-based routing migration - Delete api-mount-path.ts (87 lines) — file-based path computation - Remove acorn-loose + astring from package.json - Remove file-based routing fallback from entry-generator.ts - Remove migration prompts from dev/index.ts and vite-bundler.ts - Remove src/api/ directory watcher from file-watcher.ts - Remove migrateRoutes CLI option - Delete 15 test files testing deleted AST/file-based routing code - Rewrite route-discovery + dev-registry tests for new architecture Net: -13,073 lines deleted, +199 lines added
- Import toForwardSlash from normalize-path.ts instead of duplicating
- Replace existsSync with Bun.file().exists() in lifecycle-generator,
app-router-detector, and agent-discovery
- Import toJSONSchema from @agentuity/schema public entry point (resolved
from user's node_modules) instead of reaching into src/ internals
- Remove createAgent substring gate — check exported value shape instead,
supporting re-exported agents
- Default createRouter S generic to BlankSchema ({}) to match Hono 4.7.13
- Migrate integration-suite, e2e-web, svelte-web, auth-package-app,
webrtc-test, nextjs-app, tanstack-start, vite-rsc-app to explicit
createApp({ router }) pattern
- Create combined router.ts files for apps with multiple route files
- Expose agent.evals on AgentRunner (was missing, breaking eval discovery)
- Deduplicate agents by name (re-exported agents from index.ts)
- Update route-metadata-nested tests for explicit routing
|
The latest Agentuity deployment details.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaced many Agentuity Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…estart loop
- Runtime: createApp() returns fetch/port/hostname for bun --hot to
hot-swap the server's request handler without process restart
- Runtime: skip Bun.serve() in dev mode (bun --hot manages server
via default export)
- Runtime: add idempotent OTel re-registration guard for hot reloads
- Runtime: pass cors/compression config directly to middleware instead
of lazy global lookup via getAppConfig()
- Runtime: remove getAppState/getAppConfig/setAppConfig globals
(config passed directly, app state was always {})
- Runtime: add typed _globals.ts for Symbol.for() state and globals.d.ts
for string-keyed globalThis properties, eliminating unsafe casts
- Runtime: use Symbol.for() pattern in _process-protection.ts
- Runtime: guard one-time log messages (server started, local services)
to prevent reprinting on hot reloads
- Runtime: downgrade internal port messages to debug level
- CLI: use bun --hot --no-clear-screen for backend subprocess
- CLI: remove file-watcher.ts usage, restart loop, stopBunServer,
cleanupForRestart — bun --hot handles all backend HMR
- CLI: run 'Preparing dev server' once at startup instead of on
every file change (~490 lines removed from dev/index.ts)
In production mode, startServer() already calls Bun.serve() on the configured port. Bun v1.2+ also auto-serves when the default export has fetch + port properties (added in c98ce19 for --hot support), causing a second bind attempt and EADDRINUSE. Strip fetch/port/hostname from the returned AppResult in production so only the explicit Bun.serve() is active. Dev mode keeps them for bun --hot auto-serve.
Resolve conflicts: - modify/delete: keep v2's deletions of generated files (app.ts, routes.ts), ast.ts, and route-migration.ts — superseded by v2's import-based architecture - agent-discovery.ts: keep v2's import-based version, port duplicate eval name detection from main (cab51e2) - dev/index.ts: keep v2's bun --hot version — main's file-watcher restart loop fixes (5b7f9b8) don't apply since v2 removed the restart loop Auto-merged from main: - Gateway URL fallback update (agentuity.ai → catalyst.agentuity.cloud) - Windows path fix for AI SDK patches (buildPatchFilter) - Task status aliases, sandbox events, OIDC commands, monitoring - Coder TUI updates, API reference docs, various CLI fixes
Bun --hot creates the server from the default export's properties.
Without the websocket handler, WebSocket upgrades fail with:
'To enable websocket support, set the "websocket" object in Bun.serve({})'
Add websocket from hono/bun to the AppResult (and strip it in
production alongside fetch/port/hostname).
json5 was not declared as a dependency in cli/package.json, causing a type error. Use the existing parseJSONC utility (from utils/jsonc) which handles tsconfig.json comments and trailing commas.
## @agentuity/migrate package (new) A CLI tool to migrate v1 projects to v2: - `npx @agentuity/migrate` — guided migration with codemods - Deletes `src/generated/` directory - Removes `bootstrapRuntimeEnv()` call from app.ts - Transforms routes from createRouter() mutable style to new Hono<Env>() chained - Generates src/api/index.ts and src/agent/index.ts barrels - Adds migration comments for setup/shutdown lifecycle - Guides on agentuity.config.ts deprecation - Detects frontend using removed APIs (createClient, useAPI, RPCRouteRegistry) - Runs bun install and typecheck post-migration ## agentuity.config.ts deprecation - New app-config-extractor.ts extracts analytics/workbench from createApp() - config-loader.ts emits deprecation warning when loading agentuity.config.ts - getWorkbenchConfig() now prefers runtime config from createApp() - dev/index.ts and vite-builder.ts use loadRuntimeConfig() Config consolidation in v2: - Runtime config (analytics, workbench, cors, etc.) → createApp() only - Vite config (plugins, define, render, bundle) → vite.config.ts - agentuity.config.ts → deprecated, delete entirely ## Documentation - Updated migration-guide.mdx with v1→v2 tab - Includes automated migration instructions and manual steps - Covers all breaking changes and troubleshooting
This commit consolidates several v2 improvements: ### bun-dev-server error diagnostics - Add app.ts validation to detect v1 pattern (destructuring without export default) - Capture Bun stderr/stdout and show in error messages - Add port cleanup with ensurePortAvailable() to kill orphan processes - Warn before starting if app.ts has common issues - Export validation functions for testing ### Process manager for dev mode - New ProcessManager class to track all spawned processes/servers - Ordered cleanup (LIFO for processes) - Force kill fallback after timeout - Integrated into dev/index.ts for cleanup on failure/shutdown ### Remove agentuity.config.ts support - Deleted loadAgentuityConfig from config-loader.ts - getWorkbenchConfig now only takes (dev, runtimeConfig) - no config file fallback - Users must use vite.config.ts for Vite config - Users must use createApp() for runtime config (workbench, analytics) ### Remove auto-adding React plugin - Vite no longer auto-adds @vitejs/plugin-react - Users must configure frontend framework in vite.config.ts ### Deprecate @agentuity/react - Added deprecation notice to README.md and package.json - @agentuity/auth no longer depends on @agentuity/react - AuthProvider now accepts callback props instead of relying on AgentuityProvider ### Migrate tool updates - Detect missing vite.config.ts when frontend exists - Detect deprecated @agentuity/react API usage - Detect agentuity.config.ts and suggest migration Tests: Updated workbench tests, removed define-config test (obsolete), added process-manager tests
Tests verify: - publicDir is set correctly in dev mode config - Public files are served at root paths in dev - Public files maintain directory structure - Various file types are handled correctly - Edge cases (empty folder, hidden files, subdirectories) - Integration with vite-builder functions
Add tests for dev server orchestration covering: - dev-lock.test.ts: Lockfile management, orphan process cleanup, edge cases for corrupted/missing lockfiles - ws-proxy.test.ts: Front-door TCP proxy routing decisions, error handling, URL parsing, query strings - dev-server-integration.test.ts: Full lifecycle testing, crash recovery, hot reload validation, error resilience All 60 tests pass covering: - Startup/shutdown with port cleanup - Hot reload behavior (Bun --hot, Vite HMR) - Crash recovery (SIGTERM/SIGKILL escalation) - WS proxy routing (HTTP→Vite, WS upgrade→Bun) - Error resilience (TypeScript errors, v1 patterns)
Merge main (1.0.54) into v2 branch. Resolution strategy: - Deleted files (v2): Kept v2's removal of src/generated/*, ast.ts, route-migration.ts - Dev server files: Kept v2's no-bundle architecture with bun --hot - Package versions: Took main's higher versions - New features from main: Accepted (oauth, sandbox jobs, service packages) - API docs: Took main's updated documentation Key changes merged from main: - New standalone service packages (@agentuity/db, @agentuity/email, etc.) - OAuth service support - Sandbox job commands - Updated CLI commands for all cloud services - API reference documentation updates
Since React is no longer auto-added by the CLI, each project with a frontend needs its own vite.config.ts with the appropriate plugins. Added vite.config.ts for: - apps/docs (React + Tailwind + MDX + TanStack Router) - apps/testing/e2e-web (React) - apps/testing/cloud-deployment (React) - apps/testing/integration-suite (React) - apps/testing/auth-package-app (React) - apps/testing/oauth (React) - apps/testing/webrtc-test (React) - apps/testing/svelte-web (Svelte - pending investigation for CLI build) Updated vite-builder.ts to properly merge user vite.config.ts: - User plugins now come FIRST (important for framework plugins like Svelte) - User config values are preserved unless overridden by Agentuity-specific needs - Removed mergeConfig in favor of explicit spread to avoid array merge issues Note: Svelte builds work with vite v8.0.1 building client environment for production... �[2K transforming...✓ 1 modules transformed. but fail when built through the CLI. This requires further investigation into how the Svelte plugin interacts with the CLI's build process.
…lity ## Problem Svelte 5 builds failed when invoked through CLI's programmatic viteBuild() call, but worked correctly with `bunx vite build`. The error showed the Svelte compile plugin receiving already-compiled JavaScript instead of Svelte source code. ## Root Cause Bun's module loading system has issues with Vite's plugin pipeline when importing Vite and calling build() programmatically. Certain plugins like @sveltejs/vite-plugin-svelte receive already-compiled code, possibly due to module state caching or transformation order issues. ## Solution For client builds, spawn `bun x vite build` as a subprocess instead of importing Vite and calling build() programmatically. This gives Vite complete control over its module loading and plugin execution, avoiding Bun's module system entirely. Workbench builds continue using programmatic viteBuild() since those use our own React plugin without external framework plugins. ## Additional Changes - Updated vite.config.ts for all test projects to include root and input path (required when spawning vite as subprocess) - Updated svelte-web agentuity.config.ts to v2 format (removed plugins) - Removed temporary svelte.config.js that was added during debugging ## Testing All test projects now build successfully: - apps/testing/e2e-web (React) - apps/testing/svelte-web (Svelte 5) - apps/testing/cloud-deployment (React) - apps/testing/integration-suite (React) - apps/testing/auth-package-app (React) - apps/testing/oauth (React) - apps/testing/webrtc-test (React)
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-evals-2.0.0-beta.1-e80f941.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-runtime-2.0.0-beta.1-e80f941.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-keyvalue-2.0.0-beta.1-e80f941.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-coder-2.0.0-beta.1-e80f941.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-claude-code-2.0.0-beta.1-e80f941.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-webhook-2.0.0-beta.1-e80f941.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-db-2.0.0-beta.1-e80f941.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-auth-2.0.0-beta.1-e80f941.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-react-2.0.0-beta.1-e80f941.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-schema-2.0.0-beta.1-e80f941.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-task-2.0.0-beta.1-e80f941.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-email-2.0.0-beta.1-e80f941.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-schedule-2.0.0-beta.1-e80f941.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-queue-2.0.0-beta.1-e80f941.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-sandbox-2.0.0-beta.1-e80f941.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-drizzle-2.0.0-beta.1-e80f941.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-migrate-2.0.0-beta.1-e80f941.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-core-2.0.0-beta.1-e80f941.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-server-2.0.0-beta.1-e80f941.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-postgres-2.0.0-beta.1-e80f941.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-frontend-2.0.0-beta.1-e80f941.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-workbench-2.0.0-beta.1-e80f941.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-cli-2.0.0-beta.1-e80f941.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-opencode-2.0.0-beta.1-e80f941.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-vector-2.0.0-beta.1-e80f941.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-evals-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-runtime-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-keyvalue-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-coder-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-claude-code-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-webhook-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-db-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-auth-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-react-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-schema-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-task-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-email-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-schedule-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-queue-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-sandbox-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-drizzle-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-migrate-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-core-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-server-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-postgres-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-frontend-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-workbench-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-cli-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-opencode-2.0.0-beta.1-e80f941.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.0-beta.1-e80f941/agentuity-vector-2.0.0-beta.1-e80f941.tgz |
The migrate package was missing from the root tsconfig.json references, causing it to not be built during CI builds.
- Resolved package.json conflicts by keeping v2 versions (2.0.0-beta.1) - Kept v2's simpler vite-builder.ts approach (spawns vite subprocess) - Removed apps/docs/src/generated/env.d.ts (v2 removed src/generated) - Kept v2's bun.lock
- Remove worker files from main (incompatible with v2's simpler approach) - Add archiver and @types/archiver dependencies for CLI
The jq script was unconditionally adding all packages to .dependencies, but the template has @agentuity/cli in .devDependencies. This created a duplicate dependency warning. Now uses a helper function to update packages in their existing location (dependencies or devDependencies) instead of always adding to dependencies.
archiver is used in src/utils/zip.ts and src/cmd/support/report.ts but was missing from dependencies. This caused 'Cannot find package' errors when running CLI from packed tarballs.
- Remove adm-zip (unused, we use archiver instead) - Remove @types/adm-zip (unused since adm-zip removed) - Remove git-url-parse (not found in source) - Move @types/archiver to CLI devDependencies (was in root) - Add archiver to CLI runtime dependencies
Add detection and transformation for outdated @agentuity packages: Detection (detect.ts): - Scan package.json for @agentuity/* packages - Detect 'latest', '*', and v1.x.x versions - Add 'outdated-agentuity-packages' finding Transform (transforms/package-json.ts): - Replace all outdated versions with ^2.0.0 - Works for both dependencies and devDependencies Migration flow: - Step 5g: Update package versions before bun install - Ensures all @agentuity packages are on v2 for migration to work
The merged vite-builder from main includes worker subprocess code that depends on modules not present in v2 (entry-generator, registry-generator, loadAgentuityConfig, hasFrameworkPlugin, routeInfoList). Reverted to v2's implementation which uses the v2 architecture.
This reverts commit d3f1399.
The vite.config.ts was missing routesDirectory and generatedRouteTree, causing TanStack Router to default to src/routes instead of src/web/routes. This aligns vite.config.ts with the config in agentuity.config.ts.
In v2, runtime config (analytics, workbench) is extracted from createApp() in app.ts via AST parsing. Vite plugins go in vite.config.ts. These files came from main where the v1 config file pattern still exists.
Two fixes for WSL CI failure:
1. CLI fallback: Generate vite.config.ts if missing before vite build
- Projects created from older templates don't have vite.config.ts
- CLI now creates a fallback config with React plugin + entry point
2. CI workflow: Use template branch matching the current ref
- ${GITHUB_REF_NAME} determines branch (main, v2, v3)
- Passes --template-branch to project create command
- Ensures v2 CLI uses v2 templates with vite.config.ts
Fixes: 'Could not resolve entry module index.html'
Previously, agent discovery would log a warning and skip agents that failed to import at build time. This caused deployments to fail at runtime with "Agent has no metadata IDs" errors. Now the build fails immediately with actionable guidance when an agent cannot be imported, directing users to either: 1. Set required environment variables at build time 2. Use lazy initialization (setup/handler) instead of module scope Also fixes the default template's translate agent to use lazy initialization for the OpenAI client, avoiding OPENAI_API_KEY requirement at build time. Fixes Windows WSL CLI Smoke Test deployment failure.
- Skip test files (*.test.ts, *.spec.ts) and test directories (test/, __tests__/) during agent discovery to prevent build failures from test imports - Normalize index.html location after vite client build - vite may output to src/web/index.html depending on project config, but static renderer expects it at client root Fixes docs website build failure from test file imports.
The vite.config.ts was missing root and build.rollupOptions.input, causing vite to fail with 'Cannot resolve entry module index.html'. This aligns the docs config with the CLI's fallback vite.config.ts.
For pull_request events, GITHUB_REF_NAME is 'refs/pull/N/merge', not the source branch. Use GITHUB_HEAD_REF for PRs to get the correct branch. Also add v2 branch to push triggers so pushes to v2 run the test.
The static renderer's Vite SSR build was running in-process via the programmatic API, which caused @mdx-js/rollup to fail with 'Unexpected FunctionDeclaration in code' errors due to Bun module resolution issues within the same process. Changed to spawn vite build --ssr as a subprocess, matching the approach already used for client builds. Also passes the dev flag through to use the correct build mode (development vs production).
The frozen lockfile check fails on PR merge commits when main and v2 have divergent dependency trees (e.g., main has @mrleebo/prisma-ast with chevrotain@10.5.0 while v2 does not). Bun 1.3.11 fails to parse the merged lockfile, reporting a missing regexp-to-ast resolution. Since the biome CI only needs dependencies installed to run the linter, strict lockfile validation is unnecessary here.
…te branch
- agent-discovery: rewrite error message when agent import fails at build
time to show concrete before/after code examples guiding users to move
SDK client initialization into setup() instead of module scope
- test-windows-wsl: use ${{ }} GitHub expressions instead of ${} env vars
which are not available inside WSL. Fixes template branch always resolving
to 'main' and run ID always being 'local'. Uses github.base_ref for PRs
to correctly select the target branch (e.g. v2).
The v2 generateRouteId was producing IDs with a 'routeid_' prefix and SHA256 hash of only path+method, while the platform expects 'route_' prefix with SHA1 hash of all 7 components (projectId, deploymentId, type, method, filename, path, version). This mismatch caused runtime errors: expected id to be route_... but was routeid_... - Changed prefix from 'routeid_' to 'route_' - Changed hash from SHA256 (truncated 16 chars) to SHA1 (full 40 chars) - Added missing hash inputs: type, filename, version - Exported generateRouteId for testability - Added 8 unit tests including exact hash compatibility check
The platform (main branch ast.ts) uses lowercase HTTP methods ('get',
'post', etc.) when hashing route IDs. The v2 route discovery was
uppercasing the method from Hono before passing it to generateRouteId,
producing a different hash.
Updated the compatibility test to use real production values from the
error: route_243d777fa53d9769d5f146862131650cb0b774f3
# Conflicts: # .claude-plugin/marketplace.json # apps/create-agentuity/package.json # apps/docs/package.json # apps/testing/package.json # bun.lock # package.json # packages/auth/package.json # packages/claude-code/.claude-plugin/plugin.json # packages/claude-code/package.json # packages/cli/package.json # packages/coder/package.json # packages/core/package.json # packages/db/package.json # packages/drizzle/package.json # packages/email/package.json # packages/evals/package.json # packages/frontend/package.json # packages/keyvalue/package.json # packages/opencode/package.json # packages/postgres/package.json # packages/queue/package.json # packages/react/package.json # packages/runtime/package.json # packages/sandbox/package.json # packages/schedule/package.json # packages/schema/package.json # packages/server/package.json # packages/task/package.json # packages/test-utils/package.json # packages/vector/package.json # packages/vscode/package.json # packages/webhook/package.json # packages/workbench/package.json
Agentuity SDK v2
Overview
v2 is a major architectural shift toward explicitness, type safety, and standard patterns. It removes build-time code generation (
src/generated/), file-based auto-discovery, and SDK-specific wrappers in favor of direct Hono usage and user-controlled configuration.Migration tool:
npx @agentuity/migrate— see v1→v2 migration guideBreaking Changes from v1
1. Explicit Agent Registration
Agents are no longer auto-discovered from
src/agent/*/agent.ts. They must be explicitly imported and passed tocreateApp():2. Explicit Router (No More File-Based Routing)
Routes in
src/api/*.tsare no longer auto-discovered. A Hono router must be explicitly provided:3. Use Hono Directly (No
createRouter())createRouter()wrapper is removed. Usenew Hono<Env>()with chained methods (required forhc<AppRouter>()type inference):4. No More
setup/shutdownHookscreateApp({ setup, shutdown })is removed. Use module-level initialization andprocess.on("beforeExit", ...)for cleanup.5. React Client Helpers Removed
createClient,useAPI,RPCRouteRegistry,useEventStream,useWebsocketremoved from@agentuity/react. Usehc<AppRouter>()fromhono/clientor any data-fetching library (TanStack Query, SWR, etc.).6. Standard
vite.config.tsagentuity.config.tsno longer handles Vite configuration. Use a standardvite.config.tsand move runtime settings (analytics, workbench) tocreateApp().What's New
New Package:
@agentuity/migrateCLI tool (
npx @agentuity/migrate) that automates v1→v2 migration:src/generated/, removesbootstrapRuntimeEnv(), rewrites routes to chained Hono style, generates barrel files for agents and routessetup/shutdownremoval, config consolidation--dry-runRuntime Bootstrap Consolidation
New
packages/runtime/src/bootstrap.ts— server lifecycle (analytics, workbench, static serving, middleware) extracted fromcreateApp()into dedicated helpers.Build System Overhaul (
packages/cli)ast.ts(3,500 lines),entry-generator.ts(760 lines),workbench.ts,route-migration.ts— all build-time code generation removedapp-config-extractor.ts(reads config from user'screateApp()call),ids.ts(route ID generation),ws-proxy.ts(WebSocket proxying),process-manager.ts(dev server process orchestration)agent-discovery.ts(simplified — reads barrel exports instead of scanning),route-discovery.ts,vite-builder.ts,bun-dev-server.ts,config-loader.tsbun --hotfor backend HMR instead of manual file-watching restart loopDeprecation Warnings (
@agentuity/core)New
deprecation.ts— logs migration warnings when v1 packages are used with v2 runtime.Version Mismatch Detection
New
packages/runtime/src/version-check.tsandpackages/cli/src/utils/version-mismatch.ts— warns when@agentuity/*packages have version conflicts.Frontend Client Cleanup
Removed from
@agentuity/frontend:client/directory (eventstream, websocket, stream, types) — replaced by directhono/clientusage.Removed from
@agentuity/react:api.ts,client.ts,eventstream.ts,websocket.ts,types.tsand all related tests.Changes by Package
runtimecreateApp()simplified,bootstrap.tsextracted,createRouterdeprecated,version-check.tsadded, workbench/middleware rewrittenclibun --hotmigratecoredeprecation.tsfor v1→v2 migration warningsreactcreateClient,useAPI,useEventStream,useWebsocketand related typesfrontendclient/directory (eventstream, websocket, stream helpers)templates_baseanddefaultto v2 patterns, addedvite.config.tsdocs appsrc/generated/, added agent barrel, replacedagentuity.config.tswithvite.config.tstest appsvite.config.tsStats
src/generated/artifacts, AST code gen, react/frontend client code, and related tests)Migration Guide
Full guide: v1→v2 Migration Guide
Quick start: