refactor(dynamic-tools): rename to dynamic-tools-{list,search,cache,evict}
Mirror of the Plexum-side rename so cross-runtime tool names + ClawSkills workflow text stay consistent. Old → new: dynamic-list-tools → dynamic-tools-list dynamic-search-tools → dynamic-tools-search dynamic-cache-tools → dynamic-tools-cache dynamic-evict-tools → dynamic-tools-evict Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
"proxy-pcexec",
|
||||
"safe_restart",
|
||||
"dynamic-trim",
|
||||
"dynamic-list-tools",
|
||||
"dynamic-search-tools",
|
||||
"dynamic-cache-tools",
|
||||
"dynamic-evict-tools"
|
||||
"dynamic-tools-list",
|
||||
"dynamic-tools-search",
|
||||
"dynamic-tools-cache",
|
||||
"dynamic-tools-evict"
|
||||
]
|
||||
},
|
||||
"configSchema": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// `dynamic-list-tools` / `dynamic-search-tools` / `dynamic-cache-tools` /
|
||||
// `dynamic-evict-tools` — agent-driven per-session tool visibility gate.
|
||||
// `dynamic-tools-list` / `dynamic-tools-search` / `dynamic-tools-cache` /
|
||||
// `dynamic-tools-evict` — agent-driven per-session tool visibility gate.
|
||||
//
|
||||
// openclaw plugin SDK has no `before_outgoing_tools` hook (see PaddedCell
|
||||
// plans/OPENCLAW_TOOLS_FILTER_HOOK.md for the gap analysis), so this
|
||||
@@ -31,10 +31,10 @@ import * as path from 'node:path';
|
||||
|
||||
/** Names of tools always exposed (the 4 cache tools themselves). */
|
||||
export const ESSENTIAL_CACHE_TOOLS = new Set([
|
||||
'dynamic-list-tools',
|
||||
'dynamic-search-tools',
|
||||
'dynamic-cache-tools',
|
||||
'dynamic-evict-tools',
|
||||
'dynamic-tools-list',
|
||||
'dynamic-tools-search',
|
||||
'dynamic-tools-cache',
|
||||
'dynamic-tools-evict',
|
||||
]);
|
||||
|
||||
/** Catalog entry registered by an opt-in plugin. */
|
||||
@@ -234,9 +234,9 @@ function renderCatalogText(
|
||||
|
||||
export function createListToolsTool(): any {
|
||||
return {
|
||||
name: 'dynamic-list-tools',
|
||||
name: 'dynamic-tools-list',
|
||||
description:
|
||||
'List the per-session tool catalog (essentials / cached / available). Pair with dynamic-cache-tools to enable specific tools for this session. Cache takes effect next turn.',
|
||||
'List the per-session tool catalog (essentials / cached / available). Pair with dynamic-tools-cache to enable specific tools for this session. Cache takes effect next turn.',
|
||||
parameters: { type: 'object', properties: {}, required: [] },
|
||||
async execute(_callId: string, _params: any, ctx?: ToolCtx) {
|
||||
const c = ctx ?? {};
|
||||
@@ -250,7 +250,7 @@ export function createListToolsTool(): any {
|
||||
const text = renderCatalogText(
|
||||
entries,
|
||||
c,
|
||||
'Call dynamic-cache-tools({names: [...]}) to make available tools usable this session.',
|
||||
'Call dynamic-tools-cache({names: [...]}) to make available tools usable this session.',
|
||||
);
|
||||
return { content: [{ type: 'text', text }] };
|
||||
},
|
||||
@@ -259,7 +259,7 @@ export function createListToolsTool(): any {
|
||||
|
||||
export function createSearchToolsTool(): any {
|
||||
return {
|
||||
name: 'dynamic-search-tools',
|
||||
name: 'dynamic-tools-search',
|
||||
description:
|
||||
'Substring search (case-insensitive) over tool names + descriptions. Returns matches grouped by source.',
|
||||
parameters: {
|
||||
@@ -272,7 +272,7 @@ export function createSearchToolsTool(): any {
|
||||
const query = String(params?.query ?? '').trim();
|
||||
if (!query) {
|
||||
return {
|
||||
content: [{ type: 'text', text: 'dynamic-search-tools: query is required' }],
|
||||
content: [{ type: 'text', text: 'dynamic-tools-search: query is required' }],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
@@ -289,7 +289,7 @@ export function createSearchToolsTool(): any {
|
||||
|
||||
export function createCacheToolsTool(): any {
|
||||
return {
|
||||
name: 'dynamic-cache-tools',
|
||||
name: 'dynamic-tools-cache',
|
||||
description:
|
||||
'Add the given tool names to this session\'s tools-cache. Takes effect starting your next turn (this iteration\'s tool list is frozen).',
|
||||
parameters: {
|
||||
@@ -304,14 +304,14 @@ export function createCacheToolsTool(): any {
|
||||
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
||||
if (names.length === 0) {
|
||||
return {
|
||||
content: [{ type: 'text', text: 'dynamic-cache-tools: names is required (non-empty)' }],
|
||||
content: [{ type: 'text', text: 'dynamic-tools-cache: names is required (non-empty)' }],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
const fp = cacheFilePath(c.agentId, c.sessionId);
|
||||
if (!fp) {
|
||||
return {
|
||||
content: [{ type: 'text', text: 'dynamic-cache-tools: no session context' }],
|
||||
content: [{ type: 'text', text: 'dynamic-tools-cache: no session context' }],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
@@ -349,7 +349,7 @@ export function createCacheToolsTool(): any {
|
||||
|
||||
export function createEvictToolsTool(): any {
|
||||
return {
|
||||
name: 'dynamic-evict-tools',
|
||||
name: 'dynamic-tools-evict',
|
||||
description:
|
||||
'Remove the given tool names from this session\'s tools-cache. Essentials are silently un-evictable. Takes effect starting your next turn.',
|
||||
parameters: {
|
||||
@@ -364,14 +364,14 @@ export function createEvictToolsTool(): any {
|
||||
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
||||
if (names.length === 0) {
|
||||
return {
|
||||
content: [{ type: 'text', text: 'dynamic-evict-tools: names is required (non-empty)' }],
|
||||
content: [{ type: 'text', text: 'dynamic-tools-evict: names is required (non-empty)' }],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
const fp = cacheFilePath(c.agentId, c.sessionId);
|
||||
if (!fp) {
|
||||
return {
|
||||
content: [{ type: 'text', text: 'dynamic-evict-tools: no session context' }],
|
||||
content: [{ type: 'text', text: 'dynamic-tools-evict: no session context' }],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user