@basou/core 0.50.0 → 0.51.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 +38 -6
- package/dist/index.js +59 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -800,11 +800,6 @@ declare function getDiff(repoRoot: string, baseRef: string, headRef: string): Pr
|
|
|
800
800
|
* Untracked files are NOT included — `git diff` never reports them — so a
|
|
801
801
|
* caller that wants them unions this with {@link getWorkingTreeChanges}.
|
|
802
802
|
*
|
|
803
|
-
* {@link getDiff} does NOT set `core.quotePath=false` and still returns git's
|
|
804
|
-
* quoted rendering for a non-ASCII path. That is a separate defect on a
|
|
805
|
-
* shipped path (`basou run` / `exec` write those paths into `file_changed`
|
|
806
|
-
* events) and is deliberately not changed here.
|
|
807
|
-
*
|
|
808
803
|
* Pathless contract and error vocabulary are identical to {@link getDiff}.
|
|
809
804
|
*
|
|
810
805
|
* @param repoRoot absolute path to the git repository root
|
|
@@ -4574,6 +4569,43 @@ declare function parseBuildStamp(raw: string | undefined): BuildStamp | undefine
|
|
|
4574
4569
|
*/
|
|
4575
4570
|
declare const BASOU_CORE_BUILD: BuildStamp | undefined;
|
|
4576
4571
|
|
|
4572
|
+
/**
|
|
4573
|
+
* Render a recorded file path for a human reader or a model: every character
|
|
4574
|
+
* that would act rather than read — a line break, a tab, an escape sequence —
|
|
4575
|
+
* becomes a visible escape, and every other character is left as it is.
|
|
4576
|
+
*
|
|
4577
|
+
* Paths are stored RAW, exactly as the filesystem names the file, because that
|
|
4578
|
+
* is the only spelling that identifies it. But a raw name can carry a newline,
|
|
4579
|
+
* and every place basou prints paths is line-structured: a generated Markdown
|
|
4580
|
+
* document, where a newline followed by `## ` in a file name becomes a heading
|
|
4581
|
+
* of the document; the position handed to a session at start, where it becomes
|
|
4582
|
+
* text the model reads as basou's own; and a terminal, where an ESC byte in a
|
|
4583
|
+
* name is an instruction to the terminal, not a character. So the conversion
|
|
4584
|
+
* happens where a path is SHOWN, never where it is kept.
|
|
4585
|
+
*
|
|
4586
|
+
* Not {@link oneLine}: collapsing a newline into a space turns `a\nb.txt` into
|
|
4587
|
+
* `a b.txt`, which is another, possibly real, file.
|
|
4588
|
+
*
|
|
4589
|
+
* Escaped: C0 controls (U+0000–U+001F), DEL, C1 controls (U+0080–U+009F), the
|
|
4590
|
+
* Unicode line and paragraph separators U+2028 / U+2029, which Markdown and
|
|
4591
|
+
* JavaScript both treat as line breaks, and the bidirectional embedding,
|
|
4592
|
+
* override and isolate controls (U+202A–U+202E, U+2066–U+2069), one of which is
|
|
4593
|
+
* enough to make every name after it on the line display reversed. `\n`, `\r`
|
|
4594
|
+
* and `\t` keep their familiar spellings; the rest become `\xHH` or `\uHHHH`.
|
|
4595
|
+
*
|
|
4596
|
+
* NOT reversible, and not meant to be. A backslash is not escaped -- it is an
|
|
4597
|
+
* ordinary character in a POSIX name, and doubling every one would make the
|
|
4598
|
+
* common case harder to read -- so a name containing a real newline and a name
|
|
4599
|
+
* containing the two characters `\` and `n` display the same. The display
|
|
4600
|
+
* keeps a name from acting; it does not identify it. Anything that must name
|
|
4601
|
+
* the file uses the stored value, which is exact.
|
|
4602
|
+
*
|
|
4603
|
+
* Markdown syntax inside the one line (`# `, `[..](..)`, `*`) is not escaped
|
|
4604
|
+
* either: the name can no longer leave its line, but a renderer may still
|
|
4605
|
+
* format what is on it.
|
|
4606
|
+
*/
|
|
4607
|
+
declare function displayPath(path: string): string;
|
|
4608
|
+
|
|
4577
4609
|
/**
|
|
4578
4610
|
* Parse a unit-suffixed duration string (e.g. `30s`, `5m`, `1h`, `100ms`)
|
|
4579
4611
|
* into milliseconds.
|
|
@@ -7998,4 +8030,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
|
|
|
7998
8030
|
*/
|
|
7999
8031
|
declare const BASOU_CORE_VERSION = "0.1.0";
|
|
8000
8032
|
|
|
8001
|
-
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 ClaudeSessionStartHookKind, type ClaudeSessionStartHookLocation, type ClaudeSessionStartHookRemoval, type ClaudeSessionStartHookUpsert, type ClaudeSettings, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type ClaudeUnrecognizedSessionStart, 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, findClaudeSessionStartHooks, findDecisionGaps, findErrorCode, findReviewGaps, findUnbindableRepos, findUnrecognizedSessionStart, formatDurationMs, genesisHash, getChangesSince, getDiff, getSnapshot, getWorkingTreeChanges, hasRetiredZeroDuration, importSessionFromJson, inspectChainTail, instructionMode, isBasouOrientSessionStartCommand, isBasouSessionStartHookCommand, isBasouStopHookCommand, isClaudeSessionStartHookCommand, isClaudeSessionStartMalformed, 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, removeClaudeSessionStartHook, 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, upsertClaudeSessionStartHook, upsertSessionStartHook, upsertStopHook, verifyEventsChain, viewStrings, writeEventsBulk, writeManifest, writeMarkdownFile, writeObservedDuration, writeSessionObservation, writeStatus, writeTaskFile, writeYamlFile };
|
|
8033
|
+
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 ClaudeSessionStartHookKind, type ClaudeSessionStartHookLocation, type ClaudeSessionStartHookRemoval, type ClaudeSessionStartHookUpsert, type ClaudeSettings, type ClaudeTranscriptRecord, type ClaudeTranscriptToPayloadOptions, type ClaudeUnrecognizedSessionStart, 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, displayPath, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findBasouSessionStartHook, findBasouStopHookCommand, findClaudeSessionStartHooks, findDecisionGaps, findErrorCode, findReviewGaps, findUnbindableRepos, findUnrecognizedSessionStart, formatDurationMs, genesisHash, getChangesSince, getDiff, getSnapshot, getWorkingTreeChanges, hasRetiredZeroDuration, importSessionFromJson, inspectChainTail, instructionMode, isBasouOrientSessionStartCommand, isBasouSessionStartHookCommand, isBasouStopHookCommand, isClaudeSessionStartHookCommand, isClaudeSessionStartMalformed, 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, removeClaudeSessionStartHook, 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, upsertClaudeSessionStartHook, upsertSessionStartHook, upsertStopHook, verifyEventsChain, viewStrings, writeEventsBulk, writeManifest, writeMarkdownFile, writeObservedDuration, writeSessionObservation, writeStatus, writeTaskFile, writeYamlFile };
|
package/dist/index.js
CHANGED
|
@@ -4535,6 +4535,31 @@ async function countOpenDecisionGaps(input) {
|
|
|
4535
4535
|
import { lstat as lstat2 } from "fs/promises";
|
|
4536
4536
|
import { dirname as dirname2, join as join11, resolve } from "path";
|
|
4537
4537
|
|
|
4538
|
+
// src/lib/display-path.ts
|
|
4539
|
+
function displayPath(path2) {
|
|
4540
|
+
let shown = "";
|
|
4541
|
+
for (const c of path2) {
|
|
4542
|
+
const code = c.codePointAt(0) ?? 0;
|
|
4543
|
+
if (!isActing(code)) {
|
|
4544
|
+
shown += c;
|
|
4545
|
+
} else if (c === "\n") {
|
|
4546
|
+
shown += "\\n";
|
|
4547
|
+
} else if (c === "\r") {
|
|
4548
|
+
shown += "\\r";
|
|
4549
|
+
} else if (c === " ") {
|
|
4550
|
+
shown += "\\t";
|
|
4551
|
+
} else if (code <= 255) {
|
|
4552
|
+
shown += `\\x${code.toString(16).padStart(2, "0")}`;
|
|
4553
|
+
} else {
|
|
4554
|
+
shown += `\\u${code.toString(16).padStart(4, "0")}`;
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
4557
|
+
return shown;
|
|
4558
|
+
}
|
|
4559
|
+
function isActing(code) {
|
|
4560
|
+
return code <= 31 || code >= 127 && code <= 159 || code === 8232 || code === 8233 || code >= 8234 && code <= 8238 || code >= 8294 && code <= 8297;
|
|
4561
|
+
}
|
|
4562
|
+
|
|
4538
4563
|
// src/lib/one-line.ts
|
|
4539
4564
|
function oneLine(text) {
|
|
4540
4565
|
return text.replace(/\s+/g, " ").trim();
|
|
@@ -5318,10 +5343,10 @@ async function formatDecisionsBody(args) {
|
|
|
5318
5343
|
if (d.linkedFiles !== void 0 && d.linkedFiles.length > 0) {
|
|
5319
5344
|
const parts = await Promise.all(
|
|
5320
5345
|
d.linkedFiles.map(
|
|
5321
|
-
async (path2) => await args.fileExists(path2) ? path2 : `${path2} (missing)`
|
|
5346
|
+
async (path2) => await args.fileExists(path2) ? displayPath(path2) : `${displayPath(path2)} (missing)`
|
|
5322
5347
|
)
|
|
5323
5348
|
);
|
|
5324
|
-
lines.push(`- linked_files: ${
|
|
5349
|
+
lines.push(`- linked_files: ${parts.join(", ")}`);
|
|
5325
5350
|
}
|
|
5326
5351
|
lines.push("");
|
|
5327
5352
|
}
|
|
@@ -5800,7 +5825,7 @@ async function getDiff(repoRoot, baseRef, headRef) {
|
|
|
5800
5825
|
if (baseRef === headRef) return { changed_files: [] };
|
|
5801
5826
|
let raw;
|
|
5802
5827
|
try {
|
|
5803
|
-
raw = await git.raw(["diff", "--name-status", `${baseRef}..${headRef}`]);
|
|
5828
|
+
raw = await git.raw(["diff", "--name-status", "-z", `${baseRef}..${headRef}`]);
|
|
5804
5829
|
} catch (error) {
|
|
5805
5830
|
throw translateDiffError(error);
|
|
5806
5831
|
}
|
|
@@ -5818,7 +5843,7 @@ async function getChangesSince(repoRoot, baseRef) {
|
|
|
5818
5843
|
}
|
|
5819
5844
|
let raw;
|
|
5820
5845
|
try {
|
|
5821
|
-
raw = await git.raw(["
|
|
5846
|
+
raw = await git.raw(["diff", "--name-status", "-z", baseRef]);
|
|
5822
5847
|
} catch (error) {
|
|
5823
5848
|
throw translateDiffError(error);
|
|
5824
5849
|
}
|
|
@@ -5838,27 +5863,25 @@ function translateDiffError(error) {
|
|
|
5838
5863
|
return new Error("Failed to compute git diff", { cause: error });
|
|
5839
5864
|
}
|
|
5840
5865
|
function parseDiffNameStatus(raw) {
|
|
5841
|
-
const
|
|
5866
|
+
const fields = raw.split("\0");
|
|
5842
5867
|
const changes = [];
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
const code =
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
});
|
|
5856
|
-
} else if (code === "
|
|
5857
|
-
changes.push({ path:
|
|
5858
|
-
} else if (code === "
|
|
5859
|
-
changes.push({ path:
|
|
5860
|
-
} else if (code === "D" && parts[1]) {
|
|
5861
|
-
changes.push({ path: parts[1], status: "deleted" });
|
|
5868
|
+
let i = 0;
|
|
5869
|
+
while (i < fields.length) {
|
|
5870
|
+
const code = fields[i] ?? "";
|
|
5871
|
+
const twoPaths = code.startsWith("R") || code.startsWith("C");
|
|
5872
|
+
const first = fields[i + 1];
|
|
5873
|
+
const second = twoPaths ? fields[i + 2] : void 0;
|
|
5874
|
+
i += twoPaths ? 3 : 2;
|
|
5875
|
+
if (first === void 0 || first.length === 0) continue;
|
|
5876
|
+
if (code.startsWith("R")) {
|
|
5877
|
+
if (second === void 0 || second.length === 0) continue;
|
|
5878
|
+
changes.push({ path: second, status: "renamed", old_path: first });
|
|
5879
|
+
} else if (code === "A") {
|
|
5880
|
+
changes.push({ path: first, status: "added" });
|
|
5881
|
+
} else if (code === "M") {
|
|
5882
|
+
changes.push({ path: first, status: "modified" });
|
|
5883
|
+
} else if (code === "D") {
|
|
5884
|
+
changes.push({ path: first, status: "deleted" });
|
|
5862
5885
|
}
|
|
5863
5886
|
}
|
|
5864
5887
|
return changes;
|
|
@@ -6270,7 +6293,7 @@ function formatHandoffBody(args) {
|
|
|
6270
6293
|
if (args.displayedFiles.length === 0) {
|
|
6271
6294
|
lines.push("(no related files recorded)");
|
|
6272
6295
|
} else {
|
|
6273
|
-
for (const f of args.displayedFiles) lines.push(`- ${f}`);
|
|
6296
|
+
for (const f of args.displayedFiles) lines.push(`- ${displayPath(f)}`);
|
|
6274
6297
|
if (args.overflow > 0) lines.push(`- ... +${args.overflow} more`);
|
|
6275
6298
|
}
|
|
6276
6299
|
lines.push("");
|
|
@@ -6323,7 +6346,7 @@ function formatHandoffBody(args) {
|
|
|
6323
6346
|
lines.push(t.handoff.headingReadNext);
|
|
6324
6347
|
lines.push("");
|
|
6325
6348
|
lines.push("- .basou/decisions.md");
|
|
6326
|
-
for (const f of args.displayedFiles.slice(0, 3)) lines.push(`- ${f}`);
|
|
6349
|
+
for (const f of args.displayedFiles.slice(0, 3)) lines.push(`- ${displayPath(f)}`);
|
|
6327
6350
|
lines.push("");
|
|
6328
6351
|
lines.push(t.handoff.headingNextWork);
|
|
6329
6352
|
lines.push("");
|
|
@@ -6430,7 +6453,7 @@ function parseBuildStamp(raw) {
|
|
|
6430
6453
|
}
|
|
6431
6454
|
}
|
|
6432
6455
|
var BASOU_CORE_BUILD = parseBuildStamp(
|
|
6433
|
-
true ? '{"version":"0.
|
|
6456
|
+
true ? '{"version":"0.51.0","commit":"22ef44f","committedAt":"2026-09-23T22:27:59+09:00"}' : void 0
|
|
6434
6457
|
);
|
|
6435
6458
|
|
|
6436
6459
|
// src/lib/duration.ts
|
|
@@ -6960,7 +6983,7 @@ function formatOrientationBody(summary, opts) {
|
|
|
6960
6983
|
const parts = [];
|
|
6961
6984
|
if (summary.relatedFiles.displayed.length > 0) {
|
|
6962
6985
|
const more = summary.relatedFiles.overflow > 0 ? ` (... +${summary.relatedFiles.overflow} more)` : "";
|
|
6963
|
-
parts.push(`${summary.relatedFiles.displayed.join(", ")}${more}`);
|
|
6986
|
+
parts.push(`${summary.relatedFiles.displayed.map(displayPath).join(", ")}${more}`);
|
|
6964
6987
|
}
|
|
6965
6988
|
if (summary.relatedFiles.omitted > 0) {
|
|
6966
6989
|
parts.push(t.orientation.scratchOmitted(summary.relatedFiles.omitted));
|
|
@@ -6969,7 +6992,7 @@ function formatOrientationBody(summary, opts) {
|
|
|
6969
6992
|
if (summary.relatedFiles.outOfRoot.length > 0) {
|
|
6970
6993
|
const OUT_OF_ROOT_DISPLAY = 10;
|
|
6971
6994
|
const out = summary.relatedFiles.outOfRoot;
|
|
6972
|
-
const shownOut = out.slice(0, OUT_OF_ROOT_DISPLAY).join(", ");
|
|
6995
|
+
const shownOut = out.slice(0, OUT_OF_ROOT_DISPLAY).map(displayPath).join(", ");
|
|
6973
6996
|
const outMore = out.length > OUT_OF_ROOT_DISPLAY ? ` (... +${out.length - OUT_OF_ROOT_DISPLAY} more)` : "";
|
|
6974
6997
|
lines.push(` - ${t.orientation.outOfRootWarning(out.length, `${shownOut}${outMore}`)}`);
|
|
6975
6998
|
}
|
|
@@ -6997,7 +7020,9 @@ function formatOrientationBody(summary, opts) {
|
|
|
6997
7020
|
lines.push(` - ${t.orientation.recentNextStepLabel}: ${noteSummary(note)}`);
|
|
6998
7021
|
}
|
|
6999
7022
|
if (s.files.length > 0) {
|
|
7000
|
-
lines.push(
|
|
7023
|
+
lines.push(
|
|
7024
|
+
` - ${t.orientation.recentChangedLabel}: ${s.files.map(displayPath).join(", ")}`
|
|
7025
|
+
);
|
|
7001
7026
|
}
|
|
7002
7027
|
}
|
|
7003
7028
|
}
|
|
@@ -8793,7 +8818,9 @@ function formatReportBody(data, t) {
|
|
|
8793
8818
|
if (data.changedFiles.length === 0) {
|
|
8794
8819
|
lines.push("(no related files recorded)");
|
|
8795
8820
|
} else {
|
|
8796
|
-
for (const f of data.changedFiles.slice(0, CHANGED_FILES_MARKDOWN_LIMIT))
|
|
8821
|
+
for (const f of data.changedFiles.slice(0, CHANGED_FILES_MARKDOWN_LIMIT)) {
|
|
8822
|
+
lines.push(`- ${displayPath(f)}`);
|
|
8823
|
+
}
|
|
8797
8824
|
const overflow = data.changedFiles.length - CHANGED_FILES_MARKDOWN_LIMIT;
|
|
8798
8825
|
if (overflow > 0) lines.push(`- ... +${overflow} more`);
|
|
8799
8826
|
}
|
|
@@ -10747,6 +10774,7 @@ export {
|
|
|
10747
10774
|
createManifest,
|
|
10748
10775
|
createTaskWithEvent,
|
|
10749
10776
|
deleteTask,
|
|
10777
|
+
displayPath,
|
|
10750
10778
|
editTask,
|
|
10751
10779
|
ensureBasouDirectory,
|
|
10752
10780
|
enumerateApprovals,
|