/** * Pack subject module: declared/resolved/actual payloads, scanner composition, * and **direct-only** installed projections via the shared helper. * * Per Decision 9 of the workspace read-model design: packs cannot be members of * other packs. The pack subject's own `installed` projection therefore passes * an empty installed-pack set into the projection helper, so no pack-member * row is ever produced for a pack. Direct pack declarations remain the only * way a pack appears in `installed`. * * Other subjects derive Pack membership from the authored `pack.json` * manifest. The lock entry carries only accepted external resolution. * * Pack activation follows its declared settings entry. Disabled packs retain * their declaration, lock data, and canonical content while leaving the * active projection. */ import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import { type ExtensionName } from "../../../extensions/common.js"; import type { PackLockEntry, Lockfile } from "../../../lockfile/schema.js"; import type { PackEntry, Settings } from "../../../settings/schema.js"; import type { Diagnostics } from "../diagnostics.js"; import type { LockfileReadError, SettingsReadError } from "../errors.js"; import type { CanonicalExtensionOccurrence } from "../scanners/types.js"; import type { ActivationState, ExtensionKey, InstallationOrigin, InstalledPackRef, Scope } from "../types.js"; export type PackDetectionOrigin = { readonly _tag: "canonical-axm-pack"; } | { readonly _tag: "external-axm-pack"; }; export interface DeclaredPack { readonly name: ExtensionName; readonly entry: PackEntry; } export type DeclaredPacks = ReadonlyArray; /** Resolved Pack carrying the accepted external-resolution row verbatim. */ export interface ResolvedPack { readonly keyName: string; readonly name: ExtensionName; readonly lockEntry: PackLockEntry; } export type ResolvedPacks = ReadonlyArray; export interface ActualPack { readonly key: ExtensionKey<"pack">; readonly origin: PackDetectionOrigin; readonly contentRoot: string; readonly packageRoot: string | null; } export type ActualPacks = ReadonlyArray; /** * Pack member entry carrying enough info to identify the source pack. Pack * subjects do not produce member rows (packs are not pack members), but the * shared projection helper still type-parameters its pack-member type, so we * supply a never-instantiated placeholder. */ export type PackPackMember = never; /** * Installed pack row. The installation origin union is widened only to * `direct` because packs cannot be pack members. Generic consumers reading * `installationOrigin._tag` always observe `"direct"` on a pack row. */ export interface InstalledPack { readonly key: ExtensionKey<"pack">; readonly installationOrigin: InstallationOrigin; readonly activation: ActivationState; readonly resolved: Option.Option; readonly actual: ReadonlyArray; readonly providingPacks: ReadonlyArray; } export interface UnmanagedPack { readonly key: ExtensionKey<"pack">; readonly actual: ActualPack; } export interface PackScopedLoaders { readonly settings: Effect.Effect, SettingsReadError>; readonly lockfile: Effect.Effect, LockfileReadError>; } export interface PackScanners { readonly canonical: Effect.Effect>; } export interface PackExtensionsApiDeps { readonly scope: Scope; readonly loaders: PackScopedLoaders; readonly scanners: PackScanners; readonly diagnostics: Diagnostics; } export interface PackExtensionsApi { readonly declared: Effect.Effect, SettingsReadError>; readonly resolved: Effect.Effect, LockfileReadError>; readonly actual: Effect.Effect; readonly installed: Effect.Effect, SettingsReadError | LockfileReadError>; readonly byName: (name: string) => Effect.Effect, SettingsReadError | LockfileReadError>; readonly declaredByName: (name: string) => Effect.Effect, SettingsReadError>; readonly active: Effect.Effect, SettingsReadError | LockfileReadError>; readonly unmanaged: Effect.Effect, SettingsReadError | LockfileReadError>; } /** * Build the pack subject API. Returns an `Effect` because the projection * cell is wrapped in `Effect.cached` so the four derived cells share one * in-flight execution per scope, mirroring `state.ts`. */ export declare const makePackExtensionsApi: (deps: PackExtensionsApiDeps) => Effect.Effect; //# sourceMappingURL=pack.d.ts.map