/** * Reconcile the project-local plugin store (`/.skaile/plugins/`). * * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin * list plus the lock file's `plugins` slice and compares it to the stored * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it * regenerates the store's `package.json` and runs `bun install` against it. * * The install step is injectable (`InstallFn`) so tests stay hermetic — they * pass a fake installer that records calls and writes a stub `node_modules`. */ /** * Installs the store's dependencies. Returns `ok: false` (never throws) on a * failed install so the reconciler can surface the captured `output`. */ export type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string; }>; /** Options for {@link reconcilePlugins}. */ export interface ReconcileOptions { /** Injectable installer. Defaults to a real `bun install` of the store. */ runInstall?: InstallFn; /** * Lock slice to fold into the reconcile-hash. Defaults to * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash. */ lockSlice?: unknown; } /** Result of a reconcile pass. */ export interface ReconcileResult { changed: boolean; reason: "no-plugins" | "up-to-date" | "reconciled"; } /** * The default real installer: `bun install` inside the store directory. * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and * non-frozen on the first run so a lock can be generated. */ export declare const defaultInstall: InstallFn; /** * Reconcile the plugin store for a project. * * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`. * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers). * @param opts - Optional injectable installer + lock slice override. * @returns Whether the store changed and why. */ export declare function reconcilePlugins(projectDir: string, plugins: string[], opts?: ReconcileOptions): Promise; //# sourceMappingURL=reconcile.d.ts.map