export interface KazzleComponentEnv { /** Secret collection slug */ collection: string; /** Environment slug for secret injection */ environment: string; /** Only inject these env var names. If omitted, inject all from collection+environment. */ include?: string[]; } export interface KazzleRuntimeMode { /** Command to start the component in this mode (e.g. "bun run dev", "bun run start") */ command: string; /** Command to build for this mode (used by production deploys, e.g. "bun run build") */ build?: string; /** Mode-specific secret collection + environment. Falls back to the component env. */ env?: KazzleComponentEnv; } export interface KazzleComponentRuntime { /** Local dev / preview runtime */ dev?: KazzleRuntimeMode; /** Production runtime */ prod?: KazzleRuntimeMode; } /** * A single trigger entry on a process component. One component can declare * many triggers — for example, a daily cron AND a webhook handler that both * route into the same code. * * - `kind: 'schedule'` → fires on the cron expression in `schedule`. * `schedule` is a 5-field cron expression with minute resolution. * * - `kind: 'webhook'` → fires when the platform receives * `POST /webhooks/{spaceId}/{appId}/{componentName}/{name}`. * * `path` is the HTTP route on the running server that handles this trigger. * Required when `processMode: 'persistent'` (the platform POSTs the trigger * into the long-running server at this path with `Authorization: Bearer * ${KAZZLE_TRIGGER_SECRET}`). Ignored for `processMode: 'triggered'` — those * components run as one-off ephemeral processes that read `TRIGGER_NAME` * from the environment instead. */ export interface KazzleTrigger { /** Stable identifier, unique within the component (kebab-case, e.g. "daily-digest"). */ name: string; /** Trigger kind — schedule (cron) or webhook (HTTP POST). */ kind: 'schedule' | 'webhook'; /** Cron expression (5-field, minute resolution). Required for kind="schedule". */ schedule?: string; /** HTTP path on the running server. Required when processMode="persistent". */ path?: string; } export interface KazzleComponent { /** Unique component name within the app */ name: string; /** Component type — ui (max 1) or process */ type: 'ui' | 'process'; /** Entry path within the app directory */ path: string; /** Default secret collection + environment for env var injection. */ env?: KazzleComponentEnv; /** Commands and optional env overrides for dev and production modes */ runtime?: KazzleComponentRuntime; /** * Execution lifecycle for process components. * * - 'persistent' — long-running server. Triggers are POSTed into the * server at the declared `path`. This is the default. * - 'triggered' — ephemeral one-off run per trigger. The platform * spawns the entry script with `TRIGGER_NAME`, `RUN_ID`, and an * optional `WEBHOOK_PAYLOAD` env var, then waits for exit. */ processMode?: 'persistent' | 'triggered'; /** Schedule and webhook triggers. One component may declare many. */ triggers?: KazzleTrigger[]; } export interface KazzleSkill { /** Skill name */ name: string; /** Path to the SKILL.md file relative to the app root */ path: string; } export interface KazzleConfig { /** Marketing display name shown in the app catalog. Falls back to the slug when omitted. */ name?: string; /** One-line catalog tagline. Required to publish. */ subtitle?: string; /** Author-set version label (e.g. "1.2.0"). Display-only; snapshotted on publish. */ version?: string; /** Where the published app runs — remote (Fly.io) or local (user computer). Defaults to remote. */ target?: 'local' | 'remote'; /** Path to the app icon file (png, jpg, svg, webp, ico) */ icon?: string; /** Executable components — UI frontends or background processes */ components?: KazzleComponent[]; /** AI skill definitions — markdown files the AI reads for domain knowledge */ skills?: KazzleSkill[]; } /** Type-safe config helper. Use: export default defineConfig({ ... }) */ export declare function defineConfig(config: KazzleConfig): KazzleConfig;