import {
TOOL_DEFINITION as GetPackageTree_Tool,
handleGetPackageTree,
} from '../../../handlers/system/high/handleGetPackageTree';
import {
TOOL_DEFINITION as GetNodeStructureLow_Tool,
handleGetNodeStructure,
} from '../../../handlers/system/low/handleGetNodeStructure';
import {
TOOL_DEFINITION as GetObjectStructureLow_Tool,
handleGetObjectStructure as handleGetObjectStructureLow,
} from '../../../handlers/system/low/handleGetObjectStructure';
import {
TOOL_DEFINITION as GetVirtualFoldersLow_Tool,
handleGetVirtualFolders,
} from '../../../handlers/system/low/handleGetVirtualFolders';
import { TOOL_DEFINITION as DescribeByList_Tool } from '../../../handlers/system/readonly/handleDescribeByList';
import { handleDescribeByList } from '../../../handlers/system/readonly/handleDescribeByList.js';
import {
TOOL_DEFINITION as GetAbapAST_Tool,
handleGetAbapAST,
} from '../../../handlers/system/readonly/handleGetAbapAST';
import {
TOOL_DEFINITION as GetAbapSemanticAnalysis_Tool,
handleGetAbapSemanticAnalysis,
} from '../../../handlers/system/readonly/handleGetAbapSemanticAnalysis';
import {
TOOL_DEFINITION as GetAbapSystemSymbols_Tool,
handleGetAbapSystemSymbols,
} from '../../../handlers/system/readonly/handleGetAbapSystemSymbols';
import {
TOOL_DEFINITION as GetAdtTypes_Tool,
handleGetAdtTypes,
} from '../../../handlers/system/readonly/handleGetAllTypes';
import {
TOOL_DEFINITION as GetInactiveObjects_Tool,
handleGetInactiveObjects,
} from '../../../handlers/system/readonly/handleGetInactiveObjects';
import {
TOOL_DEFINITION as GetObjectInfo_Tool,
handleGetObjectInfo,
} from '../../../handlers/system/readonly/handleGetObjectInfo';
import { TOOL_DEFINITION as GetObjectNodeFromCache_Tool } from '../../../handlers/system/readonly/handleGetObjectNodeFromCache';
import { handleGetObjectNodeFromCache } from '../../../handlers/system/readonly/handleGetObjectNodeFromCache.js';
import { TOOL_DEFINITION as GetObjectStructure_Tool } from '../../../handlers/system/readonly/handleGetObjectStructure';
import { handleGetObjectStructure } from '../../../handlers/system/readonly/handleGetObjectStructure.js';
import {
TOOL_DEFINITION as GetSession_Tool,
handleGetSession,
} from '../../../handlers/system/readonly/handleGetSession';
import {
TOOL_DEFINITION as GetSqlQuery_Tool,
handleGetSqlQuery,
} from '../../../handlers/system/readonly/handleGetSqlQuery';
import {
TOOL_DEFINITION as GetTransaction_Tool,
handleGetTransaction,
} from '../../../handlers/system/readonly/handleGetTransaction';
// Import system handlers
// Import TOOL_DEFINITION from handlers
import {
TOOL_DEFINITION as GetTypeInfo_Tool,
handleGetTypeInfo,
} from '../../../handlers/system/readonly/handleGetTypeInfo';
import {
TOOL_DEFINITION as GetWhereUsed_Tool,
handleGetWhereUsed,
} from '../../../handlers/system/readonly/handleGetWhereUsed';
import {
handleRuntimeAnalyzeDump,
TOOL_DEFINITION as RuntimeAnalyzeDump_Tool,
} from '../../../handlers/system/readonly/handleRuntimeAnalyzeDump';
import {
handleRuntimeAnalyzeProfilerTrace,
TOOL_DEFINITION as RuntimeAnalyzeProfilerTrace_Tool,
} from '../../../handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace';
import {
handleRuntimeCreateProfilerTraceParameters,
TOOL_DEFINITION as RuntimeCreateProfilerTraceParameters_Tool,
} from '../../../handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters';
import {
handleRuntimeGetDumpById,
TOOL_DEFINITION as RuntimeGetDumpById_Tool,
} from '../../../handlers/system/readonly/handleRuntimeGetDumpById';
import {
handleRuntimeGetProfilerTraceData,
TOOL_DEFINITION as RuntimeGetProfilerTraceData_Tool,
} from '../../../handlers/system/readonly/handleRuntimeGetProfilerTraceData';
import {
handleRuntimeListDumps,
TOOL_DEFINITION as RuntimeListDumps_Tool,
} from '../../../handlers/system/readonly/handleRuntimeListDumps';
import {
handleRuntimeListProfilerTraceFiles,
TOOL_DEFINITION as RuntimeListProfilerTraceFiles_Tool,
} from '../../../handlers/system/readonly/handleRuntimeListProfilerTraceFiles';
import {
handleRuntimeRunClassWithProfiling,
TOOL_DEFINITION as RuntimeRunClassWithProfiling_Tool,
} from '../../../handlers/system/readonly/handleRuntimeRunClassWithProfiling';
import {
handleRuntimeRunProgramWithProfiling,
TOOL_DEFINITION as RuntimeRunProgramWithProfiling_Tool,
} from '../../../handlers/system/readonly/handleRuntimeRunProgramWithProfiling';
import { BaseHandlerGroup } from '../base/BaseHandlerGroup.js';
import type { HandlerEntry } from '../interfaces.js';
/**
* Handler group for all system-related handlers
* Contains handlers for system information, analysis, and metadata operations
*/
export class SystemHandlersGroup extends BaseHandlerGroup {
protected groupName = 'SystemHandlers';
/**
* Gets all system handler entries
*/
getHandlers(): HandlerEntry[] {
return [
{
toolDefinition: {
name: GetTypeInfo_Tool.name,
description: GetTypeInfo_Tool.description,
inputSchema: GetTypeInfo_Tool.inputSchema,
},
handler: (args: any) => handleGetTypeInfo(this.context, args),
},
{
toolDefinition: {
name: GetTransaction_Tool.name,
description: GetTransaction_Tool.description,
inputSchema: GetTransaction_Tool.inputSchema,
},
handler: (args: any) => handleGetTransaction(this.context, args),
},
{
toolDefinition: {
name: RuntimeCreateProfilerTraceParameters_Tool.name,
description: RuntimeCreateProfilerTraceParameters_Tool.description,
inputSchema: RuntimeCreateProfilerTraceParameters_Tool.inputSchema,
},
handler: (args: any) =>
handleRuntimeCreateProfilerTraceParameters(this.context, args),
},
{
toolDefinition: {
name: RuntimeListProfilerTraceFiles_Tool.name,
description: RuntimeListProfilerTraceFiles_Tool.description,
inputSchema: RuntimeListProfilerTraceFiles_Tool.inputSchema,
},
handler: () => handleRuntimeListProfilerTraceFiles(this.context),
},
{
toolDefinition: {
name: RuntimeGetProfilerTraceData_Tool.name,
description: RuntimeGetProfilerTraceData_Tool.description,
inputSchema: RuntimeGetProfilerTraceData_Tool.inputSchema,
},
handler: (args: any) =>
handleRuntimeGetProfilerTraceData(this.context, args),
},
{
toolDefinition: {
name: RuntimeListDumps_Tool.name,
description: RuntimeListDumps_Tool.description,
inputSchema: RuntimeListDumps_Tool.inputSchema,
},
handler: (args: any) => handleRuntimeListDumps(this.context, args),
},
{
toolDefinition: {
name: RuntimeGetDumpById_Tool.name,
description: RuntimeGetDumpById_Tool.description,
inputSchema: RuntimeGetDumpById_Tool.inputSchema,
},
handler: (args: any) => handleRuntimeGetDumpById(this.context, args),
},
{
toolDefinition: {
name: RuntimeRunClassWithProfiling_Tool.name,
description: RuntimeRunClassWithProfiling_Tool.description,
inputSchema: RuntimeRunClassWithProfiling_Tool.inputSchema,
},
handler: (args: any) =>
handleRuntimeRunClassWithProfiling(this.context, args),
},
{
toolDefinition: {
name: RuntimeRunProgramWithProfiling_Tool.name,
description: RuntimeRunProgramWithProfiling_Tool.description,
inputSchema: RuntimeRunProgramWithProfiling_Tool.inputSchema,
},
handler: (args: any) =>
handleRuntimeRunProgramWithProfiling(this.context, args),
},
{
toolDefinition: {
name: RuntimeAnalyzeProfilerTrace_Tool.name,
description: RuntimeAnalyzeProfilerTrace_Tool.description,
inputSchema: RuntimeAnalyzeProfilerTrace_Tool.inputSchema,
},
handler: (args: any) =>
handleRuntimeAnalyzeProfilerTrace(this.context, args),
},
{
toolDefinition: {
name: RuntimeAnalyzeDump_Tool.name,
description: RuntimeAnalyzeDump_Tool.description,
inputSchema: RuntimeAnalyzeDump_Tool.inputSchema,
},
handler: (args: any) => handleRuntimeAnalyzeDump(this.context, args),
},
{
toolDefinition: {
name: GetSqlQuery_Tool.name,
description: GetSqlQuery_Tool.description,
inputSchema: GetSqlQuery_Tool.inputSchema,
},
handler: (args: any) => handleGetSqlQuery(this.context, args),
},
{
toolDefinition: {
name: GetWhereUsed_Tool.name,
description: GetWhereUsed_Tool.description,
inputSchema: GetWhereUsed_Tool.inputSchema,
},
handler: (args: any) => handleGetWhereUsed(this.context, args),
},
{
toolDefinition: {
name: GetObjectInfo_Tool.name,
description: GetObjectInfo_Tool.description,
inputSchema: GetObjectInfo_Tool.inputSchema,
},
handler: async (args: any) => {
if (!args || typeof args !== 'object') {
throw new Error('Missing or invalid arguments for GetObjectInfo');
}
return await handleGetObjectInfo(
this.context,
args as { parent_type: string; parent_name: string },
);
},
},
{
toolDefinition: {
name: GetAbapAST_Tool.name,
description: GetAbapAST_Tool.description,
inputSchema: GetAbapAST_Tool.inputSchema,
},
handler: (args: any) => handleGetAbapAST(this.context, args),
},
{
toolDefinition: {
name: GetAbapSemanticAnalysis_Tool.name,
description: GetAbapSemanticAnalysis_Tool.description,
inputSchema: GetAbapSemanticAnalysis_Tool.inputSchema,
},
handler: (args: any) =>
handleGetAbapSemanticAnalysis(this.context, args),
},
{
toolDefinition: {
name: GetAbapSystemSymbols_Tool.name,
description: GetAbapSystemSymbols_Tool.description,
inputSchema: GetAbapSystemSymbols_Tool.inputSchema,
},
handler: (args: any) => handleGetAbapSystemSymbols(this.context, args),
},
{
toolDefinition: {
name: GetSession_Tool.name,
description: GetSession_Tool.description,
inputSchema: GetSession_Tool.inputSchema,
},
handler: (args: any) => handleGetSession(this.context, args),
},
{
toolDefinition: {
name: GetInactiveObjects_Tool.name,
description: GetInactiveObjects_Tool.description,
inputSchema: GetInactiveObjects_Tool.inputSchema,
},
handler: (args: any) => handleGetInactiveObjects(this.context, args),
},
// Dynamic import handlers
{
toolDefinition: {
name: GetAdtTypes_Tool.name,
description: GetAdtTypes_Tool.description,
inputSchema: GetAdtTypes_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetAdtTypes(this.context, args as { type_name: string });
},
},
{
toolDefinition: {
name: GetObjectStructure_Tool.name,
description: GetObjectStructure_Tool.description,
inputSchema: GetObjectStructure_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetObjectStructure(
this.context,
args as { object_type: string; object_name: string },
);
},
},
{
toolDefinition: {
name: GetObjectNodeFromCache_Tool.name,
description: GetObjectNodeFromCache_Tool.description,
inputSchema: GetObjectNodeFromCache_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetObjectNodeFromCache(
this.context,
args as
| { object_type: string; object_name: string }
| {
object_type: string;
object_name: string;
cache_type: string;
},
);
},
},
{
toolDefinition: {
name: DescribeByList_Tool.name,
description: DescribeByList_Tool.description,
inputSchema: DescribeByList_Tool.inputSchema,
},
handler: (args: any) => {
return handleDescribeByList(
this.context,
args as
| { object_type: string; object_name: string }
| {
object_type: string;
object_name: string;
cache_type: string;
},
);
},
},
// Low-level handlers for virtual folders, node structure, and object structure
{
toolDefinition: {
name: GetVirtualFoldersLow_Tool.name,
description: GetVirtualFoldersLow_Tool.description,
inputSchema: GetVirtualFoldersLow_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetVirtualFolders(this.context, args);
},
},
{
toolDefinition: {
name: GetNodeStructureLow_Tool.name,
description: GetNodeStructureLow_Tool.description,
inputSchema: GetNodeStructureLow_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetNodeStructure(this.context, args);
},
},
{
toolDefinition: {
name: GetObjectStructureLow_Tool.name,
description: GetObjectStructureLow_Tool.description,
inputSchema: GetObjectStructureLow_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetObjectStructureLow(
this.context,
args as {
object_type: string;
object_name: string;
session_id?: string;
session_state?: {
cookies?: string;
csrf_token?: string;
cookie_store?: Record<string, string>;
};
},
);
},
},
// High-level handler for package tree
{
toolDefinition: {
name: GetPackageTree_Tool.name,
description: GetPackageTree_Tool.description,
inputSchema: GetPackageTree_Tool.inputSchema,
},
handler: (args: any) => {
return handleGetPackageTree(
this.context,
args as {
package_name: string;
include_subpackages?: boolean;
max_depth?: number;
include_descriptions?: boolean;
},
);
},
},
];
}
}