import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec"; import { type EntryErrorReason } from "../entry-error.js"; type Step = { set?: string; confirm?: string; } & ({ expr: string; } | { literal: unknown; }); /** * What the model sends to the `expr` tool: steps to run and, with `read` on, an expression to read back. * * @example * const input: ExprToolInput = { steps: [{ set: "scopes.root.selected", literal: { "7": true } }] }; */ export type ExprToolInput = { steps?: Step[]; read?: string; }; /** * What the `expr` tool answers: the value of `read` (with `read` on), `declined` when the user declined a `confirm`, or the classified * error of the step or read that failed. * * @example * const output: ExprToolOutput = { error: { reason: "unknown-reference", message: "…" } }; */ export type ExprToolOutput = { value?: unknown; } | { declined: true; } | { error: { reason: EntryErrorReason; message: string; }; }; type Schema = { readonly "~standard": Omit, "validate"> & StandardJSONSchemaV1.Props & { readonly validate: (value: unknown) => StandardSchemaV1.Result; }; }; export declare const exprToolSchemas: (read: boolean) => { input: Schema; output: Schema; } | { input: Schema; output: Schema; }; export {};