import type { AgentResponder } from "@mono-agent/agent-contracts"; import { type MonoAgentConfig, type MonoAgentConfigJson } from "@mono-agent/config"; import type { AgentHarnessRuntimeOptionsExtension, AgentHarnessRuntimeOptionsInput } from "@mono-agent/agent-harness"; import type { ConfigurationProposalCard, ConfigurationProposalResult, TuiConfigurationController } from "@mono-agent/tui"; import type { BackgroundSnapshot } from "./background-snapshot.js"; import { type AgentConfigurationProposal, type JsonPatchOperation } from "./configuration-proposal-tool.js"; export declare const LOCAL_CONFIGURATION_PROMPT = "Begin the dedicated self-configuration session. This is not ordinary chat. Read the mono-agent-configure skill. In the first assistant message, identify the session as SELF-CONFIG and show one compact, user-led map of every capability area: identity and knowledge; runtime and models; skills, tools, MCP servers, and plugins; memory; channels, APIs, and A2A; automation and proactive work; security, sandboxing, and secrets; observability and operations; and acceptance criteria. Explain that the conversation can build a workflow from trigger \u2192 context/data \u2192 tools/actions \u2192 delivery \u2192 memory \u2192 safety/operations \u2192 success checks. State that secrets must never be entered, every file change requires a separate host-owned approval, and approval, rejection, done, or no changes keeps SELF-CONFIG active. Only /quit, /exit, or ctrl+c twice exits this session; quitting never sends a background stop request. Invite the operator to choose an area or describe the workflow they want, using one concise question. Do not repeat the setup wizard and do not overwhelm the operator with a questionnaire. The session may use multiple turns: ask one focused question at a time, and record one minimal coherent proposal with ProposeAgentConfiguration only when enough information is available. It is valid to explain or ask the next question without proposing a change. Never execute ordinary tasks with configuration authority or claim a proposal was applied; the local host validates proposals and asks for separate approval."; export declare const LOCAL_CONFIGURATION_OPERATOR_PROMPT = "Continue the dedicated SELF-CONFIG conversation. The capability map and opening invitation were already shown: do not repeat them. Apply the mono-agent-configure skill instructions already in this conversation, loading them with ReadSkill only if they are absent, and use the existing conversation plus any host outcome below. Help the operator shape a usable workflow across trigger \u2192 context/data \u2192 tools/actions \u2192 delivery \u2192 memory \u2192 safety/operations \u2192 success checks. Take one conversational step: ask at most one focused question, explain the relevant supported or guided path, or, when the request is decision-complete, record one minimal coherent proposal with ProposeAgentConfiguration. A turn without a proposal is expected while exploring. After a host-applied or rejected proposal, continue with the next relevant area instead of handing off to ordinary chat. Never ask for secrets, execute an ordinary task with configuration authority, or claim a proposal was applied."; export interface ConfigurationBackgroundConnection { readonly baseUrl: string; readonly apiKey?: string; } export type ConfigurationBackgroundRestartResult = { readonly ok: true; readonly connection: ConfigurationBackgroundConnection; } | { readonly ok: false; readonly message: string; }; export type RestartConfigurationBackground = (expectedSnapshot: BackgroundSnapshot) => Promise; interface AppliedConfigurationChange { readonly changeId: string; readonly rollbackDir: string; readonly snapshot: BackgroundSnapshot; rollback(): Promise; } export interface LocalConfigurationSession { readonly responder: AgentResponder; readonly title: string; dispose(): Promise; } export interface CreateLocalConfigurationSessionOptions { readonly cwd: string; readonly configPath: string; readonly env: Record; readonly configure?: boolean; readonly envFile?: string; /** Deterministic transaction-race seam for regression tests. */ readonly beforeSnapshotCapture?: (phase: "apply" | "rollback") => void | Promise; } export interface CreateRemoteConfigurationSessionOptions extends CreateLocalConfigurationSessionOptions { readonly restartBackground: RestartConfigurationBackground; /** Deterministic failure seam for capability-rotation regression tests. */ readonly beforeRotateAttempt?: () => void | Promise; } export interface RemoteConfigurationSession { readonly configuration: TuiConfigurationController; dispose(): Promise; } /** Build a current-folder responder for ordinary embedded chat only. */ export declare function createLocalConfigurationSession(options: CreateLocalConfigurationSessionOptions): Promise; /** * Create the local host controller for a remote configuration conversation. * The daemon only proposes; this process validates, confirms, writes, restarts, * proves readiness, and rolls back on failure. */ export declare function createRemoteConfigurationSession(options: CreateRemoteConfigurationSessionOptions): Promise; export interface ConfigurationRuntimeExtensionOptions { readonly cwd: string; /** Canonical mutable path used only to authenticate this agent folder/capability root. */ readonly configPath: string; /** Immutable worker copy used for route classification and proposal base version. */ readonly configReadPath?: string; readonly env: Record; } /** Install proposal-only authority on explicitly capability-marked TUI requests. */ export declare function createLocalConfigurationRuntimeExtension(options: ConfigurationRuntimeExtensionOptions): (input: AgentHarnessRuntimeOptionsInput) => Promise; export declare class LocalConfigurationManager { private readonly options; private readonly proposalRoot; readonly currentConfig: MonoAgentConfig; readonly roleLocation: string; private readonly prepared; private readonly cleanupPaths; private currentSessionId; private currentSessionDir; private disabledReason; private constructor(); get sessionId(): string; static create(options: CreateLocalConfigurationSessionOptions): Promise; /** Revoke the completed attempt's opaque filesystem capability before issuing the next one. */ rotateAttempt(): Promise; /** Poison the public capability id and best-effort remove every owned attempt path. */ disableConfigurationAttempts(error: unknown): Promise; private assertAttemptsEnabled; takeProposal(): Promise; reject(id: string): Promise; prepareProposal(proposal: AgentConfigurationProposal): Promise; private prepare; apply(id: string): Promise; private applyPrepared; private captureCommittedSnapshot; private validateCandidate; dispose(): Promise; } export declare function isLocalConfigurationRequest(metadata: Record | undefined): boolean; export declare function applyJsonPatch(input: MonoAgentConfigJson, operations: readonly JsonPatchOperation[]): MonoAgentConfigJson; export {}; //# sourceMappingURL=local-configuration.d.ts.map