mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import type { KtxFileStorePort } from '../../../core/index.js';
|
|
import type { SlConnectionCatalogPort } from '../../../sl/index.js';
|
|
import type { BaseTool, ToolContext } from '../../../tools/index.js';
|
|
import { DiscoverDataTool } from './discover-data.tool.js';
|
|
import { EntityDetailsTool } from './entity-details.tool.js';
|
|
import { SqlExecutionTool } from './sql-execution.tool.js';
|
|
import { WarehouseCatalogService } from './warehouse-catalog.service.js';
|
|
|
|
export { DiscoverDataTool } from './discover-data.tool.js';
|
|
export { EntityDetailsTool } from './entity-details.tool.js';
|
|
export { SqlExecutionTool } from './sql-execution.tool.js';
|
|
export { WarehouseCatalogService } from './warehouse-catalog.service.js';
|
|
export type { RawSchemaHit, TableDetail, WarehouseColumnDetail } from './warehouse-catalog.service.js';
|
|
|
|
export function createWarehouseVerificationTools(deps: {
|
|
connections: SlConnectionCatalogPort;
|
|
fallbackFileStore: KtxFileStorePort;
|
|
wikiSearchTool: BaseTool;
|
|
slDiscoverTool: BaseTool;
|
|
}): BaseTool[] {
|
|
const catalogFactory = (context: ToolContext) =>
|
|
new WarehouseCatalogService({
|
|
fileStore: context.session?.configService ?? deps.fallbackFileStore,
|
|
});
|
|
return [
|
|
new EntityDetailsTool(catalogFactory),
|
|
new SqlExecutionTool(deps.connections),
|
|
new DiscoverDataTool({
|
|
wikiSearchTool: deps.wikiSearchTool,
|
|
slDiscoverTool: deps.slDiscoverTool,
|
|
catalogFactory,
|
|
}),
|
|
];
|
|
}
|