@basou/core 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2908,6 +2908,13 @@ declare function renderHandoff(input: HandoffRendererInput): Promise<HandoffRend
2908
2908
  */
2909
2909
  declare function parseDuration(input: string): number;
2910
2910
 
2911
+ /**
2912
+ * Coarse human duration from milliseconds: "3h 05m" / "12m 30s" / "8s".
2913
+ * Shared by the work-stats surfaces (`basou stats`, `basou session show`) and
2914
+ * the report renderer so they format identically.
2915
+ */
2916
+ declare function formatDurationMs(ms: number): string;
2917
+
2911
2918
  /**
2912
2919
  * Resolve a possibly-truncated session id prefix to a full session id by
2913
2920
  * scanning `<paths.sessions>/`. Existing message contract (carried over
@@ -3019,122 +3026,6 @@ type SanitizeRelatedFilesResult = {
3019
3026
  */
3020
3027
  declare function sanitizeRelatedFiles(paths: ReadonlyArray<string>, opts: SanitizePathOptions): SanitizeRelatedFilesResult;
3021
3028
 
3022
- /**
3023
- * Internal abstraction over child-process execution.
3024
- *
3025
- * The v0.1 implementation is intentionally minimal:
3026
- * - Optional UTF-8 stdout/stderr capture (`capture: "buffer"`, default) or
3027
- * pass-through to the parent's stdio (`capture: "none"`).
3028
- * - No stream callbacks for partial chunks.
3029
- * - No event emission. Callers wire any event flow separately.
3030
- *
3031
- * The boundary is internal: ProcessRunner is not part of the public
3032
- * adapter surface. Adapters do not import or instantiate it directly;
3033
- * CLI / Core orchestration owns construction and invocation.
3034
- */
3035
- /**
3036
- * Output capture mode.
3037
- *
3038
- * - `"buffer"` (default): pipe stdout/stderr to the runner and accumulate
3039
- * the full UTF-8 string into {@link RunResult}.
3040
- * - `"none"`: inherit the parent's stdio. The child writes directly to the
3041
- * parent terminal in real time and {@link RunResult.stdout} /
3042
- * {@link RunResult.stderr} are empty strings. `stdin` cannot be combined
3043
- * with `"none"` because the child has no writable stdin pipe.
3044
- */
3045
- type CaptureMode = "buffer" | "none";
3046
- type RunOptions = {
3047
- /**
3048
- * Working directory for the child process. Required: callers resolve
3049
- * the workspace root themselves; the runner does not validate cwd
3050
- * existence and surfaces native spawn errors via classification.
3051
- */
3052
- readonly cwd: string;
3053
- /**
3054
- * Environment variables for the child. When omitted, the parent's
3055
- * `process.env` is inherited verbatim. Callers wanting a sanitized
3056
- * environment must build it explicitly.
3057
- */
3058
- readonly env?: NodeJS.ProcessEnv;
3059
- /**
3060
- * External cancellation. Aborting the signal triggers a two-stage
3061
- * kill (SIGTERM, then SIGKILL after a short grace period).
3062
- */
3063
- readonly signal?: AbortSignal;
3064
- /**
3065
- * Internal timeout in milliseconds. Must be a positive finite number.
3066
- * Triggers the same two-stage kill as `signal`.
3067
- */
3068
- readonly timeout_ms?: number;
3069
- /**
3070
- * Optional input written to the child's stdin. The pipe is closed
3071
- * after the value is written. Incompatible with `capture: "none"`.
3072
- */
3073
- readonly stdin?: string | Buffer;
3074
- /**
3075
- * Output capture mode. Defaults to `"buffer"`. See {@link CaptureMode}.
3076
- */
3077
- readonly capture?: CaptureMode;
3078
- /**
3079
- * Invoked synchronously immediately after the child has been spawned,
3080
- * before the runner waits for completion. Callers use this to retain a
3081
- * reference for parent-side cleanup (e.g. an `exit` hook that SIGKILLs
3082
- * the child if the parent is forcibly terminated). The runner takes no
3083
- * action if the callback throws.
3084
- */
3085
- readonly onSpawn?: (child: ChildProcess) => void;
3086
- };
3087
- type RunResult = {
3088
- readonly command: string;
3089
- readonly args: readonly string[];
3090
- readonly cwd: string;
3091
- /** `null` when the process was killed by a signal. */
3092
- readonly exit_code: number | null;
3093
- readonly signal: NodeJS.Signals | null;
3094
- readonly stdout: string;
3095
- readonly stderr: string;
3096
- /** ISO 8601 timestamp captured before spawn. */
3097
- readonly started_at: string;
3098
- /** ISO 8601 timestamp captured on the `close` event. */
3099
- readonly ended_at: string;
3100
- readonly duration_ms: number;
3101
- readonly pid: number | null;
3102
- };
3103
- type ProcessRunner = {
3104
- run(command: string, args: readonly string[], options: RunOptions): Promise<RunResult>;
3105
- };
3106
-
3107
- /**
3108
- * Spawn-based ProcessRunner implementation.
3109
- *
3110
- * Behavior:
3111
- * - `shell: false` and `detached: false`. The process group is not
3112
- * detached, but the OS does not guarantee the child is reaped when
3113
- * the parent terminates abruptly; callers handle SIGINT/SIGTERM/exit
3114
- * hooks themselves.
3115
- * - `capture: "buffer"` (default): `stdio: ['pipe', 'pipe', 'pipe']`,
3116
- * stdout / stderr are decoded as UTF-8 and accumulated as full
3117
- * strings (no streaming callbacks).
3118
- * - `capture: "none"`: `stdio: ['inherit', 'inherit', 'inherit']`, the
3119
- * child writes directly to the parent terminal in real time and
3120
- * `RunResult.stdout` / `stderr` are empty strings. `stdin` is
3121
- * incompatible with this mode (the child has no writable stdin pipe)
3122
- * and the combination is rejected before spawn.
3123
- * - `timeout_ms` and `AbortSignal` both trigger a two-stage kill:
3124
- * `SIGTERM`, then `SIGKILL` after `DEFAULT_KILL_GRACE_MS` (5_000 ms).
3125
- * - A non-zero `exit_code` does not throw; it is returned via
3126
- * `RunResult`. Spawn-time errors throw with a pathless message and
3127
- * the original error attached as `cause`.
3128
- *
3129
- * Error message contract: messages never include `cwd` or absolute
3130
- * command paths. The original errno (and any nested wrapping) is
3131
- * preserved on `Error.cause`, allowing callers to classify with
3132
- * `findErrorCode` when needed.
3133
- */
3134
- declare class ChildProcessRunner implements ProcessRunner {
3135
- run(command: string, args: readonly string[], options: RunOptions): Promise<RunResult>;
3136
- }
3137
-
3138
3029
  /**
3139
3030
  * Schema version of the on-disk Basou v0.1 formats these JSON Schemas describe.
3140
3031
  * It tracks {@link SchemaVersionSchema} (the `schema_version` field), NOT the
@@ -3472,6 +3363,253 @@ declare function computeWorkStats(input: WorkStatsInput): Promise<WorkStatsResul
3472
3363
  */
3473
3364
  declare function sessionWorkStatsFromEvents(sessionId: string, inner: Session["session"], events: ReadonlyArray<Event>, now: Date, eventsUnreadable?: boolean): SessionWorkStats;
3474
3365
 
3366
+ type ReportRendererInput = {
3367
+ paths: BasouPaths;
3368
+ /** ISO timestamp stamped into the report header and used as the clock. */
3369
+ nowIso: string;
3370
+ /** Optional subject line surfaced in the report title. */
3371
+ title?: string;
3372
+ /**
3373
+ * IANA timezone passed through to {@link computeWorkStats} (it labels the
3374
+ * time figures with the zone). The CLI omits this (host default); tests and
3375
+ * the SDK pass a fixed value for deterministic output. [Codex #5]
3376
+ */
3377
+ timeZone?: string;
3378
+ onWarning?: (warning: ReplayWarning, sessionId: string) => void;
3379
+ onSessionSkip?: (sessionId: string, reason: SessionSkipReason) => void;
3380
+ onTaskSkip?: (taskId: string, reason: TaskSkipReason) => void;
3381
+ };
3382
+ type ReportSessionItem = {
3383
+ id: string;
3384
+ label: string | null;
3385
+ status: SessionStatus;
3386
+ source: SessionSourceKind;
3387
+ startedAt: string;
3388
+ activeMs: number;
3389
+ outputTokens: number;
3390
+ };
3391
+ type ReportDecisionItem = {
3392
+ id: string;
3393
+ title: string;
3394
+ occurredAt: string;
3395
+ };
3396
+ type ReportTaskItem = {
3397
+ id: string;
3398
+ title: string;
3399
+ status: TaskStatus;
3400
+ };
3401
+ type ReportApprovalItem = {
3402
+ id: string;
3403
+ reason: string;
3404
+ status: ApprovalStatus;
3405
+ riskLevel: RiskLevel;
3406
+ };
3407
+ type TaskStatusCount = {
3408
+ status: TaskStatus;
3409
+ count: number;
3410
+ };
3411
+ /**
3412
+ * Curated, purpose-built structured shape behind `basou report generate
3413
+ * --json`. Deliberately NOT the full {@link WorkStatsResult} — report's JSON
3414
+ * stays a stable contract decoupled from the stats schema. Field names avoid
3415
+ * the word "billable": a report is a neutral work-explanation export, not a
3416
+ * billing artifact. [Codex #2]
3417
+ */
3418
+ type ReportData = {
3419
+ generatedAt: string;
3420
+ title?: string;
3421
+ /** Earliest session start .. latest session end (or `now` for open sessions). */
3422
+ period: {
3423
+ from: string | null;
3424
+ to: string | null;
3425
+ };
3426
+ sessions: {
3427
+ total: number;
3428
+ byStatus: StatusCount[];
3429
+ items: ReportSessionItem[];
3430
+ };
3431
+ volume: {
3432
+ outputTokens: number;
3433
+ reasoningTokens: number;
3434
+ commandCount: number;
3435
+ fileChangedCount: number;
3436
+ decisionCount: number;
3437
+ tokensAvailable: boolean;
3438
+ };
3439
+ time: {
3440
+ activeMs: number;
3441
+ machineActiveMs: number;
3442
+ machineAvailable: boolean;
3443
+ spanMs: number;
3444
+ commandTimeMs: number;
3445
+ timeZone: string;
3446
+ };
3447
+ decisions: {
3448
+ count: number;
3449
+ items: ReportDecisionItem[];
3450
+ };
3451
+ approvals: {
3452
+ pending: number;
3453
+ approved: number;
3454
+ rejected: number;
3455
+ expired: number;
3456
+ items: ReportApprovalItem[];
3457
+ };
3458
+ tasks: {
3459
+ total: number;
3460
+ byStatus: TaskStatusCount[];
3461
+ items: ReportTaskItem[];
3462
+ };
3463
+ /** Union of related files across non-`import` sessions (full; markdown truncates). */
3464
+ changedFiles: string[];
3465
+ integrity: {
3466
+ total: number;
3467
+ verified: number;
3468
+ unchained: number;
3469
+ empty: number;
3470
+ incomplete: number;
3471
+ in_progress: number;
3472
+ tampered: number;
3473
+ /** Session ids whose chain is `tampered`, surfaced for follow-up. */
3474
+ tamperedSessions: string[];
3475
+ };
3476
+ };
3477
+ type ReportRendererResult = {
3478
+ body: string;
3479
+ data: ReportData;
3480
+ };
3481
+ /**
3482
+ * Render a neutral "work report" — a point-in-time export that explains the
3483
+ * work captured in a workspace: how much, what was decided / approved /
3484
+ * undertaken, which files changed, and whether the local provenance is
3485
+ * internally consistent. It composes existing read primitives only and writes
3486
+ * nothing; the caller chooses where `body` goes (stdout / a file) and whether
3487
+ * to emit the structured `data` as JSON.
3488
+ *
3489
+ * Warning surfaces mirror the sibling renderers: `loadSessionEntries` (suspect
3490
+ * classification) and the decision-aggregation replay (with the same
3491
+ * unreadable-skip wrapper as `decisions-renderer.ts`) report through the
3492
+ * callbacks. {@link computeWorkStats} runs SILENTLY here — it re-reads the same
3493
+ * sessions/events, so surfacing its warnings too would double-emit. [Codex #6]
3494
+ */
3495
+ declare function renderReport(input: ReportRendererInput): Promise<ReportRendererResult>;
3496
+
3497
+ /**
3498
+ * Internal abstraction over child-process execution.
3499
+ *
3500
+ * The v0.1 implementation is intentionally minimal:
3501
+ * - Optional UTF-8 stdout/stderr capture (`capture: "buffer"`, default) or
3502
+ * pass-through to the parent's stdio (`capture: "none"`).
3503
+ * - No stream callbacks for partial chunks.
3504
+ * - No event emission. Callers wire any event flow separately.
3505
+ *
3506
+ * The boundary is internal: ProcessRunner is not part of the public
3507
+ * adapter surface. Adapters do not import or instantiate it directly;
3508
+ * CLI / Core orchestration owns construction and invocation.
3509
+ */
3510
+ /**
3511
+ * Output capture mode.
3512
+ *
3513
+ * - `"buffer"` (default): pipe stdout/stderr to the runner and accumulate
3514
+ * the full UTF-8 string into {@link RunResult}.
3515
+ * - `"none"`: inherit the parent's stdio. The child writes directly to the
3516
+ * parent terminal in real time and {@link RunResult.stdout} /
3517
+ * {@link RunResult.stderr} are empty strings. `stdin` cannot be combined
3518
+ * with `"none"` because the child has no writable stdin pipe.
3519
+ */
3520
+ type CaptureMode = "buffer" | "none";
3521
+ type RunOptions = {
3522
+ /**
3523
+ * Working directory for the child process. Required: callers resolve
3524
+ * the workspace root themselves; the runner does not validate cwd
3525
+ * existence and surfaces native spawn errors via classification.
3526
+ */
3527
+ readonly cwd: string;
3528
+ /**
3529
+ * Environment variables for the child. When omitted, the parent's
3530
+ * `process.env` is inherited verbatim. Callers wanting a sanitized
3531
+ * environment must build it explicitly.
3532
+ */
3533
+ readonly env?: NodeJS.ProcessEnv;
3534
+ /**
3535
+ * External cancellation. Aborting the signal triggers a two-stage
3536
+ * kill (SIGTERM, then SIGKILL after a short grace period).
3537
+ */
3538
+ readonly signal?: AbortSignal;
3539
+ /**
3540
+ * Internal timeout in milliseconds. Must be a positive finite number.
3541
+ * Triggers the same two-stage kill as `signal`.
3542
+ */
3543
+ readonly timeout_ms?: number;
3544
+ /**
3545
+ * Optional input written to the child's stdin. The pipe is closed
3546
+ * after the value is written. Incompatible with `capture: "none"`.
3547
+ */
3548
+ readonly stdin?: string | Buffer;
3549
+ /**
3550
+ * Output capture mode. Defaults to `"buffer"`. See {@link CaptureMode}.
3551
+ */
3552
+ readonly capture?: CaptureMode;
3553
+ /**
3554
+ * Invoked synchronously immediately after the child has been spawned,
3555
+ * before the runner waits for completion. Callers use this to retain a
3556
+ * reference for parent-side cleanup (e.g. an `exit` hook that SIGKILLs
3557
+ * the child if the parent is forcibly terminated). The runner takes no
3558
+ * action if the callback throws.
3559
+ */
3560
+ readonly onSpawn?: (child: ChildProcess) => void;
3561
+ };
3562
+ type RunResult = {
3563
+ readonly command: string;
3564
+ readonly args: readonly string[];
3565
+ readonly cwd: string;
3566
+ /** `null` when the process was killed by a signal. */
3567
+ readonly exit_code: number | null;
3568
+ readonly signal: NodeJS.Signals | null;
3569
+ readonly stdout: string;
3570
+ readonly stderr: string;
3571
+ /** ISO 8601 timestamp captured before spawn. */
3572
+ readonly started_at: string;
3573
+ /** ISO 8601 timestamp captured on the `close` event. */
3574
+ readonly ended_at: string;
3575
+ readonly duration_ms: number;
3576
+ readonly pid: number | null;
3577
+ };
3578
+ type ProcessRunner = {
3579
+ run(command: string, args: readonly string[], options: RunOptions): Promise<RunResult>;
3580
+ };
3581
+
3582
+ /**
3583
+ * Spawn-based ProcessRunner implementation.
3584
+ *
3585
+ * Behavior:
3586
+ * - `shell: false` and `detached: false`. The process group is not
3587
+ * detached, but the OS does not guarantee the child is reaped when
3588
+ * the parent terminates abruptly; callers handle SIGINT/SIGTERM/exit
3589
+ * hooks themselves.
3590
+ * - `capture: "buffer"` (default): `stdio: ['pipe', 'pipe', 'pipe']`,
3591
+ * stdout / stderr are decoded as UTF-8 and accumulated as full
3592
+ * strings (no streaming callbacks).
3593
+ * - `capture: "none"`: `stdio: ['inherit', 'inherit', 'inherit']`, the
3594
+ * child writes directly to the parent terminal in real time and
3595
+ * `RunResult.stdout` / `stderr` are empty strings. `stdin` is
3596
+ * incompatible with this mode (the child has no writable stdin pipe)
3597
+ * and the combination is rejected before spawn.
3598
+ * - `timeout_ms` and `AbortSignal` both trigger a two-stage kill:
3599
+ * `SIGTERM`, then `SIGKILL` after `DEFAULT_KILL_GRACE_MS` (5_000 ms).
3600
+ * - A non-zero `exit_code` does not throw; it is returned via
3601
+ * `RunResult`. Spawn-time errors throw with a pathless message and
3602
+ * the original error attached as `cause`.
3603
+ *
3604
+ * Error message contract: messages never include `cwd` or absolute
3605
+ * command paths. The original errno (and any nested wrapping) is
3606
+ * preserved on `Error.cause`, allowing callers to classify with
3607
+ * `findErrorCode` when needed.
3608
+ */
3609
+ declare class ChildProcessRunner implements ProcessRunner {
3610
+ run(command: string, args: readonly string[], options: RunOptions): Promise<RunResult>;
3611
+ }
3612
+
3475
3613
  type AppendBasouGitignoreResult = {
3476
3614
  /** True if the block was appended (or the file was newly created). */
3477
3615
  readonly appended: boolean;
@@ -3884,4 +4022,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
3884
4022
  */
3885
4023
  declare const BASOU_CORE_VERSION = "0.1.0";
3886
4024
 
3887
- export { ACTIVE_GAP_CAP_MS, type ActiveTimeBasis, type AdapterOutputEvent, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchiveTaskInput, type ArchiveTaskResult, type AttachTaskInput, type AttachUpdateTaskStatusInput, type AttachableStatus, BASOU_CORE_VERSION, type BasouPaths, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, type DayWorkStats, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, type EditTaskInput, type EditTaskResult, type Event, EventIdSchema, EventSchema, EventSourceSchema, FailedToFinalizeError, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type MeasureAvailability, type NoteAddedEvent, type PrefixedId, type ProcessRunner, type RechainOptions, type RechainResult, type ReconcileAllResult, type ReconcileAllTasksInput, type ReconcileAllTasksOptions, type ReconcileFailure, type ReconcileResult, type ReconcileTaskInput, type RefreshLinkageInput, type RefreshLinkageResult, type ReimportOptions, type ReimportResult, type ReplayOptions, type ReplayWarning, type RiskLevel, RiskLevelSchema, type RunOptions, type RunResult, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type Session, type SessionEndedEvent, type SessionEntry, SessionIdSchema, type SessionImportPayload, SessionImportPayloadSchema, type SessionInnerImportInput, SessionInnerImportSchema, type SessionIntegrity, SessionIntegritySchema, type SessionMetrics, SessionMetricsSchema, SessionSchema, type SessionSkipReason, type SessionSourceKind, SessionSourceKindSchema, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type SuspectReason, type Task, type TaskArchivedEvent, type TaskCreatedEvent, type TaskDeletedEvent, type TaskDocument, TaskIdSchema, type TaskLinkageRefreshedEvent, type TaskReconciledEvent, TaskSchema, type TaskSkipReason, type TaskStatus, type TaskStatusChangedEvent, TaskStatusSchema, TaskWriteAfterEventError, type TaskWriteAfterEventPhase, type TokenTotals, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WriteEventsBulkOptions, type WriteTaskFileMode, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildStatusSnapshot, chainEvents, chainRawJsonLines, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, finalizeSessionYaml, findErrorCode, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, isImportDerivedSource, isLazyExpired, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadSessionEntries, loadTaskEntries, overwriteYamlFile, parseDuration, parseMarkers, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, renderDecisions, renderHandoff, renderWithMarkers, replayEvents, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, tryRemoteUrl, ulid, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
4025
+ export { ACTIVE_GAP_CAP_MS, type ActiveTimeBasis, type AdapterOutputEvent, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchiveTaskInput, type ArchiveTaskResult, type AttachTaskInput, type AttachUpdateTaskStatusInput, type AttachableStatus, BASOU_CORE_VERSION, type BasouPaths, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, type DayWorkStats, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, type EditTaskInput, type EditTaskResult, type Event, EventIdSchema, EventSchema, EventSourceSchema, FailedToFinalizeError, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type MeasureAvailability, type NoteAddedEvent, type PrefixedId, type ProcessRunner, type RechainOptions, type RechainResult, type ReconcileAllResult, type ReconcileAllTasksInput, type ReconcileAllTasksOptions, type ReconcileFailure, type ReconcileResult, type ReconcileTaskInput, type RefreshLinkageInput, type RefreshLinkageResult, type ReimportOptions, type ReimportResult, type ReplayOptions, type ReplayWarning, type ReportApprovalItem, type ReportData, type ReportDecisionItem, type ReportRendererInput, type ReportRendererResult, type ReportSessionItem, type ReportTaskItem, type RiskLevel, RiskLevelSchema, type RunOptions, type RunResult, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type Session, type SessionEndedEvent, type SessionEntry, SessionIdSchema, type SessionImportPayload, SessionImportPayloadSchema, type SessionInnerImportInput, SessionInnerImportSchema, type SessionIntegrity, SessionIntegritySchema, type SessionMetrics, SessionMetricsSchema, SessionSchema, type SessionSkipReason, type SessionSourceKind, SessionSourceKindSchema, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type SuspectReason, type Task, type TaskArchivedEvent, type TaskCreatedEvent, type TaskDeletedEvent, type TaskDocument, TaskIdSchema, type TaskLinkageRefreshedEvent, type TaskReconciledEvent, TaskSchema, type TaskSkipReason, type TaskStatus, type TaskStatusChangedEvent, type TaskStatusCount, TaskStatusSchema, TaskWriteAfterEventError, type TaskWriteAfterEventPhase, type TokenTotals, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WriteEventsBulkOptions, type WriteTaskFileMode, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildStatusSnapshot, chainEvents, chainRawJsonLines, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, finalizeSessionYaml, findErrorCode, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, isImportDerivedSource, isLazyExpired, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadSessionEntries, loadTaskEntries, overwriteYamlFile, parseDuration, parseMarkers, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, renderDecisions, renderHandoff, renderReport, renderWithMarkers, replayEvents, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, tryRemoteUrl, ulid, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };