import type { AuthoritySurface } from '../security/untrusted-content.js'; import type { ProfileSurface } from '../owner-profile/types.js'; /** Where the turn arrived from, as the shared-session record describes it. */ export interface CaptureChannelIdentity { /** The surface the message landed on, e.g. `telegram`. Absent ⇒ a local surface. */ readonly surfaceKind?: string | undefined; /** The account/chat within that surface, when the record carries one. */ readonly address?: string | undefined; /** * True when the turn came in over a configured route, i.e. it is a channel * turn whatever else the record says. * * Without this, a channel message that arrived with its `surfaceKind` missing * would be indistinguishable from the owner typing at their own keyboard, and * would be handed their authority by default. That is the wrong way for this to * fail: an absent surface on a routed turn means "I do not know where this * came from", and not knowing is a refusal. */ readonly routed?: boolean | undefined; } export interface CaptureAuthorityInput { readonly channel?: CaptureChannelIdentity | undefined; /** `profile.ownerChannels`, verbatim. Empty ⇒ fall back to the nudge channels. */ readonly ownerChannels?: string | undefined; /** `occasions.nudgeChannel`, verbatim, the channels already reaching the owner. */ readonly nudgeChannels?: string | undefined; } /** Which setting decided this, so a refusal can name the thing to change. */ export type CaptureAuthoritySource = 'local-surface' | 'profile.ownerChannels' | 'occasions.nudgeChannel' | 'unlisted-channel'; export interface CaptureAuthorityDecision { /** What to pass to the profile write gate. Only `owner-direct` is accepted by it. */ readonly authority: AuthoritySurface; /** The provenance surface recorded against the line. */ readonly surface: ProfileSurface; /** True when this turn may write. */ readonly canCapture: boolean; readonly source: CaptureAuthoritySource; /** One plain sentence: why it may write, or why it may not and what to change. */ readonly reason: string; } /** * Split a comma-separated channel list into targets. Same grammar as * `occasions.nudgeChannel`: `surfaceKind` or `surfaceKind:address`, so a value * copied from one setting to the other means the same thing in both. */ export declare function parseOwnerChannelList(value: string | undefined): readonly { readonly surfaceKind: string; readonly address: string; }[]; /** * Resolve the authority for one conversational turn. * * Never throws and never guesses upward: anything it cannot place is * `channel-message`, which the profile write gate refuses. */ export declare function resolveCaptureAuthority(input: CaptureAuthorityInput): CaptureAuthorityDecision; //# sourceMappingURL=authority.d.ts.map