import { TodoistApi } from '@doist/todoist-sdk'; import { z } from 'zod'; import { Project } from '../tool-helpers.js'; declare const ChildTaskSchema: z.ZodObject<{ content: z.ZodString; id: z.ZodString; checked: z.ZodBoolean; dueDate: z.ZodOptional; hasChildren: z.ZodBoolean; }, z.core.$strip>; declare const ChildProjectSchema: z.ZodObject<{ name: z.ZodString; id: z.ZodString; hasChildren: z.ZodBoolean; }, z.core.$strip>; /** * Output schema fragment for tools that can return an object's direct children. * Spread it into the tool's own output schema. */ declare const ChildrenOutputSchema: { childCount: z.ZodOptional; children: z.ZodOptional; hasChildren: z.ZodBoolean; }, z.core.$strip>, z.ZodObject<{ name: z.ZodString; id: z.ZodString; hasChildren: z.ZodBoolean; }, z.core.$strip>]>>>; hasMoreChildren: z.ZodOptional; childrenError: z.ZodOptional; }; type ChildSummary = z.infer | z.infer; type ChildrenResult = { childCount?: number; children?: ChildSummary[]; hasMoreChildren?: boolean; childrenError?: string; }; /** * Fetches the direct subtasks of a task, flagging which of them nest further. * * The API exposes no child count on a task, so each child needs its own probe. * That keeps the cost proportional to the number of subtasks rather than to the * size of the project, which matters because the common case is a task with none. */ declare function getTaskChildren(client: TodoistApi, taskId: string): Promise; /** * Fetches the direct sub-projects of a project, flagging which of them nest further. * * Projects cannot be filtered by parent server-side, so the hierarchy is derived * from a single fetch of every active project. */ declare function getProjectChildren(client: TodoistApi, project: Project): Promise; /** * Runs a children lookup without letting its failure sink the fetch it belongs to. * The error is reported rather than swallowed: a missing childCount would otherwise * read as "no children", which is the exact mistake these fields exist to prevent. */ declare function resolveChildren(load: () => Promise): Promise; /** Renders a children result as a suffix for a tool's one-line text summary. */ declare function formatChildrenSummary(label: string, result: ChildrenResult): string; export { ChildrenOutputSchema, formatChildrenSummary, getProjectChildren, getTaskChildren, resolveChildren, }; export type { ChildrenResult }; //# sourceMappingURL=children.d.ts.map