///|
// Public type re-exports. Canonical kernel types are the single protocol, and
// they keep unqualified names (`Message`, `Content`, ...) so ext authors never
// see a "Canonical" prefix — one system, one protocol.
///|
/// Stable metadata key for Agent-derived automatic session titles. Product
/// UIs and SessionPort adapters may read this without inspecting transcript
/// roles or extension-specific injected messages.
pub const SESSION_TITLE_METADATA_KEY : String = @types.SESSION_TITLE_METADATA_KEY
///|
pub using @types {
type ChatOptions,
type StreamMode,
type StreamChunk,
type StreamAccumulator,
type Session,
type TurnEvent,
type ToolCatalogChange,
type ToolCatalogChangedPayload,
type TurnResult,
type EventScope,
}
///|
// Core port traits.
pub using @port {
trait ModelPort,
trait DecisionPort,
trait LogPort,
trait ToolProvider,
trait SessionPort,
trait Observer,
trait PipelineHook,
trait MemoryPort,
trait Lifecycle,
trait CommandPort,
trait UiPort,
trait SystemPromptContributor,
trait ToolCancellable,
// Self-reporting manifest protocol.
trait Extension,
// Port-related enums.
type CommandOutcome,
type CommandType,
type CommandParam,
type HookAbort,
type ParamType,
type HookStage,
type ToolDecision,
type DecisionQuestion,
type DecisionAnswer,
type LogLevel,
type LogDurability,
type UiHint,
type UiSlot,
type UiBody,
type UiRequest,
type UiResponse,
// Port-related structs.
type ToolCallContext,
type DecisionOption,
type DecisionRequest,
type DecisionNamedProbability,
type DecisionUsage,
type DecisionResult,
type DecisionFailureMode,
type DecisionScope,
type DecisionCallContext,
type LogRecord,
type CommandDef,
type AutocompleteItem,
type AutocompleteSource,
type UiDescriptor,
type UiRender,
type UiEntry,
type ExtensionManifest,
type ProviderConfig,
type SessionCheckpoint,
// Consumption direction: declared capability requirements and the curated
// composed-capability view delivered at Lifecycle::on_compose.
type Capability,
type CompositionView,
type TaskMode,
type TaskSpec,
type TaskReceipt,
type TaskStatus,
type TaskOutcome,
type TaskSubmitError,
type TaskHandle,
type Tasks,
type WakeupPort,
type WakeupTicket,
type WakeupError,
type ToolContributions,
type ToolContributionCommit,
type ToolContributionError,
type ToolContributionState,
type ToolWithdrawMode,
type ToolRetire,
}
///|
pub using @error {
type AgentError,
type ModelError,
type DecisionError,
type LogError,
type RateLimitInfo,
type RuntimeError,
type SessionError,
type CompositionError,
type CommandError,
type MemoryError,
type UiError,
}
///|
// Canonical domain types used by public extension ports. Catalogs, effects,
// HostRuntime, journals and Puppet remain internal to Posoco's Agent
// implementation and are intentionally not re-exported here.
pub using @kernel {
type Completion,
type CompletionPayload,
type Content,
type FinishReason,
type Message,
type ToolCall,
type ToolDef,
type ToolExposure,
type ToolOutcome,
type InvocationResult,
type NotExecutedReason,
type ModelFailure,
type ExecutionPolicy,
type OwnerId,
// Model-call + compact protocol used by ModelPort.
type ModelCallResult,
type CompactMode,
type CompactResult,
type CompactTrigger,
type ContextPressure,
// Identity newtypes.
type CallId,
type ToolName,
type Reasoning,
type Transcript,
type Usage,
// Invocation identity passed to model-side port calls (wire contract).
type InvocationScope,
type SessionId,
type RunId,
type TurnId,
}
///|
// Optional built-in utilities live in their own package. Keep the existing
// root API names as compatibility aliases for downstream users.
pub using @builtin {
type ToolRegistry,
type NoopLifecycle,
type SystemPromptHook,
type SystemPromptSection,
type UiRenderHook,
type NoopUiPort,
type CompositeUiPort,
parse_slash_args,
validate_args,
}