import * as pendingChanges from '../../../../db/repos/pending_changes.js'; // The queue of agent-proposed mutations awaiting owner approval. This is exactly // where a prompt-injected or misbehaving agent's intent surfaces, so it's a // primary security-review surface. export const pendingReviewTool = { name: 'pending_review', description: 'List pending (unapproved) agent-proposed changes awaiting owner approval — the queue where a misbehaving or injected agent\'s intent shows up. Review these for anything unexpected.', input_schema: { type: 'object', properties: { limit: { type: 'integer', description: 'max rows (default 50, max 200)' } } }, async handler({ limit } = {}, _ctx) { const capped = Math.min(Math.max(Number(limit) || 50, 1), 200); const pending = await pendingChanges.listPending({ limit: capped }); return { pending }; } };