
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@agentuity/migrate
Advanced tools
CLI tool to migrate Agentuity SDK projects from v1 to v2.
v2 introduces seven fundamental architectural changes:
v1: Agents were auto-discovered from src/agent/*/agent.ts files at runtime.
v2: Agents must be explicitly imported and passed to createApp():
import { createApp } from '@agentuity/runtime';
import agents from './agent'; // Barrel default export (AgentRunner[])
export default await createApp({
agents,
});
v1: Lifecycle hooks in createApp():
createApp({
setup: async (ctx) => { /* initialize */ },
shutdown: async (ctx) => { /* cleanup */ }
});
v2: Use standard patterns:
setup())registerShutdownHook() from @agentuity/runtime, or Bun's process.on('beforeExit', ...)v1: File-based auto-discovery — routes in src/api/*.ts were automatically mounted.
v2: Routes are explicitly provided to createApp() when needed:
import router from './api'; // Your Hono router
export default await createApp({
router,
});
The old file-based approach no longer works. Routes must be composed into a barrel (src/api/index.ts) and exported as a Hono instance.
v1: createRouter() was a wrapper around Hono using mutating methods:
import { createRouter } from '@agentuity/runtime';
const router = createRouter();
router.get('/hello', async (c) => c.json({ msg: 'hi' }));
v2: Use createRouter() or new Hono<Env>() with chained methods:
// Option A: createRouter() from @agentuity/runtime
import { createRouter } from '@agentuity/runtime';
const router = createRouter()
.get('/hello', async (c) => c.json({ msg: 'hi' }));
// Option B: plain Hono instance
import { Hono } from 'hono';
import type { Env } from '@agentuity/runtime';
const router = new Hono<Env>()
.get('/hello', async (c) => c.json({ msg: 'hi' }));
v1: @agentuity/react exported createClient, useAPI, useAgentuity, RPCRouteRegistry for API calls.
v2: These are removed. Use your preferred data fetching library:
hc<AppRouter>() from hono/clientExample with TanStack Query:
import { useQuery } from '@tanstack/react-query';
import { hc } from 'hono/client';
import type { AppRouter } from '../api';
const client = hc<AppRouter>('/api');
function useHello() {
return useQuery({
queryKey: ['hello'],
queryFn: async () => {
const res = await client.hello.$get();
return res.json();
},
});
}
v1: Vite config lived inside agentuity.config.ts along with workbench settings.
v2: Use standard vite.config.ts for build config; runtime settings go in createApp():
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()], // Add your frontend framework's plugin
});
// app.ts
import { createApp } from '@agentuity/runtime';
export default await createApp({
analytics: true,
workbench: true,
});
Note: v2 doesn't include a default Vite plugin. You must add the plugin for your frontend framework (React, Vue, Svelte, Solid, etc.).
Note: If your frontend entry is at
src/web/index.html(not the project root), either addbuild.rollupOptions.inputto your config, or omitvite.config.tsentirely and let the CLI generate a correct fallback.
v2's build system imports agent files at build time to extract metadata. Module-scope code that requires environment variables (like new OpenAI()) will fail during agentuity build.
Move SDK client constructors into the agent's setup() function:
// ❌ Fails at build time (module scope)
const openai = new OpenAI();
// ✅ Runs at startup (agent setup)
export default createAgent('my-agent', {
setup: async () => ({ openai: new OpenAI() }),
handler: async (ctx, input) => {
const result = await ctx.config.openai.chat.completions.create({...});
},
});
npx @agentuity/migrate [project-dir] [options]
Run in your project root (or pass a path). The tool checks that your git worktree is clean before touching anything, so you can always git diff to review changes or git checkout . to roll back.
| Flag | Description |
|---|---|
--yes, -y | Skip interactive confirmation |
--dry-run | Print the migration report without modifying files |
--help, -h | Show help |
| Finding | Action |
|---|---|
src/generated/ directory | Deleted |
bootstrapRuntimeEnv() call in app.ts | Removed (createApp handles it) |
v1 createRouter() + mutating .get()/.post() route files | Rewritten to new Hono<Env>() chained style |
Missing src/api/index.ts barrel | Generated from discovered route files |
Missing src/agent/index.ts barrel | Generated from discovered agent files |
| Finding | What happens |
|---|---|
setup in createApp() | Migration comment added — move init to module level |
shutdown in createApp() | Guidance to use registerShutdownHook() from @agentuity/runtime instead |
No router/agents in createApp() | Guidance shown — wire up the generated barrels |
agentuity.config.ts has Vite keys | Guidance to create vite.config.ts with plugins/define/render/bundle |
agentuity.config.ts has analytics/workbench | Remove — keep only in createApp() |
agentuity.config.ts empty | Can be deleted |
| Finding | Guidance |
|---|---|
Frontend files using createClient, useAPI, useAgentuity, RPCRouteRegistry etc. | Replace with hc<AppRouter>() from hono/client or your preferred data fetching library |
Configuration (consolidated)
app.ts and agentuity.config.tscreateApp() — analytics, workbench, cors, compression, etc.vite.config.ts — plugins, define, render, bundleagentuity.config.ts is deprecated — delete itapp.ts entrypoint
src/generated/app.tsapp.ts is the real entrypoint; createApp() handles all lifecycleRouting
createRouter() mutating stylesrc/api/index.ts barrel + new Hono<Env>() chained styleType-safe API client
createClient<RPCRouteRegistry>() from @agentuity/reacthc<AppRouter>() from hono/client — Hono's native RPC inferenceSetup/shutdown lifecycle
createApp({ setup, shutdown }) with generic state via ctx.appsetup() for SDK clients; registerShutdownHook() for cleanupFAQs
Migration tool from Agentuity SDK v1 to v2
The npm package @agentuity/migrate receives a total of 256 weekly downloads. As such, @agentuity/migrate popularity was classified as not popular.
We found that @agentuity/migrate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.