/** * Parse outbound notification targets. * * Target grammar (Hermes-mirror — see apps/hermes-agent/tools/send_message_tool.py:21-46): * * ":" → explicit per-call target * * Bare-platform fallback (`` with no `:`) is NOT implemented in * this parser. The notify() caller layer handles the "no target → env default" * decision by passing undefined/empty as the target and reading * `SLACK_HOME_CHANNEL` directly — it never calls `parseTarget("slack")`. * * For slice 1 the only platform is "slack". for slack is a 9+ char * uppercase alphanumeric ID prefixed with one of: * C — public channel * G — private channel ("group") * D — direct message conversation * U — user (must be conversations.open'd to a D… before chat.postMessage; * the caller is responsible for that resolution) * * Optional thread suffix: ":" pins the post to an existing * thread in that conversation. Not all kinds support threading sensibly, but * the parser accepts it for any non-user kind. * * NOT supported in this pass: user IDs with embedded thread suffixes (no * coherent meaning until U→D resolution); Hermes-style multi-platform * regexes for telegram/discord/feishu (those land in slice 2+). */ /** Slack ID after the `slack:` prefix. */ export declare const SLACK_ID_RE: RegExp; /** * Slack ID + optional thread suffix `:`. * * `thread_ts` must look like Slack's canonical message timestamp shape * (`.` — digits-only). Anything else is rejected here * so the CLI / schedule add validators catch typos before they reach Slack. */ export declare const SLACK_TARGET_RE: RegExp; export type SlackTargetKind = "channel" | "group" | "dm" | "user"; export interface SlackTarget { platform: "slack"; kind: SlackTargetKind; /** * The raw Slack ID (`C…`/`G…`/`D…`/`U…`). For user targets, the caller * must resolve to a D-ID via conversations.open before posting. */ id: string; /** Optional `thread_ts` for threaded posts. */ threadTs?: string; } export type ParsedTarget = SlackTarget; export interface ParseError { ok: false; error: string; } export type ParseResult = { ok: true; target: ParsedTarget; } | ParseError; /** * Parse a target string of the form `:`. Returns either a * structured target or a friendly error. Pure — no I/O. */ export declare function parseTarget(raw: string): ParseResult; /** * Parse just the slack-side `` (the part after `slack:`). Useful when a * caller has already established platform context (e.g. `SLACK_HOME_CHANNEL` * is set without a platform prefix). */ export declare function parseSlackRef(ref: string): ParseResult; /** * Best-effort check for "looks like a Slack ID" without committing to a * specific kind — used by config validators to nudge users about typos * before any network call. */ export declare function looksLikeSlackId(value: string): boolean;