import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { Type } from "typebox"; import type { HabitCheckResult, HabitDetail } from "../domain/habit"; import type { NoteSummary } from "../domain/note"; import type { ProjectSummary } from "../domain/task"; import type { AddHabitNoteInput, CreateHabitInput, DeleteHabitResult, HabitService, UpdateHabitInput } from "../services/habit-service"; import type { ProjectService } from "../services/project-service"; interface HabitCreateToolParams { title: string; projectId: string; schedule: string; timezone: string; startDate: string; description?: string; endDate?: string; } interface HabitUpdateToolParams { habitId: string; title?: string; schedule?: string; timezone?: string; description?: string; endDate?: string; } interface HabitCheckToolParams { habitId: string; } interface HabitDeleteToolParams { habitId: string; } interface HabitNoteAddToolParams { habitId: string; content: string; } interface HabitCreateToolDetails { kind: "habit_create"; input: CreateHabitInput; habit: HabitDetail; } interface HabitUpdateToolDetails { kind: "habit_update"; input: UpdateHabitInput; habit: HabitDetail; } interface HabitCheckToolDetails { kind: "habit_check"; habitId: string; found: boolean; result?: HabitCheckResult; } interface HabitDeleteToolDetails { kind: "habit_delete"; habitId: string; found: boolean; deleted: boolean; result?: DeleteHabitResult; } interface HabitNoteAddToolDetails { kind: "habit_note_add"; habitId: string; note: NoteSummary; } interface HabitMutationToolDependencies { getHabitService: () => Promise; getProjectService: () => Promise; } declare const createHabitCreateToolDefinition: ({ getHabitService, getProjectService, }: HabitMutationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ title: Type.TString; projectId: Type.TString; schedule: Type.TString; timezone: Type.TString; startDate: Type.TString; description: Type.TOptional; endDate: Type.TOptional; }>; execute(_toolCallId: string, params: HabitCreateToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: HabitCreateToolDetails; }>; }; declare const createHabitUpdateToolDefinition: ({ getHabitService }: HabitMutationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ habitId: Type.TString; title: Type.TOptional; schedule: Type.TOptional; timezone: Type.TOptional; description: Type.TOptional; endDate: Type.TOptional; }>; execute(_toolCallId: string, params: HabitUpdateToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: HabitUpdateToolDetails; }>; }; declare const createHabitCheckToolDefinition: ({ getHabitService }: HabitMutationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ habitId: Type.TString; }>; execute(_toolCallId: string, params: HabitCheckToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: HabitCheckToolDetails; }>; }; declare const createHabitDeleteToolDefinition: ({ getHabitService }: HabitMutationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ habitId: Type.TString; }>; execute(_toolCallId: string, params: HabitDeleteToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: HabitDeleteToolDetails; }>; }; declare const createHabitNoteAddToolDefinition: ({ getHabitService }: HabitMutationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ habitId: Type.TString; content: Type.TString; }>; execute(_toolCallId: string, params: HabitNoteAddToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: HabitNoteAddToolDetails; }>; }; declare const registerHabitMutationTools: (pi: Pick, dependencies: HabitMutationToolDependencies) => void; declare const normalizeCreateHabitInput: (params: HabitCreateToolParams) => CreateHabitInput; declare const resolveCreateHabitInput: (projectService: ProjectService, params: HabitCreateToolParams) => Promise; declare const normalizeUpdateHabitInput: (params: HabitUpdateToolParams) => UpdateHabitInput; declare const resolveProjectForHabitMutation: (projectService: ProjectService, projectRef: string) => Promise; declare const normalizeHabitNoteAddInput: (params: HabitNoteAddToolParams) => AddHabitNoteInput; export type { HabitCheckToolDetails, HabitCreateToolDetails, HabitDeleteToolDetails, HabitMutationToolDependencies, HabitNoteAddToolDetails, HabitUpdateToolDetails, }; export { createHabitCheckToolDefinition, createHabitCreateToolDefinition, createHabitDeleteToolDefinition, createHabitNoteAddToolDefinition, createHabitUpdateToolDefinition, normalizeCreateHabitInput, normalizeHabitNoteAddInput, normalizeUpdateHabitInput, registerHabitMutationTools, resolveCreateHabitInput, resolveProjectForHabitMutation, };