Skip to content

๐Ÿคฏ LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

โ™ป๏ธ refactor: consolidate Hono routers (#18098)

Arvin Xue32e2efe2388
diff --git a/.agents/acceptance/PROJECT.md b/.agents/acceptance/PROJECT.md
index 9bb35d84365..71c14284579 100644
--- a/.agents/acceptance/PROJECT.md
+++ b/.agents/acceptance/PROJECT.md
@@ -18,8 +18,8 @@ Electron desktop shell, and a CLI (`lh`). Repo layout that matters for testing:
- `apps/cli/` โ€” the `lh` CLI; runs from source (`bun src/index.ts`), no rebuild.
**Standalone install** (see ยง6).
- `packages/**`, `e2e`, `apps/server` โ€” covered by the root pnpm workspace.
-- `src/` โ€” the SPA and shared web app; `src/server/` holds agent-hono /
- workflows-hono.
+- `src/` โ€” the SPA and shared web app; `apps/server/src/router-hono/` holds the
+ Hono endpoint routers and standalone runtime.
**The root pnpm workspace does NOT cover `apps/desktop` or `apps/cli`.**
`pnpm-workspace.yaml` lists `packages/**`, `e2e`, `apps/server`, and only
diff --git a/.agents/acceptance/references/dev-server.md b/.agents/acceptance/references/dev-server.md
index 5492bb49e2c..b0686795edf 100644
--- a/.agents/acceptance/references/dev-server.md
+++ b/.agents/acceptance/references/dev-server.md
@@ -78,7 +78,7 @@ in doubt.
| Change location | Restart? |
| ----------------------------------------------- | -------- |
| `apps/server/src/` (routers, services, modules) | Yes |
-| `src/server/` (agent-hono, workflows-hono) | Yes |
+| `apps/server/src/router-hono/` | Yes |
| `packages/database/` (models) | Yes |
| `packages/types/` | Yes |
| `packages/prompts/` | Yes |
diff --git a/.agents/skills/project-overview/SKILL.md b/.agents/skills/project-overview/SKILL.md
index 52bcafb033c..9d1720db0ee 100644
--- a/.agents/skills/project-overview/SKILL.md
+++ b/.agents/skills/project-overview/SKILL.md
@@ -57,7 +57,10 @@ git submodules.
โ”‚ โ”œโ”€โ”€ cli/ # LobeHub CLI
โ”‚ โ”œโ”€โ”€ desktop/ # Electron desktop app
โ”‚ โ”œโ”€โ”€ device-gateway/ # Device gateway service
-โ”‚ โ””โ”€โ”€ server/ # Next.js-backed server: featureFlags, globalConfig, modules, routers, services, utils, workflows (`@/server/*` alias)
+โ”‚ โ””โ”€โ”€ server/ # Next.js-backed server (`@/server/*` alias)
+โ”‚ โ””โ”€โ”€ src/
+โ”‚ โ”œโ”€โ”€ router-hono/ # Hono endpoint routers and standalone runtime
+โ”‚ โ””โ”€โ”€ ... # featureFlags, globalConfig, modules, routers, services, utils, workflows
โ”œโ”€โ”€ docs/ # changelog, development, self-hosting, usage
โ”œโ”€โ”€ locales/ # en-US, zh-CN, ...
โ”œโ”€โ”€ packages/ # ~80 @lobechat/* workspace packages โ€” `ls` for the full set. Key ones:
@@ -89,7 +92,6 @@ git submodules.
โ”œโ”€โ”€ business/ # Open-source stubs (client/server) โ€” cloud repo provides real impls
โ”œโ”€โ”€ features/ # Domain business components
โ”œโ”€โ”€ store/ # ~30 zustand stores โ€” `ls` for the full set
- โ”œโ”€โ”€ server/ # standalone-Hono server pieces only: agent-hono, workflows-hono (main backend lives in `apps/server`)
โ””โ”€โ”€ ... # components, hooks, layout, libs, services, types, utils
```
diff --git a/apps/server/package.json b/apps/server/package.json
index ac8f952d851..3427655289f 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "vite build --config viteHonoBuild.config.ts",
- "dev": "vite-node --watch --config viteNodeServer.config.ts src/hono/dev.ts",
+ "dev": "vite-node --watch --config viteNodeServer.config.ts src/router-hono/dev.ts",
"start": "node dist/standalone.js",
"type-check": "tsc --noEmit"
}
diff --git a/apps/server/src/agent-hono/handlers/__tests__/botCallback.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/botCallback.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/botCallback.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/botCallback.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/gatewayCallback.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/gatewayCallback.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/gatewayCallback.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/gatewayCallback.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/gatewayStart.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/gatewayStart.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/gatewayStart.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/gatewayStart.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/messengerInstall.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/messengerInstall.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/messengerInstall.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/messengerInstall.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/messengerOAuthCallback.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/messengerOAuthCallback.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/messengerOAuthCallback.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/messengerOAuthCallback.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/platformWebhook.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/platformWebhook.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/platformWebhook.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/platformWebhook.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/runStep.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/runStep.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/runStep.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/runStep.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/subAgentCallback.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/subAgentCallback.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/__tests__/subAgentCallback.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/subAgentCallback.test.ts
diff --git a/apps/server/src/agent-hono/handlers/__tests__/toolResult.test.ts b/apps/server/src/router-hono/agent/handlers/__tests__/toolResult.test.ts
similarity index 98%
rename from apps/server/src/agent-hono/handlers/__tests__/toolResult.test.ts
rename to apps/server/src/router-hono/agent/handlers/__tests__/toolResult.test.ts
index 4a545700295..98610c94f95 100644
--- a/apps/server/src/agent-hono/handlers/__tests__/toolResult.test.ts
+++ b/apps/server/src/router-hono/agent/handlers/__tests__/toolResult.test.ts
@@ -2,7 +2,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
// Import after mocks โ€” and import the handler file directly (not via the
-// agent-hono barrel) so we don't trigger Hono module resolution. The handler
+// agent router barrel) so we don't trigger Hono module resolution. The handler
// only imports Hono types, which are erased at runtime.
import { toolResult } from '../toolResult';
diff --git a/apps/server/src/agent-hono/handlers/botCallback.ts b/apps/server/src/router-hono/agent/handlers/botCallback.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/botCallback.ts
rename to apps/server/src/router-hono/agent/handlers/botCallback.ts
diff --git a/apps/server/src/agent-hono/handlers/execAgent.ts b/apps/server/src/router-hono/agent/handlers/execAgent.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/execAgent.ts
rename to apps/server/src/router-hono/agent/handlers/execAgent.ts
diff --git a/apps/server/src/agent-hono/handlers/finalizeAbandoned.ts b/apps/server/src/router-hono/agent/handlers/finalizeAbandoned.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/finalizeAbandoned.ts
rename to apps/server/src/router-hono/agent/handlers/finalizeAbandoned.ts
diff --git a/apps/server/src/agent-hono/handlers/gatewayCallback.ts b/apps/server/src/router-hono/agent/handlers/gatewayCallback.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/gatewayCallback.ts
rename to apps/server/src/router-hono/agent/handlers/gatewayCallback.ts
diff --git a/apps/server/src/agent-hono/handlers/gatewayCron.ts b/apps/server/src/router-hono/agent/handlers/gatewayCron.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/gatewayCron.ts
rename to apps/server/src/router-hono/agent/handlers/gatewayCron.ts
diff --git a/apps/server/src/agent-hono/handlers/gatewayStart.ts b/apps/server/src/router-hono/agent/handlers/gatewayStart.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/gatewayStart.ts
rename to apps/server/src/router-hono/agent/handlers/gatewayStart.ts
diff --git a/apps/server/src/agent-hono/handlers/groupMemberCallback.ts b/apps/server/src/router-hono/agent/handlers/groupMemberCallback.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/groupMemberCallback.ts
rename to apps/server/src/router-hono/agent/handlers/groupMemberCallback.ts
diff --git a/apps/server/src/agent-hono/handlers/messengerInstall.ts b/apps/server/src/router-hono/agent/handlers/messengerInstall.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/messengerInstall.ts
rename to apps/server/src/router-hono/agent/handlers/messengerInstall.ts
diff --git a/apps/server/src/agent-hono/handlers/messengerOAuthCallback.ts b/apps/server/src/router-hono/agent/handlers/messengerOAuthCallback.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/messengerOAuthCallback.ts
rename to apps/server/src/router-hono/agent/handlers/messengerOAuthCallback.ts
diff --git a/apps/server/src/agent-hono/handlers/messengerWebhook.ts b/apps/server/src/router-hono/agent/handlers/messengerWebhook.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/messengerWebhook.ts
rename to apps/server/src/router-hono/agent/handlers/messengerWebhook.ts
diff --git a/apps/server/src/agent-hono/handlers/platformWebhook.ts b/apps/server/src/router-hono/agent/handlers/platformWebhook.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/platformWebhook.ts
rename to apps/server/src/router-hono/agent/handlers/platformWebhook.ts
diff --git a/apps/server/src/agent-hono/handlers/runStep.ts b/apps/server/src/router-hono/agent/handlers/runStep.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/runStep.ts
rename to apps/server/src/router-hono/agent/handlers/runStep.ts
diff --git a/apps/server/src/agent-hono/handlers/subAgentCallback.ts b/apps/server/src/router-hono/agent/handlers/subAgentCallback.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/subAgentCallback.ts
rename to apps/server/src/router-hono/agent/handlers/subAgentCallback.ts
diff --git a/apps/server/src/agent-hono/handlers/toolResult.ts b/apps/server/src/router-hono/agent/handlers/toolResult.ts
similarity index 100%
rename from apps/server/src/agent-hono/handlers/toolResult.ts
rename to apps/server/src/router-hono/agent/handlers/toolResult.ts
diff --git a/apps/server/src/agent-hono/index.ts b/apps/server/src/router-hono/agent/index.ts
similarity index 100%
rename from apps/server/src/agent-hono/index.ts
rename to apps/server/src/router-hono/agent/index.ts
diff --git a/apps/server/src/agent-hono/middlewares/__tests__/bearerSecretAuth.test.ts b/apps/server/src/router-hono/agent/middlewares/__tests__/bearerSecretAuth.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/__tests__/bearerSecretAuth.test.ts
rename to apps/server/src/router-hono/agent/middlewares/__tests__/bearerSecretAuth.test.ts
diff --git a/apps/server/src/agent-hono/middlewares/__tests__/qstashAuth.test.ts b/apps/server/src/router-hono/agent/middlewares/__tests__/qstashAuth.test.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/__tests__/qstashAuth.test.ts
rename to apps/server/src/router-hono/agent/middlewares/__tests__/qstashAuth.test.ts
diff --git a/apps/server/src/agent-hono/middlewares/bearerSecretAuth.ts b/apps/server/src/router-hono/agent/middlewares/bearerSecretAuth.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/bearerSecretAuth.ts
rename to apps/server/src/router-hono/agent/middlewares/bearerSecretAuth.ts
diff --git a/apps/server/src/agent-hono/middlewares/qstashAuth.ts b/apps/server/src/router-hono/agent/middlewares/qstashAuth.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/qstashAuth.ts
rename to apps/server/src/router-hono/agent/middlewares/qstashAuth.ts
diff --git a/apps/server/src/agent-hono/middlewares/qstashOrApiKeyAuth.ts b/apps/server/src/router-hono/agent/middlewares/qstashOrApiKeyAuth.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/qstashOrApiKeyAuth.ts
rename to apps/server/src/router-hono/agent/middlewares/qstashOrApiKeyAuth.ts
diff --git a/apps/server/src/agent-hono/middlewares/serviceTokenAuth.ts b/apps/server/src/router-hono/agent/middlewares/serviceTokenAuth.ts
similarity index 100%
rename from apps/server/src/agent-hono/middlewares/serviceTokenAuth.ts
rename to apps/server/src/router-hono/agent/middlewares/serviceTokenAuth.ts
diff --git a/apps/server/src/hono/dev.ts b/apps/server/src/router-hono/dev.ts
similarity index 100%
rename from apps/server/src/hono/dev.ts
rename to apps/server/src/router-hono/dev.ts
diff --git a/apps/server/src/hono/index.ts b/apps/server/src/router-hono/index.ts
similarity index 56%
rename from apps/server/src/hono/index.ts
rename to apps/server/src/router-hono/index.ts
index 074239883e6..69b1dfef1a9 100644
--- a/apps/server/src/hono/index.ts
+++ b/apps/server/src/router-hono/index.ts
@@ -17,9 +17,9 @@ app.get('/health', (c) =>
}),
);
-app.all('/api/agent', (c) => fetchWith(c, () => import('../agent-hono')));
-app.all('/api/agent/*', (c) => fetchWith(c, () => import('../agent-hono')));
-app.all('/api/workflows', (c) => fetchWith(c, () => import('../workflows-hono')));
-app.all('/api/workflows/*', (c) => fetchWith(c, () => import('../workflows-hono')));
+app.all('/api/agent', (c) => fetchWith(c, () => import('./agent')));
+app.all('/api/agent/*', (c) => fetchWith(c, () => import('./agent')));
+app.all('/api/workflows', (c) => fetchWith(c, () => import('./workflows')));
+app.all('/api/workflows/*', (c) => fetchWith(c, () => import('./workflows')));
export default app;
diff --git a/apps/server/src/hono/standalone.ts b/apps/server/src/router-hono/standalone.ts
similarity index 100%
rename from apps/server/src/hono/standalone.ts
rename to apps/server/src/router-hono/standalone.ts
diff --git a/apps/server/src/workflows-hono/agent-signal/handlers/__tests__/scheduleNightlyReview.test.ts b/apps/server/src/router-hono/workflows/agent-signal/handlers/__tests__/scheduleNightlyReview.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/agent-signal/handlers/__tests__/scheduleNightlyReview.test.ts
rename to apps/server/src/router-hono/workflows/agent-signal/handlers/__tests__/scheduleNightlyReview.test.ts
diff --git a/apps/server/src/workflows-hono/agent-signal/handlers/scheduleNightlyReview.ts b/apps/server/src/router-hono/workflows/agent-signal/handlers/scheduleNightlyReview.ts
similarity index 100%
rename from apps/server/src/workflows-hono/agent-signal/handlers/scheduleNightlyReview.ts
rename to apps/server/src/router-hono/workflows/agent-signal/handlers/scheduleNightlyReview.ts
diff --git a/apps/server/src/workflows-hono/agent-signal/index.ts b/apps/server/src/router-hono/workflows/agent-signal/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/agent-signal/index.ts
rename to apps/server/src/router-hono/workflows/agent-signal/index.ts
diff --git a/apps/server/src/workflows-hono/index.ts b/apps/server/src/router-hono/workflows/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/index.ts
rename to apps/server/src/router-hono/workflows/index.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/index.ts b/apps/server/src/router-hono/workflows/memory-user-memory/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/index.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/index.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/hourly.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/hourly.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/hourly.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/hourly.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/personaUpdate.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/personaUpdate.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/personaUpdate.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/personaUpdate.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processTopic.hourlyTask.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processTopic.hourlyTask.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processTopic.hourlyTask.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processTopic.hourlyTask.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processTopics.hourlyTask.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processTopics.hourlyTask.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processTopics.hourlyTask.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processTopics.hourlyTask.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUserTopics.hourlyTask.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUserTopics.hourlyTask.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUserTopics.hourlyTask.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUserTopics.hourlyTask.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUserTopics.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUserTopics.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUserTopics.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUserTopics.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUsers.hourlyTask.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUsers.hourlyTask.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUsers.hourlyTask.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUsers.hourlyTask.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUsers.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUsers.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/processUsers.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/processUsers.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/runGuard.test.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/runGuard.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/__tests__/runGuard.test.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/__tests__/runGuard.test.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/hourly.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/hourly.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/hourly.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/hourly.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/personaUpdate.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/personaUpdate.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/personaUpdate.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/personaUpdate.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/processTopic.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/processTopic.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/processTopic.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/processTopic.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/processTopics.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/processTopics.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/processTopics.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/processTopics.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/processUserTopics.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/processUserTopics.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/processUserTopics.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/processUserTopics.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/processUsers.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/processUsers.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/processUsers.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/processUsers.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/runGuard.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/runGuard.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/runGuard.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/runGuard.ts
diff --git a/apps/server/src/workflows-hono/memory-user-memory/workflows/utils.ts b/apps/server/src/router-hono/workflows/memory-user-memory/workflows/utils.ts
similarity index 100%
rename from apps/server/src/workflows-hono/memory-user-memory/workflows/utils.ts
rename to apps/server/src/router-hono/workflows/memory-user-memory/workflows/utils.ts
diff --git a/apps/server/src/workflows-hono/middlewares/qstashAuth.ts b/apps/server/src/router-hono/workflows/middlewares/qstashAuth.ts
similarity index 100%
rename from apps/server/src/workflows-hono/middlewares/qstashAuth.ts
rename to apps/server/src/router-hono/workflows/middlewares/qstashAuth.ts
diff --git a/apps/server/src/workflows-hono/onboarding-task-recommendation/index.ts b/apps/server/src/router-hono/workflows/onboarding-task-recommendation/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/onboarding-task-recommendation/index.ts
rename to apps/server/src/router-hono/workflows/onboarding-task-recommendation/index.ts
diff --git a/apps/server/src/workflows-hono/onboarding-understanding/index.ts b/apps/server/src/router-hono/workflows/onboarding-understanding/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/onboarding-understanding/index.ts
rename to apps/server/src/router-hono/workflows/onboarding-understanding/index.ts
diff --git a/apps/server/src/workflows-hono/qstashClient.ts b/apps/server/src/router-hono/workflows/qstashClient.ts
similarity index 100%
rename from apps/server/src/workflows-hono/qstashClient.ts
rename to apps/server/src/router-hono/workflows/qstashClient.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/__tests__/scheduledTopicDispatch.test.ts b/apps/server/src/router-hono/workflows/task/handlers/__tests__/scheduledTopicDispatch.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/__tests__/scheduledTopicDispatch.test.ts
rename to apps/server/src/router-hono/workflows/task/handlers/__tests__/scheduledTopicDispatch.test.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/heartbeatTick.ts b/apps/server/src/router-hono/workflows/task/handlers/heartbeatTick.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/heartbeatTick.ts
rename to apps/server/src/router-hono/workflows/task/handlers/heartbeatTick.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/onCreatorComplete.test.ts b/apps/server/src/router-hono/workflows/task/handlers/onCreatorComplete.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/onCreatorComplete.test.ts
rename to apps/server/src/router-hono/workflows/task/handlers/onCreatorComplete.test.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/onCreatorComplete.ts b/apps/server/src/router-hono/workflows/task/handlers/onCreatorComplete.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/onCreatorComplete.ts
rename to apps/server/src/router-hono/workflows/task/handlers/onCreatorComplete.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/onTopicComplete.ts b/apps/server/src/router-hono/workflows/task/handlers/onTopicComplete.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/onTopicComplete.ts
rename to apps/server/src/router-hono/workflows/task/handlers/onTopicComplete.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/scheduleDispatch.ts b/apps/server/src/router-hono/workflows/task/handlers/scheduleDispatch.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/scheduleDispatch.ts
rename to apps/server/src/router-hono/workflows/task/handlers/scheduleDispatch.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/scheduleExecute.ts b/apps/server/src/router-hono/workflows/task/handlers/scheduleExecute.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/scheduleExecute.ts
rename to apps/server/src/router-hono/workflows/task/handlers/scheduleExecute.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/scheduledRunKinds.ts b/apps/server/src/router-hono/workflows/task/handlers/scheduledRunKinds.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/scheduledRunKinds.ts
rename to apps/server/src/router-hono/workflows/task/handlers/scheduledRunKinds.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/scheduledTopicDispatch.ts b/apps/server/src/router-hono/workflows/task/handlers/scheduledTopicDispatch.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/scheduledTopicDispatch.ts
rename to apps/server/src/router-hono/workflows/task/handlers/scheduledTopicDispatch.ts
diff --git a/apps/server/src/workflows-hono/task/handlers/watchdog.ts b/apps/server/src/router-hono/workflows/task/handlers/watchdog.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/handlers/watchdog.ts
rename to apps/server/src/router-hono/workflows/task/handlers/watchdog.ts
diff --git a/apps/server/src/workflows-hono/task/index.ts b/apps/server/src/router-hono/workflows/task/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/task/index.ts
rename to apps/server/src/router-hono/workflows/task/index.ts
diff --git a/apps/server/src/workflows-hono/topic-auto-summary/dispatch.test.ts b/apps/server/src/router-hono/workflows/topic-auto-summary/dispatch.test.ts
similarity index 100%
rename from apps/server/src/workflows-hono/topic-auto-summary/dispatch.test.ts
rename to apps/server/src/router-hono/workflows/topic-auto-summary/dispatch.test.ts
diff --git a/apps/server/src/workflows-hono/topic-auto-summary/dispatch.ts b/apps/server/src/router-hono/workflows/topic-auto-summary/dispatch.ts
similarity index 100%
rename from apps/server/src/workflows-hono/topic-auto-summary/dispatch.ts
rename to apps/server/src/router-hono/workflows/topic-auto-summary/dispatch.ts
diff --git a/apps/server/src/workflows-hono/topic-auto-summary/execute.ts b/apps/server/src/router-hono/workflows/topic-auto-summary/execute.ts
similarity index 100%
rename from apps/server/src/workflows-hono/topic-auto-summary/execute.ts
rename to apps/server/src/router-hono/workflows/topic-auto-summary/execute.ts
diff --git a/apps/server/src/workflows-hono/topic-auto-summary/index.ts b/apps/server/src/router-hono/workflows/topic-auto-summary/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/topic-auto-summary/index.ts
rename to apps/server/src/router-hono/workflows/topic-auto-summary/index.ts
diff --git a/apps/server/src/workflows-hono/verify/handlers/onVerifierComplete.ts b/apps/server/src/router-hono/workflows/verify/handlers/onVerifierComplete.ts
similarity index 100%
rename from apps/server/src/workflows-hono/verify/handlers/onVerifierComplete.ts
rename to apps/server/src/router-hono/workflows/verify/handlers/onVerifierComplete.ts
diff --git a/apps/server/src/workflows-hono/verify/index.ts b/apps/server/src/router-hono/workflows/verify/index.ts
similarity index 100%
rename from apps/server/src/workflows-hono/verify/index.ts
rename to apps/server/src/router-hono/workflows/verify/index.ts
diff --git a/apps/server/src/workflows/agentSignal/run.ts b/apps/server/src/workflows/agentSignal/run.ts
index a78d17d2ab4..a03b20497d8 100644
--- a/apps/server/src/workflows/agentSignal/run.ts
+++ b/apps/server/src/workflows/agentSignal/run.ts
@@ -470,7 +470,7 @@ export const runAgentSignalWorkflow = async (
// opening the top-level workflow span, otherwise each workflow run starts a fresh trace.
// Source/context:
// - `src/app/(backend)/middleware/auth/index.ts` performs extract/inject for normal backend APIs
- // - `apps/server/src/workflows-hono/agent-signal/index.ts` wires `serve(...)` directly to
+ // - `apps/server/src/router-hono/workflows/agent-signal/index.ts` wires `serve(...)` directly to
// `runAgentSignalWorkflow(...)`
// Removal condition:
// - Safe to remove only if the workflow entry stack gains a shared request middleware that
diff --git a/apps/server/src/workflows/onboardingUnderstanding/processProviders.ts b/apps/server/src/workflows/onboardingUnderstanding/processProviders.ts
index 53ab2b8ee68..2acdc4c59cc 100644
--- a/apps/server/src/workflows/onboardingUnderstanding/processProviders.ts
+++ b/apps/server/src/workflows/onboardingUnderstanding/processProviders.ts
@@ -120,7 +120,7 @@ export const processUnderstandingProviders = async (
// Cross-route workflow fan-out must use an absolute QStash trigger.
// context.invoke only replaces the current URL's final path segment, which sent this
// child to `/api/workflows/onboarding/understanding/process` and returned 404.
- // Source/context: `workflows-hono/memory-user-memory/workflows/processUserTopics.ts:193`.
+ // Source/context: `router-hono/workflows/memory-user-memory/workflows/processUserTopics.ts:193`.
// Remove when Upstash context.invoke supports absolute cross-route workflow URLs.
dependencies.triggerTaskRecommendations(body, {
// Every completed provider may race to schedule a fingerprint-specific run. The
diff --git a/apps/server/viteHonoBuild.config.ts b/apps/server/viteHonoBuild.config.ts
index ff4f050903d..82f9bd38da4 100644
--- a/apps/server/viteHonoBuild.config.ts
+++ b/apps/server/viteHonoBuild.config.ts
@@ -5,7 +5,8 @@ import { defineConfig } from 'vite';
import { honoServerDedupe, honoServerPlugins } from './viteNodeServer.config';
const serverRoot = fileURLToPath(new URL('.', import.meta.url));
-const entry = (file: string) => fileURLToPath(new URL(`./src/hono/${file}`, import.meta.url));
+const entry = (file: string) =>
+ fileURLToPath(new URL(`./src/router-hono/${file}`, import.meta.url));
export default defineConfig({
build: {
diff --git a/docs/development/basic/folder-structure.mdx b/docs/development/basic/folder-structure.mdx
index 96ddc6c49cf..1a2ed21f308 100644
--- a/docs/development/basic/folder-structure.mdx
+++ b/docs/development/basic/folder-structure.mdx
@@ -74,7 +74,7 @@ src/
โ”‚ โ”œโ”€โ”€ onboarding/ # Onboarding flow
โ”‚ โ””โ”€โ”€ share/ # Share pages
โ”œโ”€โ”€ server/ # Remaining server-side modules not yet moved to apps/server
-โ”‚ # (SEO metadata, SPA HTML rendering, composio services, workflows-hono)
+โ”‚ # (SEO metadata, SPA HTML rendering, composio services)
โ”œโ”€โ”€ services/ # Client-side service interfaces
โ”œโ”€โ”€ spa/ # SPA entry points and React Router config
โ”‚ โ”œโ”€โ”€ entry.web.tsx / entry.mobile.tsx / entry.desktop.tsx / entry.popup.tsx / entry.auth.tsx
diff --git a/docs/development/basic/folder-structure.zh-CN.mdx b/docs/development/basic/folder-structure.zh-CN.mdx
index 64da4f35126..80057fbdde4 100644
--- a/docs/development/basic/folder-structure.zh-CN.mdx
+++ b/docs/development/basic/folder-structure.zh-CN.mdx
@@ -72,7 +72,7 @@ src/
โ”‚ โ”œโ”€โ”€ onboarding/ # ๆ–ฐ็”จๆˆทๅผ•ๅฏผ
โ”‚ โ””โ”€โ”€ share/ # ๅˆ†ไบซ้กต้ข
โ”œโ”€โ”€ server/ # ๅฐšๆœช่ฟ็งปๅˆฐ apps/server ็š„ๅ‰ฉไฝ™ๆœๅŠก็ซฏๆจกๅ—
-โ”‚ # ๏ผˆSEO metadataใ€SPA HTML ๆธฒๆŸ“ใ€composio servicesใ€workflows-hono๏ผ‰
+โ”‚ # ๏ผˆSEO metadataใ€SPA HTML ๆธฒๆŸ“ใ€composio services๏ผ‰
โ”œโ”€โ”€ services/ # ๅฎขๆˆท็ซฏๆœๅŠกๆŽฅๅฃ
โ”œโ”€โ”€ spa/ # SPA ๅ…ฅๅฃๅ’Œ React Router ้…็ฝฎ
โ”‚ โ”œโ”€โ”€ entry.web.tsx / entry.mobile.tsx / entry.desktop.tsx / entry.popup.tsx / entry.auth.tsx
diff --git a/src/app/(backend)/api/agent/[[...route]]/route.ts b/src/app/(backend)/api/agent/[[...route]]/route.ts
index 92d620741a0..3ce2befa6dc 100644
--- a/src/app/(backend)/api/agent/[[...route]]/route.ts
+++ b/src/app/(backend)/api/agent/[[...route]]/route.ts
@@ -1,4 +1,4 @@
-import app from '@/server/agent-hono';
+import app from '@/server/router-hono/agent';
const handler = (request: Request) => app.fetch(request);
diff --git a/src/app/(backend)/api/workflows/[[...route]]/route.ts b/src/app/(backend)/api/workflows/[[...route]]/route.ts
index 433a41166d8..a4c77a014f8 100644
--- a/src/app/(backend)/api/workflows/[[...route]]/route.ts
+++ b/src/app/(backend)/api/workflows/[[...route]]/route.ts
@@ -1,3 +1,3 @@
-import app from '@/server/workflows-hono';
+import app from '@/server/router-hono/workflows';
export const POST = (request: Request) => app.fetch(request);