/** * SessionStart Hook * * Claude Code 세션 시작 시 실행됩니다. * Progressive Disclosure: compact 인덱스 모드로 출력합니다. * 상세 내용은 CLI `a2a-memory search`로 확인 가능. */ import { getSharedDb } from './shared.js'; import { ConfigManager } from '../config/manager.js'; import { createLogger } from '../utils/logger.js'; import type { SessionStartContext, Memory } from '../types/index.js'; /** * Sprint 12 (ADR-035): Format a Memory as L0 lightweight line (~100 tokens). * * Title rule MUST mirror backend `_memory_to_l0_response()` and * mcp-server `memory_progressive.memory_index` for cross-layer parity: * - first line of content * - truncated to 80 chars * - '...' suffix if truncated (length > 80 OR newline within first 81 chars) * * Why: triple-source consistency (backend response / mcp tool / plugin inject) * prevents user-facing drift when the same memory appears across surfaces. */ export declare function formatMemoryAsL0(memory: Memory): string; /** * push staleness 기반 fire-and-forget (Sprint 20 T1 sync-resilience). * * SessionEnd hook이 Claude Code 본체 변경(2026-03-21~)으로 발동 빈도 96% 폭락하여 * autoSync.pushOnSessionEnd가 silent 실패. SessionStart 시점에 마지막 sync 경과시간 * 또는 pending 누적치가 임계 초과면 background push로 보완한다. * * - fire-and-forget: 사용자 부팅 대기 시간 영향 0 * - frozen snapshot 정책 보존: PostToolUse mid-session push는 차단 그대로 * - 임계치는 config.autoSync.{staleHoursThreshold, pendingThreshold}로 조정 가능 */ export declare function pushStaleMemories(config: ReturnType, db: ReturnType): Promise; export declare function findRecentCheckpoint(db: ReturnType, projectPath: string, logger: ReturnType): Memory | undefined; export declare function handleSessionStart(context: SessionStartContext): Promise; /** * 전체 Hook 안전 타임아웃 (Sprint 20.5 fix — 10s → 20s 상향). * * 정상 SessionStart durationMs 측정 (2026-05-16 hooks.log): * flipedu-agent 2295ms / ai_automation 7609ms / 7982ms — 10s 한계 임박. * 본 사용자 환경 A2A project는 11,584 메모리 + pending 425건 + Sprint 20 stale-push setup * 추가로 10s 초과하여 `safety timeout (10000ms)` graceful exit → Sprint 20 T1 stale-push 본문 * 실행 0건 silent skip 발생 (2026-05-17 02:50 직접 invoke 측정 확정). * * 20s 상향으로 (a) Sprint 20 T1 본문 정상 실행 + (b) fetchRelevantMemories hybrid search * 11.5k 메모리 대상 cosine + (c) frozen snapshot 기록까지 여유 확보. */ export declare const HOOK_TIMEOUT_MS = 20000; /** * CLI 엔트리포인트 * stdin으로 HookContext JSON을 받아 처리 * 전체 실행에 HOOK_TIMEOUT_MS 안전장치 적용 */ export declare function main(): Promise; //# sourceMappingURL=session-start.d.ts.map