UNPKG

agent-contracts-runtime

Version:

Runtime bridge for executing agent-contracts workflows on Agent SDKs

141 lines (136 loc) 5.29 kB
import { z } from 'zod'; export { b as buildContractContext, a as buildGuardrailContext } from '../context-B_bekYiE.js'; /** * Generator configuration — loads and validates agents.conf.yaml / agent-runtime.config.yaml */ declare const DEFAULT_CONFIG_PATH = "./agents.conf.yaml"; declare const RuntimeConfigSchema: z.ZodObject<{ dsl: z.ZodDefault<z.ZodString>; generated_dir: z.ZodDefault<z.ZodString>; bindings: z.ZodDefault<z.ZodArray<z.ZodString>>; active_guardrail_policy: z.ZodOptional<z.ZodString>; templates_dir: z.ZodOptional<z.ZodString>; plugins: z.ZodDefault<z.ZodArray<z.ZodString>>; recovery: z.ZodDefault<z.ZodObject<{ max_follow_ups: z.ZodDefault<z.ZodNumber>; max_retries: z.ZodDefault<z.ZodNumber>; }, z.core.$strip>>; model_mapping: z.ZodDefault<z.ZodObject<{ fast: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; standard: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; thinking: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; }, z.core.$strip>>; logging: z.ZodDefault<z.ZodObject<{ progress_log: z.ZodDefault<z.ZodObject<{ destination: z.ZodDefault<z.ZodEnum<{ file: "file"; stderr: "stderr"; both: "both"; none: "none"; }>>; file: z.ZodOptional<z.ZodString>; naming: z.ZodDefault<z.ZodEnum<{ single: "single"; "per-invocation": "per-invocation"; daily: "daily"; }>>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>; declare const ProjectConfigSchema: z.ZodObject<{ dsl: z.ZodOptional<z.ZodString>; generated_dir: z.ZodOptional<z.ZodString>; bindings: z.ZodOptional<z.ZodArray<z.ZodString>>; active_guardrail_policy: z.ZodOptional<z.ZodString>; templates_dir: z.ZodOptional<z.ZodString>; plugins: z.ZodOptional<z.ZodArray<z.ZodString>>; recovery: z.ZodDefault<z.ZodObject<{ max_follow_ups: z.ZodDefault<z.ZodNumber>; max_retries: z.ZodDefault<z.ZodNumber>; }, z.core.$strip>>; model_mapping: z.ZodDefault<z.ZodObject<{ fast: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; standard: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; thinking: z.ZodOptional<z.ZodObject<{ adapter: z.ZodString; model: z.ZodOptional<z.ZodString>; }, z.core.$strip>>; }, z.core.$strip>>; logging: z.ZodDefault<z.ZodObject<{ progress_log: z.ZodDefault<z.ZodObject<{ destination: z.ZodDefault<z.ZodEnum<{ file: "file"; stderr: "stderr"; both: "both"; none: "none"; }>>; file: z.ZodOptional<z.ZodString>; naming: z.ZodDefault<z.ZodEnum<{ single: "single"; "per-invocation": "per-invocation"; daily: "daily"; }>>; }, z.core.$strip>>; }, z.core.$strip>>; cli: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ dsl: z.ZodOptional<z.ZodString>; generated_dir: z.ZodOptional<z.ZodString>; plugins: z.ZodOptional<z.ZodArray<z.ZodString>>; bindings: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strict>>>; }, z.core.$strip>; type ProjectConfig = z.infer<typeof ProjectConfigSchema>; interface ResolvedProgressLog { destination: "stderr" | "file" | "both" | "none"; file: string | undefined; naming: "single" | "per-invocation" | "daily"; } interface ResolvedConfig extends RuntimeConfig { configDir: string; dslPath: string; generatedDir: string; bindingPaths: string[]; templatesDir: string | undefined; pluginPaths: string[]; resolvedLogging: { progressLog: ResolvedProgressLog; }; } declare function loadConfig(configPath: string): Promise<ResolvedConfig>; declare function loadProjectConfig(configPath: string, cliName?: string): Promise<ResolvedConfig>; /** * Generator — orchestrates DSL-to-TypeScript code generation */ interface GenerateOptions { clean?: boolean; check?: boolean; templates?: string; configPath?: string; } interface GenerateResult { files_generated: string[]; dsl_hash: string; generation_input_hash: string; cleaned: boolean; check_mode: boolean; has_differences: boolean; } declare function generate(options?: GenerateOptions): Promise<GenerateResult>; declare function checkFreshness(configPath?: string): Promise<boolean>; export { DEFAULT_CONFIG_PATH, type GenerateOptions, type GenerateResult, type ProjectConfig, ProjectConfigSchema, type ResolvedConfig, checkFreshness, generate, loadConfig, loadProjectConfig };