/**
 * mcp-http-client — HTTP helpers used by the Threadline MCP stdio server.
 *
 * The MCP server runs as a stdio child process and cannot access the agent's
 * in-process relay client directly, so it talks to the running agent server
 * over localhost HTTP. These helpers are extracted from `mcp-stdio-entry.ts`
 * (which has a module-load side effect — it calls `main()`) so they can be
 * unit-tested in isolation.
 */
import type { SendMessageParams, SendMessageResult, ThreadHistoryResult, RequestSecretParams, RequestSecretResult } from './ThreadlineMCPServer.js';
/**
 * Send a message via the agent server's `/threadline/relay-send` endpoint.
 *
 * `relay-send` is the single funnel for Threadline sends: it attempts local
 * same-machine delivery first (for co-located agents) and falls back to the
 * cloud relay. Whatever it returns — success, a 404 "agent not found", or the
 * honest 503 "Relay not connected and local delivery unavailable" — is the
 * real outcome and is surfaced verbatim to the caller.
 *
 * History: this function previously had a SECOND fallback that POSTed to
 * `/messages/send` whenever relay-send returned 503. But `/messages/send`
 * expects an inter-agent envelope `{from,to,type,priority,subject,body}`,
 * while this fallback handed it a threadline-shaped body `{targetAgent,
 * message,...}` — so it always 400'd with "Missing required fields: from, to,
 * type, priority, subject, body". That misleading 400 masked the real reason
 * (relay down / target unreachable). Since relay-send already does local-first
 * delivery, there was nothing legitimate left to fall back to — the path was
 * pure noise. It is gone.
 */
export declare function sendMessageViaHttp(params: SendMessageParams, serverPort: number, agentToken: string): Promise<SendMessageResult>;
/**
 * Fetch thread history via the agent server's `/messages/thread/:threadId`
 * endpoint.
 *
 * Returns an empty history on any failure so the MCP tool degrades gracefully
 * (a stopped agent server or missing thread shouldn't surface as an MCP error).
 */
export declare function getThreadHistoryViaHttp(threadId: string, limit: number, serverPort: number, agentToken: string, before?: string): Promise<ThreadHistoryResult>;
/**
 * Sealed-handoff keystone — self-mint a Secret Drop request via the agent
 * server's loopback `/threadline/secrets/request` route.
 *
 * Deliberately sends NO Authorization header: this route lives under the
 * `/threadline/*` auth-bypass umbrella and enforces localhost itself. The MCP
 * stdio process cannot present a valid bearer anyway — the on-disk authToken is
 * vault-externalized (`{secret:true}`), which is the exact gap this route closes.
 * The mint goes through the server's durable SecretDrop store, so the request
 * survives session churn.
 */
export declare function requestSecretViaHttp(params: RequestSecretParams, serverPort: number): Promise<RequestSecretResult>;
//# sourceMappingURL=mcp-http-client.d.ts.map