@basou/core 0.27.0 → 0.28.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
@@ -132,6 +132,10 @@ declare const ManifestSchema: z.ZodObject<{
132
132
  "en+ja": "en+ja";
133
133
  }>>;
134
134
  }, z.core.$loose>>>;
135
+ instructions: z.ZodOptional<z.ZodEnum<{
136
+ hub: "hub";
137
+ self: "self";
138
+ }>>;
135
139
  }, z.core.$loose>>>;
136
140
  }, z.core.$loose>;
137
141
  /** Inferred runtime type for {@link ManifestSchema}. */
@@ -3612,6 +3616,15 @@ type RepoVisibility = "public" | "private" | "future-public";
3612
3616
  type RepoLanguage = "en" | "ja" | "en+ja";
3613
3617
  /** A published surface a repo emits: a deployed website or a package registry. */
3614
3618
  type PublishKind = "web" | "npm";
3619
+ /**
3620
+ * Where a repo's agent instruction files live (the instruction-source axis),
3621
+ * independent of visibility / language / publishes. `hub` is basou's native,
3622
+ * generated hub-and-spoke topology (canonical in the anchor, gitignored symlinks
3623
+ * in each repo); `self` is the additive opt-in where the canonical AGENTS.md is a
3624
+ * regular committed file in the repo itself and basou stays hands-off about its
3625
+ * content. See {@link instructionMode} for the default (absent => `hub`).
3626
+ */
3627
+ type RepoInstructions = "hub" | "self";
3615
3628
  /**
3616
3629
  * One published surface. Its visibility and language are INDEPENDENT of the
3617
3630
  * source repo's: a private repo commonly publishes a public website. Both are
@@ -3632,7 +3645,24 @@ type RepoEntry = {
3632
3645
  language?: RepoLanguage | undefined;
3633
3646
  /** Published surfaces this repo emits (opt-in; absent for a repo that publishes nothing). */
3634
3647
  publishes?: PublishTarget[] | undefined;
3648
+ /**
3649
+ * Instruction-source mode. Absent => `hub` (basou's native generated topology),
3650
+ * so an existing roster's behavior is unchanged. `self` opts the repo out of
3651
+ * generation: its AGENTS.md is a hand-authored committed file and basou stays
3652
+ * hands-off. Resolve the effective mode with {@link instructionMode}.
3653
+ */
3654
+ instructions?: RepoInstructions | undefined;
3635
3655
  };
3656
+ /**
3657
+ * The effective instruction-source mode for a repo: the declared `instructions`,
3658
+ * defaulting to `hub` when absent. The default is the single guarantee that an
3659
+ * existing roster (which has no `instructions` field) keeps basou's current
3660
+ * hub-and-spoke behavior byte-for-byte — every generator branches on this, never
3661
+ * on the raw optional field, so "absent => hub" is decided in exactly one place.
3662
+ */
3663
+ declare function instructionMode(entry: {
3664
+ instructions?: RepoInstructions | undefined;
3665
+ }): RepoInstructions;
3636
3666
  type RosterDriftSummary = {
3637
3667
  declaredCount: number;
3638
3668
  capturedCount: number;
@@ -3815,6 +3845,13 @@ type RepoGitignoreFacts = {
3815
3845
  path: string;
3816
3846
  /** Declared visibility; undefined when the operator has not set it yet. */
3817
3847
  visibility?: RepoVisibility | undefined;
3848
+ /**
3849
+ * True when this repo declares `instructions: self`: its instruction files are
3850
+ * committed and SHARED, so they must NOT be gitignored — the repo is skipped
3851
+ * (reported as `self`, never an addition) regardless of visibility. Absent =>
3852
+ * the default `hub` behavior, unchanged.
3853
+ */
3854
+ self?: boolean | undefined;
3818
3855
  /** False when the repo path could not be resolved / is not a usable git repo. */
3819
3856
  reachable: boolean;
3820
3857
  /** Existing `.gitignore` lines, trimmed; an empty array when there is no `.gitignore`. */
@@ -3830,21 +3867,30 @@ type GitignorePlanSummary = {
3830
3867
  plans: RepoGitignorePlan[];
3831
3868
  /** Repo paths skipped because visibility is unset (cannot decide safely). */
3832
3869
  unknown: string[];
3870
+ /**
3871
+ * `instructions: self` repo paths, skipped by design: their instruction files
3872
+ * are committed and shared, so they are never gitignored. Reported (not
3873
+ * silently dropped) and do NOT block the `ok` verdict — being skipped is the
3874
+ * intended terminal state, not a gap.
3875
+ */
3876
+ self: string[];
3833
3877
  /** Repo paths that could not be resolved / are not usable git repos. */
3834
3878
  unreachable: string[];
3835
3879
  /**
3836
3880
  * True only when nothing needs adding AND every repo was judgeable and
3837
3881
  * reachable — so a clean verdict is never claimed while some repos were
3838
- * skipped (unset visibility) or could not be inspected (unreachable).
3882
+ * skipped (unset visibility) or could not be inspected (unreachable). A `self`
3883
+ * repo does not block it (it is intentionally not gitignored).
3839
3884
  */
3840
3885
  ok: boolean;
3841
3886
  };
3842
3887
  /**
3843
3888
  * Compute the {@link GitignorePlanSummary}: for each public-facing, reachable
3844
3889
  * repo, the `required` patterns that are not already present in its `.gitignore`
3845
- * (compared by trimmed exact line). Private repos require nothing; unset
3846
- * visibility is reported as `unknown` and unreachable repos as `unreachable`.
3847
- * `ok` is true when no repo needs any addition.
3890
+ * (compared by trimmed exact line). Private repos require nothing; a `self` repo
3891
+ * is reported as `self` (its committed instruction files are shared, never
3892
+ * gitignored); unset visibility is reported as `unknown` and unreachable repos as
3893
+ * `unreachable`. `ok` is true when no repo needs any addition.
3848
3894
  */
3849
3895
  declare function planGitignore(input: {
3850
3896
  repos: RepoGitignoreFacts[];
@@ -3902,6 +3948,13 @@ type RepoPresetFacts = {
3902
3948
  path: string;
3903
3949
  /** True when this repo IS the project anchor (its own AGENTS.md is hand-maintained; skipped). */
3904
3950
  isAnchor: boolean;
3951
+ /**
3952
+ * True when this repo declares `instructions: self`: its AGENTS.md is
3953
+ * hand-authored and basou stays hands-off — no preset block is ever written
3954
+ * (reported as `self`, skipped like an anchor). Absent => the default `hub`
3955
+ * behavior, unchanged.
3956
+ */
3957
+ self?: boolean | undefined;
3905
3958
  /** False when the repo path could not be resolved / is not a usable git repo. */
3906
3959
  reachable: boolean;
3907
3960
  /** Declared fields (the render input). */
@@ -3971,14 +4024,16 @@ type PresetPlanSummary = {
3971
4024
  collisions: PresetCollision[];
3972
4025
  /** Repos that resolve to the anchor (their own AGENTS.md is hand-maintained; skipped). */
3973
4026
  anchors: string[];
4027
+ /** `instructions: self` repos: hands-off, skipped (basou never writes their AGENTS.md). */
4028
+ self: string[];
3974
4029
  /** Repo paths that could not be resolved / are not usable git repos. */
3975
4030
  unreachable: string[];
3976
4031
  /**
3977
4032
  * True only when nothing needs writing AND there are no marker conflicts, no
3978
4033
  * unreadable canonicals, no collisions, no unreachable repos, and no
3979
4034
  * undeclared repos — so a clean "all in sync" verdict is never claimed while
3980
- * some repo was skipped or unjudgeable. Anchors do not block it (they are
3981
- * intentionally not generated).
4035
+ * some repo was skipped or unjudgeable. Anchors and `self` repos do not block
4036
+ * it (they are intentionally not generated).
3982
4037
  */
3983
4038
  ok: boolean;
3984
4039
  };
@@ -4105,6 +4160,12 @@ type RetrofitReason =
4105
4160
  "ok"
4106
4161
  /** refuse: the repo is not in the declared roster. */
4107
4162
  | "not-declared"
4163
+ /**
4164
+ * refuse: the repo declares `instructions: self` — its AGENTS.md is a
4165
+ * hand-authored committed file that stays in the repo, so there is no anchor
4166
+ * canonical to relocate it to (retrofit does not apply).
4167
+ */
4168
+ | "self"
4108
4169
  /** refuse: the path is the project anchor (it owns the canonical directly — nothing to relocate). */
4109
4170
  | "anchor"
4110
4171
  /** refuse: the path does not resolve / is not a git repo. */
@@ -4123,6 +4184,12 @@ type RetrofitFacts = {
4123
4184
  path: string;
4124
4185
  /** True when the path is declared in the manifest roster. */
4125
4186
  declared: boolean;
4187
+ /**
4188
+ * True when the declared entry uses `instructions: self` — its AGENTS.md stays
4189
+ * in the repo, so retrofit (which relocates it to the anchor canonical) does
4190
+ * not apply. Absent/false => the default `hub` behavior, unchanged.
4191
+ */
4192
+ self?: boolean | undefined;
4126
4193
  /** True when the path resolves to the anchor itself. */
4127
4194
  isAnchor: boolean;
4128
4195
  /** False when the path does not resolve / is not a git repo. */
@@ -4156,8 +4223,8 @@ type RetrofitPlan = {
4156
4223
  /**
4157
4224
  * Classify the retrofit facts into one action. Refusals are checked first, in a
4158
4225
  * fixed precedence so the outcome is deterministic when several guardrails could
4159
- * apply: undeclared → anchor → unreachable → uninspectable AGENTS.md. Then the
4160
- * idempotent skips (already a symlink, or absent — nothing to move). Only a
4226
+ * apply: undeclared → anchor → self → unreachable → uninspectable AGENTS.md. Then
4227
+ * the idempotent skips (already a symlink, or absent — nothing to move). Only a
4161
4228
  * genuine regular-file AGENTS.md reaches the relocate decision, and even then a
4162
4229
  * pre-existing destination canonical refuses (relocating would clobber it).
4163
4230
  * `regularSpokes` is echoed in every outcome (it is advisory, relevant whenever a
@@ -4224,12 +4291,24 @@ type RepoSymlinkFacts = {
4224
4291
  * it never links to itself). An anchor entry is skipped entirely.
4225
4292
  */
4226
4293
  isAnchor: boolean;
4294
+ /**
4295
+ * True when this repo declares `instructions: self`: its canonical AGENTS.md is
4296
+ * a regular committed file in the repo itself, so only the CLAUDE.md / Copilot
4297
+ * spokes are generated (never the AGENTS.md hub link), `canonicalPresent` means
4298
+ * "the repo's own AGENTS.md is present" (an absent one is `selfAgentsMissing`,
4299
+ * not `missingCanonical`), and the repo is excluded from anchor-canonical
4300
+ * collision detection (it shares no anchor canonical). Absent => the default
4301
+ * `hub` behavior, unchanged.
4302
+ */
4303
+ self?: boolean | undefined;
4227
4304
  /** False when the repo path could not be resolved / is not a usable git repo. */
4228
4305
  reachable: boolean;
4229
4306
  /**
4230
- * Whether the anchor's canonical source for this repo
4231
- * (`<anchor>/agents/<repo>/AGENTS.md`) exists. Without it the hub link would
4232
- * dangle, so no links are planned (reported as a missing canonical instead).
4307
+ * For a `hub` repo: whether the anchor's canonical source
4308
+ * (`<anchor>/agents/<repo>/AGENTS.md`) exists without it the hub link would
4309
+ * dangle, so no links are planned (reported as `missingCanonical` instead). For
4310
+ * a `self` repo: whether the repo's OWN AGENTS.md exists — without it the
4311
+ * spokes would dangle, so none are planned (reported as `selfAgentsMissing`).
4233
4312
  */
4234
4313
  canonicalPresent: boolean;
4235
4314
  /**
@@ -4279,15 +4358,22 @@ type SymlinkPlanSummary = {
4279
4358
  conflicts: SymlinkConflict[];
4280
4359
  /** Repo paths whose anchor canonical (`agents/<repo>/AGENTS.md`) is absent, so nothing can be wired. */
4281
4360
  missingCanonical: string[];
4361
+ /**
4362
+ * `self` repo paths whose own AGENTS.md is absent, so the spokes would dangle
4363
+ * and none are planned. Distinct from `missingCanonical` (which is the anchor
4364
+ * canonical a `hub` repo links to): the operator authors a `self` repo's
4365
+ * AGENTS.md by hand, then re-runs.
4366
+ */
4367
+ selfAgentsMissing: string[];
4282
4368
  /** Repo paths that could not be resolved / are not usable git repos. */
4283
4369
  unreachable: string[];
4284
4370
  /** Groups of distinct repos that resolve to the same canonical (ambiguous; not auto-wired). */
4285
4371
  collisions: SymlinkCollision[];
4286
4372
  /**
4287
4373
  * True only when nothing needs creating AND there are no conflicts, no missing
4288
- * canonicals, no unreachable repos, and no collisions so a clean "all wired"
4289
- * verdict is never claimed while some repo was blocked, ambiguous, or could not
4290
- * be inspected.
4374
+ * canonicals, no self repos missing their AGENTS.md, no unreachable repos, and
4375
+ * no collisions so a clean "all wired" verdict is never claimed while some
4376
+ * repo was blocked, ambiguous, or could not be inspected.
4291
4377
  */
4292
4378
  ok: boolean;
4293
4379
  };
@@ -4308,6 +4394,12 @@ type SymlinkPlanSummary = {
4308
4394
  * {@link SymlinkCollision} and neither is auto-wired (silent sharing of one
4309
4395
  * canonical is surfaced, not actioned).
4310
4396
  *
4397
+ * A `self` repo (its `self` flag set by the caller) carries only its spoke files
4398
+ * (CLAUDE.md / Copilot → its own AGENTS.md), is excluded from collision
4399
+ * detection, and routes an absent own-AGENTS.md to `selfAgentsMissing` rather
4400
+ * than `missingCanonical`. Otherwise it flows through the same create/conflict
4401
+ * logic as a hub repo.
4402
+ *
4311
4403
  * `ok` is true only when there is genuinely nothing to do and every repo was
4312
4404
  * judgeable, reachable, and unambiguous.
4313
4405
  */
@@ -4341,6 +4433,13 @@ type RepoWiringFacts = {
4341
4433
  path: string;
4342
4434
  /** Declared visibility; undefined when the operator has not set it yet. */
4343
4435
  visibility?: RepoVisibility | undefined;
4436
+ /**
4437
+ * True when this repo declares `instructions: self`: its instruction files are
4438
+ * committed BY DESIGN (shared in its own git history), so a tracked file is
4439
+ * never a privacy risk — the repo is reported as `self` and excluded from the
4440
+ * risk / unknown verdicts. Absent => the default `hub` behavior, unchanged.
4441
+ */
4442
+ self?: boolean | undefined;
4344
4443
  /** False when the repo path could not be resolved / is not a usable git repo. */
4345
4444
  reachable: boolean;
4346
4445
  /** Per instruction-file facts (omitted/empty when unreachable). */
@@ -4362,6 +4461,12 @@ type WiringSummary = {
4362
4461
  risks: WiringRisk[];
4363
4462
  /** Repo paths whose visibility is unset, so the privacy verdict cannot be judged. */
4364
4463
  unknown: string[];
4464
+ /**
4465
+ * `instructions: self` repo paths: their instruction files are committed by
4466
+ * design, so they carry no privacy risk and do not need a visibility verdict.
4467
+ * Reported (not silently dropped) and do NOT block `ok`.
4468
+ */
4469
+ self: string[];
4365
4470
  /** Repos missing one or more instruction files (a wiring gap a later generate slice fills). */
4366
4471
  incomplete: {
4367
4472
  repo: string;
@@ -4377,8 +4482,11 @@ type WiringSummary = {
4377
4482
  * public-facing repo that TRACKS an instruction file is a {@link WiringRisk}
4378
4483
  * (its git history can expose the private canonical it points at); a repo with
4379
4484
  * unset visibility cannot be judged (`unknown`); a repo missing instruction
4380
- * files is `incomplete` (a wiring gap, not a privacy problem). `ok` is true only
4381
- * when nothing is at risk, every repo is judgeable, and every repo is reachable.
4485
+ * files is `incomplete` (a wiring gap, not a privacy problem). A `self` repo is
4486
+ * reported as `self` and bypasses the risk / unknown verdicts entirely its
4487
+ * instruction files are committed by design — though a genuinely missing one is
4488
+ * still surfaced as `incomplete`. `ok` is true only when nothing is at risk,
4489
+ * every repo is judgeable, and every repo is reachable.
4382
4490
  */
4383
4491
  declare function summarizeWiring(facts: RepoWiringFacts[]): WiringSummary;
4384
4492
 
@@ -5719,4 +5827,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
5719
5827
  */
5720
5828
  declare const BASOU_CORE_VERSION = "0.1.0";
5721
5829
 
5722
- 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, DEFAULT_STOP_HOOK_MIN_EDITS, 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 RetrofitAction, type RetrofitAgentsState, type RetrofitFacts, type RetrofitPlan, type RetrofitReason, 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 StopHookEvaluation, type StopHookEvaluationInput, type StopHookSilentReason, 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, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, 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 };
5830
+ 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, DEFAULT_STOP_HOOK_MIN_EDITS, 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 RepoInstructions, 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 RetrofitAction, type RetrofitAgentsState, type RetrofitFacts, type RetrofitPlan, type RetrofitReason, 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 StopHookEvaluation, type StopHookEvaluationInput, type StopHookSilentReason, 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, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, instructionMode, 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 };
package/dist/index.js CHANGED
@@ -4582,6 +4582,7 @@ var ImportConfigSchema = z9.looseObject({
4582
4582
  var RepoVisibilitySchema = z9.enum(["public", "private", "future-public"]);
4583
4583
  var RepoLanguageSchema = z9.enum(["en", "ja", "en+ja"]);
4584
4584
  var PublishKindSchema = z9.enum(["web", "npm"]);
4585
+ var RepoInstructionsSchema = z9.enum(["hub", "self"]);
4585
4586
  var PublishTargetSchema = z9.looseObject({
4586
4587
  kind: PublishKindSchema,
4587
4588
  visibility: RepoVisibilitySchema.optional(),
@@ -4591,7 +4592,8 @@ var RepoEntrySchema = z9.looseObject({
4591
4592
  path: SourceRootSchema,
4592
4593
  visibility: RepoVisibilitySchema.optional(),
4593
4594
  language: RepoLanguageSchema.optional(),
4594
- publishes: z9.array(PublishTargetSchema).optional()
4595
+ publishes: z9.array(PublishTargetSchema).optional(),
4596
+ instructions: RepoInstructionsSchema.optional()
4595
4597
  });
4596
4598
  var WorkspaceMetaSchema = z9.looseObject({
4597
4599
  id: WorkspaceIdSchema,
@@ -5365,12 +5367,17 @@ function isPublicFacing(v) {
5365
5367
  function planGitignore(input) {
5366
5368
  const plans = [];
5367
5369
  const unknown = [];
5370
+ const self = [];
5368
5371
  const unreachable = [];
5369
5372
  for (const repo of input.repos) {
5370
5373
  if (!repo.reachable) {
5371
5374
  unreachable.push(repo.path);
5372
5375
  continue;
5373
5376
  }
5377
+ if (repo.self === true) {
5378
+ self.push(repo.path);
5379
+ continue;
5380
+ }
5374
5381
  if (repo.visibility === void 0) {
5375
5382
  unknown.push(repo.path);
5376
5383
  continue;
@@ -5388,6 +5395,7 @@ function planGitignore(input) {
5388
5395
  return {
5389
5396
  plans,
5390
5397
  unknown,
5398
+ self,
5391
5399
  unreachable,
5392
5400
  ok: plans.length === 0 && unknown.length === 0 && unreachable.length === 0
5393
5401
  };
@@ -5476,7 +5484,8 @@ function summarizePresetPlan(facts) {
5476
5484
  }
5477
5485
  const byCanonical = /* @__PURE__ */ new Map();
5478
5486
  for (const f of deduped) {
5479
- if (f.isAnchor || !f.reachable || f.canonicalName === void 0 || !isRenderable(f)) continue;
5487
+ if (f.isAnchor || f.self === true || !f.reachable || f.canonicalName === void 0 || !isRenderable(f))
5488
+ continue;
5480
5489
  const repos = byCanonical.get(f.canonicalName) ?? [];
5481
5490
  repos.push(f.path);
5482
5491
  byCanonical.set(f.canonicalName, repos);
@@ -5495,12 +5504,17 @@ function summarizePresetPlan(facts) {
5495
5504
  const markerConflicts = [];
5496
5505
  const unreadable = [];
5497
5506
  const anchors = [];
5507
+ const self = [];
5498
5508
  const unreachable = [];
5499
5509
  for (const f of deduped) {
5500
5510
  if (f.isAnchor) {
5501
5511
  anchors.push(f.path);
5502
5512
  continue;
5503
5513
  }
5514
+ if (f.self === true) {
5515
+ self.push(f.path);
5516
+ continue;
5517
+ }
5504
5518
  if (!f.reachable) {
5505
5519
  unreachable.push(f.path);
5506
5520
  continue;
@@ -5546,6 +5560,7 @@ function summarizePresetPlan(facts) {
5546
5560
  unreadable,
5547
5561
  collisions,
5548
5562
  anchors,
5563
+ self,
5549
5564
  unreachable,
5550
5565
  ok: plans.length === 0 && markerConflicts.length === 0 && unreadable.length === 0 && collisions.length === 0 && unreachable.length === 0 && undeclared.length === 0
5551
5566
  };
@@ -5638,6 +5653,7 @@ function classifyRetrofit(facts) {
5638
5653
  };
5639
5654
  if (!facts.declared) return { ...base, action: "refuse", reason: "not-declared" };
5640
5655
  if (facts.isAnchor) return { ...base, action: "refuse", reason: "anchor" };
5656
+ if (facts.self === true) return { ...base, action: "refuse", reason: "self" };
5641
5657
  if (!facts.reachable) return { ...base, action: "refuse", reason: "unreachable" };
5642
5658
  if (facts.agentsState === "blocked") return { ...base, action: "refuse", reason: "blocked" };
5643
5659
  if (facts.agentsState === "symlink")
@@ -5653,6 +5669,9 @@ function classifyRetrofit(facts) {
5653
5669
  }
5654
5670
 
5655
5671
  // src/project/roster.ts
5672
+ function instructionMode(entry) {
5673
+ return entry.instructions ?? "hub";
5674
+ }
5656
5675
  function summarizeRosterDrift(input) {
5657
5676
  const captured = new Set((input.sourceRoots ?? []).map(normalizeRelativePath));
5658
5677
  const declared = /* @__PURE__ */ new Map();
@@ -5715,7 +5734,7 @@ function summarizeSymlinkPlan(facts) {
5715
5734
  }
5716
5735
  const byCanonical = /* @__PURE__ */ new Map();
5717
5736
  for (const f of deduped) {
5718
- if (f.isAnchor || !f.reachable || !f.canonicalPresent || f.canonicalName === void 0) {
5737
+ if (f.isAnchor || f.self === true || !f.reachable || !f.canonicalPresent || f.canonicalName === void 0) {
5719
5738
  continue;
5720
5739
  }
5721
5740
  const repos = byCanonical.get(f.canonicalName) ?? [];
@@ -5733,6 +5752,7 @@ function summarizeSymlinkPlan(facts) {
5733
5752
  const plans = [];
5734
5753
  const conflicts = [];
5735
5754
  const missingCanonical = [];
5755
+ const selfAgentsMissing = [];
5736
5756
  const unreachable = [];
5737
5757
  for (const f of deduped) {
5738
5758
  if (f.isAnchor) continue;
@@ -5741,7 +5761,8 @@ function summarizeSymlinkPlan(facts) {
5741
5761
  continue;
5742
5762
  }
5743
5763
  if (!f.canonicalPresent) {
5744
- missingCanonical.push(f.path);
5764
+ if (f.self === true) selfAgentsMissing.push(f.path);
5765
+ else missingCanonical.push(f.path);
5745
5766
  continue;
5746
5767
  }
5747
5768
  if (collidingPaths.has(f.path)) continue;
@@ -5768,9 +5789,10 @@ function summarizeSymlinkPlan(facts) {
5768
5789
  plans,
5769
5790
  conflicts,
5770
5791
  missingCanonical,
5792
+ selfAgentsMissing,
5771
5793
  unreachable,
5772
5794
  collisions,
5773
- ok: plans.length === 0 && conflicts.length === 0 && missingCanonical.length === 0 && unreachable.length === 0 && collisions.length === 0
5795
+ ok: plans.length === 0 && conflicts.length === 0 && missingCanonical.length === 0 && selfAgentsMissing.length === 0 && unreachable.length === 0 && collisions.length === 0
5774
5796
  };
5775
5797
  }
5776
5798
 
@@ -5781,6 +5803,7 @@ function isPublicFacing2(v) {
5781
5803
  function summarizeWiring(facts) {
5782
5804
  const risks = [];
5783
5805
  const unknown = [];
5806
+ const self = [];
5784
5807
  const incomplete = [];
5785
5808
  const unreachable = [];
5786
5809
  for (const f of facts) {
@@ -5788,7 +5811,9 @@ function summarizeWiring(facts) {
5788
5811
  unreachable.push(f.path);
5789
5812
  continue;
5790
5813
  }
5791
- if (isPublicFacing2(f.visibility)) {
5814
+ if (f.self === true) {
5815
+ self.push(f.path);
5816
+ } else if (isPublicFacing2(f.visibility)) {
5792
5817
  for (const file of f.instructionFiles) {
5793
5818
  if (file.tracked) risks.push({ repo: f.path, visibility: f.visibility, file: file.name });
5794
5819
  }
@@ -5802,6 +5827,7 @@ function summarizeWiring(facts) {
5802
5827
  repos: facts,
5803
5828
  risks,
5804
5829
  unknown,
5830
+ self,
5805
5831
  incomplete,
5806
5832
  unreachable,
5807
5833
  ok: risks.length === 0 && unknown.length === 0 && unreachable.length === 0
@@ -7694,6 +7720,7 @@ export {
7694
7720
  getSnapshot,
7695
7721
  importSessionFromJson,
7696
7722
  inspectChainTail,
7723
+ instructionMode,
7697
7724
  isGitNotFound,
7698
7725
  isImportDerivedSource,
7699
7726
  isLazyExpired,