/** * `pi-daddy init` — scaffold a governed project from the skill packages already installed (B2, P3). * * Legacy unregistered npm packages can be scaffolded per skill: create a directory, copy the * body and declaration copies plus a starting `PI_DADDY_GRANT`. Configured enabled Pi resources * are referenced where installed instead (ADR-0074); no competing .pi/skills copy is created. * * **The line it does not cross, and the reason this module exists at all:** `init` writes files an operator * then **reviews, edits and commits**. It never chooses a ceiling. A skill that declares `allowed-tools` is * copied *verbatim* — the author's declaration is the ceiling, and re-deriving it here would put a second * opinion between the file and the enforcer. A skill that declares none is copied with a **commented** * placeholder and stays unspawnable until a human fills it in. * * **What it DOES choose is the starting grant, which is a stronger act** — ADR-0029, added after a reviewer * pointed out that ADR-0028 drew its boundary around the wrong object. The handoff's reason a third party * may safely author `allowed-tools` is that *"the operator's `PI_DADDY_GRANT` still bounds it"*; a * generated union gives the bound and the bounded one author, and it is not the operator. So capabilities * that can change a machine are emitted **commented** (`./grant-env.ts`). * * The placeholder is deliberately not a working example. Uncommenting it unedited yields capability ids * like `tool:; /** `workspace:` this project could route to (ADR-0035). Always commented — `init` does not choose. */ routableWorkspaces: Capability[]; /** `/.pi/pi-daddy` — created owner-only by apply. */ stateDir: string; settingsPath: string; settingsContent: string; gitignorePath: string; /** Capabilities a declared ceiling names that pi 0.84.1 has no tool for — a caution, not a verdict. */ cautions: string[]; } /** * The file to write for one skill: verbatim when it declares a usable ceiling, plus a commented note when * it does not. * * Inserted at the END of the frontmatter block, so the rest of the file — including its own key order and * its body — is byte-identical to the package's. A `#` line is a YAML comment and this package's * frontmatter reader skips it, so an undeclared copy is still *undeclared*: not spawnable until a human * edits it, which is the whole point. */ export declare function withPlaceholder(text: string, declared: boolean, note?: string[]): string; /** * Decide what `init` would write. Pure: no filesystem, no npm, no decisions taken on the operator's behalf. * * The grant is **the read-only part** of what the copied skills declare, plus one `agent:` id per definition * that can actually run within it, plus `tool:delegate` — without which the session registers no delegation * tools at all and the whole file is inert. Everything else is emitted commented, named, and one uncomment * away (ADR-0029). */ export declare function planInit(packages: SkillPackage[], cwd: string, /** * Ids from the operator's workspace registry, when one is configured — read by the CALLER, because * `planInit` is pure and stays that way. * * ADR-0035 made routing a capability and said `init` "scaffolds the registered ids so the common path is a * one-line grant edit". It did not: `init` had never heard of the registry, so the ADR's own stated * migration path for a breaking change did not exist. These are emitted **commented**, never live — * offering the ids while refusing to choose among them is exactly ADR-0028's position. */ registeredWorkspaceIds?: readonly string[]): InitPlan; export interface InitOutcome { written: string[]; /** Present already, so left alone. `init` never silently overwrites an edited ceiling. */ kept: string[]; failed: { path: string; error: string; }[]; } /** * Apply a plan. * * **Existing files are kept, not overwritten**, and that default is load-bearing rather than polite: the * edit an operator makes to one of these files IS the capability decision, and the second run of a * scaffolding command is exactly when it would be destroyed. * * **`--force` never regenerates `settings.json`** (R-79). It rewrites the definition copies, which is the * documented re-sync path for R-74 — but the grant file is the *reviewed artifact*, and an operator who had * deleted `agent:build` and added a ledger path would have had both silently restored to generated defaults * by a command whose usage text mentions only `allowed-tools`. Deleting the file is how to regenerate it, * and that is not something anyone does by accident. */ /** * Whether git would ignore `settings.json` anyway — the common case, because most projects' root `.gitignore` * lists `.pi/`, and git never descends into an ignored directory, so the nested `!settings.json` cannot * re-include it (ADR-0076 PR 3c review finding). `true` = ignored, `false` = tracked-or-untracked, `null` = * not a git checkout or git unavailable; the caller only warns on `true`. */ export declare function settingsIgnoredByGit(settingsPath: string): Promise; /** The two lines an operator adds to the root `.gitignore` so the reviewable record is committable. */ export declare const GITIGNORE_REINCLUDE_LINES: string[]; export declare function applyInit(plan: InitPlan, options?: { force?: boolean; }): Promise; //# sourceMappingURL=init.d.ts.map