eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
36 lines (35 loc) • 1.57 kB
TypeScript
import type { ModuleSourceRef } from "#shared/source-ref.js";
import type { CompiledToolDefinition, CompiledDynamicToolDefinition } from "#compiler/manifest.js";
import { type ModuleBackedDefinitionLoadOptions } from "#compiler/normalize-helpers.js";
/**
* Compiled tool entry produced from one authored `tools/*.ts` file.
*
* Either a real tool definition, a `disabled` marker that removes the
* named framework default during graph resolution, or a dynamic tool
* resolver that produces tools at runtime.
*/
export type CompiledToolEntry = {
readonly kind: "tool";
readonly definition: CompiledToolDefinition;
} | {
readonly kind: "disabled";
readonly name: string;
} | {
readonly kind: "enable-workflow";
} | {
readonly kind: "dynamic-tool";
readonly definition: CompiledDynamicToolDefinition;
};
/**
* Compiles one authored tool module into the normalized tool entry
* stored on the compiled agent manifest.
*
* The tool name is derived from the file path under `tools/` with the
* extension stripped and any path separators flattened to dashes
* (e.g. `tools/billing/refund.ts` → `"billing-refund"`). Path separators
* cannot reach the model — most providers reject `/` in tool names — so
* tools are the one path-derived primitive that flattens nested
* directories into a slug-safe single segment. Authored `name` fields
* are rejected by the normalizer.
*/
export declare function compileToolEntry(agentRoot: string, source: ModuleSourceRef, options?: ModuleBackedDefinitionLoadOptions): Promise<CompiledToolEntry>;