/** Public surface of the embedded-runtime package. */
import type { Api, Model, Transport } from '../ai/types.js';
import type { AgentConfiguration, EmbeddedAgentRuntime } from '../contracts/agent-api.js';
import { AgentExecuteCodeMode as AgentExecuteCodeModeValue, ExecuteCodeSurface as ExecuteCodeSurfaceValue } from '../contracts/agent-execute-code.js';
import type { AgentModelRegistry } from '../contracts/agent-model.js';
import type { HostToolRuntimeHandoff } from '../contracts/host-tool.js';
import type { AgentLoopEvent, StreamFn, ThinkingLevel, ToolDefinition } from '../core/index.js';
import type { PendingHostToolRequests } from '../core/pending-host-tool-requests.js';
import type { CompactionCompleteFn } from '../core/session/compaction/index.js';
import type { ErrorRecoverySleep } from '../core/session/session-error-recovery.js';
import type { RefreshContextParams } from './host-tools/refresh-context/index.js';
import type { ShortcutXLSessionWriter } from './session-store.js';
import type { EmbeddedErrorRecoverySettings } from './settings.js';
export { createAgentSnapshotFromAgentMessages } from '../core/agent-snapshot-builder.js';
export { assertSessionInvariants, buildSessionContextMessageEntryIds, canonicalizeUserMessageEntries, parseSessionEntriesStrict, repairOrphanToolUses, serializeFileEntries } from '../core/session-schema.js';
export type { CompactionEntry, FileEntry, LlmCallEntry, ModelChangeEntry, ParseSessionStrictResult, RepairOrphanToolUsesOptions, RepairOrphanToolUsesResult, SessionEntry, SessionHeader, SessionInvariantViolation, SessionMessageEntry, SessionParseError, SystemPromptEntry, ThinkingLevelChangeEntry, ToolDefinitionsEntry, TurnEndEntry, TurnStartEntry } from '../core/session-schema.js';
export { assistantMessageToShortcutXLInvokeResponse, createShortcutXLAiModelInvokeRequestFromParams, shortcutXLAiModelInvokeRequestToPayload } from './ai-invoke.js';
export { createShortcutXLAgentSettingsStore, createShortcutXLDefaultSessionContext } from './bootstrap.js';
export { buildHostEmbeddedAgentOptions, type BuildHostEmbeddedAgentOptionsInput, type BuildHostEmbeddedAgentOptionsResult } from './host-runtime-options.js';
export { detectEmbeddedReadOnlyViolations } from './host-tools/execute-code/index.js';
export { getHostToolTimeoutMs } from './host-tools/timeouts.js';
export { createShortcutProxyModelStreamTransport, createShortcutXLModelCallOrchestrator, runShortcutXLModelCallStreamRequest, type CreateShortcutXLModelCallOrchestratorOptions, type ShortcutXLModelCallOrchestrator, type ShortcutXLModelStreamTransport, type ShortcutXLModelUsageStatusLogger } from './model-call-orchestrator.js';
export { createShortcutXLAgentModel, createShortcutXLAgentModelRegistry, ShortcutXLAgentModelId, ShortcutXLAgentProviderId, type CreateShortcutXLAgentModelOptions, type CreateShortcutXLAgentModelRegistryOptions } from './model-registry.js';
export { buildShortcutXLAgentSystemPrompt, createShortcutXLAgentConfiguration, ShortcutXLPromptMode, type ShortcutXLPromptPlatform } from './prompt/build.js';
export { createRunStatsAccumulator, type CreateRunStatsAccumulatorOptions, type RunStatsAccumulator, type RunStatsEntry, type RunStatsModelUsage, type RunStatsSnapshot, type RunStatsTokenUsageByModel } from './run-stats.js';
export { EmbeddedSessionEntryBuilder, type AgentToolDefinitionSnapshot } from './session-entry-builder.js';
export { createShortcutXLAgentSessionStore, type CreateShortcutXLAgentSessionStoreOptions, type ShortcutXLAgentSessionArtifacts, type ShortcutXLAgentSessionStore, type ShortcutXLSessionWriter } from './session-store.js';
export { pushShortcutXLModelStreamEvent } from './stream-events.js';
export { buildShortcutRuntimeRequestBody, createShortcutXLModelStream, createShortcutXLModelStreamRequest, runShortcutXLModelStreamRequest, type CreateShortcutXLModelStreamRequestOptions, type RunShortcutXLModelStreamRequestOptions, type ShortcutRuntimeRequestBody, type ShortcutXLModelStreamHostOptions } from './stream.js';
export { createEmbeddedAgentPortClient, ShortcutXLModelStreamTraceKind, type CreateEmbeddedAgentPortClientOptions, type EmbeddedAgentPortClient, type ShortcutXLModelStreamBridgeMetrics, type ShortcutXLModelStreamRequestHandler, type ShortcutXLModelStreamTraceEntry, type ShortcutXLWorkerPort } from './worker-bridge/host-client.js';
export { AgentExecuteCodeModeValue as AgentExecuteCodeMode, ExecuteCodeSurfaceValue as ExecuteCodeSurface };
/** Host-provided knobs the runtime reads at boot and per turn. */
export interface EmbeddedAgentSettingsStore {
    getSteeringMode(): 'all' | 'one-at-a-time';
    getFollowUpMode(): 'all' | 'one-at-a-time';
    getTransport(): Transport;
    /** Embedded relies on provider-side fallback; cross-model fallback is intentionally not exposed. */
    getErrorRecoverySettings?(): EmbeddedErrorRecoverySettings;
}
export type { EmbeddedErrorRecoverySettings } from './settings.js';
export { EmbeddedAgentCreditGate, type CreditBalanceOutcome, type CreditGateDeps, type CreditGateUpdateOptions } from './credit-gate.js';
export type { EmbeddedAgentPerTurnOptions } from './per-turn-options.js';
export { fetchCreditBalance } from '../credits/shortcut-credits.js';
export { isOutOfCreditsError, OutOfCreditsError } from './out-of-credits-error.js';
export { INVOKE_LLM_KIND, type InvokeLlmDetails, type InvokeLlmKind, type InvokeLlmMessage, type InvokeLlmParams, type InvokeLlmRequest, type InvokeLlmToolCall, type InvokeLlmToolChoice, type InvokeLlmToolSchema } from './host-tools/invoke-llm/index.js';
export type { SuggestionsResult } from './suggestions.js';
export interface ComposeEmbeddedAgentRuntimeOptions {
    /**
     * Builds host-suite LLM tools, given the shared pending host-tool requests.
     * Returned tools default to host-owned lifecycle unless they set
     * `lifecycleSource` explicitly (e.g. in-process helper tools).
     */
    createHostTools?: (pendingHostToolRequests: PendingHostToolRequests, context: {
        applyRuntimeHandoff(handoff: HostToolRuntimeHandoff): void | Promise<void>;
        getAgentMode(): string;
        getCurrentModel(): Model<Api> | undefined;
        getSkipTools(): readonly string[] | undefined;
        getSpeed(): 'fast' | 'standard' | undefined;
        scheduleRefresh(params: RefreshContextParams): void;
    }) => readonly ToolDefinition[];
    /** Fires once per `agent_start`. Errors are caught and logged, never crash the agent. */
    onAgentStart?: () => void;
    initialConfiguration?: AgentConfiguration;
    model?: Model<Api>;
    modelRegistry: AgentModelRegistry;
    sessionStore: ShortcutXLSessionWriter;
    settingsStore: EmbeddedAgentSettingsStore;
    systemPrompt?: string;
    streamFn?: StreamFn;
    thinkingLevel?: ThinkingLevel;
    tools?: ToolDefinition[];
    /** Override for the summarizer LLM call. Tests stub this; production uses `completeSimple`. */
    compactionCompleteFn?: CompactionCompleteFn;
    /** Test hook for deterministic recovery integration tests. Production uses real timers. */
    recoverySleep?: ErrorRecoverySleep;
    /**
     * Optional runtime-side credit gate. It is read synchronously at submit time
     * and updated in the background after `agent_end`, so credit fetches never
     * sit on the model-stream critical path.
     */
    creditGate?: import('./credit-gate.js').EmbeddedAgentCreditGate;
}
export interface ComposeEmbeddedAgentRuntimeResult {
    runtime: EmbeddedAgentRuntime;
    /** Resolves when any in-flight auto-compaction settles. Tests await this for determinism. */
    whenCompactionIdle(): Promise<void>;
    /**
     * Forward a subagent's `AgentLoopEvent` into the parent's run-stats accumulator
     * so subagent assistant usage rolls up into `threadTokenUsage` and the per-run
     * entry. Hosts call this from their `emitChildAgentEvent` wrap.
     */
    recordChildAgentEvent(event: AgentLoopEvent): void;
}
/** Build a `EmbeddedAgentRuntime` for the embedded host. */
/** Build the embedded `EmbeddedAgentRuntime` from the provided composition options. */
export declare function composeEmbeddedAgentRuntime(options: ComposeEmbeddedAgentRuntimeOptions): Promise<ComposeEmbeddedAgentRuntimeResult>;
//# sourceMappingURL=index.d.ts.map