import type { HomeResponse } from '@xopcai/gateway-contract'; import { type AutomationRun } from '../automations/index.js'; import type { AutomationService } from '../automations/service/automation-service.js'; import type { Config } from '../config/schema.js'; import type { NotesService } from '../notes/service.js'; import type { ProactiveInboxService } from '../proactive/inbox/service.js'; import type { ProjectService } from '../projects/project-service.js'; import type { SessionIndex } from '../session/manager.js'; import type { WorkflowRunService } from '../workflows/service/workflow-run-service.js'; import { type TaskReadModel } from './task-read-model-projector.js'; type HomeDecision = HomeResponse['decisions'][number]; type HomeAttention = HomeResponse['attention'][number]; type HomeBriefingWin = HomeResponse['briefing']['wins'][number]; type HomeAutomation = HomeResponse['upcomingAutomations'][number]; type HomeAutomationRun = { id: string; automationId: string; automationName?: string; status: AutomationRun['status']; createdAtMs: number; startedAtMs?: number; endedAtMs?: number; error?: string; summary?: string; sessionKey?: string; workflowRunId?: string; }; type HomeSnapshot = HomeResponse & { recentlyOpened: unknown[]; inboxCount: number; pendingTasks: unknown[]; pendingTaskCount: number; recentSessions: unknown[]; activeAgent: { id: string; name?: string; description?: string; }; gateway: Record; recentAutomationRuns: HomeAutomationRun[]; }; interface HomeGatewayPort { readonly notesServiceInstance: NotesService; readonly sessions: Pick & { getActiveRun(sessionKey: string): { active: boolean; runId?: string; }; }; readonly currentConfig: Config; readonly automationServiceInstance: AutomationService; readonly projects: ProjectService; readonly proactiveInbox: ProactiveInboxService; createWorkflowRunService(): WorkflowRunService; getHealth(): { status: string; ready: boolean; httpListening: boolean; version: string; uptime: number; }; } export declare function decisionFromTask(model: TaskReadModel, projectName?: string): HomeDecision | null; export declare function buildHomeBriefing(input: { locale?: string; decisions: HomeDecision[]; attention: HomeAttention[]; activeWorkflowCount: number; activeTaskCount: number; wins: HomeBriefingWin[]; nextScheduled?: HomeAutomation; nowMs: number; }): { generatedAt: number; summary: string; focus: { id: string; kind: "task" | "agent_judgment" | "connector_approval"; title: string; reason: "external" | "paused" | "blocked" | "dependency" | "user_input" | "approval_required" | "overdue" | "needs_input" | "user_approval" | "scheduled" | "retry" | "due_soon" | "decision_needed"; urgency: "now" | "soon"; href: string; updatedAt: number; detail?: string; projectId?: string; projectName?: string; judgment?: { inboxItemId: string; whyNow: string; impact: string; workDone: string; recommendation: string; confidence: number; valueScore?: number; decision?: { question: string; options: { id: string; label: string; consequence: string; }[]; }; }; response?: { kind: "connector_approval"; approvalId: string; }; }[]; progress: { activeWorkflowCount: number; activeTaskCount: number; movingCount: number; }; wins: { id: string; kind: "task" | "workflow_run" | "automation_run"; title: string; href: string; completedAt: number; }[]; nextScheduled: { id: string; trigger: string; action: string; nextRunAt: string; name?: string; }; }; export declare class HomeQueryService { #private; private readonly service; constructor(service: HomeGatewayPort); getSnapshot(locale?: string): Promise; } export {};