import 'reflect-metadata'; import type z from '@frontmcp/lazy-zod'; import { type JobContext } from '../interfaces'; import { type EsmOptions, type RemoteOptions, type ToolInputType, type ToolOutputType } from '../metadata'; import { type JobMetadata } from '../metadata/job.metadata'; import { type JobEsmTargetRecord, type JobRemoteRecord } from '../records/job.record'; import { type ToolInputOf, type ToolOutputOf } from './tool.decorator'; export type FrontMcpJobExecuteHandler, Out = ToolOutputOf<{ outputSchema: OutSchema; }>> = (input: In, ctx: JobContext) => Out | Promise; /** * Function builder for creating jobs without classes. */ declare function frontMcpJob>(providedMetadata: T): (handler: FrontMcpJobExecuteHandler) => () => FrontMcpJobExecuteHandler; declare function jobEsm(specifier: string, targetName: string, options?: EsmOptions): JobEsmTargetRecord; declare function jobRemote(url: string, targetName: string, options?: RemoteOptions): JobRemoteRecord; type __Shape = z.ZodRawShape; type __PrimitiveOutputType = 'string' | 'number' | 'date' | 'boolean' | z.ZodString | z.ZodNumber | z.ZodBoolean | z.ZodBigInt | z.ZodDate; type __MediaOutputType = 'image' | 'audio' | 'resource' | 'resource_link'; type __StructuredOutputType = z.ZodRawShape | z.ZodObject | z.ZodArray | z.ZodUnion<[z.ZodObject, ...z.ZodObject[]]> | z.ZodDiscriminatedUnion<[z.ZodObject, ...z.ZodObject[]]>; type __JobSingleOutputType = __PrimitiveOutputType | __MediaOutputType | __StructuredOutputType; type __OutputSchema = __JobSingleOutputType | __JobSingleOutputType[]; type __Ctor = (new (...a: any[]) => any) | (abstract new (...a: any[]) => any); type __A = C extends new (...a: infer A) => any ? A : C extends abstract new (...a: infer A) => any ? A : never; type __R = C extends new (...a: any[]) => infer R ? R : C extends abstract new (...a: any[]) => infer R ? R : never; type __ExecParams = __R extends { execute: (...args: infer P) => unknown; } ? P : never; type __HasNoParam = [__ExecParams] extends [readonly []] ? true : false; type __Param = __ExecParams extends readonly [infer P, ...unknown[]] ? P : never; type __Return = __R extends { execute: (...a: any) => infer R; } ? R : never; type __Unwrap = T extends Promise ? U : T; type __IsAny = 0 extends 1 & T ? true : false; type __MustExtendCtx = __R extends JobContext ? unknown : { 'Job class error': 'Class must extend JobContext'; }; type __MustParam = __IsAny extends true ? unknown : __IsAny<__Param> extends true ? { 'execute() parameter error': "Parameter type must not be 'any'."; expected_input_type: In; } : __HasNoParam extends true ? In extends Record ? unknown : { 'execute() parameter error': 'execute() requires a parameter matching the input schema.'; expected_input_type: In; } : __Param extends In ? In extends __Param ? unknown : { 'execute() parameter error': 'Parameter type is too wide. It must exactly match the input schema.'; expected_input_type: In; actual_parameter_type: __Param; } : { 'execute() parameter error': 'Parameter type does not match the input schema.'; expected_input_type: In; actual_parameter_type: __Param; }; type __MustReturn = __IsAny extends true ? unknown : __IsAny<__Unwrap<__Return>> extends true ? { 'execute() return type error': "Return type must not be 'any'."; expected_output_type: Out; } : __Unwrap<__Return> extends Out ? unknown : { 'execute() return type error': "The method's return type is not assignable to the expected output schema type."; expected_output_type: Out; 'actual_return_type (unwrapped)': __Unwrap<__Return>; }; type __Rewrap = C extends abstract new (...a: __A) => __R ? C & (abstract new (...a: __A) => JobContext & __R) : C extends new (...a: __A) => __R ? C & (new (...a: __A) => JobContext & __R) : never; interface JobDecorator { (opts: JobMetadata & { outputSchema: O; }): (cls: C & __MustExtendCtx & __MustParam> & __MustReturn>) => __Rewrap, ToolOutputOf<{ outputSchema: O; }>>; esm: typeof jobEsm; remote: typeof jobRemote; } declare const FrontMcpJob: JobDecorator; declare const Job: JobDecorator; export { FrontMcpJob, Job, frontMcpJob, frontMcpJob as job }; //# sourceMappingURL=job.decorator.d.ts.map