import type { NamespaceView, SessionView } from '../../../ops/types.ts'; import type { CommandOpts } from '../../config.ts'; export declare const UNKNOWN_NAME = "-"; /** * Who a session is, in the two words POSIX renders as owner and group. * * The user is the workspace user (what `whoami` prints, the launch * `agentId`); the profile is the permission set the session acts with, * which is what a group is. A backend that reports a uid or gid on an * entry (disk, or a `chown` held in the attr overlay) wins over both, so * `ls -l`, `stat %U %G` and `find -printf %u %g` all agree on one rule. */ export interface Identity { readonly user: string | null; readonly profile: string | null; } export declare const NO_IDENTITY: Identity; /** The identity two planes' views describe; either view may be absent outside a workspace. */ export declare function identityFrom(ns: NamespaceView | undefined, sessionView: SessionView | undefined): Identity; /** The identity a command invocation runs as, read off its opts. */ export declare function identityOf(opts: CommandOpts): Identity; /** The owner column: the entry's own uid, else the workspace user, else `-`. */ export declare function ownerName(uid: number | string | null | undefined, identity: Identity | null): string; /** The group column: the entry's own gid, else the session's profile, else `-`. */ export declare function groupName(gid: number | string | null | undefined, identity: Identity | null): string; //# sourceMappingURL=identity.d.ts.map