import { type Database } from "./database.js"; /** * The subject's own personal workspace in one organization, or null. * * Only an `active` membership counts, and only that membership's own * `personalWorkspaceId` pointer is read - never a default workspace, a * `created_by`, or current access. * * Non-`user:` subjects (API keys, delegated service principals, configured and * local principals) can never own an organization membership, so they * short-circuit rather than tripping `list_self_organization_memberships`' * `42501` guard. * * ORACLE, NOT AN AUTHORIZATION. This answers "which workspace is this named * subject's own" for whatever subject it is handed; it does not establish that * the caller IS that subject. Pass only a subject authenticated out of band - * for Slack, one named by a durable `slack_bot_user_links` row. Never pass a * subject taken from a request payload. */ export declare function namedSubjectPersonalWorkspaceId(db: Database, input: { accountId: string; subjectId: string; }): Promise; /** * The same pointer for an external user of the organization (an * `external_user:` subject, such as a person in an embedded chat): their own * workspace, named by their active organization membership. Null for every * other subject. The same oracle caveat applies: it does not establish that * the caller is that person. */ export declare function externalPersonPersonalWorkspaceId(db: Database, input: { accountId: string; subjectId: string; }): Promise; /** * Whether a named person is an active, full member of one organization: a * `user:` subject (a managed human, never an API key, service principal or an * embedded product's `external_user:`) whose membership there is `active` * (not provisioning, suspended or revoked) with a full-member role. * * Read live on every call, never cached. The same oracle caveat as * `namedSubjectPersonalWorkspaceId` applies: pass only a subject authenticated * out of band, such as one named by a durable `slack_bot_user_links` row. */ export declare function namedSubjectIsActiveOrganizationMember(db: Database, input: { accountId: string; subjectId: string; }): Promise; /** * True only when `workspaceId` is a Personal workspace of `accountId` and its * pointer names exactly `subjectId` (a `user:` or `external_user:` subject). * * Shared workspaces stop at the workspace-kind check, before any membership * read. A subject the membership oracle refuses (for example an external user * with no Personal workspace of their own) is not the owner, so its `42501` is * a plain false; the probe runs in its own scope (a savepoint inside a caller's * transaction), so the refusal never aborts the caller. The same oracle caveat * as `namedSubjectPersonalWorkspaceId` applies. */ export declare function isSubjectOwnPersonalWorkspace(db: Database, input: { accountId: string; workspaceId: string; subjectId: string; }): Promise;