@quantumai/quantum-cli-core
Version:
Quantum CLI Core - Multi-LLM Collaboration System
53 lines • 1.71 kB
JavaScript
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export class PreferenceEngine {
preferences;
interactions = [];
constructor() {
this.preferences = {
learningStyle: 'guided',
interestedAreas: [],
preferredComplexity: 'beginner',
};
}
getPreferences() {
return this.preferences;
}
recordInteraction(interaction) {
this.interactions.push(interaction);
// Keep only recent interactions (last 1000)
if (this.interactions.length > 1000) {
this.interactions = this.interactions.slice(-1000);
}
// Update preferences based on interaction
this.updatePreferences(interaction);
}
updatePreferences(interaction) {
// Simple heuristics for preference learning
switch (interaction.type) {
case 'feature_completion':
if (!this.preferences.interestedAreas.includes('productivity')) {
this.preferences.interestedAreas.push('productivity');
}
break;
case 'collaboration_usage':
if (!this.preferences.interestedAreas.includes('collaboration')) {
this.preferences.interestedAreas.push('collaboration');
}
break;
case 'setting_applied':
// Learn from successful setting applications
break;
default:
// Other interaction types
break;
}
}
getInteractionHistory() {
return this.interactions;
}
}
//# sourceMappingURL=preference-engine.js.map