import { type DetectResult, type WriteHostResult } from "../../hosts/registry.js"; import { type UpsertOutcome } from "../../hosts/sections.js"; import { type SettingsMergeOutcome } from "../../hosts/settings.js"; export interface InitOptions { hooks?: "claude" | undefined; agents?: string | undefined; } export interface InitResult { created: string[]; skipped: string[]; managed: { file: string; outcome: UpsertOutcome; }[]; /** * Kit files that were SKIPPED (already exist without managed markers) but * whose burned-in loopgraph version pin (A3) no longer matches this build. * Surfaced so the caller can warn; NOT auto-overwritten, because the file * may carry the repo's own edits. */ staleVersionPins: { file: string; pinned: string; current: string; }[]; /** * Files that exist without managed-section markers — legacy installs that * cannot be auto-updated. User should delete and re-run init, or add * markers manually. */ migrationHints: string[]; hooksMerge?: SettingsMergeOutcome | undefined; agentHosts?: WriteHostResult[] | undefined; agentDetection?: DetectResult[] | undefined; } /** * npm version spec a generated CI workflow should PIN loopgraph to (A3), derived * from loopgraph's own installed version. semver treats a different axis as the * breaking one before vs. after 1.0: on 0.x a MINOR bump may break, so pin * `major.minor` (`0.5` → newest 0.5.x patch, but never 0.6); from 1.0 on, MAJOR * is the breaking axis, so pin `major` (`1`). This is the whole point of A3: * `@latest` lets a future release silently change gate semantics or desync the * adapter's interfaceVersion under a CI that has been green for weeks. Returns * `null` on an unparseable version rather than a string — crucially it does NOT * fall back to `"latest"`, since emitting `loopgraph@latest` is the exact thing * A3 exists to prevent; a degenerate version must fail loud upstream (see * `loopgraphVersionPin`), never silently ship the forbidden float. * * The pattern is FULLY anchored (`^…$`) and accepts an optional semver * prerelease/build suffix, so a malformed string (`1.2.3.4`, `1.2.3-` with junk, * a bare `1.2`) reliably returns `null` instead of loosely prefix-matching. A * prerelease such as `0.5.0-rc.1` intentionally pins to the STABLE `0.5` line: * an integrator's CI should never be told to depend on our release candidate. */ export declare function versionToPinSpec(version: string): string | null; /** * What `init` prints AFTER the file list (Proposal 016 T1). `init` creates a * skeleton, not a model — a run that ends on `created .loopgraph/model/loops/` * leaves the reader believing the tool did something it did not, and the * external-repo evaluations found every first-run user inventing their own next * step from scratch. So: name the next action, name the routing threshold, and * state the cost up front. Saying the cost is a FILTER, not a deterrent — someone who * won't spend an agent session on modeling should learn that here rather than * after a half-built model. * * Exported as data so the CLI layer only has to print it and a test can assert * on it without scraping stdout formatting. */ export declare const INIT_NEXT_STEPS: readonly string[]; /** * Creates the \`.loopgraph/\` directory skeleton in a target repo (Proposal * 010 — unified namespace: model, config, adapter, agent kit, and the query * side-channel all live under one directory instead of scattered across the * repo root). \`config.json\` ships as a skeleton with empty guardedTables * (Phase 0's T0 checks don't require it — INV-1 simply doesn't run without * real entries, same posture as its absence pre-010). * * Agent kit files and SKILL.md use managed sections (Proposal 013 B1) so * loopgraph upgrades can update the managed content while preserving user * additions outside the markers. Legacy files without markers are left * untouched with a migration hint. */ export declare function runInit(targetDir: string, options?: InitOptions): Promise; //# sourceMappingURL=init.d.ts.map