feat(server): ServerModule skeleton with shared ServerContext, worker runs engine + outbox relay (B6)

modules/{auth-settings,sources-identity,acquisition-organize,agent} placeholders listed in
SERVER_MODULES; ServerModule registers routes (under /api/v1, authenticated), tasks,
outbox routes, capabilities and background loops. bootstrap() builds ServerContext (db,
config, logger, events, engine, outbox writer, secrets placeholder, settings reader,
capability registry), fills unregistered tasks with stubs and rejects duplicate task or
outbox ownership. worker starts the OpenWorkflow worker, OutboxRelay and module start().
--role migrate also migrates the engine schema; api/worker connect without migrating.
tasks: TaskRegistry.has, migrateEngineSchema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-27 19:30:55 +08:00
1 parent ef3998767c
commit 9858b8494d
23 files changed
+829 -22

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { acquisitionOrganizeModule } from "./acquisition-organize/index.ts";
import { agentModule } from "./agent/index.ts";
import { authSettingsModule } from "./auth-settings/index.ts";
import { sourcesIdentityModule } from "./sources-identity/index.ts";
import type { ServerModule } from "./types.ts";
export type * from "./types.ts";
/**
* 模块清单:http/app.ts(路由)与 worker(任务/中继/后台循环)都从这里取。
* 顺序即注册顺序;auth-settings 在前(其它模块的路由依赖它的登录门禁中间件)。
*/
export const SERVER_MODULES: readonly ServerModule[] = [
authSettingsModule,
sourcesIdentityModule,
acquisitionOrganizeModule,
agentModule,
];