import { z } from "zod"; import { ToolConfigSchema } from "./contract"; /** * Context object which is passed to function calls */ export type JobContext = { authContext?: unknown; runContext?: unknown; approved: boolean; }; export type ToolConfig = z.infer; export type ToolInput = T extends z.ZodObject ? { [K in keyof Input]: z.infer; } : any; /** * Schema for onStatusChange functions * * @see {@link https://docs.inferable.ai/pages/runs#onstatuschange} * @example * ```ts * inferable.default.register({ * name: "onStatusChangeFn", * schema: { * input: onStatusChangeInput * }, * func: (_input) => {}, * }); * ``` */ export declare const onStatusChangeInput: z.ZodObject<{ runId: z.ZodString; status: z.ZodEnum<["pending", "running", "paused", "done", "failed"]>; result: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>; summary: z.ZodOptional>; tags: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { status: "pending" | "running" | "paused" | "done" | "failed"; runId: string; result?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined; summary?: string | null | undefined; tags?: Record | null | undefined; }, { status: "pending" | "running" | "paused" | "done" | "failed"; runId: string; result?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined; summary?: string | null | undefined; tags?: Record | null | undefined; }>; /** * Schema for handleCustomAuth functions * * @see {@link https://docs.inferable.ai/pages/custom-auth} * @example * ```ts * inferable.default.register({ * name: "handleCustomAuth", * schema: { * input: handleCustomAuthInput * }, * func: (_input) => {}, * }); * ``` */ export declare const handleCustomAuthInput: z.ZodObject<{ token: z.ZodString; }, "strip", z.ZodTypeAny, { token: string; }, { token: string; }>; import type { JSONSchema4Type } from "json-schema"; import type { JsonSchema7Type } from "zod-to-json-schema"; export type JsonSchema = JSONSchema4Type | JsonSchema7Type; export type JsonSchemaInput = { type: string; properties: Record; required: string[]; $schema: string; }; export type ToolSchema = { input: T; }; export type ToolRegistrationInput = { name: string; func: (input: ToolInput, context: JobContext) => Promise; schema?: ToolSchema; config?: ToolConfig; description?: string; }; export type WorkflowToolRegistrationInput = { name: string; inputSchema?: T; config?: ToolConfig; func: (input: ToolInput, context: JobContext) => Promise; };