UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

24 lines (23 loc) • 1.33 kB
/** * toolName — the LLM tool-name law: the charset every major provider enforces, * the strict check (`assertValidToolName`) and the dev-mode warning * (`warnIfInvalidToolName`) that `defineTool` runs. A leaf so that every * layer that mints a tool name — `tools/tools.ts` · `defineTool`, the tool * registry, the coverage result's `tryInstead` — asks the same rule. */ /** * STRICT validation — throws a clear, actionable error if a tool name can't be * sent to an LLM. Exposed for consumers who want to fail hard (e.g. in a build * step or a test). The library itself only WARNS (see `warnIfInvalidToolName`), * because a name is provider-specific: a mock or a name-sanitizing custom provider * may accept dotted/namespaced names that OpenAI/Anthropic reject. */ export declare function assertValidToolName(name: unknown): asserts name is string; /** * DEV-MODE heads-up (never throws): warns once-per-call if a tool name will be * rejected by OpenAI/Anthropic. Production and non-dev runs pay nothing. This is * the library's default guard (Convention: dev diagnostics warn, they don't throw) * — keeping mock/custom-provider + namespaced-name setups working. Reach for * `assertValidToolName` when you want a hard failure. */ export declare function warnIfInvalidToolName(name: unknown): void;