/** * Core Events * DO NOT MODIFY THIS FILE - You may break the project functionality * * This module provides: * - emitEvent(): Fire-and-forget event emission to the workspace event stream * - flog(): Structured logging that outputs JSON to sandbox stdout * * Events appear in the workspace activity feed and on the app's timeline. * When running outside a workspace (standalone mode), calls are silently skipped. */ export interface EmitEventParams { type: string; entityType?: string; entityId?: string; summary: string; metadata?: Record; } interface EventEnv { WORKSPACE_API_URL?: string; WORKSPACE_API_KEY?: string; WORKSPACE_ID?: string; APP_ID?: string; APP_NAME?: string; DEPLOYMENT_MODE?: 'preview' | 'production'; WorkspaceObject?: DurableObjectNamespace; } /** * Any context that supports waitUntil - compatible with both * ExecutionContext (Hono route handlers) and DurableObjectState (DOs). */ type WaitUntilContext = Pick; /** * Convert an app name to the kebab-case label the legacy `channel` field carries. * @deprecated Channels are retired; the platform ignores the field. * "My Cool App" -> "my-cool-app" */ export declare function toChannelName(appName: string): string; /** * Structured log entry for sandbox stdout. * Outputs JSON with a consistent schema so the platform can parse and display * these entries in the observability timeline. */ export declare function flog(level: 'info' | 'warn' | 'error', system: string, message: string, data?: Record): void; export declare function emitEvent(ctx: WaitUntilContext, env: EventEnv, event: EmitEventParams): void; export {};