SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface Descriptor<A, R>

    A read capability, plus its default rendering.

    run returns typed data and render turns it into the agent-facing text form. They are separate so a consumer that wants the data (a macro's caller, a UI, a test) is never forced through the string.

    interface Descriptor<A = any, R = any> {
        description: string;
        name: string;
        params: readonly Param[];
        sdk?: string;
        render(result: R): string | Promise<string>;
        run(workbook: IWorkbook, args: A): Promise<R>;
    }

    Type Parameters

    • A = any
    • R = any
    Index
    description: string

    One or two lines, agent-facing, English.

    name: string

    Tool name and subcommand — the same word on every surface.

    params: readonly Param[]
    sdk?: string

    The SDK expression this tool wraps, e.g. sheet.getRange(scope).find(pattern, {...}).

    Rendered into every surface's description as one SDK: … line — the graduation path from tool call to macro. Generated from here so the mapping cannot drift from the tool it describes; it also makes tool↔SDK name divergence harmless where realigning an existing SDK method is cheaper than renaming it.

    • The default agent-facing rendering of a result.

      Parameters

      • result: R

      Returns string | Promise<string>

      May be async — report renderers settle calculation before reading. Adapters await the result; a sync renderer (grep) is unaffected.

    • Execute against a live workbook.

      Parameters

      • workbook: IWorkbook
      • args: A

      Returns Promise<R>

      Takes an IWorkbook, never a path. A stateful host may hold a workbook with unsaved edits and no file behind it; a path-shaped entry point would either exclude it or make it read stale data. Loading is the caller's job.