import type { AiModelSelection } from "./model-config.js"; export type GraphenixServerToolMode = "disabled" | "allowed" | "required"; export type GraphenixProviderRuntime = "gateway-default" | "openrouter"; export type GraphenixOpenRouterApiMode = "chat" | "responses" | "auto"; export type GraphenixServerToolInstructionMode = "none" | "minimal" | "strict"; export type GraphenixToolMetadataDestination = "response" | "execution" | "task" | "job"; export type GraphenixToolMetadataField = "serverTools" | "citations" | "generatedImages" | "patchProposals" | "openrouterRuntime"; export type GraphenixToolMetadataMergeMode = "replace" | "merge"; export interface GraphenixWebSearchUserLocation { type: "approximate"; city?: string; region?: string; country?: string; timezone?: string; } export type GraphenixWebSearchEngine = "auto" | "native" | "exa" | "firecrawl" | "parallel" | "perplexity"; export type GraphenixWebFetchEngine = "auto" | "native" | "exa" | "openrouter" | "firecrawl" | "parallel"; export type GraphenixServerToolOnFailure = "fail" | "warn" | "continue"; export type GraphenixWebSearchContextSize = "low" | "medium" | "high"; export interface GraphenixWebSearchToolConfig { mode: GraphenixServerToolMode; engine?: GraphenixWebSearchEngine; maxResults?: number; maxTotalResults?: number; searchContextSize?: GraphenixWebSearchContextSize; maxCharacters?: number; allowedDomains?: string[]; excludedDomains?: string[]; userLocation?: GraphenixWebSearchUserLocation; requireCitations?: boolean; onFailure?: GraphenixServerToolOnFailure; } export interface GraphenixWebFetchToolConfig { mode: GraphenixServerToolMode; engine?: GraphenixWebFetchEngine; maxUses?: number; maxContentTokens?: number; allowedDomains?: string[]; blockedDomains?: string[]; onFailure?: GraphenixServerToolOnFailure; } export interface GraphenixDatetimeToolConfig { mode: GraphenixServerToolMode; timezone?: string; } export interface GraphenixImageGenerationToolConfig { mode: GraphenixServerToolMode; model?: string; quality?: "low" | "medium" | "high" | string; size?: string; aspectRatio?: string; background?: string; outputFormat?: "png" | "jpeg" | "webp" | string; outputCompression?: number; moderation?: string; } export interface GraphenixApplyPatchToolConfig { mode: GraphenixServerToolMode; /** Graphenix plans must not request automatic file mutation. */ behavior?: "return_only"; allowCreate?: boolean; allowUpdate?: boolean; allowDelete?: boolean; workspaceRoot?: string; } export interface GraphenixReasoningConfig { effort?: "low" | "medium" | "high"; maxTokens?: number; } export interface GraphenixFusionToolConfig { mode: GraphenixServerToolMode; /** Planning-time model references for candidate analysis. */ analysisModelSelections?: AiModelSelection[]; /** Planning-time model reference for judging/merging. */ judgeModelSelection?: AiModelSelection; /** Optional escape hatch for already-concrete model IDs. */ analysisModels?: string[]; judgeModel?: string; maxToolCalls?: number; maxCompletionTokens?: number; temperature?: number; reasoning?: GraphenixReasoningConfig; } export interface GraphenixAdvisorToolConfig { mode: GraphenixServerToolMode; name?: string; purpose?: string; instructions?: string; /** Planning-time model reference (ai-profiles / profile-choice language). */ modelSelection?: AiModelSelection; /** Optional escape hatch for already-concrete model IDs. */ model?: string; tools?: GraphenixNestedServerTool[]; forwardTranscript?: boolean; stream?: boolean; maxToolCalls?: number; maxCompletionTokens?: number; temperature?: number; reasoning?: GraphenixReasoningConfig; } export interface GraphenixSubagentToolConfig { mode: GraphenixServerToolMode; name?: string; purpose?: string; instructions?: string; modelSelection?: AiModelSelection; model?: string; tools?: GraphenixNestedServerTool[]; maxToolCalls?: number; maxCompletionTokens?: number; temperature?: number; reasoning?: GraphenixReasoningConfig; } export type GraphenixNestedServerTool = { type: "webSearch"; config?: GraphenixWebSearchToolConfig; } | { type: "webFetch"; config?: GraphenixWebFetchToolConfig; } | { type: "datetime"; config?: GraphenixDatetimeToolConfig; }; export interface GraphenixServerToolsConfig { webSearch?: GraphenixWebSearchToolConfig; webFetch?: GraphenixWebFetchToolConfig; datetime?: GraphenixDatetimeToolConfig; imageGeneration?: GraphenixImageGenerationToolConfig; applyPatch?: GraphenixApplyPatchToolConfig; fusion?: GraphenixFusionToolConfig; advisor?: GraphenixAdvisorToolConfig | GraphenixAdvisorToolConfig[]; subagent?: GraphenixSubagentToolConfig; } export interface GraphenixOpenRouterRuntimeConfig { apiMode?: GraphenixOpenRouterApiMode; /** Forbidden on compiled plans — escape hatch for internal debugging only. */ rawOverrides?: Record; } export interface GraphenixToolMetadataOutputConfig { destination: GraphenixToolMetadataDestination; key?: string; mode?: GraphenixToolMetadataMergeMode; include?: GraphenixToolMetadataField[]; } export interface GraphenixLlmRuntimeOutputConfig { toolMetadata?: GraphenixToolMetadataOutputConfig; } /** * Optional LLM runtime extensions for a main skill invocation. * Not model selection — {@link AiModelSelection} on the unit remains model authority. */ export interface GraphenixLlmRuntimeConfig { /** Runtime provider capability family — not model selection. */ providerRuntime?: GraphenixProviderRuntime; serverTools?: GraphenixServerToolsConfig; openrouter?: GraphenixOpenRouterRuntimeConfig; /** Default: "none". */ serverToolInstructionMode?: GraphenixServerToolInstructionMode; output?: GraphenixLlmRuntimeOutputConfig; } export interface GraphenixServerToolUsageSummary { mode?: GraphenixServerToolMode; used?: boolean; callCount?: number; } export type GraphenixServerToolUsageMap = Partial>; /** Safe trace summaries for LLM runtime tool usage — no raw payloads. */ export interface GraphenixLlmRuntimeTraceMetadata { serverTools?: GraphenixServerToolUsageMap; citations?: { count: number; urls?: string[]; }; generatedImages?: { count: number; }; patchProposals?: { count: number; }; openrouterRuntime?: { apiMode?: "chat" | "responses"; warnings?: unknown[]; policyViolations?: unknown[]; }; } //# sourceMappingURL=llm-runtime.d.ts.map