import { HatchetClient } from "@hatchet-dev/typescript-sdk"; import { OnApplicationBootstrap } from "@nestjs/common"; import { ModuleRef } from "@nestjs/core"; import { DeclarationBuilderService } from "./declaration-builder.service.js"; import type { HatchetModuleConfig } from "../hatchet.module-config.js"; export declare class WorkerManagementService implements OnApplicationBootstrap { private readonly client; private readonly declarationBuilder; private readonly config; private readonly moduleRef; private static LOGGER; constructor(client: HatchetClient, declarationBuilder: DeclarationBuilderService, config: HatchetModuleConfig, moduleRef: ModuleRef); onApplicationBootstrap(): Promise; private initWorker; /** * Builds declarations from the discovered feature registrations. */ private buildDeclarations; /** * Discovers all feature registrations from forFeature() calls. * * Returns an empty array when no `HatchetModule.forFeature()` has been * registered anywhere. Nest's `ModuleRef.get(..., { each: true })` throws * `UnknownElementException` when zero providers exist for the token, even * with `strict: false`, so we catch that case and treat it as "no features". */ private discoverFeatureRegistrations; /** * Detects workflows registered on the Hatchet server that have no * corresponding local declaration. Logs a warning for each orphan found. */ private detectOrphanWorkflows; /** * Fetches all workflows registered on the Hatchet server using pagination. * * @returns An array of workflow names registered on the server. */ private fetchAllServerWorkflows; }