All files / src/entities/files index.ts

100% Statements 10/10
100% Branches 0/0
100% Functions 1/1
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  1x     1x     1x     1x     1x       1x     1x     1x 2x               1x  
// Always export shared schemas
export * from "../shared";
 
// Always export read-only schemas (for backward compatibility)
export * from "./schema-readonly";
 
// Export write schemas (for backward compatibility)
export * from "./schema";
 
// Export the new unified registry
export * from "./registry";
 
// Import from the new registry
import { getFilteredFilesTools, getFilesReadOnlyToolNames } from "./registry";
import type { ToolDefinition } from "../../types";
 
// Conditional exports based on GITLAB_READONLY environment variable
const isReadOnly = process.env.GITLAB_READONLY === "true";
 
// Get tools from the new registry (with backward compatibility)
const filesToolsFromRegistry = getFilteredFilesTools(isReadOnly);
 
// Convert enhanced tool definitions to regular tool definitions for backward compatibility
export const filesTools: ToolDefinition[] = filesToolsFromRegistry.map(
  (tool): ToolDefinition => ({
    name: tool.name,
    description: tool.description,
    inputSchema: tool.inputSchema,
  })
);
 
// Export read-only tool names for backward compatibility
export const filesReadOnlyTools = getFilesReadOnlyToolNames();