···1010import { SessionService } from '../services/SessionService';
1111import { FollowService } from '../services/FollowService';
1212import { normalize } from '../utils/string.utils';
1313+import type { AppEnv } from '../types/hono';
13141414-const search = new Hono();
1515+const search = new Hono<AppEnv>();
15161617// Validation schema for batch search request
1718const batchSearchSchema = z.object({
+22
packages/api/src/types/hono.ts
···11+/**
22+ * Hono Context Types
33+ * Defines custom variables available in the request context
44+ */
55+66+/**
77+ * Custom variables set by middleware and available via c.get()/c.set()
88+ */
99+export interface AppVariables {
1010+ /** User's decentralized identifier, set by authMiddleware */
1111+ did: string;
1212+ /** Session ID from the cookie, set by authMiddleware */
1313+ sessionId: string;
1414+}
1515+1616+/**
1717+ * Environment type for the Hono app
1818+ * This enables type-safe access to context variables
1919+ */
2020+export interface AppEnv {
2121+ Variables: AppVariables;
2222+}