/** * Library — user-facing concept for a named, writable-or-readable * collection of AI assets. * * Four orthogonal properties: * - backend: how content moves to/from a remote (local | git) * - ownership: which sync verbs are permitted (owner | contributor | reader) * - structure: how discovery walks the tree (flat | domain) * - isDefault: auto-target for `skaile asset migrate` * * See `_devlog/specs/2026-05-27-source-library-store-vocabulary.md`. * * @docLink packages/library/concepts#library */ /** Literal tuple of supported backend kinds. */ export declare const LIBRARY_BACKENDS: readonly ["local", "git"]; /** Backend kind for a library. */ export type LibraryBackend = (typeof LIBRARY_BACKENDS)[number]; /** Literal tuple of supported ownership levels. */ export declare const LIBRARY_OWNERSHIPS: readonly ["owner", "contributor", "reader"]; /** Ownership level on a library — gates sync verbs. */ export type LibraryOwnership = (typeof LIBRARY_OWNERSHIPS)[number]; /** Literal tuple of supported discovery structures. */ export declare const LIBRARY_STRUCTURES: readonly ["flat", "domain"]; /** Layout that discovery walks under the library root. */ export type LibraryStructure = (typeof LIBRARY_STRUCTURES)[number]; /** Empty config for `backend: 'local'`. */ export type LocalBackendConfig = {}; /** Config for `backend: 'git'`. */ export interface GitBackendConfig { url: string; branch: string; authHint: "ssh" | "https" | "gh-cli"; forkUrl?: string; lastPr?: string; } /** Discriminated union of all backend configs. */ export type BackendConfig = LocalBackendConfig | GitBackendConfig; /** * A registered library — one row of the `libraries` table. * * @docLink packages/library/concepts#library */ export interface Library { id: string; name: string; path: string; backend: LibraryBackend; backendConfig: BackendConfig; ownership: LibraryOwnership; structure?: LibraryStructure; isDefault: boolean; manifestGenerated: boolean; lastSyncAt?: Date; createdAt: Date; updatedAt: Date; } /** Input shape for `LibraryManager.addLibrary()`. */ export interface AddLibraryInput { name: string; path: string; backend: LibraryBackend; backendConfig?: BackendConfig; ownership: LibraryOwnership; structure?: LibraryStructure; isDefault?: boolean; manifestGenerated?: boolean; } /** Partial update for `LibraryManager.updateLibrary()`. */ export interface UpdateLibraryInput { name?: string; path?: string; backend?: LibraryBackend; backendConfig?: BackendConfig; ownership?: LibraryOwnership; structure?: LibraryStructure; isDefault?: boolean; manifestGenerated?: boolean; lastSyncAt?: Date; } export interface LocalChanges { added: string[]; modified: string[]; deleted: string[]; } export interface RemoteChanges { behind: number; ahead: number; } export interface ConflictDescriptor { path: string; reason: string; } export interface SyncStatus { reachable: boolean; localChanges: LocalChanges; remoteChanges?: RemoteChanges; conflicts?: ConflictDescriptor[]; notes: string[]; } export interface PullResult { applied: number; conflicts: ConflictDescriptor[]; } export interface PushResult { pushed: number; } export interface ProposeOpts { title?: string; body?: string; branch?: string; } export interface ProposeResult { prUrl: string; branch: string; } export interface PublishOpts { scope?: "team" | "public"; } export interface PublishResult { refs: string[]; } export interface PullOpts { rebase?: boolean; } export interface PushOpts { force?: boolean; } export type AssetRef = string; export declare class LibrarySyncError extends Error { readonly code: string; constructor(message: string, code: string); } export declare class OperationNotPermittedError extends LibrarySyncError { constructor(verb: string, reason: string); } export declare class DuplicateLibraryNameError extends LibrarySyncError { constructor(name: string); } export declare class UserLibraryNotFoundError extends LibrarySyncError { constructor(ident: string); } //# sourceMappingURL=user-library.d.ts.map