/** * InstallMeta service — reads and writes `install-meta.json`. * * The metadata file lives at `~/.axm/install-meta.json` (Unix) * or `$AXM_USER_HOME/.axm/install-meta.json` when AXM_USER_HOME is set. * * @experimental This API is unstable and may change without notice. * @packageDocumentation */ import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import * as Path from "effect/Path"; import * as Schema from "effect/Schema"; import * as ServiceMap from "effect/Context"; import { type AppError } from "../app-error/index.js"; /** * Schema for `install-meta.json`. * * @experimental This API is unstable and may change without notice. */ export declare const InstallMetaDataSchema: Schema.Struct<{ readonly schemaVersion: Schema.Literal<2>; readonly method: Schema.Literals; readonly installedAt: Schema.decodeTo; readonly packageName: Schema.optional; readonly managerMajorVersion: Schema.optional; readonly executablePath: Schema.optional; }>; /** * Type of the decoded `install-meta.json` data. * * @experimental This API is unstable and may change without notice. */ export type InstallMetaData = typeof InstallMetaDataSchema.Type; export interface InstallMetaService { /** Read `install-meta.json`. Returns `None` if file is missing or invalid. */ readonly read: () => Effect.Effect>; /** Write `install-meta.json` with the given method and timestamp. */ readonly write: (data: InstallMetaData) => Effect.Effect; } declare const InstallMeta_base: ServiceMap.ServiceClass; /** * Effect service tag for install metadata I/O. * * @experimental This API is unstable and may change without notice. */ export declare class InstallMeta extends InstallMeta_base { } /** * Read `install-meta.json` from the given directory. * Returns `Option.none()` if the file is missing or contains invalid data. * * Exposed for testability. * * @experimental This API is unstable and may change without notice. */ export declare const readInstallMeta: (dataDir: string) => Effect.Effect, never, Path.Path | FileSystem.FileSystem>; /** * Write `install-meta.json` to the given directory. * Creates the directory if it does not exist. * * Exposed for testability. * * @experimental This API is unstable and may change without notice. */ export declare const writeInstallMeta: (dataDir: string, data: InstallMetaData) => Effect.Effect; /** * Live layer providing the `InstallMeta` service. * * @experimental This API is unstable and may change without notice. */ export declare const InstallMetaLive: Layer.Layer; /** * Create an `InstallMeta` layer for testing with a configurable data directory. * * @experimental This API is unstable and may change without notice. */ export declare const InstallMetaTest: (dataDir: string) => Layer.Layer; export {}; //# sourceMappingURL=install-meta.d.ts.map