@eldrex/core
Advanced tools
+394
-23
@@ -5,3 +5,3 @@ import { z } from 'zod'; | ||
| summary: string; | ||
| impact: 'none' | 'minor' | 'major' | 'breaking'; | ||
| impact: "none" | "minor" | "major" | "breaking"; | ||
| breaking: boolean; | ||
@@ -24,3 +24,3 @@ files: { | ||
| dryRun?: boolean; | ||
| format?: 'markdown' | 'json' | 'html'; | ||
| format?: "markdown" | "json" | "html"; | ||
| } | ||
@@ -30,3 +30,3 @@ interface GenerateResult { | ||
| formattedOutput: string; | ||
| format: 'markdown' | 'json' | 'html'; | ||
| format: "markdown" | "json" | "html"; | ||
| } | ||
@@ -42,3 +42,3 @@ declare function generateChangelog(options: GenerateOptions): Promise<GenerateResult>; | ||
| interface DiffLine { | ||
| type: 'addition' | 'deletion' | 'normal'; | ||
| type: "addition" | "deletion" | "normal"; | ||
| content: string; | ||
@@ -67,3 +67,3 @@ ln1?: number; | ||
| changes: { | ||
| type: 'addition' | 'deletion'; | ||
| type: "addition" | "deletion"; | ||
| line: number; | ||
@@ -154,2 +154,4 @@ content: string; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
@@ -169,2 +171,4 @@ providers: { | ||
| }; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
@@ -184,2 +188,4 @@ providers?: { | ||
| } | undefined; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
@@ -198,4 +204,45 @@ exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| ai: { | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
| ai: z.ZodDefault<z.ZodObject<{ | ||
| providers: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
| name: z.ZodString; | ||
| url: z.ZodString; | ||
| apiKey: z.ZodOptional<z.ZodString>; | ||
| maxTokens: z.ZodOptional<z.ZodNumber>; | ||
| priority: z.ZodDefault<z.ZodNumber>; | ||
| maxDailyCost: z.ZodOptional<z.ZodNumber>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }, { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }>, "many">>; | ||
| routing: z.ZodDefault<z.ZodObject<{ | ||
| strategy: z.ZodDefault<z.ZodEnum<["priority", "cost-aware", "latency"]>>; | ||
| complexityThreshold: z.ZodDefault<z.ZodNumber>; | ||
| localOnly: z.ZodDefault<z.ZodBoolean>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }, { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| providers: { | ||
@@ -214,11 +261,92 @@ name: string; | ||
| }; | ||
| }; | ||
| exclude: string[]; | ||
| cache: { | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
| providers?: { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }[] | undefined; | ||
| routing?: { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| } | undefined; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
| exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| cache: z.ZodDefault<z.ZodObject<{ | ||
| enabled: z.ZodDefault<z.ZodBoolean>; | ||
| path: z.ZodDefault<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| path: string; | ||
| enabled: boolean; | ||
| }; | ||
| format: "markdown" | "json" | "html"; | ||
| }, { | ||
| ai?: { | ||
| }, { | ||
| path?: string | undefined; | ||
| enabled?: boolean | undefined; | ||
| }>>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
| ai: z.ZodDefault<z.ZodObject<{ | ||
| providers: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
| name: z.ZodString; | ||
| url: z.ZodString; | ||
| apiKey: z.ZodOptional<z.ZodString>; | ||
| maxTokens: z.ZodOptional<z.ZodNumber>; | ||
| priority: z.ZodDefault<z.ZodNumber>; | ||
| maxDailyCost: z.ZodOptional<z.ZodNumber>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }, { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }>, "many">>; | ||
| routing: z.ZodDefault<z.ZodObject<{ | ||
| strategy: z.ZodDefault<z.ZodEnum<["priority", "cost-aware", "latency"]>>; | ||
| complexityThreshold: z.ZodDefault<z.ZodNumber>; | ||
| localOnly: z.ZodDefault<z.ZodBoolean>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }, { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| providers: { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }[]; | ||
| routing: { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
| providers?: { | ||
@@ -237,13 +365,28 @@ name: string; | ||
| } | undefined; | ||
| } | undefined; | ||
| exclude?: string[] | undefined; | ||
| cache?: { | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
| exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| cache: z.ZodDefault<z.ZodObject<{ | ||
| enabled: z.ZodDefault<z.ZodBoolean>; | ||
| path: z.ZodDefault<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| path: string; | ||
| enabled: boolean; | ||
| }, { | ||
| path?: string | undefined; | ||
| enabled?: boolean | undefined; | ||
| } | undefined; | ||
| format?: "markdown" | "json" | "html" | undefined; | ||
| }>; | ||
| }>>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, z.ZodTypeAny, "passthrough">>; | ||
| type Provider = z.infer<typeof ProviderSchema>; | ||
| type Routing = z.infer<typeof RoutingSchema>; | ||
| type DevDiffConfig = z.infer<typeof ConfigSchema>; | ||
| type DevDiffConfig = z.infer<typeof ConfigSchema> & { | ||
| privacy?: Record<string, any>; | ||
| monitoring?: Record<string, any>; | ||
| security?: Record<string, any>; | ||
| }; | ||
@@ -307,5 +450,233 @@ declare function loadConfig(searchFrom?: string): Promise<DevDiffConfig>; | ||
| get(diffText: string): Promise<CacheEntry | null>; | ||
| set(diffText: string, entry: Omit<CacheEntry, 'timestamp'>): Promise<void>; | ||
| set(diffText: string, entry: Omit<CacheEntry, "timestamp">): Promise<void>; | ||
| } | ||
| export { type AIExplanationResult, type AIProvider, AIRouter, DEFAULTS, type DevDiffConfig, type DiffHunk, type DiffLine, ExplanationCache, type GenerateOptions, type GenerateResult, type ParseResult, type ParsedFileDiff, type Provider, type Routing, SYSTEM_PROMPT, diffParser, formatHTML, formatJSON, formatMarkdown, generateChangelog, loadConfig, redactSecrets, scanForSecrets, trimAST }; | ||
| declare const SECURITY_ADVISORIES: { | ||
| id: string; | ||
| severity: string; | ||
| title: string; | ||
| description: string; | ||
| fix: string; | ||
| cvss: number; | ||
| cwe: string; | ||
| credit: string; | ||
| }[]; | ||
| interface PrivacyDecision { | ||
| allowed: boolean; | ||
| reason?: string; | ||
| requiresUserConsent?: boolean; | ||
| classification?: string; | ||
| } | ||
| declare class PrivacyEnforcer { | ||
| private readonly DATA_CLASSIFICATIONS; | ||
| check(data: any, destination: "local" | "cloud"): PrivacyDecision; | ||
| private classify; | ||
| } | ||
| declare const COMPLIANCE_FRAMEWORKS: Record<string, { | ||
| name: string; | ||
| jurisdiction: string; | ||
| autoConfig: any; | ||
| }>; | ||
| declare function deepMerge(target: any, source: any): any; | ||
| declare function applyCompliance(frameworkId: string, config: DevDiffConfig): Promise<DevDiffConfig>; | ||
| /** | ||
| * WebGPU-Accelerated Local Model Inference | ||
| * Runs in browser and Node.js with GPU adapter. | ||
| * Zero installation. Zero cloud. Zero cost. | ||
| */ | ||
| declare class WebGPUProvider implements AIProvider { | ||
| name: string; | ||
| private device; | ||
| private computePipeline; | ||
| private modelBuffers; | ||
| private kvCache; | ||
| initialize(config?: { | ||
| model: "llama3.2-3b-q4" | "phi3.5-mini-q4" | "gemma2-2b-q4"; | ||
| quantization: "int4" | "int8"; | ||
| }): Promise<void>; | ||
| generate(prompt: string): Promise<AsyncGenerator<string>>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| private loadModel; | ||
| private compileShaders; | ||
| private tokenize; | ||
| private detokenize; | ||
| private sample; | ||
| private get eosToken(); | ||
| private updateKVCache; | ||
| private streamTokens; | ||
| } | ||
| declare class WASMProvider implements AIProvider { | ||
| name: string; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| } | ||
| declare class NativeCPUProvider implements AIProvider { | ||
| name: string; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| } | ||
| /** | ||
| * Automatic fallback: WebGPU → WebAssembly → CPU → Download prompt | ||
| * Ensures AI always works, even without GPU. | ||
| */ | ||
| declare class LocalInferenceChain implements AIProvider { | ||
| name: string; | ||
| private providers; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| generate(prompt: string): Promise<AsyncGenerator<string>>; | ||
| private checkWebGPU; | ||
| private checkWASM; | ||
| private checkCPU; | ||
| } | ||
| interface Agent { | ||
| id: string; | ||
| role: string; | ||
| model: string; | ||
| personality: any; | ||
| capabilities: string[]; | ||
| } | ||
| interface ProcessedDiff { | ||
| files?: any[]; | ||
| changes?: any[]; | ||
| } | ||
| interface AgentAnalysis { | ||
| agentId: string; | ||
| findings: string[]; | ||
| confidence: number; | ||
| } | ||
| interface AgentMessage { | ||
| from: string; | ||
| to: string; | ||
| type: string; | ||
| content: string; | ||
| confidence: number; | ||
| timestamp: number; | ||
| } | ||
| interface AgentDiscussion { | ||
| messages: AgentMessage[]; | ||
| rounds: number; | ||
| } | ||
| interface Consensus { | ||
| findings: { | ||
| finding: string; | ||
| supportCount: number; | ||
| totalAgents: number; | ||
| consensusScore: number; | ||
| status: "consensus" | "disputed"; | ||
| }[]; | ||
| } | ||
| interface CollaborativeAnalysis { | ||
| consensus: Consensus; | ||
| analyses: AgentAnalysis[]; | ||
| report: string; | ||
| } | ||
| /** | ||
| * Multi-Agent Collaboration Engine | ||
| * Coordinates specialized local agents for comprehensive analysis. | ||
| * All agents run locally. No cloud required. | ||
| */ | ||
| declare class MultiAgentOrchestrator { | ||
| private agents; | ||
| private messageBus; | ||
| initialize(): Promise<void>; | ||
| analyze(diff: ProcessedDiff): Promise<CollaborativeAnalysis>; | ||
| private runAgentAnalysis; | ||
| private generateDiscussionPoint; | ||
| private runAgentDiscussion; | ||
| private buildConsensus; | ||
| private synthesizeReport; | ||
| } | ||
| interface Checkpoint { | ||
| id: string; | ||
| timestamp: number; | ||
| type: "pre-ai-call"; | ||
| snapshot: { | ||
| files: [string, string][]; | ||
| }; | ||
| metadata: { | ||
| trigger: "ai-call"; | ||
| aiModel: string; | ||
| prompt: string; | ||
| }; | ||
| } | ||
| interface VibeSession { | ||
| startedAt: number; | ||
| changes: any[]; | ||
| checkpoints: Checkpoint[]; | ||
| failures: any[]; | ||
| aiCalls: any[]; | ||
| } | ||
| interface RecoveryResult { | ||
| status: "retrying" | "failed-recovered"; | ||
| message: string; | ||
| nextModel?: string; | ||
| checkpointId: string; | ||
| transparency: { | ||
| whatHappened: string; | ||
| why: string; | ||
| whatWasSaved: string; | ||
| whatHappensNext: string; | ||
| howToManualRecover: string; | ||
| }; | ||
| restoredFrom?: string; | ||
| manualActions?: string[]; | ||
| } | ||
| interface VibeSessionReport { | ||
| duration: number; | ||
| totalChanges: number; | ||
| checkpointsCreated: number; | ||
| aiCallsSucceeded: number; | ||
| aiCallsFailed: number; | ||
| dataLossEvents: number; | ||
| guarantee: string; | ||
| recommendations: string[]; | ||
| } | ||
| declare class VibeCoderGuardian { | ||
| session: VibeSession; | ||
| private checkpointDir; | ||
| private sessionPath; | ||
| constructor(); | ||
| loadSession(): Promise<void>; | ||
| saveSession(): Promise<void>; | ||
| deleteSession(): Promise<void>; | ||
| /** | ||
| * Save checkpoint before any AI operation | ||
| */ | ||
| preAICheckpoint(context: { | ||
| files: string[]; | ||
| model: string; | ||
| prompt: string; | ||
| }): Promise<Checkpoint>; | ||
| private captureSnapshot; | ||
| private saveCheckpoint; | ||
| /** | ||
| * Handle AI failure with automatic recovery | ||
| */ | ||
| handleFailure(failure: { | ||
| error: Error; | ||
| model: string; | ||
| checkpointId: string; | ||
| attempt: number; | ||
| }): Promise<RecoveryResult>; | ||
| private getFallbackModel; | ||
| /** | ||
| * Restore from checkpoint — NEVER lose work | ||
| */ | ||
| restoreCheckpoint(checkpointId: string): Promise<void>; | ||
| /** | ||
| * Generate session summary | ||
| */ | ||
| generateReport(): VibeSessionReport; | ||
| private generateRecommendations; | ||
| recordChange(filename: string): void; | ||
| recordAICall(model: string, success: boolean): void; | ||
| } | ||
| export { type AIExplanationResult, type AIProvider, AIRouter, type Agent, type AgentAnalysis, type AgentDiscussion, type AgentMessage, COMPLIANCE_FRAMEWORKS, type Checkpoint, type CollaborativeAnalysis, type Consensus, DEFAULTS, type DevDiffConfig, type DiffHunk, type DiffLine, ExplanationCache, type GenerateOptions, type GenerateResult, LocalInferenceChain, MultiAgentOrchestrator, NativeCPUProvider, type ParseResult, type ParsedFileDiff, type PrivacyDecision, PrivacyEnforcer, type Provider, type RecoveryResult, type Routing, SECURITY_ADVISORIES, SYSTEM_PROMPT, VibeCoderGuardian, type VibeSession, type VibeSessionReport, WASMProvider, WebGPUProvider, applyCompliance, deepMerge, diffParser, formatHTML, formatJSON, formatMarkdown, generateChangelog, loadConfig, redactSecrets, scanForSecrets, trimAST }; |
+394
-23
@@ -5,3 +5,3 @@ import { z } from 'zod'; | ||
| summary: string; | ||
| impact: 'none' | 'minor' | 'major' | 'breaking'; | ||
| impact: "none" | "minor" | "major" | "breaking"; | ||
| breaking: boolean; | ||
@@ -24,3 +24,3 @@ files: { | ||
| dryRun?: boolean; | ||
| format?: 'markdown' | 'json' | 'html'; | ||
| format?: "markdown" | "json" | "html"; | ||
| } | ||
@@ -30,3 +30,3 @@ interface GenerateResult { | ||
| formattedOutput: string; | ||
| format: 'markdown' | 'json' | 'html'; | ||
| format: "markdown" | "json" | "html"; | ||
| } | ||
@@ -42,3 +42,3 @@ declare function generateChangelog(options: GenerateOptions): Promise<GenerateResult>; | ||
| interface DiffLine { | ||
| type: 'addition' | 'deletion' | 'normal'; | ||
| type: "addition" | "deletion" | "normal"; | ||
| content: string; | ||
@@ -67,3 +67,3 @@ ln1?: number; | ||
| changes: { | ||
| type: 'addition' | 'deletion'; | ||
| type: "addition" | "deletion"; | ||
| line: number; | ||
@@ -154,2 +154,4 @@ content: string; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
@@ -169,2 +171,4 @@ providers: { | ||
| }; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
@@ -184,2 +188,4 @@ providers?: { | ||
| } | undefined; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
@@ -198,4 +204,45 @@ exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| ai: { | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
| ai: z.ZodDefault<z.ZodObject<{ | ||
| providers: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
| name: z.ZodString; | ||
| url: z.ZodString; | ||
| apiKey: z.ZodOptional<z.ZodString>; | ||
| maxTokens: z.ZodOptional<z.ZodNumber>; | ||
| priority: z.ZodDefault<z.ZodNumber>; | ||
| maxDailyCost: z.ZodOptional<z.ZodNumber>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }, { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }>, "many">>; | ||
| routing: z.ZodDefault<z.ZodObject<{ | ||
| strategy: z.ZodDefault<z.ZodEnum<["priority", "cost-aware", "latency"]>>; | ||
| complexityThreshold: z.ZodDefault<z.ZodNumber>; | ||
| localOnly: z.ZodDefault<z.ZodBoolean>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }, { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| providers: { | ||
@@ -214,11 +261,92 @@ name: string; | ||
| }; | ||
| }; | ||
| exclude: string[]; | ||
| cache: { | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
| providers?: { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }[] | undefined; | ||
| routing?: { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| } | undefined; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
| exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| cache: z.ZodDefault<z.ZodObject<{ | ||
| enabled: z.ZodDefault<z.ZodBoolean>; | ||
| path: z.ZodDefault<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| path: string; | ||
| enabled: boolean; | ||
| }; | ||
| format: "markdown" | "json" | "html"; | ||
| }, { | ||
| ai?: { | ||
| }, { | ||
| path?: string | undefined; | ||
| enabled?: boolean | undefined; | ||
| }>>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
| ai: z.ZodDefault<z.ZodObject<{ | ||
| providers: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
| name: z.ZodString; | ||
| url: z.ZodString; | ||
| apiKey: z.ZodOptional<z.ZodString>; | ||
| maxTokens: z.ZodOptional<z.ZodNumber>; | ||
| priority: z.ZodDefault<z.ZodNumber>; | ||
| maxDailyCost: z.ZodOptional<z.ZodNumber>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }, { | ||
| name: string; | ||
| url: string; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| priority?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }>, "many">>; | ||
| routing: z.ZodDefault<z.ZodObject<{ | ||
| strategy: z.ZodDefault<z.ZodEnum<["priority", "cost-aware", "latency"]>>; | ||
| complexityThreshold: z.ZodDefault<z.ZodNumber>; | ||
| localOnly: z.ZodDefault<z.ZodBoolean>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }, { | ||
| strategy?: "priority" | "cost-aware" | "latency" | undefined; | ||
| complexityThreshold?: number | undefined; | ||
| localOnly?: boolean | undefined; | ||
| }>>; | ||
| cloudProviders: z.ZodOptional<z.ZodString>; | ||
| allowedCloudRegions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| providers: { | ||
| name: string; | ||
| url: string; | ||
| priority: number; | ||
| apiKey?: string | undefined; | ||
| maxTokens?: number | undefined; | ||
| maxDailyCost?: number | undefined; | ||
| }[]; | ||
| routing: { | ||
| strategy: "priority" | "cost-aware" | "latency"; | ||
| complexityThreshold: number; | ||
| localOnly: boolean; | ||
| }; | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }, { | ||
| providers?: { | ||
@@ -237,13 +365,28 @@ name: string; | ||
| } | undefined; | ||
| } | undefined; | ||
| exclude?: string[] | undefined; | ||
| cache?: { | ||
| cloudProviders?: string | undefined; | ||
| allowedCloudRegions?: string[] | undefined; | ||
| }>>; | ||
| exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; | ||
| cache: z.ZodDefault<z.ZodObject<{ | ||
| enabled: z.ZodDefault<z.ZodBoolean>; | ||
| path: z.ZodDefault<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| path: string; | ||
| enabled: boolean; | ||
| }, { | ||
| path?: string | undefined; | ||
| enabled?: boolean | undefined; | ||
| } | undefined; | ||
| format?: "markdown" | "json" | "html" | undefined; | ||
| }>; | ||
| }>>; | ||
| format: z.ZodDefault<z.ZodEnum<["markdown", "json", "html"]>>; | ||
| privacy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| monitoring: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| security: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, z.ZodTypeAny, "passthrough">>; | ||
| type Provider = z.infer<typeof ProviderSchema>; | ||
| type Routing = z.infer<typeof RoutingSchema>; | ||
| type DevDiffConfig = z.infer<typeof ConfigSchema>; | ||
| type DevDiffConfig = z.infer<typeof ConfigSchema> & { | ||
| privacy?: Record<string, any>; | ||
| monitoring?: Record<string, any>; | ||
| security?: Record<string, any>; | ||
| }; | ||
@@ -307,5 +450,233 @@ declare function loadConfig(searchFrom?: string): Promise<DevDiffConfig>; | ||
| get(diffText: string): Promise<CacheEntry | null>; | ||
| set(diffText: string, entry: Omit<CacheEntry, 'timestamp'>): Promise<void>; | ||
| set(diffText: string, entry: Omit<CacheEntry, "timestamp">): Promise<void>; | ||
| } | ||
| export { type AIExplanationResult, type AIProvider, AIRouter, DEFAULTS, type DevDiffConfig, type DiffHunk, type DiffLine, ExplanationCache, type GenerateOptions, type GenerateResult, type ParseResult, type ParsedFileDiff, type Provider, type Routing, SYSTEM_PROMPT, diffParser, formatHTML, formatJSON, formatMarkdown, generateChangelog, loadConfig, redactSecrets, scanForSecrets, trimAST }; | ||
| declare const SECURITY_ADVISORIES: { | ||
| id: string; | ||
| severity: string; | ||
| title: string; | ||
| description: string; | ||
| fix: string; | ||
| cvss: number; | ||
| cwe: string; | ||
| credit: string; | ||
| }[]; | ||
| interface PrivacyDecision { | ||
| allowed: boolean; | ||
| reason?: string; | ||
| requiresUserConsent?: boolean; | ||
| classification?: string; | ||
| } | ||
| declare class PrivacyEnforcer { | ||
| private readonly DATA_CLASSIFICATIONS; | ||
| check(data: any, destination: "local" | "cloud"): PrivacyDecision; | ||
| private classify; | ||
| } | ||
| declare const COMPLIANCE_FRAMEWORKS: Record<string, { | ||
| name: string; | ||
| jurisdiction: string; | ||
| autoConfig: any; | ||
| }>; | ||
| declare function deepMerge(target: any, source: any): any; | ||
| declare function applyCompliance(frameworkId: string, config: DevDiffConfig): Promise<DevDiffConfig>; | ||
| /** | ||
| * WebGPU-Accelerated Local Model Inference | ||
| * Runs in browser and Node.js with GPU adapter. | ||
| * Zero installation. Zero cloud. Zero cost. | ||
| */ | ||
| declare class WebGPUProvider implements AIProvider { | ||
| name: string; | ||
| private device; | ||
| private computePipeline; | ||
| private modelBuffers; | ||
| private kvCache; | ||
| initialize(config?: { | ||
| model: "llama3.2-3b-q4" | "phi3.5-mini-q4" | "gemma2-2b-q4"; | ||
| quantization: "int4" | "int8"; | ||
| }): Promise<void>; | ||
| generate(prompt: string): Promise<AsyncGenerator<string>>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| private loadModel; | ||
| private compileShaders; | ||
| private tokenize; | ||
| private detokenize; | ||
| private sample; | ||
| private get eosToken(); | ||
| private updateKVCache; | ||
| private streamTokens; | ||
| } | ||
| declare class WASMProvider implements AIProvider { | ||
| name: string; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| } | ||
| declare class NativeCPUProvider implements AIProvider { | ||
| name: string; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| } | ||
| /** | ||
| * Automatic fallback: WebGPU → WebAssembly → CPU → Download prompt | ||
| * Ensures AI always works, even without GPU. | ||
| */ | ||
| declare class LocalInferenceChain implements AIProvider { | ||
| name: string; | ||
| private providers; | ||
| initialize(): Promise<void>; | ||
| generateExplanation(diffText: string, modelName: string): Promise<AIExplanationResult>; | ||
| generate(prompt: string): Promise<AsyncGenerator<string>>; | ||
| private checkWebGPU; | ||
| private checkWASM; | ||
| private checkCPU; | ||
| } | ||
| interface Agent { | ||
| id: string; | ||
| role: string; | ||
| model: string; | ||
| personality: any; | ||
| capabilities: string[]; | ||
| } | ||
| interface ProcessedDiff { | ||
| files?: any[]; | ||
| changes?: any[]; | ||
| } | ||
| interface AgentAnalysis { | ||
| agentId: string; | ||
| findings: string[]; | ||
| confidence: number; | ||
| } | ||
| interface AgentMessage { | ||
| from: string; | ||
| to: string; | ||
| type: string; | ||
| content: string; | ||
| confidence: number; | ||
| timestamp: number; | ||
| } | ||
| interface AgentDiscussion { | ||
| messages: AgentMessage[]; | ||
| rounds: number; | ||
| } | ||
| interface Consensus { | ||
| findings: { | ||
| finding: string; | ||
| supportCount: number; | ||
| totalAgents: number; | ||
| consensusScore: number; | ||
| status: "consensus" | "disputed"; | ||
| }[]; | ||
| } | ||
| interface CollaborativeAnalysis { | ||
| consensus: Consensus; | ||
| analyses: AgentAnalysis[]; | ||
| report: string; | ||
| } | ||
| /** | ||
| * Multi-Agent Collaboration Engine | ||
| * Coordinates specialized local agents for comprehensive analysis. | ||
| * All agents run locally. No cloud required. | ||
| */ | ||
| declare class MultiAgentOrchestrator { | ||
| private agents; | ||
| private messageBus; | ||
| initialize(): Promise<void>; | ||
| analyze(diff: ProcessedDiff): Promise<CollaborativeAnalysis>; | ||
| private runAgentAnalysis; | ||
| private generateDiscussionPoint; | ||
| private runAgentDiscussion; | ||
| private buildConsensus; | ||
| private synthesizeReport; | ||
| } | ||
| interface Checkpoint { | ||
| id: string; | ||
| timestamp: number; | ||
| type: "pre-ai-call"; | ||
| snapshot: { | ||
| files: [string, string][]; | ||
| }; | ||
| metadata: { | ||
| trigger: "ai-call"; | ||
| aiModel: string; | ||
| prompt: string; | ||
| }; | ||
| } | ||
| interface VibeSession { | ||
| startedAt: number; | ||
| changes: any[]; | ||
| checkpoints: Checkpoint[]; | ||
| failures: any[]; | ||
| aiCalls: any[]; | ||
| } | ||
| interface RecoveryResult { | ||
| status: "retrying" | "failed-recovered"; | ||
| message: string; | ||
| nextModel?: string; | ||
| checkpointId: string; | ||
| transparency: { | ||
| whatHappened: string; | ||
| why: string; | ||
| whatWasSaved: string; | ||
| whatHappensNext: string; | ||
| howToManualRecover: string; | ||
| }; | ||
| restoredFrom?: string; | ||
| manualActions?: string[]; | ||
| } | ||
| interface VibeSessionReport { | ||
| duration: number; | ||
| totalChanges: number; | ||
| checkpointsCreated: number; | ||
| aiCallsSucceeded: number; | ||
| aiCallsFailed: number; | ||
| dataLossEvents: number; | ||
| guarantee: string; | ||
| recommendations: string[]; | ||
| } | ||
| declare class VibeCoderGuardian { | ||
| session: VibeSession; | ||
| private checkpointDir; | ||
| private sessionPath; | ||
| constructor(); | ||
| loadSession(): Promise<void>; | ||
| saveSession(): Promise<void>; | ||
| deleteSession(): Promise<void>; | ||
| /** | ||
| * Save checkpoint before any AI operation | ||
| */ | ||
| preAICheckpoint(context: { | ||
| files: string[]; | ||
| model: string; | ||
| prompt: string; | ||
| }): Promise<Checkpoint>; | ||
| private captureSnapshot; | ||
| private saveCheckpoint; | ||
| /** | ||
| * Handle AI failure with automatic recovery | ||
| */ | ||
| handleFailure(failure: { | ||
| error: Error; | ||
| model: string; | ||
| checkpointId: string; | ||
| attempt: number; | ||
| }): Promise<RecoveryResult>; | ||
| private getFallbackModel; | ||
| /** | ||
| * Restore from checkpoint — NEVER lose work | ||
| */ | ||
| restoreCheckpoint(checkpointId: string): Promise<void>; | ||
| /** | ||
| * Generate session summary | ||
| */ | ||
| generateReport(): VibeSessionReport; | ||
| private generateRecommendations; | ||
| recordChange(filename: string): void; | ||
| recordAICall(model: string, success: boolean): void; | ||
| } | ||
| export { type AIExplanationResult, type AIProvider, AIRouter, type Agent, type AgentAnalysis, type AgentDiscussion, type AgentMessage, COMPLIANCE_FRAMEWORKS, type Checkpoint, type CollaborativeAnalysis, type Consensus, DEFAULTS, type DevDiffConfig, type DiffHunk, type DiffLine, ExplanationCache, type GenerateOptions, type GenerateResult, LocalInferenceChain, MultiAgentOrchestrator, NativeCPUProvider, type ParseResult, type ParsedFileDiff, type PrivacyDecision, PrivacyEnforcer, type Provider, type RecoveryResult, type Routing, SECURITY_ADVISORIES, SYSTEM_PROMPT, VibeCoderGuardian, type VibeSession, type VibeSessionReport, WASMProvider, WebGPUProvider, applyCompliance, deepMerge, diffParser, formatHTML, formatJSON, formatMarkdown, generateChangelog, loadConfig, redactSecrets, scanForSecrets, trimAST }; |
+3
-2
| { | ||
| "name": "@eldrex/core", | ||
| "version": "1.0.0", | ||
| "version": "1.0.2", | ||
| "description": "Core engine for DevDiff — intelligent, privacy-first changelog generation", | ||
@@ -24,3 +24,4 @@ "type": "module", | ||
| "typescript": "^5.5.0", | ||
| "chalk": "^5.3.0" | ||
| "chalk": "^5.3.0", | ||
| "@eldrex/personas": "1.0.2" | ||
| }, | ||
@@ -27,0 +28,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
464879
75.98%5483
78.77%6
20%18
38.46%10
25%+ Added
+ Added