/**
 * Chat / Agent SSE routes
 *
 * POST /api/chat       — send a message, await full response
 * POST /api/chat/stream — SSE stream of agent events with session persistence
 *
 * Single agent instance per server process (single-user v1).
 */
import type { FastifyInstance } from 'fastify';
import { AgentOrchestrator } from '../../agent/orchestrator.js';
import { type ArtifactBundle } from '../../core/artifact-bundle.js';
import type { MemoryService } from '../../services/memory-service.js';
import type { WsHub } from '../ws-hub.js';
import type { AuthService, AuthUser } from '../../services/auth-service.js';
import type { CommentService } from '../../services/comment-service.js';
import { reqGitUser } from './graph-api-access.js';
import { type ArtifactCallbackResult, type ArtifactToolTarget, type ArtifactWriteOptions } from '../../agent/tools/artifact-tools.js';
import type { ChatSessionService } from '../../services/chat-session-service.js';
/**
 * A per-turn "today is …" context line so the agent always knows the current
 * date and stops misfiling entries to the wrong day. Prefers the client's local
 * date (correct timezone) and falls back to the server's UTC date for callers
 * that don't send one. The label is sanitized (single line, length-capped)
 * since it's free text from the request.
 */
export declare function buildDatePrefix(clientDate?: string, clientDateLabel?: string): string;
export declare function persistArtifactFromChat(params: {
    bundle: ArtifactBundle;
    context: string | undefined;
    target?: ArtifactToolTarget;
    user: AuthUser | undefined;
    agent: Pick<AgentOrchestrator, 'getWorkspaceManager'>;
    authService: AuthService;
    gitUser?: ReturnType<typeof reqGitUser>;
    options?: ArtifactWriteOptions;
}): Promise<ArtifactCallbackResult>;
/**
 * Render an entry's open (unresolved, non-deleted) comments as a compact,
 * newest-first block so the agent sees user feedback on the entry it's chatting
 * about without having to call a tool. Each line carries the author, the text
 * the comment is pinned to (anchor_quote), and the body. Returns '' when there
 * are no open comments (or no service), so the caller can append unconditionally.
 */
export declare function formatEntryComments(commentService: CommentService | undefined, repo: string, entryType: string, entryId: string): string;
export declare function buildChatContextPrefix(context: string | undefined, user: AuthUser | undefined, agent: Pick<AgentOrchestrator, 'getWorkspaceManager'>, authService: AuthService, commentService?: CommentService): string;
export declare function registerChatRoutes(fastify: FastifyInstance, agent: AgentOrchestrator, wsHub: WsHub, authService: AuthService, memoryService?: MemoryService, commentService?: CommentService, chatSessionService?: ChatSessionService): Promise<void>;
