@sema-agent/core
Version:
Stateless, task-oriented AI agent core
14 lines (13 loc) • 790 B
JavaScript
import { NAMESPACED_NAME_SHAPES, carriesNamespaceSeparator } from "./protocol-table.js";
import { isNameableToolName } from "./permission-rule-syntax.js";
export function callerToolNameProblem(name) {
if (!isNameableToolName(name)) {
return (`a caller tool name or alias must be a name a rule can name — ASCII letters, digits and "_" "-" "." ":" "*", ` +
`starting with a letter, a digit or "_", not ending with "." or ":", and not the lone wildcard "*" — ` +
`or no allow or deny list could name the tool; rename it`);
}
if (carriesNamespaceSeparator(name)) {
return `"__" is reserved for the engine's protocol tool namespaces (${NAMESPACED_NAME_SHAPES}) and no caller tool name or alias may carry it`;
}
return undefined;
}