/** * Project registry — ~/.config/nostr-station/projects.json. * * A project is the top-level concept in nostr-station: a bundle of one or more * capabilities (git, ngit, nsite). Every combination of the three is valid; * callers MUST NOT assume any capability implies another. * * Persistence is a single JSON file. No migrations (yet) — old records that * are missing fields are read defensively by `readProjects` and rewritten on * next update. nsec is never stored; setters reject it at the boundary. */ export interface ProjectCapabilities { git: boolean; ngit: boolean; nsite: boolean; } export interface ProjectIdentity { useDefault: boolean; npub: string | null; bunkerUrl: string | null; } export interface ProjectRemotes { github: string | null; ngit: string | null; } export interface ProjectNsite { url: string | null; lastDeploy: string | null; } export interface Project { id: string; name: string; path: string | null; capabilities: ProjectCapabilities; identity: ProjectIdentity; remotes: ProjectRemotes; nsite: ProjectNsite; readRelays: string[] | null; createdAt: string; updatedAt: string; } export declare function readProjects(): Project[]; export declare function getProject(id: string): Project | null; export interface CreateInput { name: string; path: string | null; capabilities: ProjectCapabilities; identity: ProjectIdentity; remotes: ProjectRemotes; nsite?: ProjectNsite; readRelays?: string[] | null; } export declare function createProject(input: CreateInput): { ok: true; project: Project; } | { ok: false; error: string; }; export type UpdateInput = Partial>; export declare function updateProject(id: string, patch: UpdateInput): { ok: true; project: Project; } | { ok: false; error: string; }; export declare function deleteProject(id: string): { ok: boolean; }; export interface DetectResult { exists: boolean; isGitRepo: boolean; githubRemote: string | null; ngitRemote: string | null; hasNsyte: boolean; suggestedName: string | null; } export declare function detectPath(targetPath: string): DetectResult; export interface ProjectGitStatus { inRepo: boolean; branch?: string; hash?: string; message?: string; timestamp?: number; author?: string; dirty?: number; remotes?: Array<{ name: string; url: string; type: 'github' | 'ngit' | 'other'; }>; error?: string; } export declare function projectGitStatus(projectPath: string): ProjectGitStatus; export declare function projectGitLog(projectPath: string, limit?: number): Array<{ hash: string; message: string; author: string; timestamp: number; }>; export interface ContextResult { content: string; source: string; } export declare function resolveProjectContext(project: Project | null): ContextResult;