import { f as AgentGoal, g as AgentState, O as Observation, h as AgentEnv, i as AgentError, j as AgentAction, B as BudgetConfigInput, k as AgentEvent, l as AgentPhase, m as AgentPackageManager, n as BanditState, o as AgentRedactionConfig, p as HostSignal, H as HostProfile, q as HostTransport, r as HostCapabilities, s as HostConstraints, t as HostIdentity, P as PermissionService, u as AgentPermissionConfig, v as ApprovalService, S as Shell, F as FileSystem, w as PatchService, x as LoadedAgentConfig, L as LLM, y as LLMRequest } from '../nodeWorkspaceDiscovery-Ami1UkMt.js'; export { z as AGENT_CONFIG_FILE_NAMES, C as AgentActionType, D as AgentBatchConfig, E as AgentBatchGoal, c as AgentConfig, G as AgentConfigApprovalMode, I as AgentConfigLLMProvider, J as AgentContextConfig, K as AgentEventSink, e as AgentLLMConfig, M as AgentLanguageConfig, A as AgentMode, N as AgentPackageManagerConfig, Q as AgentPatchQualityConfig, a as AgentPreset, R as AgentProjectConfig, b as AgentResponseLanguage, T as AgentRollbackConfig, U as AgentToolPolicyConfig, V as AgentToolPolicyOverride, W as AgentWorkspaceDiscoveryResult, X as ApprovalDefaultAnswer, Y as ApprovalRequest, Z as ApprovalResponse, _ as ApprovalRisk, $ as ExecResult, a0 as HostSignalSource, a1 as LLMPurpose, a2 as LLMResponse, a3 as PatchApplyPermissionConfig, a4 as PatchApplyResult, a5 as PermissionDecision, a6 as SearchMatch, a7 as ShellAskRule, a8 as ShellPermissionConfig, a9 as deepFreeze, d as discoverNodeWorkspaceRoot, aa as goalForAgentPreset, ab as isAgentConfigApprovalMode, ac as isAgentConfigLLMProvider, ad as isAgentConfigMode, ae as isAgentPreset } from '../nodeWorkspaceDiscovery-Ami1UkMt.js'; import { A as Async, b as Runtime, S as Scope } from '../effect-DbEMiMvv.js'; declare const initialAgentState: (goal: AgentGoal) => AgentState; declare const reduceAgentState: (state: AgentState, observation: Observation) => AgentState; declare const isTerminal: (state: AgentState) => boolean; declare const decideNextAction: (state: AgentState) => Async; declare const runAgent: (runtime: Runtime, goal: AgentGoal, configBudget?: BudgetConfigInput) => Async; declare const nowMillis: () => Async; declare const emitAgentEvent: (event: AgentEvent) => Async; declare const emitAgentEvents: (events: readonly AgentEvent[]) => Async; declare const summarizeAgentAction: (action: AgentAction) => string; declare const summarizeAgentObservation: (observation: Observation) => string; declare const observationStatus: (observation: Observation) => "ok" | "warn" | "fail"; declare const errorEventFor: (action: AgentAction, state: AgentState, error: AgentError, at: number) => AgentEvent | undefined; declare const observationEventFor: (state: AgentState, observation: Observation, at: number) => AgentEvent | undefined; declare const runStatusFor: (phase: AgentPhase) => "done" | "failed"; type ProjectCommand = readonly string[]; type ProjectCommandDiscovery = { readonly packageManager: AgentPackageManager; readonly validationCommands: readonly ProjectCommand[]; readonly source: "config" | "package-json" | "fallback"; readonly notes: readonly string[]; readonly profileSummary?: string; }; declare const PROJECT_LOCKFILE_PROBES: readonly ["pnpm-lock.yaml", "yarn.lock", "bun.lockb", "bun.lock", "package-lock.json", "npm-shrinkwrap.json"]; declare const parseProjectPackageJson: (state: AgentState) => Record | undefined; declare const nextProjectProbeAction: (state: AgentState) => AgentAction | undefined; declare const discoverPackageManager: (state: AgentState) => AgentPackageManager; declare const splitCommand: (value: string) => readonly string[]; declare const commandForScript: (packageManager: AgentPackageManager, scriptName: string) => ProjectCommand; declare const discoverValidationCommands: (state: AgentState) => ProjectCommandDiscovery; declare const nextUnrunValidationCommand: (commands: readonly ProjectCommand[], observations: readonly Observation[]) => ProjectCommand | undefined; declare const describeCommandDiscovery: (discovery: ProjectCommandDiscovery) => string; type AgentProjectStack = "node" | "rust" | "tauri" | "desktop" | "bridge" | "monorepo"; type AgentWorkspaceStyle = "single-package" | "monorepo" | "mixed" | "unknown"; type AgentProjectProfile = { readonly kind: "unknown" | "node" | "rust" | "tauri" | "mixed"; readonly packageManager: AgentPackageManager; readonly stacks: readonly AgentProjectStack[]; readonly workspaceStyle: AgentWorkspaceStyle; readonly markers: readonly string[]; readonly scripts: readonly string[]; readonly candidateValidationScripts: readonly string[]; readonly candidateValidationCommands: readonly string[]; readonly notes: readonly string[]; }; declare const PROJECT_PROFILE_PROBES: readonly ["Cargo.toml", "Cargo.lock", "src-tauri/tauri.conf.json", "src-tauri/Cargo.toml", "apps/desktop/package.json", "apps/desktop/src-tauri/tauri.conf.json", "apps/desktop/src-tauri/Cargo.toml", "bridges/whatsmeow-bridge/Cargo.toml", "bridges/whatsmeow-bridge/package.json", "apps", "packages", "bridges", "turbo.json", "nx.json", "pnpm-workspace.yaml"]; declare const projectProfileProbePending: (state: AgentState) => string | undefined; declare const discoverProjectProfile: (state: AgentState, packageManager: AgentPackageManager) => AgentProjectProfile; declare const describeProjectProfile: (profile: AgentProjectProfile) => string; type ContextDiscoverySummary = { readonly enabled: boolean; readonly searchedQueries: readonly string[]; readonly pendingQueries: readonly string[]; readonly discoveredPaths: readonly string[]; readonly readPaths: readonly string[]; readonly remainingFileBudget: number; }; declare const extractLikelyFilePaths: (state: AgentState) => readonly string[]; declare const deriveContextSearchQueries: (state: AgentState) => readonly string[]; declare const describeContextDiscovery: (state: AgentState) => string; declare const summarizeContextDiscovery: (state: AgentState) => ContextDiscoverySummary; declare const nextContextDiscoveryAction: (state: AgentState, banditState?: BanditState) => AgentAction | undefined; type PatchQualitySummary = { readonly enabled: boolean; readonly maxRepairAttempts: number; readonly repairAttemptsUsed: number; readonly repairsRemaining: number; readonly exactSuppliedPatch: boolean; }; declare const patchRepairAttemptsUsed: (state: AgentState) => number; declare const patchQualitySummary: (state: AgentState) => PatchQualitySummary; declare const canRequestPatchRepair: (state: AgentState) => boolean; type PatchValidationStatus = { readonly type: "not-run"; } | { readonly type: "pending"; readonly completed: number; readonly total: number; } | { readonly type: "passed" | "failed"; readonly results: readonly Extract[]; }; declare const patchValidationStatus: (commands: readonly ProjectCommand[], observationsAfterPatch: readonly Observation[]) => PatchValidationStatus; declare const describePatchQuality: (state: AgentState) => string; type AgentRollbackStrategy = "last" | "all"; type RollbackSafetySummary = { readonly enabled: boolean; readonly onFinalValidationFailure: boolean; readonly strategy: AgentRollbackStrategy; readonly maxRollbackDepth: number; readonly runValidationAfterRollback: boolean; readonly allowForSuppliedPatches: boolean; readonly rollbackCount: number; readonly appliedStackDepth: number; readonly exactSuppliedPatch: boolean; }; type AppliedPatchEntry = { readonly index: number; readonly patch: string; readonly changedFiles: readonly string[]; }; declare const rollbackSafetySummary: (state: AgentState) => RollbackSafetySummary; declare const unappliedPatchStack: (state: AgentState) => readonly AppliedPatchEntry[]; declare const latestUnappliedPatch: (state: AgentState) => AppliedPatchEntry | undefined; declare const canAutoRollback: (state: AgentState) => boolean; declare const shouldContinueRollbackStack: (state: AgentState) => boolean; type WorkspaceValidationStatus = { readonly type: "not-run"; } | { readonly type: "pending"; readonly completed: number; readonly total: number; } | { readonly type: "passed" | "failed"; readonly results: readonly Extract[]; }; declare const workspaceValidationStatus: (commands: readonly ProjectCommand[], observationsAfterWorkspaceChange: readonly Observation[]) => WorkspaceValidationStatus; declare const describeRollbackSafety: (state: AgentState) => string; declare const isRedactionEnabled: (config: AgentRedactionConfig | undefined) => boolean; declare const redactText: (value: string, config?: AgentRedactionConfig) => string; declare const inferUserLanguage: (text: string) => string | undefined; declare const responseLanguageName: (goal: AgentGoal) => string | undefined; declare const describeLanguagePolicy: (goal: AgentGoal) => string; declare const spanishLike: (goal: AgentGoal) => boolean; type HostSignalInput = { readonly argv: readonly string[]; readonly env: Readonly>; readonly stdoutIsTTY: boolean; readonly stdinIsTTY: boolean; readonly ttyColumns: number | undefined; readonly parentProcessName: string | undefined; readonly workspaceMarkers: readonly string[]; readonly stdinFirstLine: string | undefined; readonly configPaths: readonly string[]; }; /** * Collects host signals from the provided input in fixed source category order. * * Each source is collected independently with try/catch — if a source fails, * it is omitted from the result. Returns an empty array if all sources are * unavailable (never throws). */ declare const collectHostSignals: (input: HostSignalInput) => readonly HostSignal[]; /** * Known CI environment variable indicators. * Presence of any of these keys in the environment signals a CI transport. */ declare const CI_INDICATORS: readonly ["CI", "GITHUB_ACTIONS", "JENKINS_URL", "CIRCLECI", "TRAVIS", "GITLAB_CI", "BUILDKITE", "TF_BUILD"]; /** * Infers the communication transport from collected signals. * Priority order: mcp > extension > ci > terminal > stdio > unknown. * Returns "unknown" when no signals match any known pattern. */ declare const inferTransport: (signals: readonly HostSignal[]) => HostTransport; /** * Infers host capabilities from collected signals and resolved transport. * All fields default to false when no signal triggers them. */ declare const inferCapabilities: (signals: readonly HostSignal[], transport: HostTransport) => HostCapabilities; /** * Infers behavioral constraints from capabilities and transport. * All fields default to false when their inference rules do not match. */ declare const inferConstraints: (capabilities: HostCapabilities, transport: HostTransport) => HostConstraints; /** * Infers optional host identity from collected signals. * Returns undefined when no pattern matches. * When multiple patterns match, selects the one with highest confidence. * Confidence is rounded to 2 decimal places. */ declare const inferOptionalIdentity: (signals: readonly HostSignal[]) => HostIdentity | undefined; /** * Builds a complete HostProfile from raw signal input. * Composes all inference stages and applies deepFreeze to the result. * Pure function — no shared mutable state. */ declare const buildHostProfile: (input: HostSignalInput) => HostProfile; declare const makeConfiguredPermissions: (config?: AgentPermissionConfig) => PermissionService; declare const defaultPermissions: PermissionService; declare const autoApproveApprovals: ApprovalService; declare const makeAutoDenyApprovals: (reason?: string) => ApprovalService; declare const invokeAction: (action: AgentAction, state: AgentState, scope: Scope) => Async; declare const retry: (make: () => Async, options: { readonly times: number; readonly while: (error: E) => boolean; }) => Async; declare const sleep: (ms: number) => Async; declare const timeout: (effect: Async, ms: number, scope: Scope) => Async; declare const extractUnifiedDiff: (content: string) => string | undefined; declare const extractPatchPaths: (patch: string) => readonly string[]; declare const NodeShell: Shell; declare const makeNodeFileSystem: (shell: Shell) => FileSystem; declare const makeNodePatchService: (shell: Shell) => PatchService; declare const loadNodeAgentConfig: (options: { readonly cwd: string; readonly configPath?: string; readonly noConfig?: boolean; }) => Promise; declare const makeOpenAICompatibleLLM: (config: { readonly endpoint: string; readonly apiKey: string; readonly model: string; }) => LLM; type GoogleGenerativeAIConfig = { /** API key for the Gemini API / Generative Language API. */ readonly apiKey: string; /** Model id, with or without the `models/` prefix. Example: `gemini-2.5-flash`. */ readonly model?: string; /** API version segment. Defaults to `v1beta` for broad Gemini feature coverage. */ readonly apiVersion?: "v1" | "v1beta" | string; /** Base URL for the Generative Language API. Useful for tests/proxies. */ readonly baseUrl?: string; /** Full generateContent endpoint override. If provided, baseUrl/apiVersion/model are ignored. */ readonly endpoint?: string; /** Optional developer instruction. Gemini currently supports text system instructions. */ readonly systemInstruction?: string; /** Optional generation config passthroughs. */ readonly temperature?: number; readonly topP?: number; readonly topK?: number; readonly maxOutputTokens?: number; readonly stopSequences?: readonly string[]; readonly responseMimeType?: string; /** Escape hatch for newer Gemini generationConfig fields without changing this adapter. */ readonly extraGenerationConfig?: Record; }; declare const makeGoogleGenerativeAILLM: (config: GoogleGenerativeAIConfig) => LLM; type FakeLLMOptions = { readonly content?: string | ((request: LLMRequest) => string); }; declare const makeFakeLLM: (options?: FakeLLMOptions) => LLM; export { AgentAction, AgentEnv, AgentError, AgentEvent, AgentGoal, AgentPackageManager, AgentPermissionConfig, AgentPhase, type AgentProjectProfile, type AgentProjectStack, AgentRedactionConfig, type AgentRollbackStrategy, AgentState, type AgentWorkspaceStyle, type AppliedPatchEntry, ApprovalService, CI_INDICATORS, type ContextDiscoverySummary, type FakeLLMOptions, FileSystem, type GoogleGenerativeAIConfig, HostCapabilities, HostConstraints, HostIdentity, HostProfile, HostSignal, type HostSignalInput, HostTransport, LLM, LLMRequest, LoadedAgentConfig, NodeShell, Observation, PROJECT_LOCKFILE_PROBES, PROJECT_PROFILE_PROBES, type PatchQualitySummary, PatchService, type PatchValidationStatus, PermissionService, type ProjectCommand, type ProjectCommandDiscovery, type RollbackSafetySummary, Shell, type WorkspaceValidationStatus, autoApproveApprovals, buildHostProfile, canAutoRollback, canRequestPatchRepair, collectHostSignals, commandForScript, decideNextAction, defaultPermissions, deriveContextSearchQueries, describeCommandDiscovery, describeContextDiscovery, describeLanguagePolicy, describePatchQuality, describeProjectProfile, describeRollbackSafety, discoverPackageManager, discoverProjectProfile, discoverValidationCommands, emitAgentEvent, emitAgentEvents, errorEventFor, extractLikelyFilePaths, extractPatchPaths, extractUnifiedDiff, inferCapabilities, inferConstraints, inferOptionalIdentity, inferTransport, inferUserLanguage, initialAgentState, invokeAction, isRedactionEnabled, isTerminal, latestUnappliedPatch, loadNodeAgentConfig, makeAutoDenyApprovals, makeConfiguredPermissions, makeFakeLLM, makeGoogleGenerativeAILLM, makeNodeFileSystem, makeNodePatchService, makeOpenAICompatibleLLM, nextContextDiscoveryAction, nextProjectProbeAction, nextUnrunValidationCommand, nowMillis, observationEventFor, observationStatus, parseProjectPackageJson, patchQualitySummary, patchRepairAttemptsUsed, patchValidationStatus, projectProfileProbePending, redactText, reduceAgentState, responseLanguageName, retry, rollbackSafetySummary, runAgent, runStatusFor, shouldContinueRollbackStack, sleep, spanishLike, splitCommand, summarizeAgentAction, summarizeAgentObservation, summarizeContextDiscovery, timeout, unappliedPatchStack, workspaceValidationStatus };