/** * Session logger — NDJSON ログ書き出し専用モジュール * * WorkflowEngine のイベントを受け取り、NDJSON セッションログへ追記する責務を担う。 */ import type { InteractiveMetadata } from './types.js'; import type { NdjsonRecord } from '../../../shared/utils/index.js'; import type { WorkflowResumePointEntry, WorkflowStep, AgentResponse, WorkflowState } from '../../../core/models/index.js'; import type { JudgeStageEntry, PhasePromptParts, StepProviderInfo, WorkflowCallCompleteLifecycle, WorkflowCallLifecycle, WorkflowEvents } from '../../../core/workflow/types.js'; import { buildCompanionReviewRoundRecord } from './sessionLoggerRecordFactory.js'; import type { NdjsonCompanionReviewSkipped, NdjsonCompanionQueueCoalesced } from '../../../shared/utils/types.js'; import { type PromptLogRecord } from './promptLog.js'; type CompanionReviewRoundInput = Parameters[0]; type TerminalSessionRecord = Extract & { readonly publicationId: string; }; /** * Append a terminal session record while preserving the session identity. * * @param ndjsonLogPath - Path to the NDJSON session log * @param start - Session identity used to initialize an empty log or validate its first record * @param record - Terminal record to append or reconcile * @returns Nothing; an identical existing terminal publication is treated as already complete * @throws Error if the log is invalid, its identity or terminal publication conflicts, or file access fails */ export declare function projectTerminalSessionRecord(ndjsonLogPath: string, start: { readonly task: string; readonly workflowName: string; readonly startTime: string; }, record: TerminalSessionRecord): void; export declare class SessionLogger { private readonly ndjsonLogPath; private readonly allowSensitiveData; private readonly promptLogPath; private readonly phaseTracker; private readonly activeStepIterations; private readonly ndjsonRecords; private readonly promptRecords; private workflowTerminalLogged; private companionAuditWriteFailureReported; constructor(ndjsonLogPath: string, allowSensitiveData: boolean, promptLogPath?: string); writeInteractiveMetadata(meta: InteractiveMetadata): void; onPhaseStart(step: WorkflowStep, phase: 1 | 2 | 3, phaseName: 'execute' | 'report' | 'judge', instruction: string, promptParts: PhasePromptParts, workflowStack: WorkflowResumePointEntry[] | undefined, phaseExecutionId?: string, iteration?: number): void; onPhaseComplete(step: WorkflowStep, phase: 1 | 2 | 3, phaseName: 'execute' | 'report' | 'judge', content: string, phaseStatus: string, phaseError: string | undefined, workflowStack: WorkflowResumePointEntry[] | undefined, phaseExecutionId?: string, iteration?: number): void; onJudgeStage(step: WorkflowStep, phase: 3, phaseName: 'judge', entry: JudgeStageEntry, workflowStack: WorkflowResumePointEntry[] | undefined, phaseExecutionId?: string, iteration?: number): void; onStepStart(step: WorkflowStep, iteration: number, instruction: string | undefined, workflowStack: WorkflowResumePointEntry[] | undefined, providerInfo?: StepProviderInfo): void; onWorkflowCallStart(lifecycle: WorkflowCallLifecycle): void; onWorkflowCallComplete(lifecycle: WorkflowCallCompleteLifecycle): void; onStepComplete(step: WorkflowStep, response: AgentResponse, instruction: string, workflowStack: WorkflowResumePointEntry[] | undefined): void; onWorkflowComplete(state: WorkflowState): void; onWorkflowAbort(state: WorkflowState, reason: string, failureCategory?: AgentResponse['failureCategory']): void; onCompanionReviewRound(input: CompanionReviewRoundInput): void; onCompanionQueueCoalesced(input: Omit): void; onCompanionCall(input: Parameters[0]): void; onCompanionReviewSkipped(input: Omit): void; getNdjsonRecords(): NdjsonRecord[]; getPromptRecords(): PromptLogRecord[]; private appendRecord; private appendCompanionAuditRecord; private sanitizeText; } export {}; //# sourceMappingURL=sessionLogger.d.ts.map