import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { Type } from "typebox"; import type { ProjectSummary, TaskPriority } from "../domain/task"; import type { IntegrationBinding, ProjectIntegrationService, RegisterRepositoryProjectInput } from "../services/project-integration-service"; import type { ProjectService } from "../services/project-service"; import type { ResolvedRepositoryContext } from "../services/repo-context"; interface ProjectCheckToolParams { repositoryPath?: string; provider?: string; targetRef?: string; } interface ProjectRegisterToolParams extends ProjectCheckToolParams { projectName?: string; description?: string; priority?: TaskPriority; } interface ProjectCheckToolDetails { kind: "project_check"; state: "registered" | "not-registered" | "ambiguous" | "missing-context" | "unsupported"; repositoryPath?: string; repository?: ResolvedRepositoryContext; reason?: string; project?: ProjectSummary | null; binding?: IntegrationBinding; bindings?: IntegrationBinding[]; remotes?: string[]; } interface ProjectRegisterToolDetails { kind: "project_register"; state: "registered" | "already-registered" | "name-conflict" | "ambiguous" | "missing-context" | "unsupported"; repositoryPath?: string; repository?: ResolvedRepositoryContext; project?: ProjectSummary | null; binding?: IntegrationBinding; createdProject?: boolean; createdBinding?: boolean; conflictingProjects?: ProjectSummary[]; reason?: string; remotes?: string[]; bindings?: IntegrationBinding[]; } interface ProjectIntegrationToolDependencies { getProjectIntegrationService: () => Promise; getProjectService: () => Promise; } declare const createProjectCheckToolDefinition: ({ getProjectIntegrationService, }: Pick) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ repositoryPath: Type.TOptional; provider: Type.TOptional; targetRef: Type.TOptional; }>; execute(_toolCallId: string, params: ProjectCheckToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: ProjectCheckToolDetails; }>; }; declare const createProjectRegisterToolDefinition: ({ getProjectIntegrationService, getProjectService, }: ProjectIntegrationToolDependencies) => { name: string; label: string; description: string; promptSnippet: string; promptGuidelines: string[]; parameters: Type.TObject<{ projectName: Type.TOptional; repositoryPath: Type.TOptional; provider: Type.TOptional; targetRef: Type.TOptional; description: Type.TOptional; priority: Type.TOptional>; }>; execute(_toolCallId: string, params: ProjectRegisterToolParams): Promise<{ content: { type: "text"; text: string; }[]; details: ProjectRegisterToolDetails; }>; }; declare const registerProjectIntegrationTools: (pi: Pick, dependencies: ProjectIntegrationToolDependencies) => void; declare const normalizeProjectCheckInput: (params: ProjectCheckToolParams) => ProjectCheckToolParams; declare const normalizeProjectRegisterInput: (params: ProjectRegisterToolParams) => RegisterRepositoryProjectInput; declare const formatProjectCheckContent: (details: ProjectCheckToolDetails) => string; declare const formatProjectRegisterContent: (details: ProjectRegisterToolDetails) => string; export type { ProjectCheckToolDetails, ProjectIntegrationToolDependencies, ProjectRegisterToolDetails, }; export { createProjectCheckToolDefinition, createProjectRegisterToolDefinition, formatProjectCheckContent, formatProjectRegisterContent, normalizeProjectCheckInput, normalizeProjectRegisterInput, registerProjectIntegrationTools, };