import { BindingKind } from './project-identity.js'; type TargetSource = 'profile' | 'env' | 'project' | 'cwd' | 'legacy'; interface ResolvedProject { name: string; projectId?: string; root?: string; binding: BindingKind; org?: string; legacy: boolean; bindingAbsent?: boolean; source: 'project' | 'cwd' | 'legacy'; } interface ProjectTarget { endpoint: string; authToken?: string; source: TargetSource; project?: ResolvedProject; line: string; notices: string[]; daemonProject?: string; } declare class TargetResolutionError extends Error { line?: string; constructor(message: string); } declare class UnknownProfileError extends TargetResolutionError { constructor(name: string); } interface ResolveOptions { project?: string; profile?: string; cwd?: string; env?: NodeJS.ProcessEnv; } /** * Levels 2–5: which project the command means. Never consults a profile. */ declare function resolveProject(opts?: ResolveOptions): Promise; declare function resolveProjectSync(opts?: ResolveOptions): ResolvedProject; /** * The whole resolution: the project and the endpoint to reach it, as one * decision, with the binding line to print. */ declare function resolveProjectTarget(opts?: ResolveOptions): Promise; declare function resolveProjectTargetSync(opts?: ResolveOptions): ProjectTarget; /** NEAT_LEGACY_ROUTING=1 restores the pre-ADR-273 resolution (project-identity.md §7). */ declare function legacyRoutingEnabled(env?: NodeJS.ProcessEnv): boolean; declare const LEGACY_ROUTING_NOTICE = "NEAT_LEGACY_ROUTING=1: using the pre-ADR-273 resolution (the logged-in profile routes every bare command). This switch is temporary and will be removed."; /** The line a client prints when no project resolved (project-identity.md §6). */ declare const UNRESOLVED_LINE = "project=(none) \u00B7 binding=(unresolved) \u00B7 daemon=(none)"; /** A command that acts on this machine was run on a hosted-bound project. */ declare class HostedBindingError extends TargetResolutionError { constructor(name: string, org: string | undefined); } /** * For a command that acts on this machine (`up`, `watch`, the bare orchestrator): * throws HostedBindingError when the project at or above `dir` is bound to hosted, * so the command stops before it writes, starts or prints anything that reads as * ready (§5). A directory with no project, or an identity file that can't be read, * is left to the command's own handling. */ declare function assertLocalBinding(dir: string): void; export { HostedBindingError, LEGACY_ROUTING_NOTICE, type ProjectTarget, type ResolveOptions, type ResolvedProject, TargetResolutionError, type TargetSource, UNRESOLVED_LINE, UnknownProfileError, assertLocalBinding, legacyRoutingEnabled, resolveProject, resolveProjectSync, resolveProjectTarget, resolveProjectTargetSync };