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",
|
"proxy-pcexec",
|
||||||
"safe_restart",
|
"safe_restart",
|
||||||
"dynamic-trim",
|
"dynamic-trim",
|
||||||
"dynamic-list-tools",
|
"dynamic-tools-list",
|
||||||
"dynamic-search-tools",
|
"dynamic-tools-search",
|
||||||
"dynamic-cache-tools",
|
"dynamic-tools-cache",
|
||||||
"dynamic-evict-tools"
|
"dynamic-tools-evict"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"configSchema": {
|
"configSchema": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// `dynamic-list-tools` / `dynamic-search-tools` / `dynamic-cache-tools` /
|
// `dynamic-tools-list` / `dynamic-tools-search` / `dynamic-tools-cache` /
|
||||||
// `dynamic-evict-tools` — agent-driven per-session tool visibility gate.
|
// `dynamic-tools-evict` — agent-driven per-session tool visibility gate.
|
||||||
//
|
//
|
||||||
// openclaw plugin SDK has no `before_outgoing_tools` hook (see PaddedCell
|
// openclaw plugin SDK has no `before_outgoing_tools` hook (see PaddedCell
|
||||||
// plans/OPENCLAW_TOOLS_FILTER_HOOK.md for the gap analysis), so this
|
// 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). */
|
/** Names of tools always exposed (the 4 cache tools themselves). */
|
||||||
export const ESSENTIAL_CACHE_TOOLS = new Set([
|
export const ESSENTIAL_CACHE_TOOLS = new Set([
|
||||||
'dynamic-list-tools',
|
'dynamic-tools-list',
|
||||||
'dynamic-search-tools',
|
'dynamic-tools-search',
|
||||||
'dynamic-cache-tools',
|
'dynamic-tools-cache',
|
||||||
'dynamic-evict-tools',
|
'dynamic-tools-evict',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Catalog entry registered by an opt-in plugin. */
|
/** Catalog entry registered by an opt-in plugin. */
|
||||||
@@ -234,9 +234,9 @@ function renderCatalogText(
|
|||||||
|
|
||||||
export function createListToolsTool(): any {
|
export function createListToolsTool(): any {
|
||||||
return {
|
return {
|
||||||
name: 'dynamic-list-tools',
|
name: 'dynamic-tools-list',
|
||||||
description:
|
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: [] },
|
parameters: { type: 'object', properties: {}, required: [] },
|
||||||
async execute(_callId: string, _params: any, ctx?: ToolCtx) {
|
async execute(_callId: string, _params: any, ctx?: ToolCtx) {
|
||||||
const c = ctx ?? {};
|
const c = ctx ?? {};
|
||||||
@@ -250,7 +250,7 @@ export function createListToolsTool(): any {
|
|||||||
const text = renderCatalogText(
|
const text = renderCatalogText(
|
||||||
entries,
|
entries,
|
||||||
c,
|
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 }] };
|
return { content: [{ type: 'text', text }] };
|
||||||
},
|
},
|
||||||
@@ -259,7 +259,7 @@ export function createListToolsTool(): any {
|
|||||||
|
|
||||||
export function createSearchToolsTool(): any {
|
export function createSearchToolsTool(): any {
|
||||||
return {
|
return {
|
||||||
name: 'dynamic-search-tools',
|
name: 'dynamic-tools-search',
|
||||||
description:
|
description:
|
||||||
'Substring search (case-insensitive) over tool names + descriptions. Returns matches grouped by source.',
|
'Substring search (case-insensitive) over tool names + descriptions. Returns matches grouped by source.',
|
||||||
parameters: {
|
parameters: {
|
||||||
@@ -272,7 +272,7 @@ export function createSearchToolsTool(): any {
|
|||||||
const query = String(params?.query ?? '').trim();
|
const query = String(params?.query ?? '').trim();
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return {
|
return {
|
||||||
content: [{ type: 'text', text: 'dynamic-search-tools: query is required' }],
|
content: [{ type: 'text', text: 'dynamic-tools-search: query is required' }],
|
||||||
isError: true,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ export function createSearchToolsTool(): any {
|
|||||||
|
|
||||||
export function createCacheToolsTool(): any {
|
export function createCacheToolsTool(): any {
|
||||||
return {
|
return {
|
||||||
name: 'dynamic-cache-tools',
|
name: 'dynamic-tools-cache',
|
||||||
description:
|
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).',
|
'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: {
|
parameters: {
|
||||||
@@ -304,14 +304,14 @@ export function createCacheToolsTool(): any {
|
|||||||
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
||||||
if (names.length === 0) {
|
if (names.length === 0) {
|
||||||
return {
|
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,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const fp = cacheFilePath(c.agentId, c.sessionId);
|
const fp = cacheFilePath(c.agentId, c.sessionId);
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
return {
|
return {
|
||||||
content: [{ type: 'text', text: 'dynamic-cache-tools: no session context' }],
|
content: [{ type: 'text', text: 'dynamic-tools-cache: no session context' }],
|
||||||
isError: true,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -349,7 +349,7 @@ export function createCacheToolsTool(): any {
|
|||||||
|
|
||||||
export function createEvictToolsTool(): any {
|
export function createEvictToolsTool(): any {
|
||||||
return {
|
return {
|
||||||
name: 'dynamic-evict-tools',
|
name: 'dynamic-tools-evict',
|
||||||
description:
|
description:
|
||||||
'Remove the given tool names from this session\'s tools-cache. Essentials are silently un-evictable. Takes effect starting your next turn.',
|
'Remove the given tool names from this session\'s tools-cache. Essentials are silently un-evictable. Takes effect starting your next turn.',
|
||||||
parameters: {
|
parameters: {
|
||||||
@@ -364,14 +364,14 @@ export function createEvictToolsTool(): any {
|
|||||||
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
const names = Array.isArray(params?.names) ? params.names.map(String) : [];
|
||||||
if (names.length === 0) {
|
if (names.length === 0) {
|
||||||
return {
|
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,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const fp = cacheFilePath(c.agentId, c.sessionId);
|
const fp = cacheFilePath(c.agentId, c.sessionId);
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
return {
|
return {
|
||||||
content: [{ type: 'text', text: 'dynamic-evict-tools: no session context' }],
|
content: [{ type: 'text', text: 'dynamic-tools-evict: no session context' }],
|
||||||
isError: true,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user