/** * @module bootstrap * * Shared bootstrap entry point for ibgib-based web apps. * Collapses the metaspace, globalThis, and shell-init boilerplate. */ import { RCLIArgInfo, RCLIParamInfo } from "@ibgib/helper-gib/dist/rcli/rcli-types.mjs"; import { TransformResult } from "@ibgib/ts-gib/dist/types.mjs"; import { IbGibAppAny } from "@ibgib/core-gib/dist/witness/app/app-base-v1.mjs"; import { MetaspaceService } from "@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs"; import { IbGibSpaceAny } from "@ibgib/core-gib/dist/witness/space/space-base-v1.mjs"; import { IbGibAmbientContextConfig, IbGibGlobalThis_IbGibApp, IbGibIdentityContext, RequestCommentIbGib_V1 } from "./types.mjs"; export interface TagConfig { text: string; icon: string; description: string; } export interface BootstrapIbGibAppOptions { /** Application context configuration (IndexedDB names, etc.) */ config: IbGibAmbientContextConfig; /** Accessor for the application's typed globalThis slot */ getGlobalThis: (config?: IbGibAmbientContextConfig) => IbGibGlobalThis_IbGibApp; /** The main application witness class */ AppClass: new (data?: any, rel8ns?: any) => TApp; /** * Default data used when generating the very first version of this app. * Only applied if `fnGetOrCreateApp` is omitted. */ defaultAppData: any; /** * Optional. Provide an array of parameters the application supports. */ paramInfos?: RCLIParamInfo[]; /** * Optional. Provide initial args for bootstrap. * Defaults to `['--interactive']`. */ getOpeningArgs?: () => Promise; /** * Optional. RCLI argument validation hook. */ validateArgInfos?: (opts: { argInfos: RCLIArgInfo[]; }) => string | undefined; /** * Optional. Hook called before initializing the app, but after metaspace is ready. * Can be used to check environment, space state, etc. */ onBeforeCreate?: (metaspace: MetaspaceService, space: IbGibSpaceAny) => Promise; /** * Optional. Hook called immediately after the application witness is loaded or created. * A good place to execute migrations before returning the 'ready' app. */ onAppLoaded?: (app: TApp, isNew: boolean) => Promise; /** * Nuclear escape hatch. Provide this to replace the entire app get-or-create flow. * If provided, `onBeforeCreate`, `onAppLoaded`, and `defaultAppData` are ignored. */ fnGetOrCreateApp?: (metaspace: MetaspaceService, space: IbGibSpaceAny) => Promise; /** * Optional. Hook called to initialize identity context (e.g., keystone based auth). */ resolveIdentity?: (metaspace: MetaspaceService) => Promise; /** * Optional. The point at which the application logic dictates its readiness to UI components. * Typically this executes `getAppShellSvc().onEngineReady()`. */ onReady?: (app: TApp) => void | Promise; /** * Tags verified to exist in the global user space at startup. */ ensureTags?: TagConfig[]; /** * The key prefix used for allocating new spaces (e.g. `test_app_space`). */ localSpaceNamePrefix?: string; /** * Optional hook to register AI agent function tracking and deprecations. */ registerAgentFunctionInfos?: () => void; } export declare function bootstrapIbGibApp(opts: BootstrapIbGibAppOptions): Promise; export declare function createRequestCommentIbGib_Common({ args, interpretedArgInfos, }: { args: string[]; interpretedArgInfos: RCLIArgInfo[]; }): Promise>; export declare function validateParamInfos({ paramInfos }: { paramInfos: RCLIParamInfo[]; }): string[]; //# sourceMappingURL=bootstrap.d.mts.map