/** * TelegramShuttle — the Telegram channel, on the ShuttleAdapter base (SH3). * * Proof of the "adding a channel is a weekend" promise: this file is thin * because the base does the hard part. It wires a fetch-based Bot API client + * a TelegramTransport into a ShuttleAdapter, maps updates → ShuttleMessage, * and long-polls. The agent is a *bot identity* here (its @username); DMs go * straight to the agent, groups require an @mention (default policy). */ import type { ThreadMap, GroupPolicy, ShuttleMessage } from '../types.js'; import type { DeliveryPolicy } from '../delivery.js'; import type { LinePolicy, LlmGate } from '../gate.js'; import type { PairingStore } from '../pairing.js'; import type { GatewayClient } from '../gateway-client.js'; import { type TgUpdate } from './api.js'; export interface TelegramShuttleOptions { /** Bot token (from @BotFather). SH1 part 3 will source this from the vault. */ readonly token: string; /** Which agent answers (profile slug). */ readonly profileId: string; /** How the shuttle reaches the agent. */ readonly gateway: GatewayClient; /** Thread map (default in-memory). */ readonly threads?: ThreadMap; /** Delivery mode (default `typing+final` — natural for Telegram). */ readonly delivery?: DeliveryPolicy; /** Access + response policy (personal ↔ business). */ readonly line?: LinePolicy; /** Group behavior (default `mention`). Back-compat shortcut for `line.group`. */ readonly groupPolicy?: GroupPolicy; /** Isolate each group participant into their own thread. */ readonly groupPerUser?: boolean; /** Pairing store (required when `line.dm: 'pairing'`). */ readonly pairing?: PairingStore; /** Optional cheap LLM "is this for us?" pre-filter. */ readonly llmGate?: LlmGate; /** Whether a thread is handed off to a human. */ readonly isPaused?: (msg: ShuttleMessage) => boolean | Promise; /** Injected fetch (tests / custom TLS). */ readonly fetch?: typeof fetch; /** Bot API base override (tests / self-hosted). */ readonly baseUrl?: string; /** Bot @username. If omitted, resolved via getMe on start (needed for @mention). */ readonly botUsername?: string; /** Long-poll timeout in seconds (default 30). */ readonly pollTimeoutSec?: number; } export declare class TelegramShuttle { private readonly api; private readonly adapter; private readonly transport; private readonly pollTimeout; private botUsername; private running; private offset; constructor(opts: TelegramShuttleOptions); /** Outbound push (schedule delivery): send `text` to a chat id. */ sendText(target: string, text: string): Promise; /** Resolve the bot's @username (needed for @mention detection in groups). */ ensureIdentity(): Promise; /** Map + handle one update. Public so it's testable without polling. */ processUpdate(update: TgUpdate): Promise; /** Start the long-poll loop. Resolves once {@link stop} is called. */ start(): Promise; stop(): void; } //# sourceMappingURL=shuttle.d.ts.map