chore: scaffold monorepo and migrate uhd_web design system (W0-A)
- pnpm workspace: apps/{web,server}, packages/{contracts,db,domain,adapters,tasks,agent,testkit}
- server: Hono + zod-openapi, API Key auth with scopes, redacting pino logger, SSE event bus with replay, worker heartbeat
- db: Kysely + pg, file migrator, 0001_init (settings/api_key/audit_event/outbox_event)
- web: React Router 7 SPA console shell with 12 workspace placeholders, uhd_web tokens/ui/guard scripts
- docs: ADR-001 (Node over Deno), dev runbook, design system rules
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
commit
b22c440139
138 files changed
+14455
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { z } from "zod";
|
||||
import { Timestamp } from "./common";
|
||||
|
||||
/** SSE 事件信封:seq 在进程内单调递增,客户端断线后用 ?after=<seq> 补读 */
|
||||
export const EventEnvelope = z.object({
|
||||
seq: z.number().int().nonnegative(),
|
||||
type: z.string().min(1),
|
||||
at: Timestamp,
|
||||
payload: z.unknown(),
|
||||
});
|
||||
export type EventEnvelope<P = unknown> = {
|
||||
seq: number;
|
||||
type: string;
|
||||
at: string;
|
||||
payload: P;
|
||||
};
|
||||
|
||||
/** 已知事件类型;业务事件后续按 `域.动作` 追加 */
|
||||
export const EventType = {
|
||||
heartbeat: "system.heartbeat",
|
||||
resync: "system.resync",
|
||||
} as const;
|
||||
export type EventType = (typeof EventType)[keyof typeof EventType];
|
||||
|
||||
/** 心跳 payload */
|
||||
export const HeartbeatPayload = z.object({
|
||||
role: z.string(),
|
||||
});
|
||||
Reference in new issue
Block a user