import { WorkerHost } from "@nestjs/bullmq"; import { ConfigService } from "@nestjs/config"; import { Job } from "bullmq"; import { ClsService } from "nestjs-cls"; import { CreditValidatorInterface } from "../../../common/tokens"; import { BaseConfigInterface } from "../../../config/interfaces/base.config.interface"; import { AppLoggingService } from "../../../core/logging/services/logging.service"; import { Neo4jService } from "../../../core/neo4j/services/neo4j.service"; import { TracingService } from "../../../core/tracing/services/tracing.service"; import { ChunkService } from "../../chunk/services/chunk.service"; import { ChunkRepository } from "../repositories/chunk.repository"; export declare class ChunkProcessor extends WorkerHost { private readonly logger; private readonly tracer; private readonly clsService; private readonly chunkService; private readonly chunkRepository; private readonly neo4j; /** * Credit gating goes through the app-provided `CREDIT_VALIDATOR` seam * rather than injecting `CompanyService`: `CompanyModule` declares * `CompanyController`, so importing it here mounts `companies/*` into every * consumer of `ChunkModule` and crashes any app that replaces the company * foundation with its own controller. Unbound → ungated (see * `hasAvailableCreditsVia`). */ private readonly creditValidator?; private readonly chunkJobName; constructor(logger: AppLoggingService, tracer: TracingService, clsService: ClsService, chunkService: ChunkService, chunkRepository: ChunkRepository, neo4j: Neo4jService, configService: ConfigService, /** * Credit gating goes through the app-provided `CREDIT_VALIDATOR` seam * rather than injecting `CompanyService`: `CompanyModule` declares * `CompanyController`, so importing it here mounts `companies/*` into every * consumer of `ChunkModule` and crashes any app that replaces the company * foundation with its own controller. Unbound → ungated (see * `hasAvailableCreditsVia`). */ creditValidator?: CreditValidatorInterface); onActive(job: Job): void; onError(job: Job): void; onCompleted(job: Job): void; process(job: Job): Promise; /** * Rolls a chunk-level credit deferral up to the owning entity (spec §3.2) so * the backlog reflects it even when the debounce gate passed upstream but * credits ran out mid-fan-out across a document's chunks. `contentType` is * the Neo4j label (per the `HowToService._chunkAndQueue` enqueue convention: * `contentType: howToMeta.labelName`), resolved via `modelRegistry` the same * way `buildEmbedderAttribution` does. Document flows without a registered * entity model keep the chunk-level marker only (already set by the caller). */ private markOwnerPendingCredits; } //# sourceMappingURL=chunk.processor.d.ts.map