import type { SuperagentToolCall } from '../types'; import type { KeyValueItem } from './primitives/KeyValueList'; /** * Pure logic backing the entity CRUD widgets. Mirrors the web builder's * entity tools-ui (frontend/apps/builder/.../tools-ui/Components/ * CreateEntities/ReadEntities/UpdateEntities/DeleteEntities.tsx, * utils/entitySummary.ts, ToolCallsContainer.tsx) with the English strings * from the builder's i18n catalog. */ /** Stale-turn note on non-actionable approval cards (web tools.previousApproval). */ export declare const PREVIOUS_APPROVAL_NOTE = "This approval request is from a previous message"; /** Web ToolCallsContainer's ENTITY_APPROVAL_TOOLS — tools that batch-approve. */ export declare const ENTITY_APPROVAL_TOOLS: ReadonlySet; /** Same predicate the web uses to route a call into the batch approval card. */ export declare function isPendingEntityApproval(toolCall: SuperagentToolCall): boolean; /** args.query / args.data as a plain object ({} when missing or malformed). */ export declare function getRecordArg(args: Record | null, key: string): Record; export declare function getEntityName(args: Record | null, fallback?: string): string; /** Web KeyValueList formatting: strings JSON-quoted, primitives bare. */ export declare function formatEntityFieldValue(value: unknown): string; export declare function toKeyValueItems(record: Record): KeyValueItem[]; /** * One-line description of an update/delete call — the LLM-provided `summary` * arg when present, otherwise the web entitySummary.ts fallbacks. */ export declare function getEntitySummary(toolName: string, args: Record | null): string; /** * entity name + record count for create_entity_records. * Prefers the backend-computed display_projection (survives socket truncation, * normalizes entityName/records vs entity_name/data), like the web widget. */ export declare function getCreateEntitiesInfo(toolCall: SuperagentToolCall): { entityName: string; recordCount: number | null; }; /** read_entities result count — only when the results parse to a JSON array. */ export declare function countArrayResults(results: SuperagentToolCall['results']): number | null; /** Filter/Limit/Skip/Sort rows for read_entities (limit/skip hidden when falsy, as on web). */ export declare function getReadEntitiesFilterItems(args: Record | null): KeyValueItem[]; export type BatchApprovalDecision = { toolCallId: string; approve: boolean; }; /** * Per-call decisions for "Approve (n)": approve the checked calls, reject the * unchecked ones — the exact behavior of the web useBatchApproval submit. * Approvals go first so the turn resumes only after every call is resolved * (each submit resumes the message once no pending tool calls remain). */ export declare function buildBatchApprovalDecisions(pendingIds: string[], selectedIds: ReadonlySet): BatchApprovalDecision[]; //# sourceMappingURL=entityWidgetUtils.d.ts.map