/** * The post-deploy command target (V11; refactor R5) — ONE resolve ladder for every command * that acts on an already-deployed workspace (`secrets`, `publish`, `status`, `test`): signed * in? → which workspace? → which hosted agent? Each command glue file carried its own copy, * and they had already drifted on the sign-in message (one said just "not signed in"). * * Resolution is a discriminated result, never a process exit: the domain layer decides WHAT * went wrong, the command glue decides how to report it (GUIDELINES §2). */ import type { CliApiDeps } from "./api-client"; import { type CliFailure } from "./cli-failure"; /** Every actionable refusal this ladder can produce — what is wrong, and the fix, as two fields. */ export declare const NOT_SIGNED_IN: CliFailure; export declare const notDeployed: (path: string) => CliFailure; export interface TargetOptions { cwd: string; home: string; explicitPath?: string; /** Injectable for tests (discovery's bounded-scan roots). */ scanRoots?: string[]; } export interface WorkspaceTarget { deps: CliApiDeps; workspacePath: string; /** The hosted agent minted at this workspace's first deploy — absent until then. */ agentId?: string; } export type TargetResult = { ok: true; target: WorkspaceTarget; } | { ok: false; error: CliFailure; }; export type DeployedTargetResult = { ok: true; target: WorkspaceTarget & { agentId: string; }; } | { ok: false; error: CliFailure; }; /** * The workspace a command should act on: an explicit path wins, then a remembered pick, then * the single discovery hit. Ambiguity without a remembered pick is an error (no picker here — * these are non-wizard commands; pass a path), mirroring `--ci` deploy. */ export declare function resolveWorkspacePath(opts: TargetOptions): { path: string; } | { error: CliFailure; }; /** The workspace's hosted agent id (minted at first deploy) — undefined until deployed. */ export declare function hostedAgentIdFor(home: string, workspacePath: string): string | undefined; /** Signed in + a resolved workspace. The agent id rides along when the workspace has one. */ export declare function resolveWorkspaceTarget(opts: TargetOptions): TargetResult; /** The same, for commands that are meaningless before a first deploy (secrets/publish/test). */ export declare function requireDeployedTarget(opts: TargetOptions): DeployedTargetResult;