import { ContextFetchDefinition } from "../types/utility.js"; import "../types/index.js"; import { DotPaths } from "./validation-helpers.js"; import { ContextConfigSelect, CredentialReferenceApiInsert } from "../types/entities.js"; import { z } from "@hono/zod-openapi"; //#region src/context/ContextConfig.d.ts type ExtractSchemasFromCV = { [K in keyof CV]: CV[K] extends builderFetchDefinition ? S : never }; type InferContextFromSchemas = { [K in keyof CZ]: CZ[K] extends z.ZodTypeAny ? z.infer : never }; type FullContext = InferContextFromSchemas>; type AllowedPaths = DotPaths>; interface HeadersSchemaBuilderOptions { schema: R; } declare class HeadersSchemaBuilder { private schema; constructor(options: HeadersSchemaBuilderOptions); /** Template function for headers paths with type-safe autocomplete */ toTemplate

>>(path: P): `{{headers.${P}}}`; getSchema(): R; getJsonSchema(): Record; } type builderFetchDefinition = { id: string; name?: string; trigger: 'initialization' | 'invocation'; fetchConfig: { url: string; method?: string; headers?: Record; body?: Record; transform?: string; timeout?: number; requiredToFetch?: Array; }; responseSchema: R; defaultValue?: unknown; credentialReference?: CredentialReferenceApiInsert; }; interface ContextConfigBuilderOptions>> { id: string; headers?: R | HeadersSchemaBuilder; contextVariables?: CV; tenantId?: string; projectId?: string; agentId?: string; baseURL?: string; } declare class ContextConfigBuilder>> { private config; private baseURL; private tenantId; private projectId; private agentId; constructor(options: ContextConfigBuilderOptions); /** * Set the context (tenantId, projectId, agentId) for this context config * Called by agent.setConfig() when the agent is configured */ setContext(tenantId: string, projectId: string, agentId: string, baseURL: string): void; /** * Convert the builder to a plain object for database operations */ toObject(): ContextConfigSelect; getId(): string; getHeadersSchema(): any; getContextVariables(): Record; withHeadersSchema(schema: any): this; /** 4) The function you ship: path autocomplete + validation, returns {{path}} */ toTemplate

>(path: P): `{{${P}}}`; validate(): { valid: boolean; errors: string[]; }; init(): Promise; private upsertContextConfig; private parseErrorResponse; } declare function contextConfig> = Record>>(options: ContextConfigBuilderOptions & { contextVariables?: CV; }): ContextConfigBuilder; declare function headers(options: HeadersSchemaBuilderOptions): HeadersSchemaBuilder; declare function fetchDefinition(options: builderFetchDefinition): Omit, 'credentialReference'> & { credentialReferenceId?: string; }; //#endregion export { AllowedPaths, ContextConfigBuilder, ContextConfigBuilderOptions, ExtractSchemasFromCV, HeadersSchemaBuilder, HeadersSchemaBuilderOptions, InferContextFromSchemas, builderFetchDefinition, contextConfig, fetchDefinition, headers };