@getanima/core 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -4
- package/SPEC.md +0 -475
- package/dist/alme/core/KnowledgeGraph.d.ts +0 -58
- package/dist/alme/core/KnowledgeGraph.d.ts.map +0 -1
- package/dist/alme/core/KnowledgeGraph.js +0 -114
- package/dist/alme/core/KnowledgeGraph.js.map +0 -1
- package/dist/alme/core/MetacognitionEngine.d.ts +0 -35
- package/dist/alme/core/MetacognitionEngine.d.ts.map +0 -1
- package/dist/alme/core/MetacognitionEngine.js +0 -90
- package/dist/alme/core/MetacognitionEngine.js.map +0 -1
- package/dist/alme/core/PerformanceAnalyzer.d.ts +0 -68
- package/dist/alme/core/PerformanceAnalyzer.d.ts.map +0 -1
- package/dist/alme/core/PerformanceAnalyzer.js +0 -142
- package/dist/alme/core/PerformanceAnalyzer.js.map +0 -1
- package/dist/alme/core/SelfReflectionModule.d.ts +0 -41
- package/dist/alme/core/SelfReflectionModule.d.ts.map +0 -1
- package/dist/alme/core/SelfReflectionModule.js +0 -101
- package/dist/alme/core/SelfReflectionModule.js.map +0 -1
- package/dist/alme/core/SkillProfile.d.ts +0 -52
- package/dist/alme/core/SkillProfile.d.ts.map +0 -1
- package/dist/alme/core/SkillProfile.js +0 -97
- package/dist/alme/core/SkillProfile.js.map +0 -1
- package/dist/codegen/ArchitecturalDesignGenerator.d.ts +0 -77
- package/dist/codegen/ArchitecturalDesignGenerator.d.ts.map +0 -1
- package/dist/codegen/ArchitecturalDesignGenerator.js +0 -194
- package/dist/codegen/ArchitecturalDesignGenerator.js.map +0 -1
- package/dist/codegen/ContextAwareGenerator.d.ts +0 -67
- package/dist/codegen/ContextAwareGenerator.d.ts.map +0 -1
- package/dist/codegen/ContextAwareGenerator.js +0 -158
- package/dist/codegen/ContextAwareGenerator.js.map +0 -1
- package/dist/codegen/SystemInteractionSimulator.d.ts +0 -87
- package/dist/codegen/SystemInteractionSimulator.d.ts.map +0 -1
- package/dist/codegen/SystemInteractionSimulator.js +0 -203
- package/dist/codegen/SystemInteractionSimulator.js.map +0 -1
- package/dist/codegen/multiStageCodegen.d.ts +0 -30
- package/dist/codegen/multiStageCodegen.d.ts.map +0 -1
- package/dist/codegen/multiStageCodegen.js +0 -60
- package/dist/codegen/multiStageCodegen.js.map +0 -1
- package/dist/ideation/InnovationEngine.d.ts +0 -47
- package/dist/ideation/InnovationEngine.d.ts.map +0 -1
- package/dist/ideation/InnovationEngine.js +0 -127
- package/dist/ideation/InnovationEngine.js.map +0 -1
- package/dist/learning-tracker/LearningVisualizer.d.ts +0 -26
- package/dist/learning-tracker/LearningVisualizer.d.ts.map +0 -1
- package/dist/learning-tracker/LearningVisualizer.js +0 -61
- package/dist/learning-tracker/LearningVisualizer.js.map +0 -1
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.systemInteractionSimulator = exports.SystemInteractionSimulator = void 0;
|
|
4
|
-
const PerformanceAnalyzer_1 = require("../alme/core/PerformanceAnalyzer");
|
|
5
|
-
// Enum for different simulation scenarios
|
|
6
|
-
var SimulationScenario;
|
|
7
|
-
(function (SimulationScenario) {
|
|
8
|
-
SimulationScenario[SimulationScenario["AppBlocking"] = 0] = "AppBlocking";
|
|
9
|
-
SimulationScenario[SimulationScenario["PermissionHandling"] = 1] = "PermissionHandling";
|
|
10
|
-
SimulationScenario[SimulationScenario["ResourceManagement"] = 2] = "ResourceManagement";
|
|
11
|
-
SimulationScenario[SimulationScenario["ErrorRecovery"] = 3] = "ErrorRecovery";
|
|
12
|
-
SimulationScenario[SimulationScenario["PerformanceStress"] = 4] = "PerformanceStress";
|
|
13
|
-
})(SimulationScenario || (SimulationScenario = {}));
|
|
14
|
-
class SystemInteractionSimulator {
|
|
15
|
-
performanceAnalyzer;
|
|
16
|
-
constructor() {
|
|
17
|
-
// Initialize with a mock performance analyzer
|
|
18
|
-
this.performanceAnalyzer = new PerformanceAnalyzer_1.PerformanceAnalyzer(
|
|
19
|
-
// Mock skill profile and knowledge graph
|
|
20
|
-
{}, {});
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Simulate system interaction and code performance
|
|
24
|
-
* @param generatedCode Code to simulate
|
|
25
|
-
* @param config Simulation configuration
|
|
26
|
-
* @returns Detailed simulation results
|
|
27
|
-
*/
|
|
28
|
-
async simulate(generatedCode, config) {
|
|
29
|
-
// 1. Parse and prepare code for simulation
|
|
30
|
-
const preparedCode = this.prepareCodeForSimulation(generatedCode);
|
|
31
|
-
// 2. Set up simulation environment
|
|
32
|
-
const simulationEnvironment = this.setupSimulationEnvironment(config);
|
|
33
|
-
// 3. Execute simulation scenarios
|
|
34
|
-
const scenarioResults = await this.runSimulationScenarios(preparedCode, simulationEnvironment);
|
|
35
|
-
// 4. Analyze performance and generate recommendations
|
|
36
|
-
const performanceAnalysis = this.analyzePerformance(scenarioResults, config);
|
|
37
|
-
// 5. Record performance insights
|
|
38
|
-
this.recordPerformanceInsights(performanceAnalysis);
|
|
39
|
-
return {
|
|
40
|
-
success: performanceAnalysis.overallSuccess,
|
|
41
|
-
performanceMetrics: {
|
|
42
|
-
responseTime: performanceAnalysis.averageResponseTime,
|
|
43
|
-
resourceUtilization: {
|
|
44
|
-
memoryUsage: performanceAnalysis.memoryUtilization,
|
|
45
|
-
cpuLoad: performanceAnalysis.cpuUtilization
|
|
46
|
-
},
|
|
47
|
-
errorRate: performanceAnalysis.errorRate
|
|
48
|
-
},
|
|
49
|
-
recommendations: performanceAnalysis.recommendations
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Prepare code for simulation
|
|
54
|
-
* @param generatedCode Original generated code
|
|
55
|
-
* @returns Simulation-ready code
|
|
56
|
-
*/
|
|
57
|
-
prepareCodeForSimulation(generatedCode) {
|
|
58
|
-
// Add simulation instrumentation
|
|
59
|
-
return `
|
|
60
|
-
// Simulation Instrumentation
|
|
61
|
-
const SimulationTracker = {
|
|
62
|
-
startTime: Date.now(),
|
|
63
|
-
resourceUsage: {
|
|
64
|
-
memoryPeak: 0,
|
|
65
|
-
cpuLoad: 0
|
|
66
|
-
},
|
|
67
|
-
errors: []
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
${generatedCode}
|
|
71
|
-
|
|
72
|
-
// Simulation Metrics Collector
|
|
73
|
-
function collectSimulationMetrics() {
|
|
74
|
-
return {
|
|
75
|
-
executionTime: Date.now() - SimulationTracker.startTime,
|
|
76
|
-
resourceUsage: SimulationTracker.resourceUsage,
|
|
77
|
-
errorCount: SimulationTracker.errors.length
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Set up simulation environment
|
|
84
|
-
* @param config Simulation configuration
|
|
85
|
-
* @returns Prepared simulation environment
|
|
86
|
-
*/
|
|
87
|
-
setupSimulationEnvironment(config) {
|
|
88
|
-
// Simulate different system conditions based on configuration
|
|
89
|
-
return {
|
|
90
|
-
concurrentUsers: config.parameters.concurrentUsers || 1,
|
|
91
|
-
resourceLimits: config.parameters.resourceConstraints || {
|
|
92
|
-
memoryLimit: 512, // MB
|
|
93
|
-
cpuUsage: 50 // Percent
|
|
94
|
-
},
|
|
95
|
-
errorInjectionRate: config.parameters.errorInjectionRate || 0.1
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Run simulation scenarios
|
|
100
|
-
* @param preparedCode Instrumented code
|
|
101
|
-
* @param environment Simulation environment
|
|
102
|
-
* @returns Scenario execution results
|
|
103
|
-
*/
|
|
104
|
-
async runSimulationScenarios(preparedCode, environment) {
|
|
105
|
-
const scenarios = [
|
|
106
|
-
this.simulateAppBlocking(preparedCode, environment),
|
|
107
|
-
this.simulatePermissionHandling(preparedCode, environment),
|
|
108
|
-
this.simulateResourceManagement(preparedCode, environment)
|
|
109
|
-
];
|
|
110
|
-
return Promise.all(scenarios);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Simulate app blocking scenario
|
|
114
|
-
*/
|
|
115
|
-
async simulateAppBlocking(code, environment) {
|
|
116
|
-
// Mock simulation of app blocking logic
|
|
117
|
-
return {
|
|
118
|
-
scenario: SimulationScenario.AppBlocking,
|
|
119
|
-
success: Math.random() > 0.2, // 80% success rate
|
|
120
|
-
performanceMetrics: {
|
|
121
|
-
responseTime: Math.random() * 100, // ms
|
|
122
|
-
resourceUsage: {
|
|
123
|
-
memoryUsage: Math.random() * 100, // MB
|
|
124
|
-
cpuLoad: Math.random() * 50 // Percent
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Simulate permission handling scenario
|
|
131
|
-
*/
|
|
132
|
-
async simulatePermissionHandling(code, environment) {
|
|
133
|
-
// Mock simulation of permission handling
|
|
134
|
-
return {
|
|
135
|
-
scenario: SimulationScenario.PermissionHandling,
|
|
136
|
-
success: Math.random() > 0.1, // 90% success rate
|
|
137
|
-
performanceMetrics: {
|
|
138
|
-
responseTime: Math.random() * 50, // ms
|
|
139
|
-
resourceUsage: {
|
|
140
|
-
memoryUsage: Math.random() * 50, // MB
|
|
141
|
-
cpuLoad: Math.random() * 25 // Percent
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Simulate resource management scenario
|
|
148
|
-
*/
|
|
149
|
-
async simulateResourceManagement(code, environment) {
|
|
150
|
-
// Mock simulation of resource management
|
|
151
|
-
return {
|
|
152
|
-
scenario: SimulationScenario.ResourceManagement,
|
|
153
|
-
success: Math.random() > 0.15, // 85% success rate
|
|
154
|
-
performanceMetrics: {
|
|
155
|
-
responseTime: Math.random() * 75, // ms
|
|
156
|
-
resourceUsage: {
|
|
157
|
-
memoryUsage: Math.random() * 75, // MB
|
|
158
|
-
cpuLoad: Math.random() * 40 // Percent
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Analyze simulation performance
|
|
165
|
-
* @param scenarioResults Simulation scenario results
|
|
166
|
-
* @param config Original simulation configuration
|
|
167
|
-
* @returns Performance analysis
|
|
168
|
-
*/
|
|
169
|
-
analyzePerformance(scenarioResults, config) {
|
|
170
|
-
// Aggregate performance metrics
|
|
171
|
-
const successScenarios = scenarioResults.filter(result => result.success);
|
|
172
|
-
const averageResponseTime = scenarioResults.reduce((sum, result) => sum + result.performanceMetrics.responseTime, 0) / scenarioResults.length;
|
|
173
|
-
const recommendations = [];
|
|
174
|
-
if (successScenarios.length / scenarioResults.length < 0.7) {
|
|
175
|
-
recommendations.push('Improve code reliability');
|
|
176
|
-
}
|
|
177
|
-
if (averageResponseTime > 75) {
|
|
178
|
-
recommendations.push('Optimize performance');
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
overallSuccess: successScenarios.length / scenarioResults.length >= 0.7,
|
|
182
|
-
averageResponseTime,
|
|
183
|
-
memoryUtilization: scenarioResults.reduce((sum, result) => sum + result.performanceMetrics.resourceUsage.memoryUsage, 0) / scenarioResults.length,
|
|
184
|
-
cpuUtilization: scenarioResults.reduce((sum, result) => sum + result.performanceMetrics.resourceUsage.cpuLoad, 0) / scenarioResults.length,
|
|
185
|
-
errorRate: 1 - (successScenarios.length / scenarioResults.length),
|
|
186
|
-
recommendations
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Record performance insights
|
|
191
|
-
* @param performanceAnalysis Detailed performance analysis
|
|
192
|
-
*/
|
|
193
|
-
recordPerformanceInsights(performanceAnalysis) {
|
|
194
|
-
// Use performance analyzer to record insights
|
|
195
|
-
// This is a placeholder - in a real implementation,
|
|
196
|
-
// we'd update the skill profile and knowledge graph
|
|
197
|
-
console.log('Performance Insights Recorded:', performanceAnalysis);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
exports.SystemInteractionSimulator = SystemInteractionSimulator;
|
|
201
|
-
// Singleton instance for global use
|
|
202
|
-
exports.systemInteractionSimulator = new SystemInteractionSimulator();
|
|
203
|
-
//# sourceMappingURL=SystemInteractionSimulator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SystemInteractionSimulator.js","sourceRoot":"","sources":["../../src/codegen/SystemInteractionSimulator.ts"],"names":[],"mappings":";;;AAAA,0EAAuE;AAEvE,0CAA0C;AAC1C,IAAK,kBAMJ;AAND,WAAK,kBAAkB;IACrB,yEAAW,CAAA;IACX,uFAAkB,CAAA;IAClB,uFAAkB,CAAA;IAClB,6EAAa,CAAA;IACb,qFAAiB,CAAA;AACnB,CAAC,EANI,kBAAkB,KAAlB,kBAAkB,QAMtB;AA6BD,MAAa,0BAA0B;IAC7B,mBAAmB,CAAsB;IAEjD;QACE,8CAA8C;QAC9C,IAAI,CAAC,mBAAmB,GAAG,IAAI,yCAAmB;QAChD,yCAAyC;QACzC,EAAS,EACT,EAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,aAAqB,EACrB,MAAwB;QAExB,2CAA2C;QAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAElE,mCAAmC;QACnC,MAAM,qBAAqB,GAAG,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;QAEtE,kCAAkC;QAClC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,sBAAsB,CACvD,YAAY,EACZ,qBAAqB,CACtB,CAAC;QAEF,sDAAsD;QACtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,CACjD,eAAe,EACf,MAAM,CACP,CAAC;QAEF,iCAAiC;QACjC,IAAI,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;QAEpD,OAAO;YACL,OAAO,E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CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;YACjE,eAAe;SAChB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,yBAAyB,CAAC,mBAAwB;QACxD,8CAA8C;QAC9C,qDAAqD;QACrD,oDAAoD;QACpD,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,mBAAmB,CAAC,CAAC;IACrE,CAAC;CACF;AAnPD,gEAmPC;AAED,oCAAoC;AACvB,QAAA,0BAA0B,GAAG,IAAI,0BAA0B,EAAE,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CodeGenerationStrategy } from './codeGenerationStrategy';
|
|
2
|
-
/**
|
|
3
|
-
* Multi-Stage Code Generation Framework
|
|
4
|
-
* Provides intelligent, context-aware code generation
|
|
5
|
-
*/
|
|
6
|
-
export declare class MultiStageCodeGenerator {
|
|
7
|
-
private context;
|
|
8
|
-
private strategies;
|
|
9
|
-
private simulator;
|
|
10
|
-
constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Add a code generation strategy
|
|
13
|
-
* @param strategy Specific code generation approach
|
|
14
|
-
*/
|
|
15
|
-
addStrategy(strategy: CodeGenerationStrategy): void;
|
|
16
|
-
/**
|
|
17
|
-
* Generate code through multiple refinement stages
|
|
18
|
-
* @param initialRequirement Initial project/code requirement
|
|
19
|
-
* @returns Refined, production-ready code
|
|
20
|
-
*/
|
|
21
|
-
generateCode(initialRequirement: string): Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Refine code based on simulation feedback
|
|
24
|
-
* @param code Current generated code
|
|
25
|
-
* @param feedback Validation feedback
|
|
26
|
-
* @returns Improved code
|
|
27
|
-
*/
|
|
28
|
-
private refineCode;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=multiStageCodegen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiStageCodegen.d.ts","sourceRoot":"","sources":["../../src/codegen/multiStageCodegen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,SAAS,CAA6B;;IAQ9C;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,sBAAsB;IAI5C;;;;OAIG;IACG,YAAY,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB/D;;;;;OAKG;YACW,UAAU;CAKzB"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MultiStageCodeGenerator = void 0;
|
|
4
|
-
const architecturalContext_1 = require("./architecturalContext");
|
|
5
|
-
const systemInteractionSimulator_1 = require("./systemInteractionSimulator");
|
|
6
|
-
/**
|
|
7
|
-
* Multi-Stage Code Generation Framework
|
|
8
|
-
* Provides intelligent, context-aware code generation
|
|
9
|
-
*/
|
|
10
|
-
class MultiStageCodeGenerator {
|
|
11
|
-
context;
|
|
12
|
-
strategies;
|
|
13
|
-
simulator;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.context = new architecturalContext_1.ArchitecturalContext();
|
|
16
|
-
this.strategies = [];
|
|
17
|
-
this.simulator = new systemInteractionSimulator_1.SystemInteractionSimulator();
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Add a code generation strategy
|
|
21
|
-
* @param strategy Specific code generation approach
|
|
22
|
-
*/
|
|
23
|
-
addStrategy(strategy) {
|
|
24
|
-
this.strategies.push(strategy);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Generate code through multiple refinement stages
|
|
28
|
-
* @param initialRequirement Initial project/code requirement
|
|
29
|
-
* @returns Refined, production-ready code
|
|
30
|
-
*/
|
|
31
|
-
async generateCode(initialRequirement) {
|
|
32
|
-
// Stage 1: Initial requirements analysis
|
|
33
|
-
const analyzedContext = this.context.analyze(initialRequirement);
|
|
34
|
-
// Stage 2: Strategy selection and application
|
|
35
|
-
let generatedCode = '';
|
|
36
|
-
for (const strategy of this.strategies) {
|
|
37
|
-
generatedCode = await strategy.generate(analyzedContext);
|
|
38
|
-
}
|
|
39
|
-
// Stage 3: System interaction simulation and validation
|
|
40
|
-
const validationResult = await this.simulator.validate(generatedCode);
|
|
41
|
-
// Stage 4: Refinement based on simulation
|
|
42
|
-
if (!validationResult.isValid) {
|
|
43
|
-
generatedCode = await this.refineCode(generatedCode, validationResult.feedback);
|
|
44
|
-
}
|
|
45
|
-
return generatedCode;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Refine code based on simulation feedback
|
|
49
|
-
* @param code Current generated code
|
|
50
|
-
* @param feedback Validation feedback
|
|
51
|
-
* @returns Improved code
|
|
52
|
-
*/
|
|
53
|
-
async refineCode(code, feedback) {
|
|
54
|
-
// Implementation of intelligent code refinement
|
|
55
|
-
// TODO: Implement advanced refinement logic
|
|
56
|
-
return code;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.MultiStageCodeGenerator = MultiStageCodeGenerator;
|
|
60
|
-
//# sourceMappingURL=multiStageCodegen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiStageCodegen.js","sourceRoot":"","sources":["../../src/codegen/multiStageCodegen.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAE9D,6EAA0E;AAE1E;;;GAGG;AACH,MAAa,uBAAuB;IAC1B,OAAO,CAAuB;IAC9B,UAAU,CAA2B;IACrC,SAAS,CAA6B;IAE9C;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,2CAAoB,EAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,uDAA0B,EAAE,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,QAAgC;QAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAAC,kBAA0B;QAC3C,yCAAyC;QACzC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEjE,8CAA8C;QAC9C,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,aAAa,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3D,CAAC;QAED,wDAAwD;QACxD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAEtE,0CAA0C;QAC1C,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC9B,aAAa,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,QAAgB;QACrD,gDAAgD;QAChD,4CAA4C;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxDD,0DAwDC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { KnowledgeGraph } from '../alme/core/KnowledgeGraph';
|
|
2
|
-
declare enum IdeationTechnique {
|
|
3
|
-
ParadoxicalThinking = 0,
|
|
4
|
-
InverseReality = 1,
|
|
5
|
-
CrossDomainSynthesis = 2,
|
|
6
|
-
ExtremeConstraints = 3,
|
|
7
|
-
RandomConnectionGeneration = 4,
|
|
8
|
-
FirstPrinciplesAnalysis = 5
|
|
9
|
-
}
|
|
10
|
-
interface IdeaCandidate {
|
|
11
|
-
concept: string;
|
|
12
|
-
innovationScore: number;
|
|
13
|
-
potentialImpact: 'incremental' | 'transformative' | 'disruptive';
|
|
14
|
-
generationTechnique: IdeationTechnique;
|
|
15
|
-
relatedDomains: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare class InnovationEngine {
|
|
18
|
-
private knowledgeGraph;
|
|
19
|
-
private ideaHistory;
|
|
20
|
-
constructor(knowledgeGraph: KnowledgeGraph);
|
|
21
|
-
/**
|
|
22
|
-
* Generate breakthrough ideas
|
|
23
|
-
* @param initialContext Starting domain or problem
|
|
24
|
-
* @returns Array of innovative idea candidates
|
|
25
|
-
*/
|
|
26
|
-
generateIdeas(initialContext: string, complexity?: number): IdeaCandidate[];
|
|
27
|
-
private ideationTechniqueMap;
|
|
28
|
-
/**
|
|
29
|
-
* Select ideation techniques based on complexity
|
|
30
|
-
*/
|
|
31
|
-
private selectIdeationTechniques;
|
|
32
|
-
/**
|
|
33
|
-
* Rank generated ideas
|
|
34
|
-
*/
|
|
35
|
-
private rankIdeas;
|
|
36
|
-
/**
|
|
37
|
-
* Update knowledge ecosystem with new ideas
|
|
38
|
-
*/
|
|
39
|
-
private updateKnowledgeEcosystem;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieve idea generation history
|
|
42
|
-
*/
|
|
43
|
-
getIdeaHistory(limit?: number): IdeaCandidate[];
|
|
44
|
-
}
|
|
45
|
-
export declare const innovationEngine: InnovationEngine;
|
|
46
|
-
export {};
|
|
47
|
-
//# sourceMappingURL=InnovationEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InnovationEngine.d.ts","sourceRoot":"","sources":["../../src/ideation/InnovationEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,aAAK,iBAAiB;IACpB,mBAAmB,IAAA;IACnB,cAAc,IAAA;IACd,oBAAoB,IAAA;IACpB,kBAAkB,IAAA;IAClB,0BAA0B,IAAA;IAC1B,uBAAuB,IAAA;CACxB;AAED,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,aAAa,GAAG,gBAAgB,GAAG,YAAY,CAAC;IACjE,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,WAAW,CAAuB;gBAE9B,cAAc,EAAE,cAAc;IAI1C;;;;OAIG;IACH,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,GAAE,MAAU,GAAG,aAAa,EAAE;IAmB9E,OAAO,CAAC,oBAAoB,CA4C1B;IAEF;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAOhC;;OAEG;IACH,OAAO,CAAC,SAAS;IASjB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAehC;;OAEG;IACH,cAAc,CAAC,KAAK,GAAE,MAAW,GAAG,aAAa,EAAE;CAKpD;AAGD,eAAO,MAAM,gBAAgB,kBAA6C,CAAC"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.innovationEngine = exports.InnovationEngine = void 0;
|
|
4
|
-
const KnowledgeGraph_1 = require("../alme/core/KnowledgeGraph");
|
|
5
|
-
var IdeationTechnique;
|
|
6
|
-
(function (IdeationTechnique) {
|
|
7
|
-
IdeationTechnique[IdeationTechnique["ParadoxicalThinking"] = 0] = "ParadoxicalThinking";
|
|
8
|
-
IdeationTechnique[IdeationTechnique["InverseReality"] = 1] = "InverseReality";
|
|
9
|
-
IdeationTechnique[IdeationTechnique["CrossDomainSynthesis"] = 2] = "CrossDomainSynthesis";
|
|
10
|
-
IdeationTechnique[IdeationTechnique["ExtremeConstraints"] = 3] = "ExtremeConstraints";
|
|
11
|
-
IdeationTechnique[IdeationTechnique["RandomConnectionGeneration"] = 4] = "RandomConnectionGeneration";
|
|
12
|
-
IdeationTechnique[IdeationTechnique["FirstPrinciplesAnalysis"] = 5] = "FirstPrinciplesAnalysis";
|
|
13
|
-
})(IdeationTechnique || (IdeationTechnique = {}));
|
|
14
|
-
class InnovationEngine {
|
|
15
|
-
knowledgeGraph;
|
|
16
|
-
ideaHistory = [];
|
|
17
|
-
constructor(knowledgeGraph) {
|
|
18
|
-
this.knowledgeGraph = knowledgeGraph;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Generate breakthrough ideas
|
|
22
|
-
* @param initialContext Starting domain or problem
|
|
23
|
-
* @returns Array of innovative idea candidates
|
|
24
|
-
*/
|
|
25
|
-
generateIdeas(initialContext, complexity = 3) {
|
|
26
|
-
const techniques = this.selectIdeationTechniques(complexity);
|
|
27
|
-
const ideas = [];
|
|
28
|
-
techniques.forEach(technique => {
|
|
29
|
-
const ideaGenerator = this.ideationTechniqueMap[technique];
|
|
30
|
-
const generatedIdeas = ideaGenerator(initialContext);
|
|
31
|
-
ideas.push(...generatedIdeas);
|
|
32
|
-
});
|
|
33
|
-
// Rank and filter ideas
|
|
34
|
-
const rankedIdeas = this.rankIdeas(ideas);
|
|
35
|
-
// Update idea history and knowledge graph
|
|
36
|
-
this.updateKnowledgeEcosystem(rankedIdeas);
|
|
37
|
-
return rankedIdeas.slice(0, 5); // Top 5 ideas
|
|
38
|
-
}
|
|
39
|
-
ideationTechniqueMap = {
|
|
40
|
-
[IdeationTechnique.ParadoxicalThinking]: (context) => {
|
|
41
|
-
const paradoxes = [
|
|
42
|
-
`What if ${context} was completely opposite?`,
|
|
43
|
-
`How would ${context} work if its core assumption was wrong?`,
|
|
44
|
-
`Explore ${context} by deliberately challenging its fundamental logic`
|
|
45
|
-
];
|
|
46
|
-
return paradoxes.map(paradox => ({
|
|
47
|
-
concept: paradox,
|
|
48
|
-
innovationScore: Math.random() * 0.7 + 0.3,
|
|
49
|
-
potentialImpact: 'transformative',
|
|
50
|
-
generationTechnique: IdeationTechnique.ParadoxicalThinking,
|
|
51
|
-
relatedDomains: [context, 'critical_thinking']
|
|
52
|
-
}));
|
|
53
|
-
},
|
|
54
|
-
[IdeationTechnique.CrossDomainSynthesis]: (context) => {
|
|
55
|
-
const randomDomains = ['biology', 'quantum physics', 'ancient philosophy', 'neuroscience'];
|
|
56
|
-
return randomDomains.map(domain => ({
|
|
57
|
-
concept: `Apply ${domain} principles to ${context}`,
|
|
58
|
-
innovationScore: Math.random() * 0.8 + 0.2,
|
|
59
|
-
potentialImpact: 'disruptive',
|
|
60
|
-
generationTechnique: IdeationTechnique.CrossDomainSynthesis,
|
|
61
|
-
relatedDomains: [context, domain]
|
|
62
|
-
}));
|
|
63
|
-
},
|
|
64
|
-
[IdeationTechnique.ExtremeConstraints]: (context) => {
|
|
65
|
-
const constraints = [
|
|
66
|
-
`Solve ${context} with zero budget`,
|
|
67
|
-
`${context} implementation using only analog technologies`,
|
|
68
|
-
`Redesign ${context} for users with extreme limitations`
|
|
69
|
-
];
|
|
70
|
-
return constraints.map(constraint => ({
|
|
71
|
-
concept: constraint,
|
|
72
|
-
innovationScore: Math.random() * 0.6 + 0.4,
|
|
73
|
-
potentialImpact: 'incremental',
|
|
74
|
-
generationTechnique: IdeationTechnique.ExtremeConstraints,
|
|
75
|
-
relatedDomains: [context, 'constraint_innovation']
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Select ideation techniques based on complexity
|
|
81
|
-
*/
|
|
82
|
-
selectIdeationTechniques(complexity) {
|
|
83
|
-
const allTechniques = Object.values(IdeationTechnique);
|
|
84
|
-
return allTechniques
|
|
85
|
-
.sort(() => 0.5 - Math.random())
|
|
86
|
-
.slice(0, complexity);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Rank generated ideas
|
|
90
|
-
*/
|
|
91
|
-
rankIdeas(ideas) {
|
|
92
|
-
return ideas
|
|
93
|
-
.sort((a, b) => b.innovationScore - a.innovationScore)
|
|
94
|
-
.map(idea => ({
|
|
95
|
-
...idea,
|
|
96
|
-
innovationScore: Number(idea.innovationScore.toFixed(2))
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Update knowledge ecosystem with new ideas
|
|
101
|
-
*/
|
|
102
|
-
updateKnowledgeEcosystem(ideas) {
|
|
103
|
-
ideas.forEach(idea => {
|
|
104
|
-
this.knowledgeGraph.addNode(idea.concept, 'idea', {
|
|
105
|
-
metadata: {
|
|
106
|
-
innovationScore: idea.innovationScore,
|
|
107
|
-
potentialImpact: idea.potentialImpact,
|
|
108
|
-
generationTechnique: idea.generationTechnique
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
// Store in idea history for future reference
|
|
112
|
-
this.ideaHistory.push(idea);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Retrieve idea generation history
|
|
117
|
-
*/
|
|
118
|
-
getIdeaHistory(limit = 10) {
|
|
119
|
-
return this.ideaHistory
|
|
120
|
-
.sort((a, b) => b.innovationScore - a.innovationScore)
|
|
121
|
-
.slice(0, limit);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.InnovationEngine = InnovationEngine;
|
|
125
|
-
// Singleton instance
|
|
126
|
-
exports.innovationEngine = new InnovationEngine(new KnowledgeGraph_1.KnowledgeGraph());
|
|
127
|
-
//# sourceMappingURL=InnovationEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InnovationEngine.js","sourceRoot":"","sources":["../../src/ideation/InnovationEngine.ts"],"names":[],"mappings":";;;AAAA,gEAA6D;AAE7D,IAAK,iBAOJ;AAPD,WAAK,iBAAiB;IACpB,uFAAmB,CAAA;IACnB,6EAAc,CAAA;IACd,yFAAoB,CAAA;IACpB,qFAAkB,CAAA;IAClB,qGAA0B,CAAA;IAC1B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KAAK,CAAC,CAAC;IACrB,CAAC;CACF;AA9HD,4CA8HC;AAED,qBAAqB;AACR,QAAA,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,+BAAc,EAAE,CAAC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare class LearningVisualizer {
|
|
2
|
-
private learningLog;
|
|
3
|
-
/**
|
|
4
|
-
* Log a learning event with full transparency
|
|
5
|
-
*/
|
|
6
|
-
logLearningEvent(event: {
|
|
7
|
-
context: string;
|
|
8
|
-
type: string;
|
|
9
|
-
score: number;
|
|
10
|
-
outcome: string;
|
|
11
|
-
}): void;
|
|
12
|
-
/**
|
|
13
|
-
* Generate a human-readable learning report
|
|
14
|
-
*/
|
|
15
|
-
generateLearningReport(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Write learning report to a visible file
|
|
18
|
-
*/
|
|
19
|
-
private writeReportToFile;
|
|
20
|
-
/**
|
|
21
|
-
* Provide a way to inspect recent learning events
|
|
22
|
-
*/
|
|
23
|
-
getRecentLearningEvents(limit?: number): any[];
|
|
24
|
-
}
|
|
25
|
-
export declare const learningVisualizer: LearningVisualizer;
|
|
26
|
-
//# sourceMappingURL=LearningVisualizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LearningVisualizer.d.ts","sourceRoot":"","sources":["../../src/learning-tracker/LearningVisualizer.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAE7B,OAAO,CAAC,WAAW,CAMX;IAER;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI;IAaR;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAiBhC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,uBAAuB,CAAC,KAAK,GAAE,MAAW,GAAG,GAAG,EAAE;CAGnD;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.learningVisualizer = exports.LearningVisualizer = void 0;
|
|
4
|
-
class LearningVisualizer {
|
|
5
|
-
// Detailed learning event logging
|
|
6
|
-
learningLog = [];
|
|
7
|
-
/**
|
|
8
|
-
* Log a learning event with full transparency
|
|
9
|
-
*/
|
|
10
|
-
logLearningEvent(event) {
|
|
11
|
-
const logEntry = {
|
|
12
|
-
timestamp: Date.now(),
|
|
13
|
-
conversationContext: event.context,
|
|
14
|
-
insightType: event.type,
|
|
15
|
-
significanceScore: event.score,
|
|
16
|
-
learningOutcome: event.outcome
|
|
17
|
-
};
|
|
18
|
-
this.learningLog.push(logEntry);
|
|
19
|
-
this.generateLearningReport();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Generate a human-readable learning report
|
|
23
|
-
*/
|
|
24
|
-
generateLearningReport() {
|
|
25
|
-
const report = this.learningLog
|
|
26
|
-
.map(entry => `
|
|
27
|
-
[${new Date(entry.timestamp).toLocaleString()}]
|
|
28
|
-
Context: ${entry.conversationContext}
|
|
29
|
-
Insight Type: ${entry.insightType}
|
|
30
|
-
Significance: ${(entry.significanceScore * 100).toFixed(2)}%
|
|
31
|
-
Outcome: ${entry.learningOutcome}
|
|
32
|
-
---`)
|
|
33
|
-
.join('\n');
|
|
34
|
-
// Optionally write to a visible log file
|
|
35
|
-
this.writeReportToFile(report);
|
|
36
|
-
return report;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Write learning report to a visible file
|
|
40
|
-
*/
|
|
41
|
-
writeReportToFile(report) {
|
|
42
|
-
const fs = require('fs');
|
|
43
|
-
const logFilePath = 'C:\\Users\\memom\\memory\\learning-logs\\learning-log.txt';
|
|
44
|
-
// Ensure directory exists
|
|
45
|
-
const logDirectory = 'C:\\Users\\memom\\memory\\learning-logs';
|
|
46
|
-
if (!fs.existsSync(logDirectory)) {
|
|
47
|
-
fs.mkdirSync(logDirectory, { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
fs.appendFileSync(logFilePath, report + '\n\n');
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Provide a way to inspect recent learning events
|
|
53
|
-
*/
|
|
54
|
-
getRecentLearningEvents(limit = 10) {
|
|
55
|
-
return this.learningLog.slice(-limit);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.LearningVisualizer = LearningVisualizer;
|
|
59
|
-
// Singleton instance for tracking
|
|
60
|
-
exports.learningVisualizer = new LearningVisualizer();
|
|
61
|
-
//# sourceMappingURL=LearningVisualizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LearningVisualizer.js","sourceRoot":"","sources":["../../src/learning-tracker/LearningVisualizer.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,kCAAkC;IAC1B,WAAW,GAMd,EAAE,CAAC;IAER;;OAEG;IACH,gBAAgB,CAAC,KAKhB;QACC,MAAM,QAAQ,GAAG;YACf,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,mBAAmB,EAAE,KAAK,CAAC,OAAO;YAClC,WAAW,EAAE,KAAK,CAAC,IAAI;YACvB,iBAAiB,EAAE,KAAK,CAAC,KAAK;YAC9B,eAAe,EAAE,KAAK,CAAC,OAAO;SAC/B,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW;aAC5B,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;GACjB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,C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