@agentled/cli
Version:
CLI for Agentled — manage workflows, apps, and knowledge from the command line. Zero context-window cost for AI agents.
96 lines • 4.62 kB
JavaScript
/**
* Builtin tools catalog for `aiActionWithTools` steps.
*
* Canonical source: the `Tool.builtinType` union in
* `shared/types/pipeline/PipelineTypes.ts`. This file is the
* CLI-distributable mirror — drift is guarded by
* `agentled-mcp-server/__tests__/builtin-tools-catalog.test.ts`.
*
* When a new builtin is added to the runtime:
* 1. Extend the `Tool.builtinType` union in PipelineTypes.ts
* 2. Append the same value to this catalog with a description + config
* 3. The drift test enforces (1) ⊆ (2) and vice versa
*/
export const BUILTIN_TOOLS_CATALOG = [
{
value: 'web_search',
description: 'Search the web for fresh information. Returns ranked snippets with URLs.',
providers: ['all'],
typicalCreditsPerCall: 2,
example: { type: 'builtin', name: 'web_search', builtinType: 'web_search' },
},
{
value: 'fetch_website_content',
description: 'Fetch and extract readable content from a specific URL (companion to web_search).',
providers: ['all'],
typicalCreditsPerCall: 1,
example: { type: 'builtin', name: 'fetch_website_content', builtinType: 'fetch_website_content' },
},
{
value: 'file_search',
description: 'Search across files attached to the workspace / conversation.',
providers: ['openai'],
example: { type: 'builtin', name: 'file_search', builtinType: 'file_search' },
},
{
value: 'code_interpreter',
description: 'Run Python code in a sandbox. Useful for ad-hoc data crunching inside an AI step.',
providers: ['openai', 'anthropic'],
typicalCreditsPerCall: 3,
example: { type: 'builtin', name: 'code_interpreter', builtinType: 'code_interpreter' },
},
{
value: 'workspace_memory',
description: 'Recall/search/store persistent memories scoped to workspace or workflow. Memories ≥70 confidence auto-sync to the KG.',
providers: ['all'],
extraKeys: ['memoryConfig'],
example: { type: 'builtin', name: 'workspace_memory', builtinType: 'workspace_memory' },
},
{
value: 'kg_search',
description: 'Vector search over Knowledge Graph text entries. Returns ranked rows with snippets.',
providers: ['all'],
example: { type: 'builtin', name: 'kg_search', builtinType: 'kg_search' },
},
{
value: 'kg_traverse',
description: 'Traverse KG edges from a node. Returns related entities and relationship types.',
providers: ['all'],
example: { type: 'builtin', name: 'kg_traverse', builtinType: 'kg_traverse' },
},
{
value: 'kg_nodes',
description: 'Fetch specific KG nodes by ID or by list key (structured row lookup).',
providers: ['all'],
example: { type: 'builtin', name: 'kg_nodes', builtinType: 'kg_nodes' },
},
{
value: 'kg_write',
description: 'Write rows, edges, or insights to the Knowledge Graph (bounded, not for large bulk — use `knowledgeSync` step for that).',
providers: ['all'],
example: { type: 'builtin', name: 'kg_write', builtinType: 'kg_write' },
},
];
export const VALID_BUILTIN_TOOL_VALUES = new Set(BUILTIN_TOOLS_CATALOG.map(t => t.value));
/**
* Heuristic "did you mean" for the most common invented / typo'd builtinType values.
*/
export function suggestBuiltinToolFix(invalid) {
const v = invalid.toLowerCase();
const map = {
'web-search': 'Use `web_search` (underscore).',
'websearch': 'Use `web_search` (with underscore).',
'search': 'Use `web_search` for the web or `kg_search` for the Knowledge Graph — `search` alone is not a builtin.',
'google_search': 'Use `web_search` — we abstract the provider so it works across Anthropic/OpenAI/Moonshot.',
'memory': 'Use `workspace_memory` — the canonical name.',
'workspace-memory': 'Use `workspace_memory` (underscore).',
'knowledge_graph': 'Pick one of `kg_search` / `kg_traverse` / `kg_nodes` / `kg_write` — `knowledge_graph` is not itself a builtin.',
'kg': 'Pick one of `kg_search` / `kg_traverse` / `kg_nodes` / `kg_write`.',
'code': 'Use `code_interpreter` (the canonical builtin) or switch to a `code` step for JS/Python without an LLM.',
'scrape': 'Use `fetch_website_content` — `scrape` is a `web-scraping` app action, not a builtin.',
'fetch': 'Use `fetch_website_content`.',
'fetch_url': 'Use `fetch_website_content`.',
};
return map[v];
}
//# sourceMappingURL=builtin-tools-catalog.js.map