/** * channel-profiles/install-inbound-intake.ts * * Wires the inbound-intake enrichment substrate (buildInboundIntakeEnrichment) * into the live session origination path WITHOUT every channel adapter having to * call it by hand. The composition root (registerGatewayVerbGroups, which already * constructs the principal and channel-profile registries) installs this once; it * decorates the shared broker's `submitMessage`, the single transport intake * chokepoint every adapter funnels an inbound message through, so each inbound * message gets its sender attributed and its channel's profile applied at the * moment the session is originated. * * submitMessage's input carries the NARROW transport surface kind (a Slack/Signal/ * etc. surface, never a product surface like webui/agent, those originate via * sessions.register, a different path), so decorating it is inherently scoped to * channel inbound. The enrichment only augments the session/message metadata (it * never drops or rewrites a caller field), so an unmapped sender is stamped with * the honest unknown principal (known:false) rather than a guess. */ import type { PrincipalRegistry } from '../principals/index.js'; import type { SubmitSharedSessionMessageInput, SharedSessionSubmission } from './../control-plane/session-types.js'; import type { ChannelProfileRegistry } from './registry.js'; import type { ChannelPolicyManager } from '../channels/policy-manager.js'; /** The broker surface this decorator needs: just the transport intake entry point. */ export interface InboundIntakeBroker { submitMessage(input: SubmitSharedSessionMessageInput): Promise; } export interface InboundIntakeEnrichmentDeps { readonly principals: Pick; readonly channelProfiles: Pick; /** * Optional: the channel ingress-policy manager. When present, a sender who * is not a named principal but whom this surface's owner allowlist already * authorizes is attributed to the honest owner principal instead of the * unknown one, see {@link attributeInboundSession}. Absent (a narrower * composition, or every existing test) keeps the prior unknown-principal * behavior exactly. */ readonly channelPolicy?: Pick | undefined; } /** * Compute the metadata an inbound submit input should carry: the sender * attribution plus the applied channel profile (model/provider/permission mode), * merged over whatever metadata the caller already set. Exported for direct * testing of the enrichment mapping independent of the broker decoration. */ export declare function enrichInboundSubmitMetadata(deps: InboundIntakeEnrichmentDeps, input: SubmitSharedSessionMessageInput): Promise>; /** * Decorate a broker's submitMessage so every inbound transport message is * enriched before origination. Idempotent guard: a broker already wrapped is left * as-is so a double install (defensive composition) never double-stamps. */ export declare function installInboundIntakeEnrichment(broker: InboundIntakeBroker, deps: InboundIntakeEnrichmentDeps): void; //# sourceMappingURL=install-inbound-intake.d.ts.map