/**
 * INJECTED-TOKEN fast path (Zibby Copilot per-turn credential injection) +
 * NON-OWNER SAFETY GATE — the Google twin of linkedin.js injectedPersonalToken.
 *
 * The Zibby Copilot is ONE shared chat bot backed by ONE project's
 * PROJECT_API_TOKEN. resolveIntegrationToken('google') authenticates with that
 * PAT, so the account is inferred SERVER-SIDE from the PAT — meaning the shared
 * bot would only ever see the PROJECT OWNER's Google (their readable Docs, their
 * Drive), never the (different) person who actually sent the chat message.
 *
 * Two per-turn env signals, set + restored by the copilot-runtime (a TRUSTED
 * backend service that already KMS-decrypts tenants' creds directly):
 *   - ZIBBY_INJECTED_GOOGLE_TOKEN (+ _EMAIL): the EMAIL-VERIFIED sender's OWN
 *     `google` integration access token (auto-refreshed server-side). When
 *     present it takes PRECEDENCE over resolveIntegrationToken, so every gdocs
 *     call runs against the SENDER's own Google.
 *   - ZIBBY_SENDER_IS_NON_OWNER=1: the verified sender's account differs from
 *     the PAT/tenant account. With NO injected token this is a HARD REFUSAL
 *     gate: the skill must NEVER fall through to the owner's token on a
 *     colleague's behalf (privacy: the owner's readable docs would be exposed
 *     and created docs would land in the owner's Drive). Every tool returns
 *     { ok:false, error } telling the sender to connect their own Google.
 *
 * Absent both (owner/self turns, Fargate workflows, self-host — no
 * sender-identity context) → the normal PAT chokepoint runs unchanged.
 */
export function injectedGoogleToken(): {
    token: string;
    email: string;
};
/** True when the runtime flagged this turn's verified sender as NOT the tenant owner. */
export function senderIsNonOwner(): boolean;
/**
 * STRICT CHAT-TURN INVARIANT (fail-CLOSED) — ZIBBY_CHAT_STRICT_PERSONAL=1.
 *
 * Set UNCONDITIONALLY by the Copilot runtime for EVERY chat turn (Slack +
 * Lark, owner or not). Under it, personal-tier providers (google here) must
 * NEVER fall through to the PAT-resolved project-owner token: the ONLY
 * accepted credential is the per-turn injected sender token
 * (ZIBBY_INJECTED_GOOGLE_TOKEN — the runtime injects the OWNER's own Google
 * through the same path, so the owner keeps working). No injected token →
 * HARD REFUSE, for ANY sender: verified non-owners, same-account colleagues,
 * UNVERIFIED senders (users.info failure / no email match — the exact class
 * the old ZIBBY_SENDER_IS_NON_OWNER flag failed OPEN on), and even the owner
 * when their own Google isn't connected. The non-owner flag stays as
 * belt-and-braces; this strict flag is the primary gate.
 *
 * Absent both flags (Fargate workflows, self-host, direct tool use — no chat
 * sender context) → the normal PAT chokepoint runs unchanged.
 */
export function chatStrictPersonal(): boolean;
/**
 * Extract a Google Docs document id from a raw id OR a Docs URL
 * (https://docs.google.com/document/d/<id>/edit...). Returns the id string
 * or null.
 */
export function parseDocId(ref: any): string;
export function googleApi(url: any, opts?: {}): Promise<any>;
/**
 * Parse ONE markdown line's inline marks (bold `**x**`, links `[t](u)`,
 * inline code `` `x` ``) into { text, styles } where `styles` are ranges
 * RELATIVE to the returned plain text.
 */
export function parseInlineMarkdown(line: any): {
    text: string;
    styles: ({
        start: number;
        end: number;
        link: string;
        bold?: undefined;
        code?: undefined;
    } | {
        start: number;
        end: number;
        bold: boolean;
        link?: undefined;
        code?: undefined;
    } | {
        start: number;
        end: number;
        code: boolean;
        link?: undefined;
        bold?: undefined;
    })[];
};
/**
 * Convert a small, common subset of markdown (headings #/##/###, bullet
 * lists -/*, numbered lists `1.`, bold, links, inline code) into Google Docs
 * batchUpdate requests that insert the content at `startIndex`.
 *
 * Strategy: ONE insertText request carrying the whole plain text (every line
 * newline-terminated → each becomes its own paragraph), followed by
 * updateParagraphStyle (headings), createParagraphBullets (consecutive list
 * runs) and updateTextStyle (bold/link/code) requests over the computed
 * ranges. Indices are UTF-16 code units — JS string .length matches the Docs
 * API's index space exactly.
 *
 * Returns { requests, endIndex }. Plain text (no markdown) passes through as
 * plain paragraphs — the converter is safe for the `text` input too.
 */
export function markdownToRequests(markdown: any, startIndex: any): {
    requests: {
        insertText: {
            location: {
                index: any;
            };
            text: string;
        };
    }[];
    endIndex: any;
};
/**
 * Flatten a documents.get body into plain text (paragraph text runs joined,
 * newline-separated — table cells + nested content included via recursion).
 * Bounded by MAX_TEXT_CHARS.
 */
export function extractPlainText(body: any): string;
export const NON_OWNER_REFUSAL: "You haven't connected your own Google account \u2014 connect it at https://studio.zibby.dev/integrations (Google Docs). For privacy, I can't use anyone else's Google (including the project owner's) on your behalf.";
export namespace googleDocsSkill {
    let id: string;
    let serverName: string;
    let allowedTools: string[];
    let requiresIntegration: "google";
    let description: string;
    let promptFragment: string;
    /**
     * Spawn the GENERIC skill MCP server (bin/mcp-skill.mjs) pointing at this
     * module's googleDocsSkill export, so the AGENT gets real mcp__gdocs__*
     * tools. Auth flows through the INHERITED env (PROJECT_API_TOKEN →
     * resolveIntegrationToken('google')), so no provider-specific env keys are
     * needed here. When unconnected, handleToolCall returns { ok:false, error }
     * — the agent tolerates it.
     */
    function resolve(): {
        type: string;
        command: string;
        args: any[];
        env: {};
        description: string;
        alwaysLoad: boolean;
    };
    function handleToolCall(name: any, args: any): Promise<string>;
    let tools: ({
        name: string;
        description: string;
        input_schema: {
            type: string;
            properties: {
                title: {
                    type: string;
                    description: string;
                };
                markdown: {
                    type: string;
                    description: string;
                };
                text: {
                    type: string;
                    description: string;
                };
                documentId?: undefined;
                imagePath?: undefined;
                width?: undefined;
                height?: undefined;
            };
            required: string[];
        };
    } | {
        name: string;
        description: string;
        input_schema: {
            type: string;
            properties: {
                documentId: {
                    type: string;
                    description: string;
                };
                markdown: {
                    type: string;
                    description: string;
                };
                text: {
                    type: string;
                    description: string;
                };
                title?: undefined;
                imagePath?: undefined;
                width?: undefined;
                height?: undefined;
            };
            required: string[];
        };
    } | {
        name: string;
        description: string;
        input_schema: {
            type: string;
            properties: {
                documentId: {
                    type: string;
                    description: string;
                };
                imagePath: {
                    type: string;
                    description: string;
                };
                width: {
                    type: string;
                    description: string;
                };
                height: {
                    type: string;
                    description: string;
                };
                title?: undefined;
                markdown?: undefined;
                text?: undefined;
            };
            required: string[];
        };
    } | {
        name: string;
        description: string;
        input_schema: {
            type: string;
            properties: {
                documentId: {
                    type: string;
                    description: string;
                };
                title?: undefined;
                markdown?: undefined;
                text?: undefined;
                imagePath?: undefined;
                width?: undefined;
                height?: undefined;
            };
            required: string[];
        };
    } | {
        name: string;
        description: string;
        input_schema: {
            type: string;
            properties: {
                title?: undefined;
                markdown?: undefined;
                text?: undefined;
                documentId?: undefined;
                imagePath?: undefined;
                width?: undefined;
                height?: undefined;
            };
            required?: undefined;
        };
    })[];
}
