From 6bdc4f2adaf967fd03894019798c279715518e97 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 16:26:41 +0000 Subject: [PATCH] Add Hidden to ToolDesc for reserved tool capabilities Why: the fs tool family (proposal 2026-09-30-file-preview-and-reserved- capabilities) is implemented but must stay invisible to models and tool listings until a runtime gate opens it. Evidence: new bool field with json omitempty; no golden samples carry it; go test ./... green. Impact: registries can mark gated tools; servers and runners filter on it (backend PR in the same task). Refs: task feature/file-preview-caps. --- tools.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools.go b/tools.go index e4da100..2ed1d17 100644 --- a/tools.go +++ b/tools.go @@ -20,6 +20,9 @@ type ToolDesc struct { Source SourceKind `json:"source"` PluginID string `json:"pluginId,omitempty"` HTTP *HTTPToolSpec `json:"http,omitempty"` // 声明式 HTTP 工具(无代码) + // Hidden 预留能力形态:默认不对模型与 /api/tools 列表可见,须运行时开关 + // (如 runtime.fsTools)或管理动作开启后可用(提案 2026-09-30-file-preview-and-reserved-capabilities)。 + Hidden bool `json:"hidden,omitempty"` } // HTTPToolSpec:无代码自定义工具(4.8)。模板变量 {{param.x}} 从调用参数注入。