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
+4 -3
View File
@@ -27,12 +27,13 @@ var allowedPoolHookTx = map[string]int{
"resolvespec/handler.go": 1,
"websocketspec/handler.go": 1,
"resolvemcp/handler.go": 4,
"resolvemcp/annotation.go": 1, // BeforeHandle context of the annotate tool
"resolvemcp/writewhere.go": 1, // BeforeHandle context of filter writes
"resolvemcp/functions.go": 1, // BeforeHandle context of call_function
}
// allowedPoolQuery: statements outside the request path.
var allowedPoolQuery = map[string]int{
"resolvemcp/annotation.go": 2, // tool annotations, not a data request
}
var allowedPoolQuery = map[string]int{}
func guardedFiles(t *testing.T) map[string][]string {
t.Helper()