export interface CmuxWorkspaceRenameCommand { command: string; args: string[]; } /** Current ownership state of a cmux workspace, read back from `cmux workspace list`. */ export interface CmuxWorkspaceOwnership { /** cmux marks a workspace `has_custom_title` once an explicit title is set (by the user or by GJC). */ hasCustomTitle: boolean; /** The workspace's current display title. */ title: string; } export interface CmuxWorkspaceRenameProcess { exited: Promise; kill(): void; unref(): void; } export interface CmuxWorkspaceTitleSyncOptions { env?: NodeJS.ProcessEnv; isTty?: boolean; which?: (command: string) => string | null; spawn?: (command: string[], options: { env: NodeJS.ProcessEnv; stdin: "ignore"; stdout: "ignore"; stderr: "ignore"; }) => CmuxWorkspaceRenameProcess; /** Reads the current ownership state of `workspaceId`. Injectable for tests. */ readOwnership?: (cmuxCommand: string, workspaceId: string, env: NodeJS.ProcessEnv) => Promise; } export declare function sanitizeCmuxWorkspaceTitle(title: string | undefined): string | undefined; export declare function formatCmuxWorkspaceTitle(title: string | undefined): string | undefined; export declare function buildCmuxWorkspaceRenameCommand(sessionName: string | undefined, env?: NodeJS.ProcessEnv): CmuxWorkspaceRenameCommand | null; /** Parse `cmux workspace list --json --id-format both` output and return the * ownership state of the workspace matching `workspaceId` (by UUID `id` or `ref`). */ export declare function parseCmuxWorkspaceOwnership(jsonText: string, workspaceId: string): CmuxWorkspaceOwnership | null; /** Only rename when GJC owns the name: * - unknown ownership (read failed) → skip (fail safe, never clobber) * - already the desired title → skip (no-op) * - workspace still on its default title → rename * - any custom title (user- or peer-set) → skip * This makes GJC name a fresh workspace once and then leave it alone, so it * never overwrites a user-pinned name and multiple sessions sharing one * CMUX_WORKSPACE_ID do not thrash the workspace title. */ export declare function shouldRenameCmuxWorkspace(ownership: CmuxWorkspaceOwnership | null, desiredTitle: string): boolean; /** * Best-effort sync of the containing cmux workspace title to the current GJC * session name. Ownership-guarded: GJC reads the current workspace title and * only renames a workspace that still has its default title, so it never * overwrites a name the user pinned or a name a peer session (sharing the same * CMUX_WORKSPACE_ID) set. Opt out with GJC_NO_CMUX_RENAME. */ export declare function syncCmuxWorkspaceTitle(sessionName: string | undefined, options?: CmuxWorkspaceTitleSyncOptions): Promise;