feat(resolvemcp): replace per-model tools with fixed meta tools, guarded filter writes and a function registry

Tools: list_tables, describe_table, select_table, insert_into_table, update_table,
delete_from_table, list_functions, call_function. Visibility follows the model rules.
Filter-based update/delete require filters (never dropped silently), cap the matched rows
(MaxWriteRows), support dry_run, and need a single-use confirm token bound to caller, table,
filters, data and the matched rows. RegisterFunction adds Go-callback and SQL-procedure
functions run in a transaction with BeforeCall/AfterCall hooks. Per-model tools and
resources are removed.

fix(pgsql): UPDATE with SET and a multi-placeholder WHERE renumbered the WHERE parameters
wrongly ($1, $2 became $3, $2); shift them in one pass.
This commit is contained in:
Hein
2026-10-01 13:40:00 +02:00
parent 276c3814d8
commit e49c3a916e
11 changed files with 1562 additions and 370 deletions
+6
View File
@@ -34,6 +34,12 @@ const (
BeforeDelete HookType = "before_delete"
AfterDelete HookType = "after_delete"
// BeforeCall and AfterCall fire inside the transaction of a call_function call.
// hookCtx.Entity is the function name, Data the validated arguments (BeforeCall may
// replace them) and Result the function's result (AfterCall).
BeforeCall HookType = "before_call"
AfterCall HookType = "after_call"
// OnTxBegin fires once, first, inside every transaction the handler opens
// (including the second short transaction for post-commit work). hookCtx.Tx is
// the transaction; use it to stamp transaction-local state such as RLS