@basou/core 0.48.1 → 0.49.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
@@ -655,6 +655,174 @@ type SessionImportPayload = z.infer<typeof SessionImportPayloadSchema>;
655
655
  /** Inferred runtime type for {@link SessionInnerImportSchema}. */
656
656
  type SessionInnerImportInput = z.infer<typeof SessionInnerImportSchema>;
657
657
 
658
+ /**
659
+ * Status classification used by the `file_changed` event schema. Limited to
660
+ * the four classes that simple-git's `git diff --name-status` reliably
661
+ * surfaces; copy / unmerged / typechange entries are intentionally dropped
662
+ * to keep the event payload shape narrow.
663
+ */
664
+ type FileChangeStatus = "added" | "modified" | "deleted" | "renamed";
665
+ /**
666
+ * Single file-level change observed between two refs. `old_path` is set
667
+ * only for `renamed` entries (the previous path of the file).
668
+ */
669
+ type FileChange = {
670
+ path: string;
671
+ old_path?: string;
672
+ status: FileChangeStatus;
673
+ };
674
+ /**
675
+ * Result of {@link getDiff}. The `changed_files` array is in git's natural
676
+ * `--name-status` order; callers requiring deterministic ordering should
677
+ * sort by `path` themselves.
678
+ */
679
+ type DiffResult = {
680
+ changed_files: FileChange[];
681
+ };
682
+ /**
683
+ * Compute the file-level diff between two git refs.
684
+ *
685
+ * Returns a list of changed file paths classified by status (added /
686
+ * modified / deleted / renamed). Diff content is intentionally NOT
687
+ * returned — `file_changed` events record paths only, and raw diff bodies
688
+ * are excluded so the trace cannot inadvertently leak source code that may
689
+ * be sensitive. Use `git show <ref>` to obtain the underlying diff.
690
+ *
691
+ * Pathless contract: every thrown message is a fixed string from the set
692
+ * {`Not a git repository`, `Git executable not found in PATH. Install git
693
+ * first.`, `Invalid ref`, `Failed to compute git diff`}; native errors are
694
+ * preserved on `Error.cause`.
695
+ *
696
+ * Special cases:
697
+ * - `baseRef === headRef` short-circuits to an empty result
698
+ * - copy / unmerged / typechange / unknown status codes are skipped
699
+ *
700
+ * @param repoRoot absolute path to the git repository root
701
+ * @param baseRef base ref (e.g. session-start HEAD sha)
702
+ * @param headRef head ref (e.g. session-end HEAD sha)
703
+ */
704
+ declare function getDiff(repoRoot: string, baseRef: string, headRef: string): Promise<DiffResult>;
705
+ /**
706
+ * Files that differ between `baseRef` and the WORKING TREE — committed and
707
+ * uncommitted alike, in one question to git.
708
+ *
709
+ * This is the net change a session produced, which is not the same as the
710
+ * union of "what it committed" and "what it left dirty": a file created and
711
+ * then committed, then modified again, is one `added` entry relative to the
712
+ * base, not an `added` plus a `modified`. Asking git for the net directly is
713
+ * what keeps the two halves from having to be reconciled by hand.
714
+ *
715
+ * Untracked files are NOT included — `git diff` never reports them — so a
716
+ * caller that wants them unions this with {@link getWorkingTreeChanges}.
717
+ *
718
+ * {@link getDiff} does NOT set `core.quotePath=false` and still returns git's
719
+ * quoted rendering for a non-ASCII path. That is a separate defect on a
720
+ * shipped path (`basou run` / `exec` write those paths into `file_changed`
721
+ * events) and is deliberately not changed here.
722
+ *
723
+ * Pathless contract and error vocabulary are identical to {@link getDiff}.
724
+ *
725
+ * @param repoRoot absolute path to the git repository root
726
+ * @param baseRef the ref the session started from (e.g. its session-start HEAD)
727
+ */
728
+ declare function getChangesSince(repoRoot: string, baseRef: string): Promise<FileChange[]>;
729
+
730
+ /**
731
+ * On-disk shape of a session observation. Deliberately NOT one of the durable
732
+ * schemas under `schemas/`: an observation is working state that exists only
733
+ * between a session's start and the import that consumes it, never a
734
+ * provenance record. The record is the `file_changed` event the import writes;
735
+ * this file is the scratch the hooks accumulate it in, and a reader that
736
+ * cannot parse it must be able to drop it and lose nothing but one session's
737
+ * file list. That is why the version below is checked but unversioned in the
738
+ * repository's schema-artifact machinery, and why every read path returns
739
+ * `null` instead of throwing.
740
+ *
741
+ * Nothing deletes these files. An age-based sweep was written and removed
742
+ * before shipping: an observation that has not been imported yet is the ONLY
743
+ * record of what its session changed — the vendor log cannot reproduce it —
744
+ * so deleting one on a timer discards evidence to save a kilobyte. What a
745
+ * retention rule should key on (imported? superseded? the session ended?) is a
746
+ * decision, and an unbounded directory of small files is the honest state to
747
+ * leave it in until that decision is made.
748
+ */
749
+ declare const SESSION_OBSERVATION_SCHEMA_VERSION: "0.1.0";
750
+ declare const ObservedFileSchema: z.ZodObject<{
751
+ path: z.ZodString;
752
+ change_type: z.ZodEnum<{
753
+ added: "added";
754
+ modified: "modified";
755
+ deleted: "deleted";
756
+ renamed: "renamed";
757
+ }>;
758
+ old_path: z.ZodOptional<z.ZodString>;
759
+ }, z.core.$strip>;
760
+ declare const ObservedRepoSchema: z.ZodObject<{
761
+ path: z.ZodString;
762
+ base_head: z.ZodNullable<z.ZodString>;
763
+ base_dirty: z.ZodDefault<z.ZodArray<z.ZodString>>;
764
+ files: z.ZodDefault<z.ZodArray<z.ZodObject<{
765
+ path: z.ZodString;
766
+ change_type: z.ZodEnum<{
767
+ added: "added";
768
+ modified: "modified";
769
+ deleted: "deleted";
770
+ renamed: "renamed";
771
+ }>;
772
+ old_path: z.ZodOptional<z.ZodString>;
773
+ }, z.core.$strip>>>;
774
+ }, z.core.$strip>;
775
+ declare const SessionObservationSchema: z.ZodObject<{
776
+ schema_version: z.ZodString;
777
+ external_id: z.ZodString;
778
+ started_at: z.ZodString;
779
+ updated_at: z.ZodString;
780
+ repos: z.ZodDefault<z.ZodArray<z.ZodObject<{
781
+ path: z.ZodString;
782
+ base_head: z.ZodNullable<z.ZodString>;
783
+ base_dirty: z.ZodDefault<z.ZodArray<z.ZodString>>;
784
+ files: z.ZodDefault<z.ZodArray<z.ZodObject<{
785
+ path: z.ZodString;
786
+ change_type: z.ZodEnum<{
787
+ added: "added";
788
+ modified: "modified";
789
+ deleted: "deleted";
790
+ renamed: "renamed";
791
+ }>;
792
+ old_path: z.ZodOptional<z.ZodString>;
793
+ }, z.core.$strip>>>;
794
+ }, z.core.$strip>>>;
795
+ }, z.core.$strip>;
796
+ /** A file this session changed, as observed through git. */
797
+ type ObservedFile = z.infer<typeof ObservedFileSchema>;
798
+ /** Per-repository half of a {@link SessionObservation}. */
799
+ type ObservedRepo = z.infer<typeof ObservedRepoSchema>;
800
+ /** What the hooks accumulated for one vendor session, keyed by its external id. */
801
+ type SessionObservation = z.infer<typeof SessionObservationSchema>;
802
+ /**
803
+ * Path of the observation file for `externalId`, or `null` when the id could
804
+ * address something other than a file in `observationsDir`.
805
+ */
806
+ declare function sessionObservationPath(observationsDir: string, externalId: string): string | null;
807
+ /**
808
+ * Read one observation. Returns `null` for every failure mode — absent,
809
+ * unreadable, malformed, or written by a future version — because a caller
810
+ * that cannot read the scratch must fall back to "no observation", never to an
811
+ * error that would break a hook or an import.
812
+ */
813
+ declare function readSessionObservation(observationsDir: string, externalId: string): Promise<SessionObservation | null>;
814
+ /**
815
+ * Write one observation atomically. The caller owns the decision to write; a
816
+ * failure propagates so the hook wrapper can swallow it in one place.
817
+ */
818
+ declare function writeSessionObservation(observationsDir: string, observation: SessionObservation): Promise<void>;
819
+ /**
820
+ * Flatten an observation into the file list an importer consumes: repository
821
+ * order, then path order, with duplicates across repositories impossible
822
+ * because the paths are absolute.
823
+ */
824
+ declare function observedFilesOf(observation: SessionObservation): ObservedFile[];
825
+
658
826
  /**
659
827
  * The `source` string stamped on every event derived from a Claude Code
660
828
  * native transcript, and the matching session `source.kind`.
@@ -687,6 +855,26 @@ type ClaudeTranscriptToPayloadOptions = {
687
855
  * matches the imported content. Omitted => the field is not recorded.
688
856
  */
689
857
  sourceSizeBytes?: number;
858
+ /**
859
+ * Files this session changed, observed through git while it ran (see
860
+ * `session/observe.ts`). A transcript can only report an edit made with an
861
+ * editing TOOL; work done through the shell — a heredoc, a `sed -i`, a
862
+ * script — leaves no `file_path` anywhere in it, so a session that edits
863
+ * that way reads as having touched nothing. These observations join
864
+ * `related_files`.
865
+ *
866
+ * They do NOT become events. An observation is a SNAPSHOT that each pass
867
+ * recomputes — a file changed and then reverted leaves it — while the event
868
+ * stream is append-only and a re-import preserves every event it did not
869
+ * derive itself. Writing snapshots into it would duplicate them on every
870
+ * re-import of a growing transcript and leave events contradicting the
871
+ * session record rebuilt beside them. `related_files` is rebuilt from this
872
+ * derivation each time, which is the same shape the observation has.
873
+ *
874
+ * An OPTION rather than something read here: this function is pure, and the
875
+ * observation lives on disk beside the store.
876
+ */
877
+ observedFiles?: ReadonlyArray<ObservedFile>;
690
878
  };
691
879
  /**
692
880
  * Transform a Claude Code native transcript into a Basou
@@ -1146,6 +1334,20 @@ type BasouPaths = {
1146
1334
  };
1147
1335
  readonly locks: string;
1148
1336
  readonly logs: string;
1337
+ /**
1338
+ * Per-session git observations: what each vendor session changed on disk,
1339
+ * accumulated by the hooks while it runs and consumed by the import that
1340
+ * merges it into the session's related files. Working state, not a record —
1341
+ * see `session/observation.ts`.
1342
+ *
1343
+ * Lives UNDER `tmp/` on purpose. `basou init` only appends its ignore block
1344
+ * when the file carries no basou block yet, so a store initialized before
1345
+ * this directory existed never learns to ignore a new top-level entry — and
1346
+ * these files carry absolute machine paths. `.basou/tmp/` is in every
1347
+ * generation of that block, so the placement is what keeps them out of git
1348
+ * rather than an upgrade step nobody runs.
1349
+ */
1350
+ readonly observations: string;
1149
1351
  readonly raw: string;
1150
1352
  readonly tmp: string;
1151
1353
  readonly files: {
@@ -3273,54 +3475,6 @@ type ChainVerdict = {
3273
3475
  */
3274
3476
  declare function verifyEventsChain(paths: BasouPaths, sessionId: string): Promise<ChainVerdict>;
3275
3477
 
3276
- /**
3277
- * Status classification used by the `file_changed` event schema. Limited to
3278
- * the four classes that simple-git's `git diff --name-status` reliably
3279
- * surfaces; copy / unmerged / typechange entries are intentionally dropped
3280
- * to keep the event payload shape narrow.
3281
- */
3282
- type FileChangeStatus = "added" | "modified" | "deleted" | "renamed";
3283
- /**
3284
- * Single file-level change observed between two refs. `old_path` is set
3285
- * only for `renamed` entries (the previous path of the file).
3286
- */
3287
- type FileChange = {
3288
- path: string;
3289
- old_path?: string;
3290
- status: FileChangeStatus;
3291
- };
3292
- /**
3293
- * Result of {@link getDiff}. The `changed_files` array is in git's natural
3294
- * `--name-status` order; callers requiring deterministic ordering should
3295
- * sort by `path` themselves.
3296
- */
3297
- type DiffResult = {
3298
- changed_files: FileChange[];
3299
- };
3300
- /**
3301
- * Compute the file-level diff between two git refs.
3302
- *
3303
- * Returns a list of changed file paths classified by status (added /
3304
- * modified / deleted / renamed). Diff content is intentionally NOT
3305
- * returned — `file_changed` events record paths only, and raw diff bodies
3306
- * are excluded so the trace cannot inadvertently leak source code that may
3307
- * be sensitive. Use `git show <ref>` to obtain the underlying diff.
3308
- *
3309
- * Pathless contract: every thrown message is a fixed string from the set
3310
- * {`Not a git repository`, `Git executable not found in PATH. Install git
3311
- * first.`, `Invalid ref`, `Failed to compute git diff`}; native errors are
3312
- * preserved on `Error.cause`.
3313
- *
3314
- * Special cases:
3315
- * - `baseRef === headRef` short-circuits to an empty result
3316
- * - copy / unmerged / typechange / unknown status codes are skipped
3317
- *
3318
- * @param repoRoot absolute path to the git repository root
3319
- * @param baseRef base ref (e.g. session-start HEAD sha)
3320
- * @param headRef head ref (e.g. session-end HEAD sha)
3321
- */
3322
- declare function getDiff(repoRoot: string, baseRef: string, headRef: string): Promise<DiffResult>;
3323
-
3324
3478
  /**
3325
3479
  * Build a {@link SimpleGit} instance bound to `repoRoot`. Production callers
3326
3480
  * use this single helper so any future tightening (additional safety opts,
@@ -3413,6 +3567,43 @@ declare function tryRemoteUrl(repositoryRoot: string): Promise<string | undefine
3413
3567
  */
3414
3568
  declare function getSnapshot(repositoryRoot: string): Promise<GitSnapshot>;
3415
3569
 
3570
+ /**
3571
+ * Files that differ from `HEAD` in the working tree right now — the half of a
3572
+ * session's work that {@link getDiff} cannot see, because it has not been
3573
+ * committed yet.
3574
+ *
3575
+ * A session is observed from two angles that must be UNIONED, not chosen
3576
+ * between: `getDiff(baseHead, HEAD)` covers what the session committed, and
3577
+ * this covers what it left uncommitted. Either alone reports a session that
3578
+ * ends mid-change (or one that commits everything) as having touched nothing.
3579
+ *
3580
+ * Ignored files are excluded — git's own `status` omits them, which is what
3581
+ * makes this safe to run over a repository with a build tree: `dist/` and
3582
+ * friends are ignored by the repository's own rules, so they never enter a
3583
+ * session's file list.
3584
+ *
3585
+ * Conflicted entries are skipped, matching {@link getDiff}'s treatment of the
3586
+ * `U` status code: the `file_changed` status enum has no class for them.
3587
+ *
3588
+ * Pathless contract: every thrown message is a fixed string from the set
3589
+ * {`Not a git repository`, `Git executable not found in PATH. Install git
3590
+ * first.`, `Failed to read git status`}; native errors are preserved on
3591
+ * `Error.cause`.
3592
+ *
3593
+ * @param repoRoot absolute path to the git repository root
3594
+ */
3595
+ declare function getWorkingTreeChanges(repoRoot: string): Promise<FileChange[]>;
3596
+ /**
3597
+ * `HEAD`'s commit sha, or `null` when the repository has no commits yet (an
3598
+ * unborn branch — a `git init` nobody has committed into). The null case is a
3599
+ * legitimate state for a young repository, not a failure, so it is a value
3600
+ * rather than a throw; a caller then has only the working tree to observe.
3601
+ *
3602
+ * Throws the same fixed strings as {@link getWorkingTreeChanges} when the path
3603
+ * is not a repository or git is missing.
3604
+ */
3605
+ declare function readHeadSha(repoRoot: string): Promise<string | null>;
3606
+
3416
3607
  /**
3417
3608
  * Allowed ID type prefixes for Basou entities.
3418
3609
  *
@@ -7196,6 +7387,63 @@ declare class ChildProcessRunner implements ProcessRunner {
7196
7387
  run(command: string, args: readonly string[], options: RunOptions): Promise<RunResult>;
7197
7388
  }
7198
7389
 
7390
+ /**
7391
+ * Which repositories a session's file changes are looked for in: the roster
7392
+ * the workspace declares, resolved against the store's own root.
7393
+ *
7394
+ * `repos` (not `import.source_roots`) is the roster: source roots also carry
7395
+ * non-git entries such as the workspace view, and a view is a directory of
7396
+ * symlinks with no git of its own. A workspace that declares no roster is
7397
+ * observed in its own repository only.
7398
+ */
7399
+ declare function observedRepoRoots(root: string, manifest: Manifest): string[];
7400
+ /** Inputs shared by the two observation passes. */
7401
+ type ObserveSessionInput = {
7402
+ /** `.basou/observations` of the workspace the session belongs to. */
7403
+ observationsDir: string;
7404
+ /** Absolute git repository roots to observe. */
7405
+ repoRoots: readonly string[];
7406
+ /** The vendor's session id (Claude Code's `session_id`). */
7407
+ externalId: string;
7408
+ /** Timestamp to stamp the observation with. */
7409
+ nowIso: string;
7410
+ };
7411
+ /**
7412
+ * Record where each repository stood when the session started, so a later pass
7413
+ * can ask git what changed since. Without this, "what did this session change"
7414
+ * has no base to be measured from, and the only remaining answer would be a
7415
+ * time window over commits — which attributes by proximity rather than by
7416
+ * observation, and this product has already rejected that once.
7417
+ *
7418
+ * Re-entrant by design: a SessionStart that fires again for the SAME session id
7419
+ * (a resume, a compaction) must NOT re-baseline, or every commit the session
7420
+ * has already made would drop out of its own record. An existing observation is
7421
+ * therefore left exactly as it is.
7422
+ *
7423
+ * Returns the observation in force after the call, or `null` when nothing could
7424
+ * be observed (no repository among `repoRoots` was readable).
7425
+ */
7426
+ declare function recordSessionBaseline(input: ObserveSessionInput): Promise<SessionObservation | null>;
7427
+ /**
7428
+ * Recompute what the session has changed so far, against the baseline recorded
7429
+ * at its start, and persist the result.
7430
+ *
7431
+ * A FULL recomputation, not an accumulation: `git diff <base>` already answers
7432
+ * "net change since the session started" for tracked files, committed or not,
7433
+ * so there is nothing to merge across turns and no way for the two halves to
7434
+ * disagree. A file that was changed and then reverted correctly disappears.
7435
+ *
7436
+ * Per repository, a failure keeps that repository's PREVIOUS file list rather
7437
+ * than clearing it: the common cause is a base commit that no longer resolves
7438
+ * (a rebase, a reset), and forgetting what was already observed would be a
7439
+ * silent loss where a stale list is merely old.
7440
+ *
7441
+ * Returns `null` when the session has no baseline — it started before the hook
7442
+ * was installed, or outside a registered workspace — because inventing one now
7443
+ * would measure from the middle of the work.
7444
+ */
7445
+ declare function observeSessionChanges(input: Omit<ObserveSessionInput, "repoRoots">): Promise<SessionObservation | null>;
7446
+
7199
7447
  type AppendBasouGitignoreResult = {
7200
7448
  /** True if the block was appended (or the file was newly created). */
7201
7449
  readonly appended: boolean;
@@ -7665,4 +7913,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
7665
7913
  */
7666
7914
  declare const BASOU_CORE_VERSION = "0.1.0";
7667
7915
 
7668
- export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, APPROVAL_SCHEMA_VERSION, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AnchorStarterInput, type AnchorStarterRepo, 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_BUILD, BASOU_CORE_VERSION, type BasouPaths, type BuildStamp, type BuildStopHookCommandOptions, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type CitedReview, type ClaudeSettings, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexCommandLookup, type CodexHooksFile, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, DECISION_GAPS_EPOCH, DEFAULT_STOP_HOOK_MIN_EDITS, type DayWorkStats, type DecisionGap, type DecisionGapsExcluded, type DecisionGapsIncomplete, type DecisionGapsInput, type DecisionGapsScope, type DecisionGapsSummary, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, EVENT_SCHEMA_VERSION, 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 IncompleteWiring, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSIONS, type JsonSchemaArtifact, LOCAL_CLI_EVENT_SOURCE, type LoadFederatedOptions, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, MANIFEST_SCHEMA_VERSION, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type MissingCanonical, type NoteAddedEvent, ORIENTATION_END, ORIENTATION_START, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, PROTOCOL_UPDATE_TOKEN_PREFIX, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type PresetStrings, type ProcessRunner, type ProtocolStamp, type PublishKind, type PublishTarget, REVIEW_RECORD_NO_INPUT_HINT, 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 RepoInstructions, type RepoLanguage, type RepoPathProblem, 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 RetrofitAction, type RetrofitAgentsState, type RetrofitFacts, type RetrofitPlan, type RetrofitReason, type ReviewBlocked, type ReviewFinding, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type ReviewGateResult, type ReviewGateSilentReason, type ReviewRecordBlockedInput, type ReviewRecordFindingInput, type ReviewRecordInput, type ReviewRecordedEvent, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, type RunOptions, type RunResult, SESSION_IMPORT_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SESSION_START_HOOK_CONTEXT_LIMIT, SESSION_START_HOOK_MATCHER, SESSION_START_HOOK_STATUS_MESSAGE, SESSION_START_HOOK_TIMEOUT_SECONDS, STOP_HOOK_TIMEOUT_SECONDS, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type SelfReportedReview, 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 SessionStartHookLocation, type SessionStartHookRemoval, type SessionStartHookUpsert, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceRootScope, type SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type StopHookEvaluation, type StopHookEvaluationInput, type StopHookRemoval, type StopHookSilentReason, type StopHookUpsert, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, TASK_SCHEMA_VERSION, 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 UnattachedSelfReports, type UnbindableRepo, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type ViewCollision, type ViewConflict, type ViewLanguage, type ViewLinkState, type ViewPresetInput, type ViewPresetRepo, type ViewRepoFact, type ViewStrayUnknown, type ViewStrings, type ViewWiringFacts, type WiringCollision, type WiringConflict, type WiringDriftSummary, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, type WriteEventsBulkOptions, type WriteTaskFileMode, ZERO_DURATION_RETIRED_SINCE, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildReviewRecordLabel, buildReviewRecordedEvent, buildSessionStartHookCommand, buildStatusSnapshot, buildStopHookCommand, carryForwardProtocolStamp, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexAdapterMetadata, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findBasouSessionStartHook, findBasouStopHookCommand, findDecisionGaps, findErrorCode, findReviewGaps, findUnbindableRepos, formatDurationMs, genesisHash, getDiff, getSnapshot, hasRetiredZeroDuration, importSessionFromJson, inspectChainTail, instructionMode, isBasouSessionStartHookCommand, isBasouStopHookCommand, isGitNotFound, isImportDerivedSource, isLazyExpired, isProtocolUpdateDue, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseBuildStamp, parseDuration, parseMarkers, parseProtocolStamp, parseReviewRecordInput, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, presetStrings, protocolBlockHash, protocolSectionsFrom, protocolUpdateToken, readAllEvents, readManifest, readMarkdownFile, readObservedDuration, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, removeSessionStartHook, removeStopHook, renderAnchorStarter, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderProtocolStamp, renderProtocolUpdate, renderReport, renderViewPresetBlock, renderWithMarkers, replayEvents, resolveAnchorContentLanguage, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveCodexCommand, resolveRepoContentLanguage, resolveRepoRoot, resolveRepositoryRoot, resolveSessionId, resolveTaskId, resolveViewLanguage, resolveViewLanguageFromPaths, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, seedMarkers, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, summarizeWiringDrift, transcriptStartedAt, tryRemoteUrl, ulid, unknownManifestKeys, unstampedProtocolSectionsFrom, updateTaskStatusWithEvent, upsertSessionStartHook, upsertStopHook, verifyEventsChain, viewStrings, writeEventsBulk, writeManifest, writeMarkdownFile, writeObservedDuration, writeStatus, writeTaskFile, writeYamlFile };
7916
+ export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, APPROVAL_SCHEMA_VERSION, type ActiveTimeBasis, type AdapterOutputEvent, type AdoptCandidate, type AdoptCandidateKind, type AnchorStarterInput, type AnchorStarterRepo, 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_BUILD, BASOU_CORE_VERSION, type BasouPaths, type BuildStamp, type BuildStopHookCommandOptions, type BulkChainResult, CLAUDE_IMPORT_SOURCE, CODEX_IMPORT_SOURCE, type CaptureMode, type ChainBreakReason, type ChainTailState, type ChainVerdict, type ChainVerdictStatus, type ChainedEvents, ChildProcessRunner, type CitedReview, type ClaudeSettings, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type CodexCommandLookup, type CodexHooksFile, type CodexRolloutRecord, type CodexRolloutToPayloadOptions, type CommandExecutedEvent, type CommandLookup, type CreateAdHocSessionInput, type CreateAdHocSessionResult, type CreateAdHocTaskInput, type CreateManifestInput, type CreateTaskInput, type CreateTaskResult, DECISION_GAPS_EPOCH, DEFAULT_STOP_HOOK_MIN_EDITS, type DayWorkStats, type DecisionGap, type DecisionGapsExcluded, type DecisionGapsIncomplete, type DecisionGapsInput, type DecisionGapsScope, type DecisionGapsSummary, DecisionIdSchema, type DecisionRecordedEvent, type DecisionsRendererInput, type DecisionsRendererResult, type DeleteTaskInput, type DeleteTaskResult, type DiffResult, EVENT_SCHEMA_VERSION, 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 IncompleteWiring, type InstructionFileFact, type InstructionSymlinkFact, type InstructionSymlinkState, IsoTimestampSchema, JSON_SCHEMA_VERSIONS, type JsonSchemaArtifact, LOCAL_CLI_EVENT_SOURCE, type LoadFederatedOptions, type LoadSessionEntriesOptions, type LoadTaskEntriesOptions, type LoadedApproval, type LockHandle, type LockScope, MANIFEST_SCHEMA_VERSION, type Manifest, ManifestSchema, type MarkerSection, type Markers, type MeasureAvailability, type MissingCanonical, type NoteAddedEvent, ORIENTATION_END, ORIENTATION_START, type ObserveSessionInput, type ObservedFile, type ObservedRepo, type OrientationRendererInput, type OrientationRendererResult, type OrientationSummary, PROTOCOL_END, PROTOCOL_START, PROTOCOL_UPDATE_TOKEN_PREFIX, type PrefixedId, type PresetAction, type PresetCollision, type PresetMarkerConflict, type PresetMarkerKind, type PresetPlanSummary, type PresetRepo, type PresetStrings, type ProcessRunner, type ProtocolStamp, type PublishKind, type PublishTarget, REVIEW_RECORD_NO_INPUT_HINT, 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 RepoInstructions, type RepoLanguage, type RepoPathProblem, 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 RetrofitAction, type RetrofitAgentsState, type RetrofitFacts, type RetrofitPlan, type RetrofitReason, type ReviewBlocked, type ReviewFinding, type ReviewGapRepoSummary, type ReviewGapUnit, type ReviewGapVerdict, type ReviewGapsInput, type ReviewGapsSummary, type ReviewGateResult, type ReviewGateSilentReason, type ReviewRecordBlockedInput, type ReviewRecordFindingInput, type ReviewRecordInput, type ReviewRecordedEvent, type RiskLevel, RiskLevelSchema, type RosterAdoptionPlan, type RosterDriftSummary, type RunOptions, type RunResult, SESSION_IMPORT_SCHEMA_VERSION, SESSION_OBSERVATION_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SESSION_START_HOOK_CONTEXT_LIMIT, SESSION_START_HOOK_MATCHER, SESSION_START_HOOK_STATUS_MESSAGE, SESSION_START_HOOK_TIMEOUT_SECONDS, STOP_HOOK_TIMEOUT_SECONDS, STUCK_THRESHOLD_MS, type SanitizePathOptions, type SanitizeRelatedFilesResult, SchemaVersionSchema, type SelfReportedReview, type Session, type SessionEndedEvent, type SessionEntry, SessionIdSchema, type SessionImportPayload, SessionImportPayloadSchema, type SessionInnerImportInput, SessionInnerImportSchema, type SessionIntegrity, SessionIntegritySchema, type SessionMetrics, SessionMetricsSchema, type SessionObservation, SessionSchema, type SessionSkipReason, type SessionSourceKind, SessionSourceKindSchema, type SessionStartHookLocation, type SessionStartHookRemoval, type SessionStartHookUpsert, type SessionStartedEvent, type SessionStatus, type SessionStatusChangedEvent, SessionStatusSchema, type SessionWorkStats, type SourceRootScope, type SourceRootsReconcile, type SourceWorkStats, type StatusCount, StatusSchema, type StatusSnapshot, type StopHookEvaluation, type StopHookEvaluationInput, type StopHookRemoval, type StopHookSilentReason, type StopHookUpsert, type SuspectReason, type SymlinkCollision, type SymlinkConflict, type SymlinkPlanSummary, TASK_SCHEMA_VERSION, 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 UnattachedSelfReports, type UnbindableRepo, type UpdateAdHocTaskStatusInput, type UpdateTaskStatusInput, type UpdateTaskStatusResult, type ViewCollision, type ViewConflict, type ViewLanguage, type ViewLinkState, type ViewPresetInput, type ViewPresetRepo, type ViewRepoFact, type ViewStrayUnknown, type ViewStrings, type ViewWiringFacts, type WiringCollision, type WiringConflict, type WiringDriftSummary, type WiringRisk, type WiringSummary, type WorkStatsInput, type WorkStatsResult, type WorkStatsTotals, WorkspaceIdSchema, type WorkspaceViewPlan, type WriteEventsBulkOptions, type WriteTaskFileMode, ZERO_DURATION_RETIRED_SINCE, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildReviewRecordLabel, buildReviewRecordedEvent, buildSessionStartHookCommand, buildStatusSnapshot, buildStopHookCommand, carryForwardProtocolStamp, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexAdapterMetadata, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findBasouSessionStartHook, findBasouStopHookCommand, findDecisionGaps, findErrorCode, findReviewGaps, findUnbindableRepos, formatDurationMs, genesisHash, getChangesSince, getDiff, getSnapshot, getWorkingTreeChanges, hasRetiredZeroDuration, importSessionFromJson, inspectChainTail, instructionMode, isBasouSessionStartHookCommand, isBasouStopHookCommand, isGitNotFound, isImportDerivedSource, isLazyExpired, isProtocolUpdateDue, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, observeSessionChanges, observedFilesOf, observedRepoRoots, overwriteYamlFile, parseBuildStamp, parseDuration, parseMarkers, parseProtocolStamp, parseReviewRecordInput, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, presetStrings, protocolBlockHash, protocolSectionsFrom, protocolUpdateToken, readAllEvents, readHeadSha, readManifest, readMarkdownFile, readObservedDuration, readSessionObservation, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, recordSessionBaseline, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, removeSessionStartHook, removeStopHook, renderAnchorStarter, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderProtocolStamp, renderProtocolUpdate, renderReport, renderViewPresetBlock, renderWithMarkers, replayEvents, resolveAnchorContentLanguage, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveCodexCommand, resolveRepoContentLanguage, resolveRepoRoot, resolveRepositoryRoot, resolveSessionId, resolveTaskId, resolveViewLanguage, resolveViewLanguageFromPaths, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, seedMarkers, serializeEventLine, serializeJsonSchema, sessionObservationPath, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, summarizeWiringDrift, transcriptStartedAt, tryRemoteUrl, ulid, unknownManifestKeys, unstampedProtocolSectionsFrom, updateTaskStatusWithEvent, upsertSessionStartHook, upsertStopHook, verifyEventsChain, viewStrings, writeEventsBulk, writeManifest, writeMarkdownFile, writeObservedDuration, writeSessionObservation, writeStatus, writeTaskFile, writeYamlFile };