codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
461 lines • 12.4 kB
TypeScript
export interface StreamToken {
content: string;
finished?: boolean;
index: number;
timestamp: number;
metadata?: Record<string, any>;
}
export interface REPLInterface {
showStatus(): void;
listModels(): void;
executePromptProcessing(prompt: string, options?: any): Promise<any>;
}
export interface UnifiedClientConfig {
endpoint?: string;
providers: Array<{
type: 'ollama' | 'lm-studio' | 'huggingface' | 'auto';
endpoint?: string;
apiKey?: string;
model?: string;
timeout?: number;
maxRetries?: number;
}>;
defaultModel?: string;
executionMode: 'auto' | 'fast' | 'quality';
fallbackChain: Array<'ollama' | 'lm-studio' | 'huggingface' | 'auto'>;
performanceThresholds: {
fastModeMaxTokens: number;
timeoutMs: number;
maxConcurrentRequests: number;
};
security: {
enableSandbox: boolean;
maxInputLength: number;
allowedCommands: string[];
};
streaming?: {
enabled?: boolean;
bufferSize?: number;
flushInterval?: number;
chunkSize?: number;
timeout?: number;
};
}
export interface ModelRequest {
prompt: string;
model?: string;
temperature?: number;
maxTokens?: number;
stream?: boolean;
provider?: string;
abortSignal?: AbortSignal;
tools?: Array<{
type: 'function';
function: {
name: string;
description: string;
parameters: {
type: 'object';
properties: Record<string, unknown>;
required?: string[];
};
};
}>;
context?: Record<string, JsonValue>;
files?: string[];
taskType?: 'analysis' | 'generation' | 'refactoring' | 'debug' | 'documentation' | 'testing';
}
export interface ModelResponse {
content: string;
model: string;
provider?: string;
error?: string;
toolCalls?: any[];
metadata?: {
tokens: number;
latency: number;
quality?: number;
hybridRouting?: any;
selectedProvider?: string;
toolExecuted?: boolean;
toolResults?: any[];
fromBatch?: boolean;
cacheHit?: boolean;
};
tokens_used?: number;
usage?: {
totalTokens: number;
promptTokens?: number;
completionTokens?: number;
};
cached?: boolean;
streamed?: boolean;
processingTime?: number;
llmUsed?: string;
}
export interface ProjectContext {
workingDirectory: string;
config: Record<string, unknown>;
files: Array<{
path: string;
content: string;
type: string;
language?: string;
}>;
structure?: {
directories: string[];
fileTypes: Record<string, number>;
};
}
export interface AppConfig {
llm: {
provider: string;
model: string;
endpoint: string;
};
features: {
voiceArchetypes: boolean;
agenticMode: boolean;
};
}
export interface AgentConfig {
voices: string[];
maxIterations: number;
qualityThreshold: number;
}
export interface ExecutionResult {
success: boolean;
content: string;
metadata: {
model: string;
tokens: number;
latency: number;
type?: string;
};
output?: string;
taskId?: string;
}
export interface SynthesisResponse {
code: string;
reasoning: string;
quality: number;
}
export interface SynthesisResult {
content: string;
confidence?: number;
voicesUsed: string[];
voices?: string[];
qualityScore: number;
combinedCode?: string;
convergenceReason?: string;
lessonsLearned?: string[];
iterations?: Array<{
content: string;
feedback: string;
improvement: number;
}>;
writerVoice?: string;
auditorVoice?: string;
totalIterations?: number;
finalQualityScore?: number;
converged?: boolean;
finalCode?: string;
synthesis?: string;
latency?: number;
modelUsed?: string;
reasoning?: string;
}
export interface SecurityValidation {
isValid: boolean;
reason?: string;
sanitizedInput?: string;
riskLevel?: 'low' | 'medium' | 'high';
}
export interface SecurityError extends Error {
code: string;
risk: string;
}
export declare class SecurityError extends Error {
code: string;
risk: string;
constructor(message: string, code?: string, risk?: string);
}
export interface CLIError extends Error {
code: string;
exitCode: number;
}
export declare class CLIError extends Error {
code: string;
exitCode: number;
constructor(message: string, exitCode: number, code?: string);
static timeout(operation: string): CLIError;
static networkError(message: string): CLIError;
}
export declare enum CLIExitCode {
SUCCESS = 0,
GENERAL_ERROR = 1,
INVALID_ARGS = 2,
CONFIG_ERROR = 3,
NETWORK_ERROR = 4,
INVALID_INPUT = 5,
EXECUTION_FAILED = 6,
INITIALIZATION_FAILED = 7,
AUTHENTICATION_REQUIRED = 8,
AUTHENTICATION_FAILED = 9,
PERMISSION_DENIED = 10,
SECURITY_VIOLATION = 11,
UNEXPECTED_ERROR = 99
}
export interface LLMProvider {
name: string;
endpoint: string;
isAvailable(): Promise<boolean>;
generateCode(prompt: string, options?: Record<string, unknown>): Promise<LLMResponse>;
getCapabilities(): LLMCapabilities;
getStatus(): Promise<LLMStatus>;
}
export interface LLMResponse {
content: string;
confidence: number;
responseTime: number;
model: string;
provider: string;
metadata?: Record<string, unknown>;
}
export interface LLMCapabilities {
strengths: string[];
optimalFor: string[];
responseTime: string;
contextWindow: number;
supportsStreaming?: boolean;
maxConcurrent?: number;
}
export interface LLMStatus {
available: boolean;
currentLoad: number;
maxLoad: number;
responseTime: number;
errorRate: number;
lastError?: string;
}
export interface Task {
id: string;
type: string;
description: string;
capability?: string;
input?: string;
priority?: 'low' | 'medium' | 'high';
estimatedTime?: number;
}
export interface ExecutionRequest {
id: string;
input: string;
mode?: string;
type?: string;
priority?: string;
maxTokens?: number;
voice?: string;
temperature?: number;
}
export interface Workflow {
id: string;
tasks: Task[];
startTime: Date;
endTime?: Date;
results?: Record<string, unknown>;
error?: string;
request?: Record<string, unknown>;
status?: 'pending' | 'running' | 'completed' | 'failed';
}
export interface ExecutionRequestExtended extends ExecutionRequest {
type: string;
}
export interface ExecutionResponse {
success: boolean;
result: Record<string, unknown>;
results?: Record<string, unknown>;
workflowId?: string;
executionTime?: number;
error?: string;
}
export interface VoiceConfig {
name: string;
prompt: string;
temperature: number;
model: string;
}
export interface IterativeResult {
content: string;
iterations: Array<{
content: string;
feedback: string;
improvement: number;
iteration?: number;
qualityScore?: number;
diff?: Record<string, unknown>;
code?: string;
auditFeedback?: string;
}>;
finalCode?: string;
writerVoice?: string;
auditorVoice?: string;
totalIterations?: number;
finalQualityScore?: number;
converged?: boolean;
}
export interface SpiralConfig {
maxIterations: number;
qualityThreshold?: number;
voices?: string[];
voiceSelectionStrategy?: 'adaptive' | 'fixed';
enableAdaptiveLearning?: boolean;
reflectionDepth?: 'shallow' | 'medium' | 'deep';
}
export interface ProviderMetrics {
requests: number;
totalRequests: number;
totalLatency: number;
averageLatency: number;
errorRate?: number;
successRate: number;
lastError?: string;
}
export interface PerformanceMetrics {
timestamp: Date;
totalRequests: number;
averageLatency: number;
errorRate: number;
providers?: Record<string, ProviderMetrics>;
overall?: {
successRate: number;
uptime: number;
totalRequests: number;
averageLatency: number;
};
}
export declare const ResponseValidator: {
validate: (response: Record<string, unknown>) => {
isValid: boolean;
errors: never[];
};
};
export declare const UnifiedClientConfig: Record<string, unknown>;
export declare const ModelRequest: Record<string, unknown>;
export declare const ModelResponse: Record<string, unknown>;
export declare const ProjectContext: Record<string, unknown>;
export declare const AppConfig: Record<string, unknown>;
export declare const AgentConfig: Record<string, unknown>;
export declare const ExecutionResult: Record<string, unknown>;
export declare const SynthesisResponse: Record<string, unknown>;
export interface ExecutionMode {
type: 'auto' | 'fast' | 'quality';
timeout?: number;
}
export interface WorkflowExtended extends Workflow {
status?: 'pending' | 'running' | 'completed' | 'failed';
}
export interface ExecutionResponseExtended extends ExecutionResponse {
results?: Record<string, unknown>;
error?: string;
}
export interface TaskExtended extends Task {
priority?: 'low' | 'medium' | 'high';
}
export declare const ExecutionMode: Record<string, unknown>;
export interface ModelClient {
generate(request: Record<string, unknown>): Promise<Record<string, unknown>>;
checkStatus(): Promise<boolean>;
}
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
export interface JsonObject {
[key: string]: JsonValue;
}
export interface JsonArray extends Array<JsonValue> {
}
export type TransformFunction<T, R> = (input: T) => R;
export type PredicateFunction<T> = (input: T) => boolean;
export type EvaluationFunction<T> = (input: T) => number;
export interface ConfigurationObject extends Record<string, JsonValue> {
}
export interface ExecutionContext {
timestamp?: number;
executionId?: string;
[key: string]: JsonValue | undefined;
}
export interface GenericResult<T = JsonValue> {
success: boolean;
data?: T;
error?: string;
metadata?: Record<string, JsonValue>;
}
export interface ProcessingResult<T = JsonValue> extends GenericResult<T> {
processingTime?: number;
iterations?: number;
}
export interface WorkflowNode {
id: string;
type: string;
name: string;
config?: ConfigurationObject;
}
export interface WorkflowContext {
nodeId: string;
history: Array<{
nodeId: string;
timestamp: number;
result: JsonValue;
}>;
metrics?: Record<string, JsonValue>;
}
export interface ToolArguments extends Record<string, JsonValue> {
}
export interface ToolResult<T = JsonValue> extends GenericResult<T> {
}
export interface MemoryItem {
id: string;
content: JsonValue;
timestamp: number;
importance?: number;
metadata?: Record<string, JsonValue>;
}
export interface CacheEntry<T = JsonValue> {
key: string;
value: T;
timestamp: number;
ttl?: number;
}
export interface AnalysisResult {
type: string;
results: Record<string, JsonValue>;
recommendations?: string[];
score?: number;
}
export interface MetricsData {
timestamp: number;
values: Record<string, number>;
metadata?: Record<string, JsonValue>;
}
export interface EventData extends Record<string, JsonValue> {
type: string;
timestamp: number;
}
export interface MessageData {
from: string;
to?: string;
content: JsonValue;
timestamp: number;
metadata?: Record<string, JsonValue>;
}
export interface ComplexityAnalysis {
score: number;
level: 'simple' | 'medium' | 'complex';
factors: {
promptLength: number;
hasContext: boolean;
hasFiles: boolean;
fileCount: number;
};
estimatedTime: string;
}
export type TaskType = 'analysis' | 'generation' | 'refactoring' | 'debug' | 'documentation' | 'testing' | 'optimization' | 'general' | 'template' | 'security' | 'planning' | 'generate';
//# sourceMappingURL=types.d.ts.map