UNPKG

run402-mcp

Version:

MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.

35 lines • 1.83 kB
/** * How a `run` value is paged: by items, never by text lines. * * A value that fits the inline budget is returned whole. A larger one is paged * by the unit a reader thinks in: * * - an array: its elements (`path: "$"`); * - an object holding arrays: the elements of its largest top-level array, * e.g. the `rows` of a SQL result (`path: "$.rows"`), with the object's * other fields kept whole beside the window (`rest`); * - any other object: its entries as `{ key, value }` (`path: "$entries"`); * - a long string: its lines (`path: "$lines"`). * * The window is whole items only: as many leading items as fit the budget, * and always at least one, so a page never ends in the middle of a row. */ /** A value whose pretty-printed JSON fits in this many lines is returned whole. */ export declare const VALUE_INLINE_LINES = 200; export interface PagedValue { /** Where the paged items live in the value: `$`, `$.<key>`, `$entries`, or `$lines`. */ path: string; /** Every item, in order: what the result store holds and `expand_result` pages. */ items: unknown[]; /** The leading items that fit the inline budget (at least one). */ window: unknown[]; /** For `$.<key>`: the object's other top-level fields, whole. */ rest?: Record<string, unknown>; } /** True when the whole value fits the inline budget. */ export declare function fitsInline(value: unknown, budget?: number): boolean; /** The items a value pages by, and where they live. */ export declare function pageableItems(value: unknown): Pick<PagedValue, "path" | "items" | "rest">; /** Page a value that does not fit inline: every item, and the leading window of whole items. */ export declare function pageValue(value: unknown, budget?: number): PagedValue; //# sourceMappingURL=value-paging.d.ts.map