@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
29 lines • 1.72 kB
TypeScript
/** Every dev-tool result is capped at this many bytes of text. */
export declare const DEV_TOOLS_MAX_BYTES: number;
/** Rows a list tool returns at most. */
export declare const DEV_TOOLS_MAX_ROWS = 100;
/** A single blob field (a run's input, a message) is cut to this many bytes. */
export declare const DEV_TOOLS_FIELD_BYTES: number;
/**
* The final redaction pass over everything a dev tool returns (and over the arguments the audit line
* logs): a key that names a secret (`secret`, `token`, `password`, `authorization`, `cookie`,
* `api_key`) loses its value, whatever its type. Kept: `null`, booleans (`hasPassword: true`) and
* the numbers of token-count keys (`inputTokens`, `tokenCount`).
*
* Only a real cycle (an object inside itself) becomes `'[circular]'`: the same object reached twice
* from different places (a flag's `stored` and `definition`) is written out both times.
*/
export declare function redactDevToolOutput(value: unknown, ancestors?: WeakSet<object>): unknown;
/**
* Cut a string to `maxBytes`, ending it with `…(truncated, N bytes)`, N being the original size.
* Under the limit it is returned as is.
*/
export declare function truncateText(text: string, maxBytes?: number): string;
/**
* Serialize a tool result as the text the MCP client receives, capped at `maxBytes`, and always valid
* JSON. Over the cap, a list (`{ items }` or a bare array) loses rows from the end and gains
* `truncated: true` and `next`; any other object has its largest arrays and strings cut (strings end
* with `…(truncated, N bytes)`) and gains `truncated: true`.
*/
export declare function capDevToolResult(value: unknown, maxBytes?: number): string;
//# sourceMappingURL=limits.d.ts.map