/** * Project resolution ladder — which Project does this invocation's output * belong to? First rung that matches wins. * * 0. CONVERSATION_ID already set → do nothing at all (cloud ab-agent path) * 1. --project prj_xxx → explicit flag * 2. REMIXMATE_PROJECT_ID → explicit env * 3. ~/.config/remixmate/projects.json → `project use` binding (byPath → default) * 4. the default project 「未分类」 → lazily created server-side * * Only "explicit" and "fallback" — there is deliberately no inference step in * between. Deriving a project from the git remote reads well until you notice * it *creates* one on every unfamiliar repo (`/project/create` is an upsert), * and that its rules have to keep growing for private remotes, non-GitHub * remotes, monorepos and repos with no origin — each misfire silently filing * output under a project the user never made. * * See docs/cli-project-binding-design.md §3. */ import { type HttpContext } from '../http.js'; export interface ResolvedProject { projectId: string; source: 'flag' | 'env' | 'binding-path' | 'binding-default' | 'default-project'; } /** Minimal shape of ab-api's ProjectVO — only what the ladder needs. */ export interface ProjectSummary { id: string; displayName?: string; fullName?: string; sourceUrl?: string; isDefault?: boolean; } /** POST /project/default — get-or-lazily-create 「未分类」. */ export declare function fetchDefaultProject(ctx: HttpContext): Promise; /** POST /project/list — for `remixmate project list`. */ export declare function listProjects(ctx: HttpContext): Promise; export declare function resolveProject(ctx: HttpContext, opts?: { flagProjectId?: string; env?: NodeJS.ProcessEnv; cwd?: string; }): Promise; /** Human-readable label for `doctor` / `project show`. */ export declare function describeProjectSource(source: ResolvedProject['source']): string;