/**
 * @fileoverview Shared heartbeat kernel primitives for run admission,
 * transcript capture, runtime metadata, and billing evidence.
 *
 * @see doc/product/domains/execution/heartbeats.md - RUN.WAKEUP.001 central wakeup contract
 * @see doc/product/domains/execution/agent-runs.md - durable run records and lifecycle
 * @see doc/product/domains/execution/transcripts-and-results.md - transcript and result evidence
 */
import type { TranscriptEntry } from "@rudderhq/agent-runtime-utils";
import type { Db } from "@rudderhq/db";
import { heartbeatRuns } from "@rudderhq/db";
import type { AgentSkillTelemetryEvidence, AgentSkillTelemetryEvidenceCounts, BillingType, ExecutionObservabilitySurface } from "@rudderhq/shared";
import type { AgentRuntimeExecutionResult, AgentRuntimeInvocationMeta } from "../../agent-runtimes/index.js";
export { prioritizeProjectWorkspaceCandidatesForRun, type ResolvedWorkspaceForRun } from "../agent-run-context.js";
export declare const MAX_LIVE_LOG_CHUNK_BYTES: number;
export declare const HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT = 3;
export declare const HEARTBEAT_MAX_CONCURRENT_RUNS_MIN = 1;
export declare const HEARTBEAT_MAX_CONCURRENT_RUNS_MAX = 10;
export declare const DEFERRED_WAKE_CONTEXT_KEY = "_paperclipWakeContext";
export declare const DETACHED_PROCESS_ERROR_CODE = "process_detached";
export declare const ORPHANED_PROCESS_TERMINATION_GRACE_MS = 2000;
export declare const ORPHANED_PROCESS_KILL_WAIT_MS = 500;
export declare const ORPHANED_PROCESS_POLL_INTERVAL_MS = 100;
export declare const startLocksByAgent: Map<string, Promise<void>>;
export declare const MAX_RECOVERY_CHAIN_DEPTH = 8;
export declare const ISSUE_PASSIVE_FOLLOWUP_REASON = "issue_passive_followup";
export declare const ISSUE_PASSIVE_FOLLOWUP_WAKE_SOURCE = "passive_issue_followup";
export declare const ISSUE_PASSIVE_FOLLOWUP_FAILURE_REASON = "missing_closure";
export declare const ISSUE_PASSIVE_FOLLOWUP_MAX_ATTEMPTS = 3;
export declare const ISSUE_COMMENT_MENTION_REASON = "issue_comment_mentioned";
export declare const ISSUE_REVIEW_CLOSEOUT_REASON = "issue_review_closeout_missing";
export declare const ISSUE_REVIEW_CLOSEOUT_FAILURE_REASON = "missing_review_decision";
export declare const ISSUE_REVIEW_CLOSEOUT_MAX_ATTEMPTS = 3;
export declare const ISSUE_PASSIVE_FOLLOWUP_COOLDOWN_MS_BY_ATTEMPT: Map<number, number>;
export declare const ISSUE_PASSIVE_FOLLOWUP_TIMER_CONTINUITY_MAX_WINDOW_MS: number;
export declare const SESSIONED_LOCAL_ADAPTERS: Set<string>;
export type TimerPreflightResult = {
    shouldRun: true;
    reason: string;
} | {
    shouldRun: false;
    skipReason: string;
    diagnostics?: Record<string, unknown>;
};
export declare const heartbeatRunListColumns: {
    readonly id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly orgId: import("drizzle-orm/pg-core").PgColumn<{
        name: "org_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly agentId: import("drizzle-orm/pg-core").PgColumn<{
        name: "agent_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly invocationSource: import("drizzle-orm/pg-core").PgColumn<{
        name: "invocation_source";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly triggerDetail: import("drizzle-orm/pg-core").PgColumn<{
        name: "trigger_detail";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly startedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "started_at";
        tableName: "heartbeat_runs";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly finishedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "finished_at";
        tableName: "heartbeat_runs";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly error: import("drizzle-orm/pg-core").PgColumn<{
        name: "error";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly wakeupRequestId: import("drizzle-orm/pg-core").PgColumn<{
        name: "wakeup_request_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly exitCode: import("drizzle-orm/pg-core").PgColumn<{
        name: "exit_code";
        tableName: "heartbeat_runs";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly signal: import("drizzle-orm/pg-core").PgColumn<{
        name: "signal";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly usageJson: import("drizzle-orm/pg-core").PgColumn<{
        name: "usage_json";
        tableName: "heartbeat_runs";
        dataType: "json";
        columnType: "PgJsonb";
        data: Record<string, unknown>;
        driverParam: unknown;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {
        $type: Record<string, unknown>;
    }>;
    readonly resultJson: import("drizzle-orm/pg-core").PgColumn<{
        name: "result_json";
        tableName: "heartbeat_runs";
        dataType: "json";
        columnType: "PgJsonb";
        data: Record<string, unknown>;
        driverParam: unknown;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {
        $type: Record<string, unknown>;
    }>;
    readonly sessionIdBefore: import("drizzle-orm/pg-core").PgColumn<{
        name: "session_id_before";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly sessionIdAfter: import("drizzle-orm/pg-core").PgColumn<{
        name: "session_id_after";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly logStore: import("drizzle-orm/pg-core").PgColumn<{
        name: "log_store";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly logRef: import("drizzle-orm/pg-core").PgColumn<{
        name: "log_ref";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly logBytes: import("drizzle-orm/pg-core").PgColumn<{
        name: "log_bytes";
        tableName: "heartbeat_runs";
        dataType: "number";
        columnType: "PgBigInt53";
        data: number;
        driverParam: string | number;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly logSha256: import("drizzle-orm/pg-core").PgColumn<{
        name: "log_sha256";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly logCompressed: import("drizzle-orm/pg-core").PgColumn<{
        name: "log_compressed";
        tableName: "heartbeat_runs";
        dataType: "boolean";
        columnType: "PgBoolean";
        data: boolean;
        driverParam: boolean;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly stdoutExcerpt: import("drizzle-orm").SQL.Aliased<string | null>;
    readonly stderrExcerpt: import("drizzle-orm").SQL.Aliased<string | null>;
    readonly errorCode: import("drizzle-orm/pg-core").PgColumn<{
        name: "error_code";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly externalRunId: import("drizzle-orm/pg-core").PgColumn<{
        name: "external_run_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly chatConversationId: import("drizzle-orm/pg-core").PgColumn<{
        name: "chat_conversation_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly processPid: import("drizzle-orm/pg-core").PgColumn<{
        name: "process_pid";
        tableName: "heartbeat_runs";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly processStartedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "process_started_at";
        tableName: "heartbeat_runs";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly retryOfRunId: import("drizzle-orm/pg-core").PgColumn<{
        name: "retry_of_run_id";
        tableName: "heartbeat_runs";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly processLossRetryCount: import("drizzle-orm/pg-core").PgColumn<{
        name: "process_loss_retry_count";
        tableName: "heartbeat_runs";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly contextSnapshot: import("drizzle-orm/pg-core").PgColumn<{
        name: "context_snapshot";
        tableName: "heartbeat_runs";
        dataType: "json";
        columnType: "PgJsonb";
        data: Record<string, unknown>;
        driverParam: unknown;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {
        $type: Record<string, unknown>;
    }>;
    readonly createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "heartbeat_runs";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
    readonly updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "heartbeat_runs";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
    }, {}, {}>;
};
export declare function appendExcerpt(prev: string, chunk: string): string;
export declare function isIssueCommentMentionWake(input: {
    reason?: string | null;
    contextSnapshot?: unknown;
    payload?: unknown;
}): boolean;
export declare function appendTranscriptEntriesFromChunk(input: {
    buffer: string;
    chunk: string;
    transcript: TranscriptEntry[];
    finalize?: boolean;
    parser?: ((line: string, ts: string) => TranscriptEntry[]) | null;
    kind: "stdout" | "stderr";
}): string;
export declare function normalizeMaxConcurrentRuns(value: unknown): number;
export declare function withAgentStartLock<T>(agentId: string, fn: () => Promise<T>): Promise<T>;
export interface WakeupOptions {
    source?: "timer" | "assignment" | "review" | "on_demand" | "automation";
    triggerDetail?: "manual" | "ping" | "callback" | "system";
    reason?: string | null;
    payload?: Record<string, unknown> | null;
    idempotencyKey?: string | null;
    requestedByActorType?: "user" | "agent" | "system";
    requestedByActorId?: string | null;
    contextSnapshot?: Record<string, unknown>;
    existingWakeupRequestId?: string | null;
}
export type UsageTotals = {
    inputTokens: number;
    cachedInputTokens: number;
    outputTokens: number;
};
export type SessionCompactionDecision = {
    rotate: boolean;
    reason: string | null;
    handoffMarkdown: string | null;
    previousRunId: string | null;
};
export interface ParsedIssueAssigneeAgentRuntimeOverrides {
    agentRuntimeConfig: Record<string, unknown> | null;
    useProjectWorkspace: boolean | null;
}
export declare function readNonEmptyString(value: unknown): string | null;
export declare function resolveHeartbeatObservabilitySurface(contextSnapshot: Record<string, unknown> | null | undefined): ExecutionObservabilitySurface;
export declare function buildHeartbeatObservationName(run: typeof heartbeatRuns.$inferSelect, agentName: string): string;
export declare function compactTraceText(value: string | null | undefined, maxLength?: number): string | null;
export declare function buildIssueRunTraceName(input: {
    issueTitle?: string | null;
    issueId: string;
}): string;
export declare function buildHeartbeatRuntimeTraceMetadata(input: {
    runtimeConfig: Record<string, unknown>;
    runtimeSkills: Array<{
        key: string;
        runtimeName: string;
        name: string | null;
        description: string | null;
    }>;
    adapterMeta?: Pick<AgentRuntimeInvocationMeta, "agentRuntimeType" | "command" | "cwd" | "commandNotes" | "promptMetrics"> | null;
}): {
    runtimeAgentType?: string | undefined;
    runtimeCommand?: string | undefined;
    runtimeCwd?: string | null | undefined;
    runtimeCommandNotes?: string[] | undefined;
    runtimePromptMetrics?: Record<string, number> | null | undefined;
    loadedSkillCount: number;
    loadedSkillKeys: string[];
    loadedSkills: {
        key: string;
        runtimeName: string | null;
        name: string | null;
        description: string | null;
    }[];
    instructionsConfigured: boolean;
    instructionsFilePath: string | null;
};
export declare function buildHeartbeatAdapterInvokePayload(input: {
    meta: AgentRuntimeInvocationMeta;
    runtimeSkills: Array<{
        key: string;
        runtimeName: string;
        name: string | null;
        description: string | null;
    }>;
}): Record<string, unknown>;
export declare function sanitizeStartupContextPromptForPersistence(prompt: string | null | undefined): string | null | undefined;
export declare function sanitizeStartupContextContextForPersistence(context: Record<string, unknown> | null | undefined): Record<string, unknown> | null | undefined;
export declare function buildRecentDateKeys(windowDays: number, now: Date): string[];
export declare function buildDateKeysBetween(startDate: string, endDate: string): string[];
export declare function fallbackSkillLabel(key: string): string;
export declare function normalizeLoadedSkill(value: unknown): {
    key: string;
    label: string;
} | null;
export declare function normalizeLoadedSkillForPayload(value: unknown): {
    key: string;
    runtimeName: string | null;
    name: string | null;
    description: string | null;
} | null;
export declare function emptySkillEvidenceCounts(): AgentSkillTelemetryEvidenceCounts;
export declare function incrementSkillEvidenceCount(counts: AgentSkillTelemetryEvidenceCounts, evidence: AgentSkillTelemetryEvidence): void;
export declare function strongestSkillEvidence(left: AgentSkillTelemetryEvidence, right: AgentSkillTelemetryEvidence): AgentSkillTelemetryEvidence;
export declare function resolveSkillEvidence(input: {
    usedSkills: Array<{
        key: string;
        label: string;
    }>;
    requestedSkills: Array<{
        key: string;
        label: string;
    }>;
    loadedSkills: Array<{
        key: string;
        label: string;
    }>;
}): {
    evidence: AgentSkillTelemetryEvidence;
    skills: Array<{
        key: string;
        label: string;
    }>;
};
export declare function readSkillEvidenceFromPayload(payload: Record<string, unknown>): {
    evidence: AgentSkillTelemetryEvidence;
    skills: Array<{
        key: string;
        label: string;
    }>;
};
export declare function extractSkillSlugFromPath(value: string): string | null;
export declare function collectSkillPathsFromText(value: string): string[];
export declare function collectStringValues(value: unknown, depth?: number, seen?: WeakSet<object>): string[];
export declare function resolveForbiddenRuntimeSkillMarkers(runtimeConfig: Record<string, unknown> | null | undefined): string[];
export type ForbiddenRuntimeSkillMarkerEvidenceSource = "adapter_meta" | "stdout_excerpt" | "stderr_excerpt" | "resultJson" | "transcript";
export interface ForbiddenRuntimeSkillMarkerEvidence {
    marker: string | null;
    source: ForbiddenRuntimeSkillMarkerEvidenceSource;
}
export declare function detectForbiddenRuntimeSkillMarker(input: {
    markers: string[];
    meta?: Pick<AgentRuntimeInvocationMeta, "forbiddenMarkerObserved"> | null;
    stdoutExcerpt?: string | null;
    stderrExcerpt?: string | null;
    resultJson?: Record<string, unknown> | null;
    transcript?: TranscriptEntry[] | null;
}): {
    observed: boolean;
    evidence: ForbiddenRuntimeSkillMarkerEvidence[];
};
export declare function normalizeSkillUseFromPath(value: string): {
    key: string;
    label: string;
} | null;
export declare function dedupeSkillUses(skills: Array<{
    key: string;
    label: string;
}>): {
    key: string;
    label: string;
}[];
export declare function collectSkillUsesFromText(value: string): {
    key: string;
    label: string;
}[];
export declare function readToolCommandInput(input: unknown): string | null;
export declare function isCommandTranscriptTool(name: string): boolean;
export declare function isReadTranscriptTool(name: string): boolean;
export declare function isSkillTranscriptTool(name: string): boolean;
export declare function readSkillToolInput(input: unknown): {
    key: string;
    label: string;
} | null;
export declare function inferUsedSkillsFromTranscript(transcript: TranscriptEntry[]): {
    key: string;
    label: string;
}[];
export declare function normalizeSkillCandidate(value: string | null | undefined): string;
export declare function addSkillCandidate(candidates: Set<string>, value: string | null | undefined): void;
export declare function readSkillReferenceSlug(href: string): string | null;
export declare function collectSkillReferences(prompt: string): {
    key: string;
    label: string;
    candidates: Set<string>;
}[];
export declare function inferUsedSkillsFromPrompt(prompt: unknown, loadedSkills: unknown[]): Array<{
    key: string;
    label: string;
}>;
export declare function normalizeLedgerBillingType(value: unknown): BillingType;
export declare function resolveLedgerBiller(result: AgentRuntimeExecutionResult): string;
export declare function normalizeBilledCostCents(costUsd: number | null | undefined, billingType: BillingType): number;
export declare function resolveLedgerScopeForRun(db: Db, orgId: string, run: typeof heartbeatRuns.$inferSelect): Promise<{
    issueId: null;
    projectId: string | null;
} | {
    issueId: string;
    projectId: string | null;
}>;
//# sourceMappingURL=heartbeat.core.d.ts.map