@nomyx/assistant
Version:
A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)
36 lines (35 loc) • 1.34 kB
TypeScript
export interface CodeQualityMetrics {
complexity: number;
maintainabilityIndex: number;
codeDuplicationPercentage: number;
commentDensity: number;
functionLength: number;
}
export interface SecurityIssue {
severity: 'HIGH' | 'MEDIUM' | 'LOW';
description: string;
location: string;
}
export declare class CodeNode {
type: string;
value: string;
children: CodeNode[];
metadata: Record<string, any>;
id: string;
codeQualityMetrics?: CodeQualityMetrics;
securityIssues?: SecurityIssue[];
generatedCode?: string;
constructor(type: string, value: string, children?: CodeNode[], metadata?: Record<string, any>);
toJSON(): any;
static fromJSON(json: any): CodeNode;
toString(indent?: string): string;
traverse(callback: (node: CodeNode) => void): void;
find(predicate: (node: CodeNode) => boolean): CodeNode | null;
serialize(): string;
static deserialize(serialized: string): CodeNode;
}
export declare function findNodeById(root: CodeNode, id: string): CodeNode | null;
export declare function countNodes(root: CodeNode): number;
export declare function getLeafNodes(root: CodeNode): CodeNode[];
export declare function getNodeDepth(root: CodeNode, targetNode: CodeNode): number;
export declare function cloneCodeNode(node: CodeNode): CodeNode;