#!/usr/bin/env node /** * Compact result formatter. Default (lean) form is single-line / minimal — NO * pretty-print — so it doesn't bloat the context window. Pass { verbose: true } for * the fuller, indented form when a human actually needs to read every field. * * Accepts an already-prepared `data` value. Callers are expected to have already * trimmed to the fields that matter for the lean case (see the READ tools), but this * function is also safe to hand a full object for the verbose path. */ export declare function leanResult(data: unknown, opts?: { verbose?: boolean; }): string; export declare function isFlatObject(v: unknown): v is Record; interface RenderTableColumn { key: string; label?: string; align?: "left" | "right"; maxWidth?: number; } /** * Render tabular data as a clean, column-aligned monospace ASCII table using * box-drawing characters. The output is meant to be dropped inside a Slack code * block (```) so it renders with a fixed-width font and column alignment survives. * * Accepts any of: * - array of flat objects → columns inferred from keys (or pass `columns`) * - 2D array (string[][]) → first row treated as header * - a markdown table string (| a | b |\n|---|---|\n| 1 | 2 |) * * Long cells are truncated with an ellipsis past a per-column max width (default 40). * Numeric-looking columns are right-aligned automatically unless overridden. */ export declare function renderTable(rows: Record[] | unknown[][] | string, columns?: RenderTableColumn[]): string; export declare function cellToString(v: unknown): string; export declare function parseMarkdownTable(md: string): { headers: string[]; body: string[][]; }; /** * Render a unicode progress bar, e.g. renderProgressBar(40) => "▰▰▰▰▱▱▱▱▱▱ 40%". */ export declare function renderProgressBar(pct: number, width?: number): string; interface CardSection { text?: string; fields?: { label?: string; value: string; }[]; } interface BuildCardOpts { header: string; sections?: CardSection[]; context?: string; color?: string; } /** * Build a Slack Block Kit blocks[] array: a header block, section blocks (each with * optional two-column fields), dividers between sections, and an optional context * footer. Used by slack_send_card and the task-lifecycle summary cards. * * Returns { blocks } always, plus { attachments } when a color bar is requested * (Slack only supports the colored left-bar via the legacy attachments wrapper). */ export declare function buildCard(opts: BuildCardOpts): { blocks: any[]; attachments?: any[]; }; export declare function truncatePlain(s: string, max: number): string; export declare class SlackerV3Server { private server; private accountState; private readonly CACHE_TTL_MS; private usersCache; private channelsCache; private userInfoCache; private taskRegistry; private browser; private browserIdleTimer; private readonly BROWSER_IDLE_MS; private static readonly NO_TOKEN_MESSAGE; constructor(opts?: { tokens?: Record; workspace?: string; }); private loadSecretFromASM; private loadAccountFromEnv; private rosterCache; private rosterFetchP; /** Roster cache: name→ID from users.list, hourly TTL, single-flight. */ private getRoster; /** Wrap chat.postMessage so ALL send paths get auto-tagging for free. * Delegates to the RAW function via .call and copies its own properties, so * test doubles (jest.fn: .mock, .mockClear, ...) keep working through the wrap. */ private installLinkify; private getActiveClient; private getActiveUserClient; private ensureWorkspaceInfo; private currentAccountKey; private getAllUsersCached; private getAllChannelsCached; private describeActiveAccount; private getActiveAccount; private listAccounts; private slackListChannels; private convertMarkdownToSlackMrkdwn; private processExplicitMentions; private resolveRecipient; private slackSendMessage; private slackSendTable; private taskKey; private identityOverrides; private swapReaction; private slackSendCard; private slackStartTask; private slackUpdateTask; private slackCompleteTask; private static readonly NATO_CALL_SIGNS; private legateStateDir; private sanitizeCallSign; private loadLegateState; private saveLegateState; private tsGreater; private mentionsToken; private classifyAddressing; private looksSelfAuthored; private slackPoll; private laneKey; private parseLaneClaim; private slackClaimLane; private slackCheckin; private miningStateDir; private sanitizeKey; private loadMiningState; private saveMiningState; private parseTimeToTs; private fetchHistoryWindow; private static readonly INCIDENT_RE; private static readonly HARD_INCIDENT_RE; private static readonly HTTP_ERR_RE; private static readonly CRASH_METAPHOR_RE; private static readonly SOFT_NEG_RE; private static readonly WORK_CONTEXT_RE; private static readonly JOKE_RE; private static readonly HELP_REQUEST_RE; private looksLikeIncident; private buildUserNameMap; private displayUser; private augmentNameMap; private isBotMessage; private slackPullFiltered; private slackPullSince; private slackMineIncidents; private slackDigest; private slackGetChannelHistory; private moreFooter; private slackAddReaction; private slackListUsers; private slackGetUserByName; private slackGetUserInfo; private fetchChannelMemberIds; private resolveMembers; private leanMember; private slackListChannelMembers; private slackListExternalUsers; private slackSearchFiles; private static readonly MAX_INLINE_IMAGE_BYTES; private static readonly INLINE_IMAGE_TYPES; private static readonly INLINE_TEXT_TYPES; private fetchSlackFile; private downloadWithTokenFallback; private slackDownloadFile; private fileCacheDir; /** * Build lean file stubs for a message's attachments. Always flags whether any are * images (so read tools can surface `has_images`). When `includeFiles` is true, * image attachments are auto-downloaded to the local cache and the stub gains a * ready-to-`Read` `local_path` — one call to view the actual pixels, no separate * slack_download_file step. Best-effort: a failed download just omits `local_path` * (the file id is still there for a manual download). Pass the FULL Slack file * objects (they carry url_private / thumbs), not pre-trimmed stubs. */ private buildFileStubs; /** * Download an image attachment to the cache dir and return its local path. Falls * back to Slack's largest thumbnail if the original exceeds the inline image cap, so * the cached file stays a viewable size. Returns null if there's no URL or the * download fails (caller treats null as "no local_path"). */ private cacheImageToDisk; private slackSearchMessages; private searchFooter; private slackSearchByUser; private slackSearchByDateRange; private slackPinMessage; private slackUnpinMessage; private slackCreateChannel; private slackInviteUsers; private slackRemoveUsers; private slackInviteExternal; private slackArchiveChannel; private slackRenameChannel; private slackSetChannelTopic; private slackDeleteMessage; private slackEditMessage; private slackScheduleMessage; private slackGetUserStatus; private slackGetUserProfile; private slackCreateReminder; private slackListReminders; private slackGetCustomEmoji; private slackSendFormattedMessage; private slackAuditUserActivity; private slackBulkReactMessages; private slackForwardMessage; private slackBulkForwardMessages; private slackGetThreadReplies; private slackGetWorkspaceStats; private slackUploadFile; private slackSendDiagram; private getBrowser; private scheduleBrowserIdleClose; private closeBrowser; private renderHtmlToPng; private setupHandlers; run(): Promise; } export {}; //# sourceMappingURL=index.d.ts.map