/*
 * 文件定位：agentCore framework 公共入口。
 * 核心目的：为普通开发者暴露稳定的 Agent authoring、manifest compile 和 runtime kernel API。
 * 边界：不把 runtime.* 深层实现文件作为普通 public API。
 */
import { PromptPack, PraxisAgent, PraxisAgentArchetype, append, compileAgent, endpoint, harness, inspectAgentManifest, loop, mainLoop, markdown, markdownFile, model, modelFleet, overwrite, policy, prepend, replaceLastLines, sandbox, session, statePlane, storage, tool, toolPolicies, tools, validateAgentManifest, } from "./agent_runtimeImplementation/runtimeAgentManifest.js";
import { createSandboxRuntimeProvider, prepareSandboxRuntime, sandboxRuntimeProviderDescriptor, } from "./agent_runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
import { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope, } from "./agent_interfaceAdapter/interfaceEnvelope.js";
import { createInterfaceAdapterRuntime, } from "./agent_runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
import { bindBasicInterfaceLayer, } from "./agent_runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
import { applyRaxStorageInitPlan, createAndApplyStoragePlaneRuntime, createRaxStorageLayout, createStoragePlaneRuntime, planRaxStorageInit, resolveRaxHome, resolveRaxWorkspace, } from "./agent_runtimeImplementation/runtime.storagePlane/storagePlaneRuntime.js";
import { PraxisRuntimeKernel, createPraxisRuntimeKernel, } from "./agent_runtimeImplementation/praxisRuntimeKernel.js";
import { createInMemorySessionStateEventStore, } from "./agent_runtimeImplementation/runtimeSessionStateEventStore.js";
import { createFrameworkInspectionReport, } from "./agent_runtimeImplementation/runtime.inspection/frameworkInspectionReport.js";
import { baseToolDeveloperCatalogDescriptor, baseTools, listBaseToolDeveloperCatalog, toolSets, tryBaseToolById, } from "./agent_runtimeImplementation/runtime.execEngine/baseToolDeveloperCatalog.js";
import { baseToolRealityLedgerDescriptor, createBaseToolRealityLedger, inspectBaseToolReality, snapshotBaseToolRealityLedger, } from "./agent_runtimeImplementation/runtime.execEngine/baseToolRealityLedger.js";
import { adjudicateRuntimeDecision, createLoopTick, createMainLoopCheckpoint, createMainLoopRun, createMainLoopSessionTimeline, createMainLoopStepRecord, createMainLoopTimelineRef, createUserTurn, decideMainLoopFinalAcceptance, exposeMainLoopState, planFrameworkMainLoopHandoff, prepareMainLoopTurn, resolveMainLoopFailureRecovery, resolveMainLoopBudget, runMainLoop, selectMainLoopModel, } from "./agent_executionEngine/coreLogic/mainLoop.js";
import { interpretModelDecision, } from "./agent_executionEngine/coreLogic/modelDecision.js";
import { assemblePromptPack, } from "./agent_executionEngine/promptPack/promptAssembler.js";
import { createFallbackMemoryRef, createObservationMaterial, } from "./agent_executionEngine/coreLogic/observationIntegrator.js";
export { PromptPack, PraxisAgent, PraxisAgentArchetype, STATE_PLANE_STANDARD_CONTROLS, append, compileAgent, endpoint, harness, inspectAgentManifest, loop, mainLoop, markdown, markdownFile, model, modelFleet, overwrite, policy, prepend, replaceLastLines, sandbox, session, statePlane, storage, tool, toolPolicies, tools, validateAgentManifest, } from "./agent_runtimeImplementation/runtimeAgentManifest.js";
export { adjudicateRuntimeDecision, analyzeMainLoopCacheHealth, createLoopTick, createMainLoopApprovalEnvelope, createMainLoopBehaviorRegistry, createMainLoopCancelToken, createMainLoopCheckpoint, createMainLoopControlAction, createMainLoopRun, createMainLoopRollbackPoint, createMainLoopSessionTimeline, createMainLoopStepRecord, createMainLoopTimelineRef, createUserTurn, decideMainLoopFinalAcceptance, exposeMainLoopState, planFrameworkMainLoopHandoff, prepareMainLoopTurn, replayMainLoopStep, replayMainLoopTick, replayUserTurn, resolveMainLoopApproval, resolveMainLoopBehaviorRef, resolveMainLoopFailureRecovery, resolveMainLoopBudget, resolveMainLoopBudgetExhaustion, resolveMainLoopContinuation, resolveMainLoopToolChoice, runMainLoop, selectMainLoopModel, DEFAULT_MAIN_LOOP_BUDGET, DEFAULT_MAIN_LOOP_FAILURE_RECOVERY_POLICY, MAIN_LOOP_CONTROL_PRIMITIVES, } from "./agent_executionEngine/coreLogic/mainLoop.js";
export { interpretModelDecision, } from "./agent_executionEngine/coreLogic/modelDecision.js";
export { DEFAULT_OBSERVATION_COMPRESSION_POLICY, DEFAULT_OBSERVATION_SUMMARY_DELEGATION_POLICY, DEFAULT_SUMMARY_AGENT_REF, DEFAULT_TOOL_RESULT_SIZE_POLICY, createFallbackMemoryRef, createObservationMaterial, } from "./agent_executionEngine/coreLogic/observationIntegrator.js";
export { createEphemeralProcedureExecutionState, normalizeEphemeralProcedurePlan, } from "./agent_executionEngine/coreLogic/ephemeralProcedure.js";
export { assemblePromptPack, } from "./agent_executionEngine/promptPack/promptAssembler.js";
export { PROMPT_PACK_PROVIDER_VISIBLE_SEGMENT_KINDS, PROMPT_PACK_SEGMENT_KINDS, inferPromptPackSegmentKind, } from "./agent_executionEngine/promptPack/promptDefiner.js";
export { createSandboxRuntimeProvider, prepareSandboxRuntime, sandboxRuntimeProviderDescriptor, } from "./agent_runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
export { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope, } from "./agent_interfaceAdapter/interfaceEnvelope.js";
export { bindBasicInterfaceLayer, } from "./agent_runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
export { createInterfaceAdapterRuntime, } from "./agent_runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
export { applyRaxStorageInitPlan, createAndApplyStoragePlaneRuntime, createRaxStorageLayout, createStoragePlaneRuntime, planRaxStorageInit, resolveRaxHome, resolveRaxWorkspace, } from "./agent_runtimeImplementation/runtime.storagePlane/storagePlaneRuntime.js";
export { PraxisRuntimeKernel, createPraxisRuntimeKernel, } from "./agent_runtimeImplementation/praxisRuntimeKernel.js";
export { createInMemorySessionStateEventStore, } from "./agent_runtimeImplementation/runtimeSessionStateEventStore.js";
export { bindRaxodeRoleModel, createRaxodeModelEntry, createRaxodeProviderProfile, createRaxodeSecret, maskRaxodeSecret, resolveRaxodeProviderRequestUrl, } from "./agent_modelAdapter/authProfileLayer/providerConfiguration.js";
export { createFrameworkInspectionReport, } from "./agent_runtimeImplementation/runtime.inspection/frameworkInspectionReport.js";
export { baseToolDeveloperCatalogDescriptor, baseTools, listBaseToolDeveloperCatalog, toolSets, tryBaseToolById, } from "./agent_runtimeImplementation/runtime.execEngine/baseToolDeveloperCatalog.js";
export { baseToolRealityLedgerDescriptor, createBaseToolRealityLedger, inspectBaseToolReality, snapshotBaseToolRealityLedger, } from "./agent_runtimeImplementation/runtime.execEngine/baseToolRealityLedger.js";
export { createProviderToolMappings, createPraxisToolDeclarations, lowerPraxisToolsForProvider, lowerProviderToolResult, normalizeProviderInputSchema, providerToolName, raiseProviderToolCalls, } from "./agent_modelAdapter/bridgingLayer/toolSchemaCompatibilityLayer.js";
/**
 * Recommended developer authoring boxes.
 *
 * 白话：细粒度导出还保留；这些对象只是给普通开发者一个更像 framework 的入口，
 * 不用在一个 Agent 文件顶部 import 三十多个零件。
 */
export const authoringPrimitives = Object.freeze({
    PromptPack,
    PraxisAgent,
    PraxisAgentArchetype,
    compileAgent,
    inspectAgentManifest,
    validateAgentManifest,
});
export const promptPack = Object.freeze({
    PromptPack,
    append,
    markdown,
    markdownFile,
    overwrite,
    prepend,
    replaceLastLines,
});
export const modelAuthoring = Object.freeze({
    endpoint,
    model,
    modelFleet,
});
export const harnessRuntimePolicy = Object.freeze({
    harness,
    loop,
    mainLoop,
    policy,
    sandbox,
    session,
    statePlane,
    storage,
});
export const baseTool = Object.freeze({
    baseTools,
    tool,
    tools,
    toolPolicies,
    toolSets,
    tryBaseToolById,
    listBaseToolDeveloperCatalog,
    baseToolDeveloperCatalogDescriptor,
});
export const runtimeKernel = Object.freeze({
    PraxisRuntimeKernel,
    createPraxisRuntimeKernel,
    createInMemorySessionStateEventStore,
});
export const executionCore = Object.freeze({
    adjudicateRuntimeDecision,
    assemblePromptPack,
    createLoopTick,
    createMainLoopCheckpoint,
    createMainLoopRun,
    createMainLoopSessionTimeline,
    createMainLoopStepRecord,
    createMainLoopTimelineRef,
    createUserTurn,
    decideMainLoopFinalAcceptance,
    exposeMainLoopState,
    interpretModelDecision,
    planFrameworkMainLoopHandoff,
    prepareMainLoopTurn,
    resolveMainLoopFailureRecovery,
    resolveMainLoopBudget,
    runMainLoop,
    selectMainLoopModel,
    createFallbackMemoryRef,
    createObservationMaterial,
});
export const inspection = Object.freeze({
    createFrameworkInspectionReport,
    createBaseToolRealityLedger,
    inspectBaseToolReality,
    snapshotBaseToolRealityLedger,
    baseToolRealityLedgerDescriptor,
});
export const storagePlane = Object.freeze({
    applyRaxStorageInitPlan,
    createAndApplyStoragePlaneRuntime,
    createRaxStorageLayout,
    createStoragePlaneRuntime,
    planRaxStorageInit,
    resolveRaxHome,
    resolveRaxWorkspace,
});
export const sandboxPlane = Object.freeze({
    createSandboxRuntimeProvider,
    prepareSandboxRuntime,
    sandboxRuntimeProviderDescriptor,
});
export const interfaceAdapter = Object.freeze({
    approvalInterfaceEnvelope,
    bindBasicInterfaceLayer,
    createInterfaceEnvelope,
    createInterfaceAdapterRuntime,
    eventInterfaceEnvelope,
    managementInterfaceEnvelope,
    repairInterfaceEnvelope,
    stateInterfaceEnvelope,
});
/**
 * One-object authoring facade.
 *
 * 白话：这是最省心的开发者入口。用户可以只写：
 *
 * ```ts
 * import { praxis } from "@praxis-ai/praxis";
 * ```
 *
 * 然后用 `praxis.AgentArchetype`、`praxis.prompt.append`、
 * `praxis.model(...)`、`praxis.baseTools.code.read()` 来定义 Agent。
 */
export const praxis = Object.freeze({
    Agent: PraxisAgent,
    AgentArchetype: PraxisAgentArchetype,
    PraxisAgent,
    PraxisAgentArchetype,
    PromptPack,
    compileAgent,
    inspectAgentManifest,
    validateAgentManifest,
    prompt: promptPack,
    append,
    markdown,
    markdownFile,
    overwrite,
    prepend,
    replaceLastLines,
    endpoint,
    model,
    modelFleet,
    harness,
    loop,
    mainLoop,
    policy,
    sandbox,
    session,
    statePlane,
    storage,
    baseTools,
    tool,
    tools,
    toolPolicies,
    toolSets,
    tryBaseToolById,
    listBaseToolDeveloperCatalog,
    runtime: runtimeKernel,
    execution: executionCore,
    inspection,
    storagePlane,
    sandboxPlane,
    interfaceAdapter,
});
export default praxis;
