@basou/core 0.15.0 → 0.17.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
@@ -1573,6 +1573,19 @@ type SessionEntry = {
1573
1573
  session: Session;
1574
1574
  suspect: boolean;
1575
1575
  suspectReason: SuspectReason | null;
1576
+ /**
1577
+ * The trail store this entry was read from. Its `sessions` directory locates
1578
+ * the session's `events.jsonl`, so a federated caller can replay events from
1579
+ * the store the session actually lives in (not the local store). For a plain
1580
+ * local load this is the `paths` passed to {@link loadSessionEntries}.
1581
+ */
1582
+ sourceRoot: BasouPaths;
1583
+ /**
1584
+ * Federation host label from the registry (`~/.basou/hosts.yaml`), or `null`
1585
+ * for the local store. Surfaced by orientation so a merged, multi-host view
1586
+ * can attribute the latest session / decision / next-step to its host.
1587
+ */
1588
+ host: string | null;
1576
1589
  };
1577
1590
  /**
1578
1591
  * Per-session degradation reason emitted by {@link loadSessionEntries.onSkip}.
@@ -1595,6 +1608,28 @@ type LoadSessionEntriesOptions = {
1595
1608
  onWarning?: (warning: ReplayWarning, sessionId: string) => void;
1596
1609
  onSkip?: (sessionId: string, reason: SessionSkipReason) => void;
1597
1610
  };
1611
+ /**
1612
+ * A trail store to read in a federated load, tagged with its host label.
1613
+ * `host: null` denotes the local store; a non-null label comes from the host
1614
+ * registry (`~/.basou/hosts.yaml`). `paths` is where that store is reachable
1615
+ * as a local path on this machine (an SSHFS mount, an rsync mirror, etc.) —
1616
+ * basou itself never performs any network I/O to obtain it.
1617
+ */
1618
+ type FederatedRoot = {
1619
+ paths: BasouPaths;
1620
+ host: string | null;
1621
+ };
1622
+ type LoadFederatedOptions = LoadSessionEntriesOptions & {
1623
+ /**
1624
+ * Called when a NON-local root cannot be enumerated (present-but-unreadable
1625
+ * mount, permission error). That root is skipped best-effort so the local
1626
+ * store and other roots still load. The local root (`host: null`) is never
1627
+ * degraded here — its errors propagate, preserving single-store behaviour.
1628
+ * (An absent root path is not an error: {@link enumerateSessionDirs} returns
1629
+ * `[]` on ENOENT, so a dropped mount is simply an empty host.)
1630
+ */
1631
+ onRootUnavailable?: (host: string, error: unknown) => void;
1632
+ };
1598
1633
  /**
1599
1634
  * List session directory names under `paths.sessions`, ULID ascending.
1600
1635
  *
@@ -1668,20 +1703,18 @@ declare function classifySuspect(paths: BasouPaths, sessionId: string, session:
1668
1703
  suspect: boolean;
1669
1704
  suspectReason: SuspectReason | null;
1670
1705
  }>;
1706
+ declare function loadSessionEntries(paths: BasouPaths, options: LoadSessionEntriesOptions): Promise<SessionEntry[]>;
1671
1707
  /**
1672
- * High-level helper that enumerates session dirs, reads each `session.yaml`,
1673
- * and classifies suspect for `running` sessions in one pass.
1674
- *
1675
- * Per-session degradations are surfaced via `options.onSkip`:
1676
- * - `session_yaml_missing` (ENOENT) and `session_yaml_invalid` (parse or
1677
- * schema violation): the entry is omitted from the result.
1678
- * - `events_jsonl_unreadable`: the entry is still pushed with `suspect=false`
1679
- * so callers can render the session row plus a CLI-side warning.
1680
- *
1681
- * `options.now` is taken once and threaded into every {@link classifySuspect}
1682
- * call so age comparisons are consistent across sessions.
1708
+ * Federated load across multiple trail stores. Each root's sessions are tagged
1709
+ * with that root's host label and `sourceRoot`, so a caller replays events from
1710
+ * the store the session lives in. De-duped by `sessionId` (a per-host random
1711
+ * ULID), then by `source.external_id` when present — first occurrence wins, so
1712
+ * pass the local root FIRST to keep it authoritative (e.g. over a re-imported
1713
+ * copy of the same vendor session on another host). A non-local root that
1714
+ * cannot be enumerated is reported via `onRootUnavailable` and skipped; the
1715
+ * local root's errors propagate, matching {@link loadSessionEntries}.
1683
1716
  */
1684
- declare function loadSessionEntries(paths: BasouPaths, options: LoadSessionEntriesOptions): Promise<SessionEntry[]>;
1717
+ declare function loadFederatedSessionEntries(roots: ReadonlyArray<FederatedRoot>, options: LoadFederatedOptions): Promise<SessionEntry[]>;
1685
1718
 
1686
1719
  type DecisionsRendererInput = {
1687
1720
  paths: BasouPaths;
@@ -3128,6 +3161,71 @@ type SanitizeRelatedFilesResult = {
3128
3161
  */
3129
3162
  declare function sanitizeRelatedFiles(paths: ReadonlyArray<string>, opts: SanitizePathOptions): SanitizeRelatedFilesResult;
3130
3163
 
3164
+ /**
3165
+ * Cross-project boundary classification: split a session's `related_files`
3166
+ * into those that resolve INSIDE the project's declared `source_roots` and
3167
+ * those that confidently resolve OUTSIDE all of them.
3168
+ *
3169
+ * Why this exists: the claude-code adapter records every file a transcript
3170
+ * edited, regardless of where the file lives. A session is attributed to a
3171
+ * project by its recorded cwd (the import-time cwd guard), but a session that
3172
+ * legitimately belongs to project A can still have edited files under an
3173
+ * unrelated repo B. Those B paths then surface in `basou orient`'s "recent
3174
+ * files" and can mislead a resuming agent into continuing the wrong project's
3175
+ * work. This helper is the read-only primitive both the import warning and the
3176
+ * orientation advisory use to flag that boundary crossing — it never mutates
3177
+ * the trail.
3178
+ *
3179
+ * Resolution is realpath-aware so a file recorded through a workspace-view
3180
+ * symlink (e.g. `~/projects/foo-workspace/foo -> ../foo`) is NOT mis-flagged as
3181
+ * out-of-root. The bias is deliberately toward NOT crying wolf: a path is only
3182
+ * reported out-of-root when it confidently resolves outside every source root.
3183
+ * Anything that cannot be resolved with confidence stays classified in-root.
3184
+ */
3185
+ /**
3186
+ * The agent's / basou's own tooling directories. Edits here (plans, memory,
3187
+ * the trail store itself) are routine infrastructure, not another project's
3188
+ * work, so callers pass these as `extraInRoot` to keep them out of the
3189
+ * cross-project out-of-root flag.
3190
+ */
3191
+ declare const AGENT_INFRA_DIRS: readonly string[];
3192
+ /** Result of {@link classifyFilesBySourceRoot}: a partition of the input. */
3193
+ type SourceRootScope = {
3194
+ /** Entries (verbatim, as passed in) that resolve under a source root, or that could not be resolved with confidence. */
3195
+ inRoot: string[];
3196
+ /** Entries (verbatim) that confidently resolve outside every source root. */
3197
+ outOfRoot: string[];
3198
+ };
3199
+ /**
3200
+ * Partition `files` into in-root / out-of-root against the project's
3201
+ * `source_roots`.
3202
+ *
3203
+ * - `sourceRoots` are the manifest's `import.source_roots` (relative to
3204
+ * `masterRoot`). An absent/empty list means "the whole repo root" — matching
3205
+ * the effective-source-roots rule elsewhere — so a solo project never reports
3206
+ * anything out-of-root.
3207
+ * - `masterRoot` is the absolute repository root the source roots resolve
3208
+ * against (the parent of `.basou`).
3209
+ *
3210
+ * Returns `{ inRoot, outOfRoot }` preserving the original entry strings. Empty
3211
+ * input or zero resolvable roots yields everything in-root (no false alarms).
3212
+ */
3213
+ declare function classifyFilesBySourceRoot(input: {
3214
+ files: readonly string[];
3215
+ workingDirectory: string;
3216
+ sourceRoots: readonly string[] | null | undefined;
3217
+ masterRoot: string;
3218
+ /**
3219
+ * Extra directories (absolute or `~`-prefixed) that also count as in-root.
3220
+ * Callers pass the agent's own tooling dirs (`~/.claude`, `~/.codex`,
3221
+ * `~/.basou`) so routine plan / memory / store edits are NOT flagged as
3222
+ * another project's work — they are infrastructure, not a cross-project
3223
+ * crossing. Resolved against the home directory, not `masterRoot`.
3224
+ */
3225
+ extraInRoot?: readonly string[];
3226
+ homedir?: string;
3227
+ }): Promise<SourceRootScope>;
3228
+
3131
3229
  /** Input contract for {@link renderOrientation} and {@link summarizeOrientation}. */
3132
3230
  type OrientationRendererInput = {
3133
3231
  paths: BasouPaths;
@@ -3155,6 +3253,19 @@ type OrientationRendererInput = {
3155
3253
  * reads as a verdict for a supervisor, not developer diagnostics.
3156
3254
  */
3157
3255
  verbose?: boolean;
3256
+ /**
3257
+ * Additional trail stores to MERGE into this orientation, each a local path
3258
+ * (an SSHFS mount / rsync mirror of another host's `.basou`) tagged with a
3259
+ * host label. Absent / empty = local-only (byte-identical to before). basou
3260
+ * performs no network I/O; the operator's existing tooling places these paths.
3261
+ */
3262
+ federatedRoots?: FederatedRoot[];
3263
+ /**
3264
+ * Called when a federated (non-local) host root is present but cannot be
3265
+ * enumerated (e.g. an unreadable mount). That host is skipped; the local
3266
+ * store and other hosts still render. An absent root path is silently empty.
3267
+ */
3268
+ onHostUnavailable?: (host: string, error: unknown) => void;
3158
3269
  };
3159
3270
  type OrientationRendererResult = {
3160
3271
  /** Generated body. orientation.md is overwritten whole (no markers, gitignored). */
@@ -3171,11 +3282,13 @@ type DecisionRecord = {
3171
3282
  title: string;
3172
3283
  occurredAt: string;
3173
3284
  sessionId: string;
3285
+ host: string | null;
3174
3286
  };
3175
3287
  type NoteRecord = {
3176
3288
  body: string;
3177
3289
  sessionId: string;
3178
3290
  occurredAt: string;
3291
+ host: string | null;
3179
3292
  };
3180
3293
  type PendingApproval = {
3181
3294
  id: string;
@@ -3200,11 +3313,13 @@ type SuspectSession = {
3200
3313
  sessionId: string;
3201
3314
  status: string;
3202
3315
  reason: SuspectReason | null;
3316
+ host: string | null;
3203
3317
  };
3204
3318
  type LatestSession = {
3205
3319
  sessionId: string;
3206
3320
  label: string | null;
3207
3321
  status: string;
3322
+ host: string | null;
3208
3323
  };
3209
3324
  type SourceCount = {
3210
3325
  kind: string;
@@ -3238,10 +3353,19 @@ type OrientationSummary = {
3238
3353
  * step / handoff ("次の起点") surfaced in the forward section; null when none.
3239
3354
  */
3240
3355
  latestNote: NoteRecord | null;
3241
- /** related_files of the latest session, deduped + sorted + capped at the display limit. */
3356
+ /**
3357
+ * related_files of the latest session, deduped + sorted + capped at the
3358
+ * display limit. `outOfRoot` lists the entries (over the FULL deduped set,
3359
+ * not just `displayed`) that resolve OUTSIDE the project's `source_roots` — a
3360
+ * cross-project boundary crossing worth flagging so a resuming agent does not
3361
+ * mistake another repo's edits for this project's work. Empty unless the
3362
+ * latest session is local (a federated host's source_roots are not loaded
3363
+ * here) and confidently has out-of-root edits.
3364
+ */
3242
3365
  relatedFiles: {
3243
3366
  displayed: string[];
3244
3367
  overflow: number;
3368
+ outOfRoot: string[];
3245
3369
  };
3246
3370
  /** Tasks whose status is `planned` or `in_progress`. */
3247
3371
  inFlightTasks: InFlightTask[];
@@ -3249,6 +3373,12 @@ type OrientationSummary = {
3249
3373
  plannedTasks: PlannedTask[];
3250
3374
  pendingApprovals: PendingApproval[];
3251
3375
  suspects: SuspectSession[];
3376
+ /**
3377
+ * Distinct non-local host labels present in the merged set (sorted). Empty
3378
+ * for a local-only orientation. Lets a consumer render the multi-host banner
3379
+ * and the local-only-freshness caveat without re-deriving from sessions.
3380
+ */
3381
+ hosts: string[];
3252
3382
  freshness: {
3253
3383
  /** started_at of the newest non-archived session, or null when none captured. */
3254
3384
  newestStartedAt: string | null;
@@ -5324,4 +5454,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
5324
5454
  */
5325
5455
  declare const BASOU_CORE_VERSION = "0.1.0";
5326
5456
 
5327
- export { ACTIVE_GAP_CAP_MS, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AppendBasouGitignoreOptions, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchivePlan, 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 CitedReview, 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, type ExistingViewLink, FailedToFinalizeError, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type GitignorePlanSummary, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type NoteAddedEvent, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type ProcessRunner, type PublishKind, type PublishTarget, 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 RenamePlan, type ReplayOptions, type ReplayWarning, type RepoEntry, type RepoGitignoreFacts, type RepoGitignorePlan, type RepoLanguage, type RepoPresetFacts, type RepoPresetPlan, type RepoSymlinkFacts, type RepoSymlinkPlan, type RepoVisibility, type RepoWiringFacts, type ReportApprovalItem, type ReportData, type ReportDecisionItem, type ReportRendererInput, type ReportRendererResult, type ReportSessionItem, type ReportTaskItem, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, 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 SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, 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 ViewCollision, type ViewConflict, type ViewLinkState, type ViewRepoFact, type ViewStrayUnknown, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, 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, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
5457
+ export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AppendBasouGitignoreOptions, type AppendBasouGitignoreResult, type AppendEventToExistingInput, type AppendEventToExistingResult, type Approval, type ApprovalApprovedEvent, type ApprovalExpiredEvent, ApprovalIdSchema, type ApprovalLocation, type ApprovalRejectedEvent, type ApprovalRequestedEvent, ApprovalSchema, type ApprovalStatus, ApprovalStatusSchema, type ArchivePlan, 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 CitedReview, 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, type ExistingViewLink, FailedToFinalizeError, type FederatedRoot, type FileChange, type FileChangeStatus, type FileChangedEvent, GENERATED_END, GENERATED_START, type GitSnapshot, type GitSnapshotEvent, type GitignorePlanSummary, type HandoffRendererInput, type HandoffRendererResult, ID_PREFIXES, type IdPrefix, type ImportSessionOptions, type ImportSessionResult, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSION, type JsonSchemaArtifact, type LoadFederatedOptions, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type NoteAddedEvent, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type ProcessRunner, type PublishKind, type PublishTarget, 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 RenamePlan, type ReplayOptions, type ReplayWarning, type RepoEntry, type RepoGitignoreFacts, type RepoGitignorePlan, type RepoLanguage, type RepoPresetFacts, type RepoPresetPlan, type RepoSymlinkFacts, type RepoSymlinkPlan, type RepoVisibility, type RepoWiringFacts, type ReportApprovalItem, type ReportData, type ReportDecisionItem, type ReportRendererInput, type ReportRendererResult, type ReportSessionItem, type ReportTaskItem, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, 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 SourceRootScope, type SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, 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 ViewCollision, type ViewConflict, type ViewLinkState, type ViewRepoFact, type ViewStrayUnknown, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, type WriteEventsBulkOptions, type WriteTaskFileMode, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildStatusSnapshot, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, finalizeSessionYaml, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };