mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-06 05:16:27 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user