/**
 * High-level issue operations — Neotoma-canonical.
 *
 * All issues (public and private) are submitted to the operator's Neotoma
 * instance as the canonical store. GitHub is an optional discovery/mirror
 * layer for public issues.
 *
 * Flow:
 *   1. (Public only) Push to GitHub first for discoverability
 *   2. Submit to operator's Neotoma instance (with github_url if available)
 *   3. Store local reference for status tracking
 *
 * When `issues.target_url` is non-empty, step 2 is required: if the remote
 * instance is unreachable or rejects the store, the tool throws after step 3
 * so callers see an error while local `sync_pending` data remains for retry.
 *
 * Private issues never touch GitHub.
 */
import type { Operations } from "../../core/operations.js";
import type { IssueCreateParams, IssueMessageParams, IssueStatusParams, IssueVisibility } from "./types.js";
type ResolvedIssueRow = {
    issue_entity_id: string;
    snapshot: Record<string, unknown>;
    githubNumber: number;
    localIssueId: string | null;
};
/**
 * Resolve an `issue` row from Neotoma (`entity_id` preferred) or legacy GitHub issue number
 * in the configured repo.
 */
export declare function resolveIssueRow(ops: Operations, params: {
    entity_id?: string;
    issue_number?: number;
}): Promise<ResolvedIssueRow>;
/**
 * Human-facing guidance when a public issue did not get a GitHub mirror.
 * Safe for MCP tool JSON (truncated cause; no raw response bodies beyond error.message).
 */
export declare function buildGithubMirrorGuidance(cause: unknown): string;
export interface SubmitIssueResult {
    issue_number: number;
    github_url: string;
    entity_id: string;
    conversation_id: string;
    remote_entity_id: string;
    pushed_to_github: boolean;
    submitted_to_neotoma: boolean;
    guest_access_token?: string;
    /** When a public issue was stored without a GitHub mirror, non-null guidance for agents/operators. */
    github_mirror_guidance: string | null;
    /** Non-null when remote submission was attempted but failed; issue stored locally with sync_pending=true. */
    remote_submission_error: string | null;
}
export interface GuestIssueSubmitParams {
    userId: string;
    title: string;
    body: string;
    labels?: string[];
    visibility?: IssueVisibility;
    githubUrl?: string;
    githubNumber?: number;
    author?: string;
    local_issue_id?: string;
    submission_timestamp?: string;
}
export interface GuestIssueSubmitResult {
    entity_ids: string[];
    issue_entity_id: string;
    conversation_id: string;
    guest_access_token: string;
}
export interface AddMessageResult {
    github_comment_id: string | null;
    message_entity_id: string;
    pushed_to_github: boolean;
    submitted_to_neotoma: boolean;
    remote_submission_error: string | null;
}
export interface GetIssueStatusResult {
    /** Neotoma canonical id for this `issue` row. */
    issue_entity_id: string;
    issue_number: number;
    title: string;
    status: string;
    labels: string[];
    github_url: string;
    author: string;
    created_at: string;
    closed_at: string | null;
    messages: Array<{
        author: string;
        body: string;
        created_at: string;
    }>;
    synced: boolean;
}
/**
 * Load conversation_message rows for an issue's linked conversation (local graph).
 */
export declare function loadIssueThreadMessages(ops: Operations, issueEntityId: string): Promise<GetIssueStatusResult["messages"]>;
/**
 * Build get_issue_status-shaped payload from the local graph for one issue entity id.
 */
export declare function loadIssueStatusFromGraph(ops: Operations, issueEntityId: string, config: {
    repo: string;
}): Promise<GetIssueStatusResult>;
export declare function submitGuestIssue(ops: Operations, params: GuestIssueSubmitParams): Promise<GuestIssueSubmitResult>;
export declare function appendGuestIssueMessage(ops: Operations, params: {
    issue_entity_id: string;
    body: string;
}): Promise<{
    message_entity_id: string;
}>;
/**
 * Create a new issue: optionally mirror to GitHub, then submit to Neotoma.
 */
export declare function submitIssue(ops: Operations, params: IssueCreateParams): Promise<SubmitIssueResult>;
/**
 * Add a message to an existing issue: submit to remote Neotoma + optionally GitHub.
 *
 * Reporter environment is a soft requirement here: when the issue thread is
 * public and neither `reporter_git_sha` nor `reporter_app_version` is
 * provided, a single warning is emitted to stderr describing the gap. The
 * message still persists. Agents are expected to pass these on every
 * issue-thread message (see docs/developer/mcp/instructions.md).
 */
export declare function addIssueMessage(ops: Operations, params: IssueMessageParams): Promise<AddMessageResult>;
/**
 * Get the status of an issue, with optional sync-if-stale from GitHub and
 * read-through to the configured operator Neotoma when this row mirrors a
 * remote canonical issue (`remote_entity_id` + `issues.target_url`).
 */
export declare function getIssueStatus(ops: Operations, params: IssueStatusParams): Promise<GetIssueStatusResult>;
export {};
//# sourceMappingURL=issue_operations.d.ts.map