/** * Notion skill — read context + write pages/blocks/images. * * Historically read-only (pull a page/database as markdown context for a * downstream agent, e.g. a code-review agent reading an * engineering-standards page). It now ALSO delivers content: create pages, * append blocks, and insert images — the Notion twin of googleDocs.js / * larkDocs.js for the report-delivery channels. * * Modelled on jira.js: * - resolveIntegrationToken('notion') is the SINGLE auth chokepoint * (via the notionApi() helper below). Don't re-resolve at call sites. * - handleToolCall() dispatches the tools and NEVER throws — any HTTP * or parse failure is returned as { ok:false, error } so an optional * context source can't crash the review. * * Token shape (GET /integrations/token/notion → resolveIntegrationToken): * { provider:'notion', token, workspaceId, workspaceName, botId, expiresInSec } * We only need `token` here — it's a long-lived Notion bearer (no refresh). * * Served over MCP via the generic bin/mcp-skill.mjs (resolve() below) so * the agent gets real mcp__notion__* tools; deterministic node code can * also call handleToolCall directly, same as jira/slack. */ /** * Extract a 32-char Notion id from a raw id OR a Notion URL. * * Notion ids are 32 hex chars, usually rendered dashed * (8-4-4-4-12) as a UUID. In URLs they appear undashed, often as the * trailing segment after a human slug, e.g. * https://www.notion.so/My-Page-Title-1a2b3c...d4e5 (32 hex at end) * https://www.notion.so/workspace/1a2b...d4e5?pvs=4 * and may also be passed as a bare dashed UUID or undashed 32-char id. * * Returns the dashed UUID form (which the Notion REST API accepts), or * null if no id can be found. */ export declare function parseNotionId(ref: any): string; /** * Low-level Notion REST helper. Resolves the bearer via * resolveIntegrationToken('notion'), sets the required Notion-Version * header, retries once on transient auth errors, and returns parsed JSON. * * Keep this the single auth chokepoint — don't resolve tokens at call sites. * `opts.formData`: a FormData body (the file-upload send endpoint is * multipart/form-data, not JSON) — fetch sets the multipart boundary itself, * so no Content-Type is set for it. */ export declare function notionApi(path: any, opts?: any): Promise; /** * Map a small, common subset of markdown into Notion block objects. * Each block is a single line: headings (#/##/### → heading_1/2/3), bullets * (- / *), ordered (1.) — everything else a paragraph. Inline marks are kept * as literal text (content preserved; no annotation parsing — honest + * robust). Empty lines are skipped. Mirrors larkDocs.js markdownToLarkBlocks. */ export declare function markdownToNotionBlocks(markdown: any): any[]; export declare const notionSkill: any;