eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
47 lines (46 loc) • 1.69 kB
TypeScript
import type { ModelMessage } from "ai";
import { ContextKey } from "#context/key.js";
import type { ResolvedToolDefinition } from "#runtime/types.js";
import type { JsonObject } from "#shared/json.js";
/**
* Single item in the todo list.
*/
export interface TodoItem {
readonly content: string;
readonly priority: "high" | "medium" | "low";
readonly status: "pending" | "in_progress" | "completed" | "cancelled";
}
/**
* Durable state for the framework todo tool.
*/
export interface TodoState {
readonly items: readonly TodoItem[];
}
export declare const TodoStateKey: ContextKey<TodoState>;
/**
* Typed input accepted by {@link executeTodoTool}.
*
* When `todos` is provided, the list is replaced (full replacement write).
* When `todos` is omitted, the current list is returned without modification.
*/
export interface TodoToolInput {
readonly todos?: readonly TodoItem[];
}
/**
* Builds the message that re-injects the current todo list after the harness
* compacts message history, so the agent keeps its task list across
* compaction. Returns `undefined` when there is no list to preserve.
*/
export declare function getTodoCompactionMessage(): ModelMessage | undefined;
/**
* Executes the framework todo tool.
*
* - Read: omit `todos` → returns the current list.
* - Write: provide `todos` → replaces the entire list, returns the new list.
*
* Both paths return the same formatted output so the model always sees
* the full current state.
*/
export declare function executeTodoTool(input: TodoToolInput): unknown;
export declare const TODO_OUTPUT_SCHEMA: JsonObject;
export declare const TODO_TOOL_DEFINITION: ResolvedToolDefinition;