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
…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)
The migrate package was missing from the root tsconfig.json references, causing it to not be built during CI builds.
The evals package depends on @agentuity/runtime and @agentuity/schema but was missing the TypeScript project references, causing build failures.
Since the CLI now spawns vite as a subprocess for client builds, projects need a vite.config.ts file with the proper input path. Added: - templates/_base/vite.config.ts with React plugin and input path - vite and @vitejs/plugin-react to devDependencies in package.json
When vite.config.ts sets root='.' and input='src/web/index.html', vite outputs the HTML at client/src/web/index.html instead of client/index.html. The runtime now checks both locations. This fixes cloud deployment tests that were failing because the analytics beacon injection couldn't find the HTML file.
# Conflicts: # .claude-plugin/marketplace.json # apps/create-agentuity/package.json # apps/testing/package.json # bun.lock # docs/package.json # package.json # packages/aigateway/package.json # packages/auth/package.json # packages/claude-code/.claude-plugin/plugin.json # packages/claude-code/package.json # packages/cli/package.json # packages/cli/src/cmd/cloud/aigateway/index.ts # packages/coder-tui/package.json # packages/coder/package.json # packages/core/package.json # packages/db/package.json # packages/drizzle/package.json # packages/email/package.json # packages/keyvalue/package.json # packages/local/package.json # packages/migrate/package.json # packages/opencode/package.json # packages/pi/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/stream/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
# Conflicts: # .github/workflows/biome.yml # .github/workflows/build.yaml # .github/workflows/canary.yaml # .github/workflows/package-smoke-test.yaml # .github/workflows/release-next.yaml # .github/workflows/snapshot.yaml # .github/workflows/sync-docs-full.yml # .github/workflows/sync-docs.yml # .github/workflows/test-install.yaml # .github/workflows/test-windows-wsl.yaml
# Conflicts: # .claude-plugin/marketplace.json # apps/create-agentuity/package.json # apps/testing/package.json # bun.lock # docs/package.json # package.json # packages/aigateway/package.json # packages/auth/package.json # packages/claude-code/.claude-plugin/plugin.json # packages/claude-code/package.json # packages/cli/package.json # packages/coder-tui/package.json # packages/coder/package.json # packages/core/package.json # packages/db/package.json # packages/drizzle/package.json # packages/email/package.json # packages/keyvalue/package.json # packages/local/package.json # packages/migrate/package.json # packages/opencode/package.json # packages/pi/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/stream/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
This comment has been minimized.
This comment has been minimized.
# Conflicts: # .claude-plugin/marketplace.json # apps/create-agentuity/package.json # apps/testing/package.json # bun.lock # docs/package.json # package.json # packages/aigateway/package.json # packages/auth/package.json # packages/claude-code/.claude-plugin/plugin.json # packages/claude-code/package.json # packages/cli/package.json # packages/cli/src/cmd/project/remote-import.ts # packages/coder-tui/package.json # packages/coder/package.json # packages/core/package.json # packages/db/package.json # packages/drizzle/package.json # packages/email/package.json # packages/keyvalue/package.json # packages/local/package.json # packages/migrate/package.json # packages/opencode/package.json # packages/pi/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/stream/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
This is the v3 line of the Agentuity SDK. It removes the bundled
@agentuity/runtime"agent runtime" model and replaces it with a framework-agnostic deploy pipeline plus a set of standalone service-client packages.You bring your framework (Next.js, Hono, SvelteKit, Astro, Nuxt, Remix, Vite + React, …); we provide the build and deploy infrastructure plus the service clients you call directly from your code.
Currently published as
3.0.0-beta.0on thebetanpm tag.bun add @agentuity/cli@beta # or npm install -g @agentuity/cli@betaArchitecture
Buildpack-based deploy pipeline
launch.json+Procfile).agentuity devis a passthrough to the framework's own dev script with AI Gateway env injection (OPENAI_API_KEY/OPENAI_BASE_URLetc. routed through the gateway whenAGENTUITY_SDK_KEYis set).agentuity deployworks against any project the buildpack knows how to build — no Agentuity-specific config, noagentuity.config.ts.staticDir; static server injected when no start command exists.Framework scaffolding (
agentuity project create)/translateendpoint + landing page using the AI SDK).@agentuity/clias a devDependency, adeployscript, and.gitignoreentries.drizzle-orm+@neondatabase/serverless), KeyValue, Queue, Storage, Vector. Each one wires real functionality into the demo (cached translations, history, similar-translation search, queued jobs, exports).Service-client packages
Standalone packages that talk directly to Agentuity's Catalyst API. Useable in any framework, in any runtime that supports
fetch(Node 24+, Bun 1.3+):@agentuity/db,@agentuity/email,@agentuity/keyvalue,@agentuity/queue,@agentuity/sandbox,@agentuity/schedule,@agentuity/storage,@agentuity/task,@agentuity/vector,@agentuity/webhook.Hono integration
@agentuity/honoships anagentuity()middleware for projects that prefer the v2-stylec.var.*access pattern:Migration tool
@agentuity/migratecovers the upgrade path. Auto-detects the source version frompackage.json, then runs the right migration:^1.x→ v1 → v2^2.x→ v2 → v3 (rewritescreateApp/createAgentpatterns into a plain Hono app, generatessrc/services.tswith singleton clients, replacesc.var.*/ctx.*access with direct service-client imports)Both modes are also force-selectable via
--v1-to-v2/--v2-to-v3.CLI runtime
The
agentuityCLI now runs under both Node 24+ and Bun 1.3+ (was Bun-only). All service-client packages are dual-runtime as well.Packages
Tooling
@agentuity/cli— main CLIcreate-agentuity—bun create agentuityshim that delegates to the CLI@agentuity/coder+@agentuity/coder-tui— Coder Hub (sandbox-as-a-service IDE)@agentuity/vscode— VS Code extension@agentuity/claude-code,@agentuity/opencode— coding-agent integrationsService clients
@agentuity/db,email,keyvalue,queue,sandbox,schedule,storage,task,vector,webhookFramework integration
@agentuity/hono— Hono middleware@agentuity/migrate— v1 → v2 → v3 migration toolingInfrastructure (rarely consumed directly)
@agentuity/core— shared types, schema interfaces, API client primitives@agentuity/server— server-side helpers used by@agentuity/cli@agentuity/telemetry— OpenTelemetry initialization + JSONL exporters@agentuity/analytics,stream,adapterDeprecated (still publish; npm
deprecatedfield set)@agentuity/runtime— gutted to a stub. ImportingcreateApp,createAgent, orcreateRouterthrows with a migration message. Will be removed in v3.1.@agentuity/postgres,@agentuity/drizzle— superseded by usingdrizzle-orm+@neondatabase/serverlessdirectly.@agentuity/schema— superseded by Zod or Valibot.@agentuity/local— local-dev fallback layer; will be removed in v3.1.Removed
@agentuity/auth(BetterAuth integration, core auth types, CLIproject authcommands)@agentuity/react,@agentuity/frontend(React hooks, WebRTC managers, transport hooks)@agentuity/workbench@agentuity/evals(eval framework, CLIeval-runcommands, core eval services)templates/directory (no templates tarball in publish)examples/directory (the v2-style demo apps)Breaking changes
This is a breaking release. There is no shim layer —
@agentuity/migrateis the supported v2 → v3 path.createApp()is goneagentuity deployworks with any buildable project.createAgent()/ agent registry is gonebootstrapRuntimeEnv()is gone@agentuity/runtimeis a deprecation stub@agentuity/authremoved@agentuity/react/@agentuity/frontendremovedagentuity.config.tsdeprecatedTesting
tests/services/<svc>/— standalone Bun apps that hit the live cloud per service client.tests/frameworks/{tanstack-start,nextjs-app,svelte-web}— Playwright e2e against the buildpack pipeline + AI Gateway translation flow.tests/integration/{e2e-web,oauth,standalone-backend}— minimal Hono apps used as integration targets.packages/<pkg>/test/.CI status:
Build Packages & Test,Package Smoke Test,NPM Pack & Upload,Test Install Script,Biome, andWindows WSL CLI Testall green on the latest commit. TheService Client Smoke TestsDB step is currently gated behind agentuity/infra#120 (SDK keys can't authenticate against the DB/resourceendpoints — being addressed platform-side).Install
The
betadist-tag points at3.0.0-beta.0today and will move forward as v3 stabilises. Thelatestdist-tag remains on the v2 line until v3 is promoted.