All files / src/entities/context index.ts

100% Statements 13/13
100% Branches 0/0
100% Functions 2/2
100% Lines 13/13

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 35 36 37 38 39 40 41 42 43 44 45 46 47  2x     2x     2x     2x     2x     2x     2x               2x     2x     2x 2x               2x     5x  
// Always export shared schemas
export * from "../shared";
 
// Export types
export * from "./types";
 
// Export schema
export * from "./schema";
 
// Export context manager
export * from "./context-manager";
 
// Export handlers
export * from "./handlers";
 
// Export registry
export * from "./registry";
 
// Import from registry for convenience exports
import {
  getFilteredContextTools,
  getContextReadOnlyToolNames,
  contextToolRegistry,
} from "./registry";
import type { ToolDefinition } from "../../types";
 
// Conditional exports based on GITLAB_READ_ONLY_MODE environment variable
const isReadOnly = process.env.GITLAB_READ_ONLY_MODE === "true";
 
// Get tools from registry (with backward compatibility)
const contextToolsFromRegistry = getFilteredContextTools(isReadOnly);
 
// Convert enhanced tool definitions to regular tool definitions for backward compatibility
export const contextTools: ToolDefinition[] = contextToolsFromRegistry.map(
  (tool): ToolDefinition => ({
    name: tool.name,
    description: tool.description,
    inputSchema: tool.inputSchema,
  })
);
 
// Export read-only tool names for backward compatibility
export const contextReadOnlyTools = getContextReadOnlyToolNames();
 
// Export registry for direct access
export { contextToolRegistry };