mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-22 01:10:48 +02:00
feat: add configurable tool call blocking and monitoring
This commit is contained in:
@@ -116,6 +116,9 @@ type ToolCall struct {
|
||||
type ToolResult struct {
|
||||
Content []Content `json:"content"`
|
||||
IsError bool `json:"isError,omitempty"`
|
||||
// Blocked means policy stopped the call before execution. IsError remains
|
||||
// true for MCP/model handling, while monitoring uses a distinct status.
|
||||
Blocked bool `json:"blocked,omitempty"`
|
||||
}
|
||||
|
||||
// Content 表示内容
|
||||
@@ -184,8 +187,10 @@ type CallToolRequest struct {
|
||||
|
||||
// CallToolResponse 调用工具响应
|
||||
type CallToolResponse struct {
|
||||
Content []Content `json:"content"`
|
||||
IsError bool `json:"isError,omitempty"`
|
||||
Content []Content `json:"content"`
|
||||
IsError bool `json:"isError,omitempty"`
|
||||
Blocked bool `json:"blocked,omitempty"`
|
||||
Meta map[string]interface{} `json:"_meta,omitempty"`
|
||||
}
|
||||
|
||||
// ToolExecution 工具执行记录
|
||||
@@ -193,7 +198,7 @@ type ToolExecution struct {
|
||||
ID string `json:"id"`
|
||||
ToolName string `json:"toolName"`
|
||||
Arguments map[string]interface{} `json:"arguments"`
|
||||
Status string `json:"status"` // pending, running, completed, failed, cancelled
|
||||
Status string `json:"status"` // queued, running, completed, blocked, failed, cancelled, hard_timeout, orphaned
|
||||
Result *ToolResult `json:"result,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
StartTime time.Time `json:"startTime"`
|
||||
@@ -216,6 +221,7 @@ type ToolStats struct {
|
||||
TotalCalls int `json:"totalCalls"`
|
||||
SuccessCalls int `json:"successCalls"`
|
||||
FailedCalls int `json:"failedCalls"`
|
||||
BlockedCalls int `json:"blockedCalls"`
|
||||
LastCallTime *time.Time `json:"lastCallTime,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user