mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-06 13:26:28 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user