import type { ToolDef } from './types.js';
import { editFileTool } from './edit_file.js';
import { createFileTool } from './create_file.js';
import { deleteFileTool } from './delete_file.js';
import { applyPendingTool } from './apply_pending.js';
import { rewindTool } from './rewind.js';
import { newTaskTool } from './new_task.js';
import { listTasksTool } from './list_tasks.js';
import { checkTaskStatusTool } from './check_task_status.js';
import { lspDiagnosticsTool } from './lsp_diagnostics.js';
import { lspGotoDefinitionTool } from './lsp_goto_definition.js';
import { lspFindReferencesTool } from './lsp_find_references.js';

export type { ToolDef, ToolContext, ToolJsonSchema } from './types.js';

// All BooCoder write tools. The inference loop (Phase 2B) will combine these
// with BooChat's read-only tools to form the full tool set available to agents.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const WRITE_TOOLS: readonly ToolDef<any>[] = [
  applyPendingTool,
  createFileTool,
  deleteFileTool,
  editFileTool,
  rewindTool,
  // Boomerang subtask tools — orchestrator agents call these to spawn/monitor child tasks.
  // An "Orchestrator" agent profile would whitelist [new_task, list_tasks, check_task_status].
  newTaskTool,
  listTasksTool,
  checkTaskStatusTool,
];

// Read-only agent tools for code intelligence.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const READ_TOOLS: readonly ToolDef<any>[] = [
  lspDiagnosticsTool,
  lspGotoDefinitionTool,
  lspFindReferencesTool,
];

export {
  editFileTool, createFileTool, deleteFileTool, applyPendingTool, rewindTool,
  newTaskTool, listTasksTool, checkTaskStatusTool,
  lspDiagnosticsTool, lspGotoDefinitionTool, lspFindReferencesTool,
};
