/** `bober calendar` — propose / apply a schedule from ranked findings + free/busy. */ import type { Command } from "commander"; import type { Finding, BusyInterval } from "../../calendar/types.js"; import type { CalendarConnector } from "../../calendar/connector.js"; /** * Injectable dependencies for runCalendarPlan. * Production callers pass undefined (all fields default to the real implementations). * Tests inject fixture readers and a fixed clock to achieve deterministic assertions. */ export interface CalendarPlanDeps { /** Override the findings reader (default: readFindingsFromFile). */ readFindings?: (path: string) => Promise; /** Override the free/busy reader (default: readBusyIntervalsFromFile). */ readFreeBusy?: (path: string) => Promise; /** Override the current ISO time string (clock read ONLY at the CLI boundary). */ nowIso?: string; /** Factory for the calendar connector used by --export-ics (default: createIcsConnector). */ makeConnector?: (outPath: string) => CalendarConnector; /** * Generate the planId for the live propose path. * Default: `Date.now().toString(36)` (unique per run). * Tests inject a fixed string for deterministic checkpointId assertions. */ makePlanId?: () => string; /** * Override the connector name stored in the plan sidecar. * Default: read from `config.calendar.connector` (or "ics" if no config). * Tests inject "stub" to avoid config loading. */ connectorName?: string; } /** * Injectable dependencies for runCalendarApply. * Tests inject a pre-built stub connector to avoid config loading and real I/O. */ export interface CalendarApplyDeps { /** Inject a pre-built connector (bypasses config + factory). */ connector?: CalendarConnector; /** * ICS output path for the ics connector (only used when connector is 'ics'). * Default: /.bober/calendar/schedule.ics */ icsOutPath?: string; } /** * Core logic for `bober calendar plan`. * * Extracted so tests can inject fixture deps without module-level mocking. * The CLI .action() calls this with no deps (production path). * * --dry-run: prints the proposed plan to stdout only; writes NOTHING to any calendar * or .ics file. No connectors exist in this sprint (sc-1-6 / nonGoals). * --export-ics: writes a local RFC 5545 .ics file via the ICS connector. * (no flags): live path — proposes via the approval gate; writes ZERO events until * an ApprovedMarker exists for the returned checkpointId. */ export declare function runCalendarPlan(projectRoot: string, opts: { findings?: string; freebusy?: string; dryRun?: boolean; exportIcs?: string; }, deps?: CalendarPlanDeps): Promise; /** * Core logic for `bober calendar apply `. * * Detects the approved/rejected marker and calls connector.writeEvents exactly * once on approval; never on rejection; prints "pending" when neither marker exists. */ export declare function runCalendarApply(projectRoot: string, checkpointId: string, deps?: CalendarApplyDeps): Promise; /** * Register the `bober calendar` command tree. * Mirrors registerMedicalCommand (src/cli/commands/medical.ts:229-297). */ export declare function registerCalendarCommand(program: Command): void; //# sourceMappingURL=calendar.d.ts.map