/** * Application entry point for Runwork apps. * * Users call createApp() in their worker entry file to register their * application code (agents, entities, routes, etc.) and get back * a Cloudflare Workers ExportedHandler. * * @example * ```typescript * // worker/index.ts * import { createApp } from '@runworkai/framework'; * import { APP_AGENTS } from './agents'; * import { APP_ENTITIES } from './entities'; * import { APP_ROUTES } from './routes'; * * export default createApp({ * agents: APP_AGENTS, * entities: APP_ENTITIES, * routes: APP_ROUTES, * }); * ``` */ import { type ComponentDefinition, type RouteEntry } from './app-registry'; import type { AgentDefinition } from './core-agent'; import type { EntityClass } from './core-entities'; import type { EndpointDefinition } from './core-endpoints'; import type { IntegrationRequirement } from './core-integrations'; import type { ScheduledJob } from './core-scheduler'; import type { Env } from './core-utils'; import type { WorkflowDefinition } from './core-workflow-types'; /** * Options for createApp(). All fields are optional -- omitted fields * default to empty arrays. */ export interface CreateAppOptions { agents?: AgentDefinition[]; entities?: Array>; routes?: RouteEntry[]; endpoints?: EndpointDefinition[]; workflows?: WorkflowDefinition[]; schedules?: ScheduledJob[]; integrationRequirements?: IntegrationRequirement[]; components?: ComponentDefinition[]; } /** * Initialize a Runwork application with the given feature registrations. * * Registers user-defined agents, entities, routes, and other features * into the global app registry so framework core files can access them * without direct imports. * * Returns an ExportedHandler suitable for use as the default export * of a Cloudflare Worker entry point. */ export declare function createApp(options?: CreateAppOptions): ExportedHandler;