import { type OnePasswordPlanTier, type VaultErrorCode, type VaultItemSummary, type VaultItemType, type VaultSummary } from "@opengeni/sdk"; import { type AgentCapabilities } from "@opengeni/contracts"; export type VaultGroupId = "user" | "workspace"; export declare const VAULT_GROUP_TITLE: Record; /** * Vaults are grouped by who can use them, whatever their source: a vault * linked from a personal 1Password account sits under Only me, next to the * person's own vaults. Its tile says where the items come from. */ export declare function vaultGroup(vault: VaultSummary): VaultGroupId | null; export declare function groupVaults(vaults: VaultSummary[]): { id: VaultGroupId; vaults: VaultSummary[]; }[]; export type ConnectionOwner = "user" | "workspace" | "organization"; /** "Only me", "This workspace" or "Organization", as on vaults. */ export declare function connectionOwnerLabel(owner: ConnectionOwner): string; /** Who can use the vaults linked through a connection, as one sentence. */ export declare function connectionAudience(owner: ConnectionOwner, organizationName: string): string; /** The vaults linked through one connection, by name. */ export declare function vaultsOfConnection(vaults: VaultSummary[], connectionId: string): VaultSummary[]; export declare const PLAN_LABEL: Record; export declare const OWNER_LABEL: Record; export declare const SOURCE_LABEL: Record; export declare const MODE_LABEL: Record; /** Who a vault is shared with, in one short phrase. */ export declare function vaultAudience(vault: VaultSummary, organizationName: string): string; export declare const ITEM_TYPE_LABEL: Record; export declare const ITEM_TYPE_FILTERS: { value: "all" | VaultItemType; label: string; }[]; export declare function itemsLabel(count: number): string; /** The row's second line: the username, else the first website. */ export declare function itemSubtitle(item: VaultItemSummary): string | undefined; export declare function hostOf(website: string): string; export declare const EXPIRING_SOON_DAYS = 14; export type ExpiryState = { kind: "expired"; at: Date; } | { kind: "expiring"; at: Date; days: number; } | null; export declare function expiryState(expiresAt: string | null, now?: number): ExpiryState; export declare function expiryLabel(state: NonNullable): string; export declare function formatClock(iso: string | null): string | null; export declare function syncLabel(vault: VaultSummary): string | null; /** What happened and what to do, never a raw code. `home` names the password manager. */ export declare function vaultErrorText(error: unknown, fallback?: string, home?: string | null): string; /** An Error carrying the user-facing copy, for FormPage and confirm throwers. */ export declare function vaultError(error: unknown, fallback?: string, home?: string | null): Error; export declare function isMissingKeyError(error: unknown): boolean; /** A confirmed create awaiting inventory, not a failed or uncertain write. */ export declare function savedCreation(caught: unknown, itemName: string, vaultName: string): { title: string; description: string; } | null; export interface CreatedManagedVault { name: string; externalVaultId: string | null; vaultId: string | null; linked: boolean | null; sharingUnconfirmed: boolean; errorCode: VaultErrorCode | null; } /** Creation is confirmed independently of local linking, sharing and discovery. */ export declare function createdManagedVault(caught: unknown, name: string): CreatedManagedVault | null; export declare function managedVaultCreationText(created: CreatedManagedVault, home: string): string; /** A move or copy that failed after its copy was saved: what to tell the person. */ export interface SavedTransfer { title: string; description: string; /** The saved copy, when the server could name it (it may not be listed yet). */ copy: { vaultId: string; itemId: string; } | null; /** The original was archived or trashed too, so its page is gone. */ originalRemoved: boolean; } /** * A failed move or copy whose copy was saved anyway (`details.saved`), so it * mustn't be offered again: a retry would save a second copy. Null for an * ordinary failure, which stays retryable. The error's code says why the * original was kept (a provider that didn't answer, a changed original, one * no longer listed), so the copy here never reads the code alone. */ export declare function savedTransfer(caught: unknown, context: { mode: "move" | "copy"; itemName: string; targetName: string; /** Where the original lives: "Proton Pass", or the vault's name in Opengeni. */ source: string; removal: "archive" | "trash"; }): SavedTransfer | null; export declare function isNotFoundError(error: unknown): boolean; export declare function isPermissionError(error: unknown): boolean; /** * Whether these capabilities turn Secrets off: true or false when they decide * it, null when they follow the workspace default (or there are none). */ export declare function secretsOffIn(capabilities: AgentCapabilities | undefined): boolean | null; /** The workspace default turns Secrets off for its agents. */ export declare function secretsCapabilityOff(settings: unknown): boolean;