import type { ChatType } from "../../channels/chat-type.js";
import type { FasedAgentConfig } from "../../config/config.js";
import { type GatewaySessionRow, type GatewaySessionsDefaults } from "../../gateway/session-utils.js";
/**
 * Sanitized session metadata returned to permissioned plugins.
 *
 * This type is intentionally metadata-only. It does not include transcript
 * bodies, message previews, session file paths, raw origin/delivery targets,
 * account ids, or compaction summaries.
 */
export type PluginRuntimeSessionStatus = {
    key: string;
    kind: GatewaySessionRow["kind"];
    label?: string;
    displayName?: string;
    channel?: string;
    subject?: string;
    groupChannel?: string;
    space?: string;
    chatType?: ChatType;
    updatedAt: number | null;
    systemSent?: boolean;
    abortedLastRun?: boolean;
    thinkingLevel?: string;
    verboseLevel?: string;
    reasoningLevel?: string;
    elevatedLevel?: string;
    sendPolicy?: "allow" | "deny";
    inputTokens?: number;
    outputTokens?: number;
    totalTokens?: number;
    totalTokensFresh?: boolean;
    responseUsage?: "on" | "off" | "tokens" | "full";
    modelProvider?: string;
    model?: string;
    contextTokens?: number;
    compactionCheckpointCount?: number;
    lastChannel?: GatewaySessionRow["lastChannel"];
};
/**
 * Filters for `runtime.helpers.sessions.list()`.
 */
export type PluginRuntimeSessionListParams = {
    agentId?: string;
    activeMinutes?: number;
    includeGlobal?: boolean;
    includeUnknown?: boolean;
    limit?: number;
};
/**
 * Result returned by `runtime.helpers.sessions.list()`.
 */
export type PluginRuntimeSessionListResult = {
    ts: number;
    count: number;
    defaults: GatewaySessionsDefaults;
    sessions: PluginRuntimeSessionStatus[];
};
/**
 * Lookup parameters for `runtime.helpers.sessions.get()`.
 */
export type PluginRuntimeSessionGetParams = {
    key: string;
    agentId?: string;
    includeGlobal?: boolean;
    includeUnknown?: boolean;
};
/**
 * Read-only plugin runtime helpers for session metadata/status.
 *
 * Access requires `plugins.entries.<pluginId>.runtime.helpers.sessions.read =
 * true`. Calls are scoped to the trusted plugin id assigned by the plugin
 * loader. These helpers are not a gateway dispatcher and cannot read
 * transcripts, mutate sessions, invoke nodes, edit config, or perform admin
 * actions.
 */
export type PluginRuntimeSessionHelpers = {
    /**
     * List sanitized session metadata/status rows.
     *
     * The returned rows are safe for plugin status and diagnostics. They do not
     * contain message bodies, transcript previews, raw routing targets, account
     * ids, session file paths, or compaction summaries.
     */
    list: (params?: PluginRuntimeSessionListParams) => PluginRuntimeSessionListResult;
    /**
     * Return one sanitized session metadata/status row by canonical session key,
     * or `null` when the row is not visible.
     */
    get: (params: PluginRuntimeSessionGetParams) => PluginRuntimeSessionStatus | null;
};
/**
 * Lightweight audit event emitted for plugin session-helper reads and denials.
 */
export type PluginRuntimeSessionAuditEvent = {
    pluginId?: string;
    helper: "sessions.list" | "sessions.get";
    outcome: "allowed" | "denied";
    sessionKey?: string;
    listCount?: number;
    denyReason?: string;
};
export type PluginRuntimeSessionAuditSink = (event: PluginRuntimeSessionAuditEvent) => void;
/**
 * Runtime wiring options for scoped session helpers.
 *
 * Plugin authors do not construct these directly. The loader injects a trusted
 * plugin id and config when it creates `api.runtime` for a plugin.
 */
export type PluginRuntimeSessionHelperOptions = {
    config?: FasedAgentConfig;
    pluginId?: string;
    audit?: PluginRuntimeSessionAuditSink;
};
export declare function createPluginRuntimeSessionHelpers(options?: PluginRuntimeSessionHelperOptions): PluginRuntimeSessionHelpers;
