import { type MessengerWorkspaceConfig } from "../util/config.js"; import { getWorkspaceYamlPath } from "../util/paths.js"; /** * v0.8 §3.6 — Broadcast channel (`#solosquad-broadcast`). * * Opt-in. When `workspace.yaml.messenger.broadcast_enabled === true` exactly * one bot (the `broadcast_owner_handle`) is allowed to push morning/evening * briefs and weekly review summaries. Every other bot in the workspace must * push briefs to its own `works-` channel only — otherwise N bots * post the same brief N times. */ export declare const BROADCAST_CHANNEL_DEFAULT = "solosquad-broadcast"; /** * @deprecated v1.2 — kept as a type alias for backward compatibility with * call sites that imported `MessengerSection`. The canonical type lives in * `src/util/config.ts` as `MessengerWorkspaceConfig` (covers broadcast + * discord + slack subsections). */ export type MessengerSection = MessengerWorkspaceConfig; export declare function loadMessengerSection(workspace?: string): MessengerWorkspaceConfig; export declare function broadcastEnabled(workspace?: string): boolean; export declare function broadcastChannelName(workspace?: string): string; export declare function broadcastOwnerHandle(workspace?: string): string | null; /** * Predicate every push site (scheduler briefs, weekly review) uses to decide * whether the current bot may send to the broadcast channel. * * Returns true only when: * 1. `broadcast_enabled: true`, AND * 2. `broadcast_owner_handle === currentHandle` * * Any other bot must push to its own `works-` instead. */ export declare function isDesignatedBroadcaster(currentHandle: string, workspace?: string): boolean; export interface HandoverInput { toHandle: string; workspace?: string; /** When true, set `broadcast_enabled: true` along with the handover. */ enable?: boolean; } export interface HandoverResult { previous: string | null; next: string; enabled: boolean; } /** * v0.8 §3.6 — `solosquad messenger broadcast-handover --to `. * * Idempotent. The caller (CLI) is responsible for sanity-checking that the * target handle has a corresponding user yaml; this function only mutates * `workspace.yaml.messenger.broadcast_owner_handle`. */ export declare function handoverBroadcast(input: HandoverInput): HandoverResult; /** * Helper used by adapters: should the bot create / claim the broadcast * channel at startup? Only the designated bot does — others are read-only or * skip the channel entirely. */ export declare function shouldCreateBroadcastChannel(currentHandle: string, workspace?: string): boolean; /** Re-export the workspace.yaml path for callers that want to stamp directly. */ export { getWorkspaceYamlPath }; /** Touch helper kept for tests that need an empty messenger section. */ export declare function ensureMessengerSectionPresent(workspace?: string): void;