@basou/core 0.31.0 → 0.32.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 +299 -16
- package/dist/index.js +218 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3844,6 +3844,62 @@ declare function summarizeOrientation(input: OrientationRendererInput): Promise<
|
|
|
3844
3844
|
*/
|
|
3845
3845
|
declare function renderOrientation(input: OrientationRendererInput): Promise<OrientationRendererResult>;
|
|
3846
3846
|
|
|
3847
|
+
/**
|
|
3848
|
+
* The anchor (planning master) repo's own AGENTS.md STARTER. Unlike a repo's
|
|
3849
|
+
* preset block or the workspace view's canonical — both marker-managed regions
|
|
3850
|
+
* that `basou project preset` keeps in sync — the anchor's own AGENTS.md is
|
|
3851
|
+
* HAND-MAINTAINED by design (preset deliberately skips the anchor, and its
|
|
3852
|
+
* canonical lives at the anchor root, never under `agents/`). A greenfield
|
|
3853
|
+
* bring-up (`basou project new` → declare → `basou project derive`) therefore
|
|
3854
|
+
* leaves the planning master with no conventions doc at all, while every project
|
|
3855
|
+
* onboarded the older way carries one from the start.
|
|
3856
|
+
*
|
|
3857
|
+
* This renders a MINIMAL starter so a greenfield anchor is not empty: identity,
|
|
3858
|
+
* commit-routing, per-repo AGENTS.md pointers, a pointer to the workspace view
|
|
3859
|
+
* for the LIVE roster, and TODO stubs for the policy basou cannot derive
|
|
3860
|
+
* (product facts, phase, secrets, language policy). It is meant to be written
|
|
3861
|
+
* ONCE if the file is absent and NEVER touched again (create-only, no
|
|
3862
|
+
* BASOU:GENERATED markers) — the operator owns and hand-maintains it thereafter,
|
|
3863
|
+
* preserving the anchor's hands-off design.
|
|
3864
|
+
*
|
|
3865
|
+
* It deliberately does NOT embed a roster snapshot table: a manifest-derived
|
|
3866
|
+
* table frozen into a markerless, never-resynced file would drift silently the
|
|
3867
|
+
* moment a repo is added / renamed / archived, with no staleness signal for a
|
|
3868
|
+
* reader (or an agent) that trusts it. The live roster lives in the workspace
|
|
3869
|
+
* view's own generated AGENTS.md, which stays in sync; the anchor points there.
|
|
3870
|
+
*
|
|
3871
|
+
* Pure and deterministic: it renders markdown from the declared fields only, so
|
|
3872
|
+
* the output is a function of the manifest snapshot at seed time. It embeds no
|
|
3873
|
+
* operator-specific string beyond the declared repo names / project name.
|
|
3874
|
+
*/
|
|
3875
|
+
/** One roster repo referenced by the anchor starter's per-repo pointers. */
|
|
3876
|
+
type AnchorStarterRepo = {
|
|
3877
|
+
/** The repo's display name (its on-disk basename). */
|
|
3878
|
+
name: string;
|
|
3879
|
+
/** True when this repo IS the anchor (the planning master itself; excluded from the pointers). */
|
|
3880
|
+
anchor?: boolean | undefined;
|
|
3881
|
+
};
|
|
3882
|
+
/** The declared fields the anchor starter is rendered from. */
|
|
3883
|
+
type AnchorStarterInput = {
|
|
3884
|
+
/** The anchor repo's display name (its on-disk basename) — names the file heading. */
|
|
3885
|
+
anchorName: string;
|
|
3886
|
+
/** `manifest.project.name`, when declared — used in the identity line. */
|
|
3887
|
+
projectName?: string | undefined;
|
|
3888
|
+
/** The workspace view's directory basename, when the project has a view. */
|
|
3889
|
+
viewName?: string | undefined;
|
|
3890
|
+
/** The declared roster (the anchor included), in declared order. */
|
|
3891
|
+
repos: AnchorStarterRepo[];
|
|
3892
|
+
};
|
|
3893
|
+
/**
|
|
3894
|
+
* Render the anchor's starter AGENTS.md (a full file, NOT a marker block). The
|
|
3895
|
+
* manifest-derived parts (identity, per-repo pointers) are filled from the
|
|
3896
|
+
* declaration; everything basou cannot know (product facts, phase, secrets,
|
|
3897
|
+
* language policy) is left as an explicit `<!-- TODO -->` for the operator. The
|
|
3898
|
+
* live roster is NOT snapshotted here — the file points at the workspace view's
|
|
3899
|
+
* generated AGENTS.md for it. Returns the file content WITH a trailing newline.
|
|
3900
|
+
*/
|
|
3901
|
+
declare function renderAnchorStarter(input: AnchorStarterInput): string;
|
|
3902
|
+
|
|
3847
3903
|
/**
|
|
3848
3904
|
* Project roster drift (the "saddle" model). A project's repos are DECLARED
|
|
3849
3905
|
* once in the manifest's `repos` list; the capture config (`source_roots`) must
|
|
@@ -4184,6 +4240,48 @@ declare function isRenderable(repo: PresetRepo): boolean;
|
|
|
4184
4240
|
* writer adds the surrounding structure.
|
|
4185
4241
|
*/
|
|
4186
4242
|
declare function renderPresetBlock(repo: PresetRepo): string;
|
|
4243
|
+
/** One repo aggregated by the view, rendered with its short visibility / language. */
|
|
4244
|
+
type ViewPresetRepo = {
|
|
4245
|
+
name: string;
|
|
4246
|
+
visibility?: RepoVisibility | undefined;
|
|
4247
|
+
language?: RepoLanguage | undefined;
|
|
4248
|
+
/**
|
|
4249
|
+
* True when the repo declares `instructions: self` (it owns its AGENTS.md;
|
|
4250
|
+
* basou stays hands-off). Rendered in the instruction-ownership column so an
|
|
4251
|
+
* agent reading the view knows which AGENTS.md files are generated and which
|
|
4252
|
+
* are hand-maintained. Absent => the default `hub` (basou-generated).
|
|
4253
|
+
*/
|
|
4254
|
+
self?: boolean | undefined;
|
|
4255
|
+
/**
|
|
4256
|
+
* True when this repo IS the project anchor (the planning master). Its own
|
|
4257
|
+
* AGENTS.md is hand-maintained at the anchor root — basou never generates it
|
|
4258
|
+
* (preset skips it), so the instruction column must NOT claim `hub`. Takes
|
|
4259
|
+
* precedence over `self` in the label.
|
|
4260
|
+
*/
|
|
4261
|
+
anchor?: boolean | undefined;
|
|
4262
|
+
};
|
|
4263
|
+
/** The declared fields the view preset block is rendered from. */
|
|
4264
|
+
type ViewPresetInput = {
|
|
4265
|
+
/**
|
|
4266
|
+
* The view directory's basename — names the view's own canonical
|
|
4267
|
+
* (`agents/<viewName>/AGENTS.md`) in the block's self-description, so a reader
|
|
4268
|
+
* of the generated file learns where its editable source of truth lives.
|
|
4269
|
+
*/
|
|
4270
|
+
viewName: string;
|
|
4271
|
+
repos: ViewPresetRepo[];
|
|
4272
|
+
};
|
|
4273
|
+
/**
|
|
4274
|
+
* Render the workspace-view instruction-file preset block (the content between
|
|
4275
|
+
* the BASOU:GENERATED markers in the view's own canonical). Like
|
|
4276
|
+
* {@link renderPresetBlock} it is deterministic and OSS-generic: it derives
|
|
4277
|
+
* entirely from the declared roster (repo names come from the manifest, no
|
|
4278
|
+
* operator-specific string is embedded), so re-running on an unchanged manifest
|
|
4279
|
+
* produces byte-identical output. The repos are listed in the order supplied.
|
|
4280
|
+
* An empty roster still renders cleanly (a header-only table, empty lists).
|
|
4281
|
+
* Returns the block WITHOUT a trailing newline; the marker writer adds the
|
|
4282
|
+
* surrounding structure.
|
|
4283
|
+
*/
|
|
4284
|
+
declare function renderViewPresetBlock(input: ViewPresetInput): string;
|
|
4187
4285
|
/**
|
|
4188
4286
|
* The canonical's marker state as parsed by the caller (mirrors
|
|
4189
4287
|
* `markdown-store`'s `MarkerSection.kind`). `ok` means exactly one well-ordered
|
|
@@ -4257,6 +4355,13 @@ type PresetMarkerConflict = {
|
|
|
4257
4355
|
type PresetCollision = {
|
|
4258
4356
|
canonicalName: string;
|
|
4259
4357
|
repos: string[];
|
|
4358
|
+
/**
|
|
4359
|
+
* True when the shared canonical is the WORKSPACE VIEW's own
|
|
4360
|
+
* (`agents/<viewName>/AGENTS.md`): the listed repo(s) collide with the view,
|
|
4361
|
+
* not (only) with each other, so neither the repo side nor the view side is
|
|
4362
|
+
* generated. Absent for a plain repo↔repo collision.
|
|
4363
|
+
*/
|
|
4364
|
+
view?: boolean;
|
|
4260
4365
|
};
|
|
4261
4366
|
type PresetPlanSummary = {
|
|
4262
4367
|
/** Repos whose canonical's generated region will be created/updated (only those with work). */
|
|
@@ -4301,8 +4406,15 @@ type PresetPlanSummary = {
|
|
|
4301
4406
|
* - Two DISTINCT repos resolving to the same canonical name are a
|
|
4302
4407
|
* {@link PresetCollision} and neither is generated (silent clobbering of one
|
|
4303
4408
|
* canonical is surfaced, not actioned).
|
|
4304
|
-
|
|
4305
|
-
|
|
4409
|
+
* - When the caller passes `opts.viewCanonicalName` (the workspace view's own
|
|
4410
|
+
* canonical name), a repo whose canonical name equals it is ALSO a collision
|
|
4411
|
+
* (flagged `view: true`) and is suppressed — the repo and the view would
|
|
4412
|
+
* otherwise write over one shared `agents/<name>/AGENTS.md`. Without the
|
|
4413
|
+
* option the behavior is unchanged.
|
|
4414
|
+
*/
|
|
4415
|
+
declare function summarizePresetPlan(facts: RepoPresetFacts[], opts?: {
|
|
4416
|
+
viewCanonicalName?: string;
|
|
4417
|
+
}): PresetPlanSummary;
|
|
4306
4418
|
|
|
4307
4419
|
/**
|
|
4308
4420
|
* Rename (re-path) a repo in a project's declared roster. When a repo's
|
|
@@ -4423,6 +4535,13 @@ type RetrofitReason =
|
|
|
4423
4535
|
| "blocked"
|
|
4424
4536
|
/** refuse: the destination canonical already exists (relocating would clobber it). */
|
|
4425
4537
|
| "canonical-exists"
|
|
4538
|
+
/**
|
|
4539
|
+
* refuse: the repo's canonical name equals the workspace view's, so
|
|
4540
|
+
* `agents/<name>/AGENTS.md` would be owned by BOTH — relocating the repo's
|
|
4541
|
+
* file into it (and later generating the view block over it) would corrupt
|
|
4542
|
+
* one with the other. The operator renames the view directory or the repo.
|
|
4543
|
+
*/
|
|
4544
|
+
| "view-collision"
|
|
4426
4545
|
/** skip: AGENTS.md is already a symlink (likely already wired — idempotent). */
|
|
4427
4546
|
| "already-symlink"
|
|
4428
4547
|
/** skip: there is no AGENTS.md to relocate. */
|
|
@@ -4445,6 +4564,13 @@ type RetrofitFacts = {
|
|
|
4445
4564
|
reachable: boolean;
|
|
4446
4565
|
/** The repo basename used for the anchor canonical `agents/<canonicalName>/AGENTS.md`. */
|
|
4447
4566
|
canonicalName: string;
|
|
4567
|
+
/**
|
|
4568
|
+
* The workspace view's own canonical name (`agents/<viewCanonicalName>/AGENTS.md`),
|
|
4569
|
+
* when a view is declared. A repo whose `canonicalName` equals it shares ONE
|
|
4570
|
+
* canonical file with the view, so the relocate is refused (`view-collision`).
|
|
4571
|
+
* Absent (no view declared) => no collision possible.
|
|
4572
|
+
*/
|
|
4573
|
+
viewCanonicalName?: string | undefined;
|
|
4448
4574
|
/** On-disk state of the repo's own `AGENTS.md`. */
|
|
4449
4575
|
agentsState: RetrofitAgentsState;
|
|
4450
4576
|
/** True when the destination canonical already exists (moving would clobber it). */
|
|
@@ -4475,9 +4601,11 @@ type RetrofitPlan = {
|
|
|
4475
4601
|
* apply: undeclared → anchor → self → unreachable → uninspectable AGENTS.md. Then
|
|
4476
4602
|
* the idempotent skips (already a symlink, or absent — nothing to move). Only a
|
|
4477
4603
|
* genuine regular-file AGENTS.md reaches the relocate decision, and even then a
|
|
4478
|
-
*
|
|
4479
|
-
*
|
|
4480
|
-
*
|
|
4604
|
+
* canonical name shared with the workspace view refuses (`view-collision` — the
|
|
4605
|
+
* relocate would land in the view's own canonical) and a pre-existing destination
|
|
4606
|
+
* canonical refuses (relocating would clobber it). `regularSpokes` is echoed in
|
|
4607
|
+
* every outcome (it is advisory, relevant whenever a relocate or skip leaves the
|
|
4608
|
+
* operator to tidy the spokes).
|
|
4481
4609
|
*/
|
|
4482
4610
|
declare function classifyRetrofit(facts: RetrofitFacts): RetrofitPlan;
|
|
4483
4611
|
|
|
@@ -4536,8 +4664,13 @@ type RepoSymlinkFacts = {
|
|
|
4536
4664
|
/** Roster repo path (relative to the manifest root). */
|
|
4537
4665
|
path: string;
|
|
4538
4666
|
/**
|
|
4539
|
-
* True when this repo IS the project anchor (it
|
|
4540
|
-
*
|
|
4667
|
+
* True when this repo IS the project anchor (it hosts the OTHER repos' hub
|
|
4668
|
+
* canonicals under `agents/`, so it is excluded from canonical-collision
|
|
4669
|
+
* detection — it owns those, never links to them). Its OWN AGENTS.md is a
|
|
4670
|
+
* regular committed file at the anchor root, the same shape as a `self` repo:
|
|
4671
|
+
* only its CLAUDE.md / Copilot spokes are generated, and only once that root
|
|
4672
|
+
* AGENTS.md exists (`canonicalPresent`). An anchor whose AGENTS.md is absent is
|
|
4673
|
+
* left alone (not reported missing) until it is seeded.
|
|
4541
4674
|
*/
|
|
4542
4675
|
isAnchor: boolean;
|
|
4543
4676
|
/**
|
|
@@ -4567,7 +4700,7 @@ type RepoSymlinkFacts = {
|
|
|
4567
4700
|
* caller for reachable, canonical-present repos; undefined otherwise.
|
|
4568
4701
|
*/
|
|
4569
4702
|
canonicalName?: string;
|
|
4570
|
-
/** Per instruction-file facts (empty when anchor / unreachable / canonical absent). */
|
|
4703
|
+
/** Per instruction-file facts (empty when an un-seeded anchor / unreachable / canonical absent). */
|
|
4571
4704
|
files: InstructionSymlinkFact[];
|
|
4572
4705
|
};
|
|
4573
4706
|
/** The instruction-file symlinks to CREATE in one repo (only the `missing` ones). */
|
|
@@ -4628,12 +4761,18 @@ type SymlinkPlanSummary = {
|
|
|
4628
4761
|
};
|
|
4629
4762
|
/**
|
|
4630
4763
|
* Compute the {@link SymlinkPlanSummary} from per-repo facts. For each declared,
|
|
4631
|
-
*
|
|
4632
|
-
*
|
|
4633
|
-
*
|
|
4634
|
-
*
|
|
4635
|
-
*
|
|
4636
|
-
*
|
|
4764
|
+
* reachable repo whose canonical exists: a `missing` link becomes a create, a
|
|
4765
|
+
* `mismatch`/`occupied`/`blocked` link becomes a {@link SymlinkConflict} (never a
|
|
4766
|
+
* create — we do not overwrite), and a `correct` link is a no-op. An absent
|
|
4767
|
+
* canonical is reported as `missingCanonical` (no links planned, since the hub
|
|
4768
|
+
* would dangle), and an unresolvable repo as `unreachable`.
|
|
4769
|
+
*
|
|
4770
|
+
* The anchor is a special case: it hosts the other repos' hub canonicals (so it
|
|
4771
|
+
* is excluded from collision detection — it owns those), but its OWN AGENTS.md is
|
|
4772
|
+
* a root committed file (self-style), so its CLAUDE.md / Copilot spokes ARE wired
|
|
4773
|
+
* — once that root AGENTS.md exists. An anchor whose AGENTS.md is absent is left
|
|
4774
|
+
* alone (not reported as missing): the seed step / operator creates it, then a
|
|
4775
|
+
* re-run wires the spokes.
|
|
4637
4776
|
*
|
|
4638
4777
|
* Robustness:
|
|
4639
4778
|
* - Facts are deduped by normalized path (first wins), so a repo listed twice in
|
|
@@ -4739,6 +4878,124 @@ type WiringSummary = {
|
|
|
4739
4878
|
*/
|
|
4740
4879
|
declare function summarizeWiring(facts: RepoWiringFacts[]): WiringSummary;
|
|
4741
4880
|
|
|
4881
|
+
/**
|
|
4882
|
+
* Wiring drift for `basou project check`: given the gathered instruction-file
|
|
4883
|
+
* facts for every declared repo AND the workspace view, classify what is DRIFTED
|
|
4884
|
+
* from basou's native hub-and-spoke topology — an ABSENT instruction canonical
|
|
4885
|
+
* (AGENTS.md), an incompletely wired repo/view, an existing file/link that is not
|
|
4886
|
+
* what basou would wire, a canonical-name collision, or an unreachable repo.
|
|
4887
|
+
*
|
|
4888
|
+
* The motivating gap: `project check` compared only the roster against the
|
|
4889
|
+
* capture config (`source_roots`) and did no filesystem probe, so a MISSING
|
|
4890
|
+
* instruction canonical — most sharply the workspace view's own AGENTS.md — went
|
|
4891
|
+
* unnoticed until an operator eyeballed it. This makes `check` surface that class
|
|
4892
|
+
* as drift, leading with canonical absence (the missing-AGENTS.md case).
|
|
4893
|
+
*
|
|
4894
|
+
* Pure: it composes {@link summarizeSymlinkPlan} (which already judges the repo
|
|
4895
|
+
* side) with the view's gathered facts and re-frames both as read-only drift. The
|
|
4896
|
+
* realpath / symlink reading that produces the facts is the caller's job (the CLI
|
|
4897
|
+
* reuses the same gatherers `project symlinks` uses), so this stays testable
|
|
4898
|
+
* without disk I/O.
|
|
4899
|
+
*/
|
|
4900
|
+
|
|
4901
|
+
/**
|
|
4902
|
+
* The workspace view's gathered instruction facts, structurally identical to the
|
|
4903
|
+
* CLI's `ViewSymlinksOutcome` so the CLI passes its gathered value straight
|
|
4904
|
+
* through. `no-view` = no `workspace.view` declared; `collision` = the view name
|
|
4905
|
+
* clashes with a roster repo's canonical; `missing-canonical` = the view's own
|
|
4906
|
+
* canonical (`agents/<viewName>/AGENTS.md`) is absent (the my-favorites case);
|
|
4907
|
+
* `gathered` = the canonical exists and each spoke's on-disk state was inspected.
|
|
4908
|
+
*/
|
|
4909
|
+
type ViewWiringFacts = {
|
|
4910
|
+
kind: "no-view";
|
|
4911
|
+
} | {
|
|
4912
|
+
kind: "collision";
|
|
4913
|
+
viewName: string;
|
|
4914
|
+
repoPath: string;
|
|
4915
|
+
} | {
|
|
4916
|
+
kind: "missing-canonical";
|
|
4917
|
+
viewName: string;
|
|
4918
|
+
} | {
|
|
4919
|
+
kind: "gathered";
|
|
4920
|
+
viewName: string;
|
|
4921
|
+
files: InstructionSymlinkFact[];
|
|
4922
|
+
};
|
|
4923
|
+
/**
|
|
4924
|
+
* An absent instruction canonical (AGENTS.md) — the primary drift this surfaces.
|
|
4925
|
+
* `repo-hub`: a `hub` repo's anchor canonical (`agents/<repo>/AGENTS.md`) is
|
|
4926
|
+
* missing; `repo-self`: a `self` repo's own committed AGENTS.md is missing;
|
|
4927
|
+
* `view`: the workspace view's canonical (`agents/<viewName>/AGENTS.md`) is
|
|
4928
|
+
* missing. `name` is the repo's roster path (repo targets) or the view name.
|
|
4929
|
+
*/
|
|
4930
|
+
type MissingCanonical = {
|
|
4931
|
+
target: "repo-hub" | "repo-self" | "view";
|
|
4932
|
+
name: string;
|
|
4933
|
+
};
|
|
4934
|
+
/** A repo or the view whose canonical exists but whose spoke links are not all wired. */
|
|
4935
|
+
type IncompleteWiring = {
|
|
4936
|
+
target: "repo" | "view";
|
|
4937
|
+
/** Repo roster path, or the view name. */
|
|
4938
|
+
path: string;
|
|
4939
|
+
/** Instruction files still missing their link (e.g. "AGENTS.md", "CLAUDE.md"). */
|
|
4940
|
+
files: string[];
|
|
4941
|
+
};
|
|
4942
|
+
/** An existing file/link that is not what basou would wire — surfaced, never touched. */
|
|
4943
|
+
type WiringConflict = {
|
|
4944
|
+
target: "repo" | "view";
|
|
4945
|
+
/** Repo roster path, or the view name. */
|
|
4946
|
+
path: string;
|
|
4947
|
+
file: string;
|
|
4948
|
+
reason: "mismatch" | "occupied" | "blocked";
|
|
4949
|
+
/** The conflicting link's current target, present only when `reason` is `mismatch`. */
|
|
4950
|
+
actualTarget?: string;
|
|
4951
|
+
};
|
|
4952
|
+
/** Distinct repos (or view↔repo) resolving to the same `agents/<canonicalName>/AGENTS.md`. */
|
|
4953
|
+
type WiringCollision = {
|
|
4954
|
+
canonicalName: string;
|
|
4955
|
+
/** The colliding roster repo paths. */
|
|
4956
|
+
repos: string[];
|
|
4957
|
+
/** True when the workspace view is one side of the collision. */
|
|
4958
|
+
view?: boolean;
|
|
4959
|
+
};
|
|
4960
|
+
type WiringDriftSummary = {
|
|
4961
|
+
/** Absent instruction canonicals (repo hub, repo self, or view) — the headline gap. */
|
|
4962
|
+
missingCanonicals: MissingCanonical[];
|
|
4963
|
+
/** Repos/view whose canonical exists but whose spoke links are not fully wired. */
|
|
4964
|
+
incompleteWiring: IncompleteWiring[];
|
|
4965
|
+
/** Existing links that are not what basou would wire (left untouched). */
|
|
4966
|
+
conflicts: WiringConflict[];
|
|
4967
|
+
/** Ambiguous canonical-name collisions (repo↔repo or view↔repo). */
|
|
4968
|
+
collisions: WiringCollision[];
|
|
4969
|
+
/**
|
|
4970
|
+
* Declared repos not present on this machine (unresolvable / not a usable git
|
|
4971
|
+
* repo). ADVISORY: expected on a partial checkout (a workspace declares N repos;
|
|
4972
|
+
* a given machine has a subset cloned), so it is reported but does NOT fail
|
|
4973
|
+
* `ok` — otherwise `check` would read chronically dirty on every partial
|
|
4974
|
+
* checkout and drown the actionable drift it exists to surface.
|
|
4975
|
+
*/
|
|
4976
|
+
unreachable: string[];
|
|
4977
|
+
/**
|
|
4978
|
+
* True when there is no ACTIONABLE drift: no missing canonical, no incomplete
|
|
4979
|
+
* wiring, no conflict, no collision. `unreachable` is deliberately excluded (it
|
|
4980
|
+
* is advisory — see above), so a partial checkout with otherwise-correct wiring
|
|
4981
|
+
* is `ok`. A missing view/repo AGENTS.md, a mismatched link, or a collision all
|
|
4982
|
+
* deny `ok`.
|
|
4983
|
+
*/
|
|
4984
|
+
ok: boolean;
|
|
4985
|
+
};
|
|
4986
|
+
/**
|
|
4987
|
+
* Compute the {@link WiringDriftSummary} from the per-repo instruction facts and
|
|
4988
|
+
* the view's gathered facts. The repo side is delegated to
|
|
4989
|
+
* {@link summarizeSymlinkPlan} (so its dedup, collision, and canonical-absence
|
|
4990
|
+
* judgments are reused verbatim) and re-labelled as drift; the view side is folded
|
|
4991
|
+
* in from {@link ViewWiringFacts}. Leads with `missingCanonicals` because an absent
|
|
4992
|
+
* AGENTS.md is the drift the caller most needs to see.
|
|
4993
|
+
*/
|
|
4994
|
+
declare function summarizeWiringDrift(input: {
|
|
4995
|
+
repos: RepoSymlinkFacts[];
|
|
4996
|
+
view: ViewWiringFacts;
|
|
4997
|
+
}): WiringDriftSummary;
|
|
4998
|
+
|
|
4742
4999
|
/**
|
|
4743
5000
|
* Plan the symlinks a project's throwaway "view" needs (the generation step
|
|
4744
5001
|
* after the instruction-file symlinks in the "saddle" model). When a project
|
|
@@ -4762,7 +5019,12 @@ declare function summarizeWiring(facts: RepoWiringFacts[]): WiringSummary;
|
|
|
4762
5019
|
* Pruning stray entries already in the view IS now in scope (see `toPrune` /
|
|
4763
5020
|
* `strayUnknown` and {@link ExistingViewLink}): the ownership model that tells an
|
|
4764
5021
|
* orphaned repo link from the view's own instruction files / local state lives
|
|
4765
|
-
* here.
|
|
5022
|
+
* here. Generating the view's OWN instruction files (its AGENTS.md canonical and
|
|
5023
|
+
* the CLAUDE.md / Copilot spokes) is handled by `project preset` / `project
|
|
5024
|
+
* symlinks`, which treat the view as a second instruction target — this planner's
|
|
5025
|
+
* job stays the repo-aggregation symlinks and their strays. The prune ownership
|
|
5026
|
+
* model here (which excludes the view's own top-level instruction-file symlinks
|
|
5027
|
+
* from stray detection) is what keeps those generated files safe from pruning.
|
|
4766
5028
|
*/
|
|
4767
5029
|
/**
|
|
4768
5030
|
* The on-disk state of one repo's view symlink. `correct` = the expected link
|
|
@@ -5911,6 +6173,27 @@ declare function parseMarkers(content: string, markers?: Markers): MarkerSection
|
|
|
5911
6173
|
* so the error message is informative without leaking an absolute path.
|
|
5912
6174
|
*/
|
|
5913
6175
|
declare function renderWithMarkers(existing: string | null, generated: string, fileLabel: string, markers?: Markers): string;
|
|
6176
|
+
/**
|
|
6177
|
+
* Seed a marker region into a file, migrating a markerless (hand-authored) file
|
|
6178
|
+
* IN PLACE instead of refusing it the way {@link renderWithMarkers} does. Used by
|
|
6179
|
+
* `project retrofit` to auto-migrate an existing prose canonical: the generated
|
|
6180
|
+
* block is prepended and every byte of the existing content is preserved.
|
|
6181
|
+
*
|
|
6182
|
+
* - `existing === null` (no file yet): identical to `renderWithMarkers(null, …)`
|
|
6183
|
+
* — a fresh `<START>\n<generated>\n<END>\n` block.
|
|
6184
|
+
* - existing parses to `ok`: delegated to {@link renderWithMarkers} — the marked
|
|
6185
|
+
* region is replaced, everything before START / after END is kept.
|
|
6186
|
+
* - `no_markers` (including a 0-byte / empty-string file): the block is PREPENDED
|
|
6187
|
+
* (`<START>\n<generated><END>\n\n<existing>`) so the hand-authored prose is kept
|
|
6188
|
+
* verbatim after one blank-line separator. A leading UTF-8 BOM is re-placed at
|
|
6189
|
+
* the FILE head (before the seeded block), never left mid-file — matching
|
|
6190
|
+
* {@link parseMarkers}' BOM tolerance. A leading YAML frontmatter (`---`) is
|
|
6191
|
+
* NOT special-cased: the block is prepended above it (a known limitation).
|
|
6192
|
+
* - any malformed result (`missing_start` / `missing_end` / `multiple_pairs` /
|
|
6193
|
+
* `wrong_order`): throws a pathless error referencing `fileLabel`, exactly like
|
|
6194
|
+
* {@link renderWithMarkers} (a broken marker pair must never be silently rewritten).
|
|
6195
|
+
*/
|
|
6196
|
+
declare function seedMarkers(existing: string | null, generated: string, fileLabel: string, markers?: Markers): string;
|
|
5914
6197
|
/**
|
|
5915
6198
|
* Remove a marker region from `existing`, returning the body without the block.
|
|
5916
6199
|
*
|
|
@@ -6148,4 +6431,4 @@ declare function overwriteYamlFile(filePath: string, value: unknown): Promise<vo
|
|
|
6148
6431
|
*/
|
|
6149
6432
|
declare const BASOU_CORE_VERSION = "0.1.0";
|
|
6150
6433
|
|
|
6151
|
-
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 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 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, ORIENTATION_END, ORIENTATION_START, 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, 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 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, STOP_HOOK_TIMEOUT_SECONDS, 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 StopHookRemoval, type StopHookSilentReason, type StopHookUpsert, 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, buildReviewRecordLabel, buildReviewRecordedEvent, buildStatusSnapshot, buildStopHookCommand, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexAdapterMetadata, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findBasouStopHookCommand, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, instructionMode, isBasouStopHookCommand, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, parseReviewRecordInput, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, removeStopHook, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveCodexCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, upsertStopHook, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
|
|
6434
|
+
export { ACTIVE_GAP_CAP_MS, AGENT_INFRA_DIRS, 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_VERSION, type BasouPaths, 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 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 IncompleteWiring, 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 MissingCanonical, type NoteAddedEvent, ORIENTATION_END, ORIENTATION_START, 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, 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 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, STOP_HOOK_TIMEOUT_SECONDS, 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 StopHookRemoval, type StopHookSilentReason, type StopHookUpsert, 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 ViewPresetInput, type ViewPresetRepo, type ViewRepoFact, type ViewStrayUnknown, 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, acquireLock, appendBasouGitignore, appendChainedEvent, appendChainedEventLocked, appendEvent, appendEventToExistingSession, archiveTask, assertBasouRootSafe, basouPaths, buildJsonSchemas, buildReviewRecordLabel, buildReviewRecordedEvent, buildStatusSnapshot, buildStopHookCommand, chainEvents, chainRawJsonLines, classifyFilesBySourceRoot, classifyRetrofit, classifySuspect, claudeCodeAdapterMetadata, claudeTranscriptToImportPayload, codexAdapterMetadata, codexRolloutToImportPayload, computeWorkStats, createAdHocSessionWithEvent, createManifest, createTaskWithEvent, deleteTask, editTask, ensureBasouDirectory, enumerateApprovals, enumerateArchivedTaskIds, enumerateSessionDirs, enumerateTaskIds, evaluateStopHook, finalizeSessionYaml, findBasouStopHookCommand, findErrorCode, findReviewGaps, formatDurationMs, genesisHash, getDiff, getSnapshot, importSessionFromJson, inspectChainTail, instructionMode, isBasouStopHookCommand, isGitNotFound, isImportDerivedSource, isLazyExpired, isRenderable, isValidPrefixedId, lineHash, linkYamlFile, loadApproval, loadFederatedSessionEntries, loadSessionEntries, loadTaskEntries, normalizeRepoKey, normalizeRepoPath, overwriteYamlFile, parseDuration, parseMarkers, parseReviewRecordInput, pathBasename, planArchive, planGitignore, planRename, planRosterAdoption, planWorkspaceView, prefixedUlid, readAllEvents, readManifest, readMarkdownFile, readSessionYaml, readStatus, readTaskFile, readTaskFileWithArchiveFallback, readYamlFile, rechainSessionInPlace, reconcileAllTasks, reconcileSourceRoots, reconcileTask, refreshTaskLinkedSessions, reimportPreservingId, removeMarkerSection, removeStopHook, renderAnchorStarter, renderDecisions, renderHandoff, renderOrientation, renderPresetBlock, renderReport, renderViewPresetBlock, renderWithMarkers, replayEvents, resolveBasouRepositoryRoot, resolveClaudeCodeCommand, resolveCodexCommand, resolveRepositoryRoot, resolveSessionId, resolveTaskId, safeSimpleGit, sanitizePath, sanitizeRelatedFiles, sanitizeWorkingDirectory, seedMarkers, serializeEventLine, serializeJsonSchema, sessionWorkStatsFromEvents, summarizeAdapterOutput, summarizeOrientation, summarizePresetPlan, summarizeRosterDrift, summarizeSymlinkPlan, summarizeWiring, summarizeWiringDrift, tryRemoteUrl, ulid, unknownManifestKeys, updateTaskStatusWithEvent, upsertStopHook, verifyEventsChain, writeEventsBulk, writeManifest, writeMarkdownFile, writeStatus, writeTaskFile, writeYamlFile };
|