this.me 2.2.2 → 2.2.3
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/index.js +70 -1
- package/main.js +0 -68
- package/package.json +2 -1
- package/compareit.js +0 -47
- package/mainoLD.js +0 -162
- package/neurons.js +0 -4
- package/x.js +0 -100
- package/y.js +0 -207
package/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
//main entry point to .me suite. Happy bizarre coding....
|
|
2
|
+
const readline = require('readline');
|
|
3
|
+
const neurons = require('neurons.me');
|
|
4
|
+
const cleakerShell = require('cleaker/shell');
|
|
5
|
+
const Menu = require('this.me/src/utils');
|
|
6
|
+
// Other imports ...
|
|
1
7
|
console.log(`
|
|
2
8
|
___________
|
|
3
9
|
[------------]
|
|
@@ -13,4 +19,67 @@ console.log(`
|
|
|
13
19
|
[---------------------------------.me-----------]
|
|
14
20
|
-^^^^^^^^zzzz...
|
|
15
21
|
Welcome to .me - Your AI Playground
|
|
16
|
-
`);
|
|
22
|
+
`);
|
|
23
|
+
// .me Main entry function
|
|
24
|
+
function main() {
|
|
25
|
+
const rl = readline.createInterface({
|
|
26
|
+
input: process.stdin,
|
|
27
|
+
output: process.stdout,
|
|
28
|
+
});
|
|
29
|
+
mainMenu(rl);
|
|
30
|
+
rl.setPrompt('Select module (.me)> ');
|
|
31
|
+
rl.prompt();
|
|
32
|
+
rl.on('line', (input) => {
|
|
33
|
+
switch (input.trim()) {
|
|
34
|
+
case '1':
|
|
35
|
+
const neuronsShell = neurons.shell(rl); // Call neurons.shell to get the object
|
|
36
|
+
neurons.shell(rl).init(); // initiate neurons.me
|
|
37
|
+
break;
|
|
38
|
+
case '2':
|
|
39
|
+
cleakerShell(rl);
|
|
40
|
+
break;
|
|
41
|
+
// Add other cases...
|
|
42
|
+
case '/q':
|
|
43
|
+
rl.close();
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
console.log('Invalid option. Please choose a valid module.');
|
|
47
|
+
rl.prompt();
|
|
48
|
+
}
|
|
49
|
+
}).on('close', () => {
|
|
50
|
+
console.log('Exiting .me');
|
|
51
|
+
process.exit(0);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function mainMenu(rl) {
|
|
55
|
+
console.log('\nChoose a module to get started:');
|
|
56
|
+
console.log('1. neurons.me - Manage neural networks');
|
|
57
|
+
console.log('2. cleaker - Work with Cleaker application');
|
|
58
|
+
console.log('\ntype /q to exit');
|
|
59
|
+
rl.prompt();
|
|
60
|
+
}
|
|
61
|
+
// NEURONS.ME SECTION
|
|
62
|
+
function neuronsModule(rl) {
|
|
63
|
+
class NeuronsMeApp {
|
|
64
|
+
constructor() {
|
|
65
|
+
this.rl = rl;
|
|
66
|
+
this.currentMenu = new neuronsme_MainMenu(this);
|
|
67
|
+
this.currentMenu.display(); // Display the main menu
|
|
68
|
+
}
|
|
69
|
+
// ... Rest of your neurons.me related code
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class neuronsme_MainMenu extends Menu {
|
|
73
|
+
// ... Your existing code for the neurons menu
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Other neurons classes...
|
|
77
|
+
|
|
78
|
+
const neurons_me_app_init = new NeuronsMeApp();
|
|
79
|
+
neurons_me_app_init.start();
|
|
80
|
+
}
|
|
81
|
+
// CLEAKER SECTION
|
|
82
|
+
function cleakerModule(rl) {
|
|
83
|
+
// Implement the cleaker module here
|
|
84
|
+
}
|
|
85
|
+
main();
|
package/main.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//main entry point to .me suite. Happy bizarre coding....
|
|
3
|
-
const readline = require('readline');
|
|
4
|
-
const neurons = require('neurons.me');
|
|
5
|
-
const cleakerShell = require('cleaker/shell');
|
|
6
|
-
const Menu = require('this.me/src/utils');
|
|
7
|
-
// Other imports ...
|
|
8
2
|
console.log(`
|
|
9
3
|
___________
|
|
10
4
|
[------------]
|
|
@@ -21,66 +15,4 @@ console.log(`
|
|
|
21
15
|
-^^^^^^^^zzzz...
|
|
22
16
|
Welcome to .me - Your AI Playground
|
|
23
17
|
`);
|
|
24
|
-
// .me Main entry function
|
|
25
|
-
function main() {
|
|
26
|
-
const rl = readline.createInterface({
|
|
27
|
-
input: process.stdin,
|
|
28
|
-
output: process.stdout,
|
|
29
|
-
});
|
|
30
|
-
mainMenu(rl);
|
|
31
|
-
rl.setPrompt('Select module (.me)> ');
|
|
32
|
-
rl.prompt();
|
|
33
|
-
rl.on('line', (input) => {
|
|
34
|
-
switch (input.trim()) {
|
|
35
|
-
case '1':
|
|
36
|
-
const neuronsShell = neurons.shell(rl); // Call neurons.shell to get the object
|
|
37
|
-
neurons.shell(rl).init(); // initiate neurons.me
|
|
38
|
-
break;
|
|
39
|
-
case '2':
|
|
40
|
-
cleakerShell(rl);
|
|
41
|
-
break;
|
|
42
|
-
// Add other cases...
|
|
43
|
-
case '/q':
|
|
44
|
-
rl.close();
|
|
45
|
-
break;
|
|
46
|
-
default:
|
|
47
|
-
console.log('Invalid option. Please choose a valid module.');
|
|
48
|
-
rl.prompt();
|
|
49
|
-
}
|
|
50
|
-
}).on('close', () => {
|
|
51
|
-
console.log('Exiting .me');
|
|
52
|
-
process.exit(0);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function mainMenu(rl) {
|
|
56
|
-
console.log('\nChoose a module to get started:');
|
|
57
|
-
console.log('1. neurons.me - Manage neural networks');
|
|
58
|
-
console.log('2. cleaker - Work with Cleaker application');
|
|
59
|
-
console.log('\ntype /q to exit');
|
|
60
|
-
rl.prompt();
|
|
61
|
-
}
|
|
62
|
-
// NEURONS.ME SECTION
|
|
63
|
-
function neuronsModule(rl) {
|
|
64
|
-
class NeuronsMeApp {
|
|
65
|
-
constructor() {
|
|
66
|
-
this.rl = rl;
|
|
67
|
-
this.currentMenu = new neuronsme_MainMenu(this);
|
|
68
|
-
this.currentMenu.display(); // Display the main menu
|
|
69
|
-
}
|
|
70
|
-
// ... Rest of your neurons.me related code
|
|
71
|
-
}
|
|
72
18
|
|
|
73
|
-
class neuronsme_MainMenu extends Menu {
|
|
74
|
-
// ... Your existing code for the neurons menu
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Other neurons classes...
|
|
78
|
-
|
|
79
|
-
const neurons_me_app_init = new NeuronsMeApp();
|
|
80
|
-
neurons_me_app_init.start();
|
|
81
|
-
}
|
|
82
|
-
// CLEAKER SECTION
|
|
83
|
-
function cleakerModule(rl) {
|
|
84
|
-
// Implement the cleaker module here
|
|
85
|
-
}
|
|
86
|
-
main();
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "this.me",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "CLI for managing the .me suite.",
|
|
5
5
|
"bin": {
|
|
6
6
|
".me": "./main.js"
|
|
7
7
|
},
|
|
8
8
|
"main": "main.js",
|
|
9
9
|
"scripts": {
|
|
10
|
+
"start": "node main.js",
|
|
10
11
|
"test": "test"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
package/compareit.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// ./src/NeuronsHandler.js
|
|
2
|
-
const neurons = require('neurons.me');
|
|
3
|
-
const { logError } = require('@sui.gn/me/src/errorHandler');
|
|
4
|
-
const { showMenu } = require('./utils');
|
|
5
|
-
const prompt = (rl, question) => new Promise((resolve) => rl.question(question, resolve));
|
|
6
|
-
//neuron handler
|
|
7
|
-
module.exports = (rl) => {
|
|
8
|
-
// Other functions...
|
|
9
|
-
|
|
10
|
-
const neuronConfig = async (rl, neuron, updateNeuronProperties, cloneNeuron, showMenu) => {
|
|
11
|
-
// Other code...
|
|
12
|
-
switch (action.trim()) {
|
|
13
|
-
case '1':
|
|
14
|
-
await updateNeuronProperties(neuron, rl, cloneNeuron, showMenu);
|
|
15
|
-
break;
|
|
16
|
-
case '2':
|
|
17
|
-
await cloneNeuron(neuron, rl, updateNeuronProperties, showMenu);
|
|
18
|
-
break;
|
|
19
|
-
case '3':
|
|
20
|
-
showNeuronMenu();
|
|
21
|
-
break;
|
|
22
|
-
case '4':
|
|
23
|
-
showMenu(rl, showNeuronMenu);
|
|
24
|
-
break;
|
|
25
|
-
default:
|
|
26
|
-
console.log('Invalid action. Back to Neuron Menu.');
|
|
27
|
-
showNeuronMenu();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const createNeuron = async (rl, updateNeuronProperties, cloneNeuron, showMenu) => {
|
|
32
|
-
// Other code...
|
|
33
|
-
await neuronConfig(rl, neuron, updateNeuronProperties, cloneNeuron, showMenu);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Other functions...
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
showNeuronMenu,
|
|
40
|
-
promptNeuronConfig,
|
|
41
|
-
listAllNeurons,
|
|
42
|
-
createNeuron,
|
|
43
|
-
neuronConfig,
|
|
44
|
-
updateNeuronProperties,
|
|
45
|
-
cloneNeuron
|
|
46
|
-
};
|
|
47
|
-
}
|
package/mainoLD.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
const readline = require('readline');
|
|
2
|
-
const neurons = require('neurons.me');
|
|
3
|
-
const { logError } = require('./src/errorHandler');
|
|
4
|
-
const Menu = require('./src/utils'); // Import Menu class
|
|
5
|
-
const NeuronsHandler = require('@sui.gn/me/src/NeuronsHandler');
|
|
6
|
-
const NeuralNetworksHandler = require('@sui.gn/me/src/NeuralNetworksHandler');
|
|
7
|
-
const LayersHandler = require('@sui.gn/me/src/LayersHandler');
|
|
8
|
-
|
|
9
|
-
class MainApp {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.rl = readline.createInterface({
|
|
12
|
-
input: process.stdin,
|
|
13
|
-
output: process.stdout,
|
|
14
|
-
});
|
|
15
|
-
this.displayMainMenu();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
displayMainMenu() {
|
|
19
|
-
console.log('\nWelcome to .me CLI! Choose a module to get started:\n');
|
|
20
|
-
console.log('1. neurons - Manage neural networks');
|
|
21
|
-
console.log('2. cleaker - Work with Cleaker application');
|
|
22
|
-
console.log('3. v:// - Kind of like c path');
|
|
23
|
-
console.log('\ntype /q to exit');
|
|
24
|
-
this.rl.prompt();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
start() {
|
|
28
|
-
this.rl.on('line', (input) => {
|
|
29
|
-
switch (input.trim()) {
|
|
30
|
-
case '1':
|
|
31
|
-
neuronsHandler.run(this.rl); // Run neurons module
|
|
32
|
-
break;
|
|
33
|
-
// Handle other cases...
|
|
34
|
-
}
|
|
35
|
-
}).on('close', () => {
|
|
36
|
-
console.log('Exiting .me');
|
|
37
|
-
process.exit(0);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const app = new MainApp();
|
|
43
|
-
app.start();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//NEURONS.ME SECTION
|
|
48
|
-
class neuronsme_MainMenu extends Menu {
|
|
49
|
-
constructor(app) {
|
|
50
|
-
super(app.rl);
|
|
51
|
-
this.app = app; // Store the reference to the main app
|
|
52
|
-
}
|
|
53
|
-
async display() {
|
|
54
|
-
console.log('\nRunning .me! Your AI playground.\n');
|
|
55
|
-
console.log('┌──────────────────────────────────────────┐');
|
|
56
|
-
console.log('│ MAIN MENU │');
|
|
57
|
-
console.log('└──────────────────────────────────────────┘');
|
|
58
|
-
console.log('\ntype /q to exit:');
|
|
59
|
-
console.log('1. Neurons: Create, list, update, and delete neurons');
|
|
60
|
-
console.log('2. Neural Networks: Create, list, update, and delete neural networks');
|
|
61
|
-
console.log('3. Layers: Create, list, update, and delete layers');
|
|
62
|
-
console.log('4. Show Info...');
|
|
63
|
-
this.rl.prompt();
|
|
64
|
-
}
|
|
65
|
-
async handleInput(input) {
|
|
66
|
-
switch (input) {
|
|
67
|
-
case '/q':
|
|
68
|
-
this.rl.close();
|
|
69
|
-
break;
|
|
70
|
-
case '1':
|
|
71
|
-
this.currentMenu = new neuronsme_NeuronsMenu(this.rl);
|
|
72
|
-
break;
|
|
73
|
-
case '2':
|
|
74
|
-
this.currentMenu = new neuronsme_NeuralNetworksMenu(this.rl);
|
|
75
|
-
break;
|
|
76
|
-
case '3':
|
|
77
|
-
this.currentMenu = new neuronsme_LayersMenu(this.rl);
|
|
78
|
-
break;
|
|
79
|
-
case '4':
|
|
80
|
-
console.log('Showing information of neurons.me...');
|
|
81
|
-
console.log(neurons);
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
console.log('Invalid option. Please choose a valid menu option.');
|
|
85
|
-
}
|
|
86
|
-
this.currentMenu.display();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
class neuronsme_NeuronsMenu extends Menu {
|
|
90
|
-
constructor(app) {
|
|
91
|
-
super(app.rl);
|
|
92
|
-
this.app = app; // Store the reference to the main app
|
|
93
|
-
}
|
|
94
|
-
async display() {
|
|
95
|
-
console.log('\nNeurons:');
|
|
96
|
-
console.log('0. Back to Home');
|
|
97
|
-
console.log('1. Create a new neuron');
|
|
98
|
-
console.log('2. List all neurons');
|
|
99
|
-
this.rl.prompt();
|
|
100
|
-
}
|
|
101
|
-
async handleInput(input) {
|
|
102
|
-
// Handle input based on the neurons menu options
|
|
103
|
-
// E.g., if input is '1', create a new neuron
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
class neuronsme_NeuralNetworksMenu extends Menu {
|
|
107
|
-
constructor(app) {
|
|
108
|
-
super(app.rl); // Pass the readline interface to the parent class
|
|
109
|
-
this.app = app; // Store the reference to the main app
|
|
110
|
-
}
|
|
111
|
-
async display() {
|
|
112
|
-
console.log('\nNeural Networks:');
|
|
113
|
-
console.log('0. Back to Home');
|
|
114
|
-
console.log('1. Create a new neural network');
|
|
115
|
-
console.log('2. List all neural networks');
|
|
116
|
-
this.rl.prompt();
|
|
117
|
-
}
|
|
118
|
-
async handleInput(input) {
|
|
119
|
-
// Handle input based on the neural networks menu options
|
|
120
|
-
// E.g., if input is '1', create a new neural network
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
class neuronsme_LayersMenu extends Menu {
|
|
124
|
-
constructor(app) {
|
|
125
|
-
super(app.rl); // Pass the readline interface to the parent class
|
|
126
|
-
this.app = app; // Store the reference to the main app
|
|
127
|
-
}
|
|
128
|
-
async display() {
|
|
129
|
-
console.log('\nLayers:');
|
|
130
|
-
console.log('0. Back to Home');
|
|
131
|
-
console.log('1. Create a new layer');
|
|
132
|
-
console.log('2. List all layers');
|
|
133
|
-
this.rl.prompt();
|
|
134
|
-
}
|
|
135
|
-
async handleInput(input) {
|
|
136
|
-
// Handle input based on the layers menu options
|
|
137
|
-
// E.g., if input is '1', create a new layer
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
class NeuronsMeApp {
|
|
142
|
-
constructor() {
|
|
143
|
-
this.rl = readline.createInterface({
|
|
144
|
-
input: process.stdin,
|
|
145
|
-
output: process.stdout,
|
|
146
|
-
});
|
|
147
|
-
this.currentMenu = new neuronsme_MainMenu(this); // Pass the entire app instance
|
|
148
|
-
this.currentMenu.display(); // Display the main menu
|
|
149
|
-
}
|
|
150
|
-
start() {
|
|
151
|
-
this.rl.setPrompt('neurons.me> '); // Use 'this.rl'
|
|
152
|
-
this.rl.prompt();
|
|
153
|
-
this.rl.on('line', (input) => {
|
|
154
|
-
this.currentMenu.handleInput(input.trim());
|
|
155
|
-
}).on('close', () => {
|
|
156
|
-
console.log('Exiting .me');
|
|
157
|
-
process.exit(0);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const neurons_me_app_init = new NeuronsMeApp();
|
|
162
|
-
neurons_me_app_init.start();
|
package/neurons.js
DELETED
package/x.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const readline = require('readline');
|
|
3
|
-
const neurons = require('neurons.me');
|
|
4
|
-
const { logError } = require('./src/errorHandler');
|
|
5
|
-
const { Menu } = require('./src/utils');
|
|
6
|
-
const NeuronsHandler = require('@sui.gn/me/src/NeuronsHandler');
|
|
7
|
-
const NeuralNetworksHandler = require('@sui.gn/me/src/NeuralNetworksHandler');
|
|
8
|
-
const LayersHandler = require('@sui.gn/me/src/LayersHandler');
|
|
9
|
-
class neuronsme_MainMenu extends Menu {
|
|
10
|
-
async display() {
|
|
11
|
-
console.log('\nWelcome to neurons.me type /q to close:');
|
|
12
|
-
console.log('1. Neurons: Create, list, update, and delete neurons');
|
|
13
|
-
console.log('2. Neural Networks: Create, list, update, and delete neural networks');
|
|
14
|
-
console.log('3. Layers: Create, list, update, and delete layers');
|
|
15
|
-
console.log('4. Show Info...');
|
|
16
|
-
this.rl.prompt();
|
|
17
|
-
}
|
|
18
|
-
async handleInput(input) {
|
|
19
|
-
switch (input) {
|
|
20
|
-
case '/q':
|
|
21
|
-
this.rl.close();
|
|
22
|
-
break;
|
|
23
|
-
case '1':
|
|
24
|
-
this.currentMenu = new neuronsme_NeuronsMenu(this.rl);
|
|
25
|
-
break;
|
|
26
|
-
case '2':
|
|
27
|
-
this.currentMenu = new neuronsme_NeuralNetworksMenu(this.rl);
|
|
28
|
-
break;
|
|
29
|
-
case '3':
|
|
30
|
-
this.currentMenu = new neuronsme_LayersMenu(this.rl);
|
|
31
|
-
break;
|
|
32
|
-
case '4':
|
|
33
|
-
console.log('Showing information of neurons.me...');
|
|
34
|
-
console.log(neurons);
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
console.log('Invalid option. Please choose a valid menu option.');
|
|
38
|
-
}
|
|
39
|
-
this.currentMenu.display();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class neuronsme_NeuronsMenu extends Menu {
|
|
43
|
-
async display() {
|
|
44
|
-
console.log('\nNeurons:');
|
|
45
|
-
console.log('0. Back to Home');
|
|
46
|
-
console.log('1. Create a new neuron');
|
|
47
|
-
console.log('2. List all neurons');
|
|
48
|
-
this.rl.prompt();
|
|
49
|
-
}
|
|
50
|
-
async handleInput(input) {
|
|
51
|
-
// Handle input based on the neurons menu options
|
|
52
|
-
// E.g., if input is '1', create a new neuron
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
class neuronsme_NeuralNetworksMenu extends Menu {
|
|
56
|
-
async display() {
|
|
57
|
-
console.log('\nNeural Networks:');
|
|
58
|
-
console.log('0. Back to Home');
|
|
59
|
-
console.log('1. Create a new neural network');
|
|
60
|
-
console.log('2. List all neural networks');
|
|
61
|
-
this.rl.prompt();
|
|
62
|
-
}
|
|
63
|
-
async handleInput(input) {
|
|
64
|
-
// Handle input based on the neural networks menu options
|
|
65
|
-
// E.g., if input is '1', create a new neural network
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
class neuronsme_LayersMenu extends Menu {
|
|
69
|
-
async display() {
|
|
70
|
-
console.log('\nLayers:');
|
|
71
|
-
console.log('0. Back to Home');
|
|
72
|
-
console.log('1. Create a new layer');
|
|
73
|
-
console.log('2. List all layers');
|
|
74
|
-
this.rl.prompt();
|
|
75
|
-
}
|
|
76
|
-
async handleInput(input) {
|
|
77
|
-
// Handle input based on the layers menu options
|
|
78
|
-
// E.g., if input is '1', create a new layer
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
class neuronsmeApp {
|
|
82
|
-
constructor() {
|
|
83
|
-
this.rl = readline.createInterface({
|
|
84
|
-
input: process.stdin,
|
|
85
|
-
output: process.stdout,
|
|
86
|
-
});
|
|
87
|
-
this.currentMenu = new neuronsme_MainMenu(this.rl);
|
|
88
|
-
}
|
|
89
|
-
start() {
|
|
90
|
-
this.rl.prompt();
|
|
91
|
-
this.rl.on('line', (input) => {
|
|
92
|
-
this.currentMenu.handleInput(input.trim());
|
|
93
|
-
}).on('close', () => {
|
|
94
|
-
console.log('Exiting .me');
|
|
95
|
-
process.exit(0);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const neurons_me_app_init = new neuronsmeApp();
|
|
100
|
-
neurons_me_app_init.start();
|
package/y.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const readline = require('readline');
|
|
3
|
-
const neurons = require('neurons.me');
|
|
4
|
-
const { logError } = require('./src/errorHandler');
|
|
5
|
-
const { showMenu } = require('./src/utils');
|
|
6
|
-
const NeuronsHandler = require('@sui.gn/me/src/NeuronsHandler');
|
|
7
|
-
const NeuralNetworksHandler = require('@sui.gn/me/src/NeuralNetworksHandler');
|
|
8
|
-
const LayersHandler = require('@sui.gn/me/src/LayersHandler');
|
|
9
|
-
// Create the readline interface
|
|
10
|
-
let rl = readline.createInterface({
|
|
11
|
-
input: process.stdin,
|
|
12
|
-
output: process.stdout,
|
|
13
|
-
});
|
|
14
|
-
/*
|
|
15
|
-
┳┓┏┓┳┳┳┓┏┓┳┓┏┓
|
|
16
|
-
┃┃┣ ┃┃┣┫┃┃┃┃┗┓
|
|
17
|
-
┛┗┗┛┗┛┛┗┗┛┛┗┗┛
|
|
18
|
-
neurons SECTION...*/
|
|
19
|
-
let neuronsHandlerINIT = NeuronsHandler(rl);
|
|
20
|
-
const promptNeuronConfig = async () => {
|
|
21
|
-
await neuronsHandlerINIT.promptNeuronConfig(rl);
|
|
22
|
-
};
|
|
23
|
-
const createNeuronWrapper = async () => {
|
|
24
|
-
await neuronsHandlerINIT.createNeuron(rl);
|
|
25
|
-
};
|
|
26
|
-
// List all neurons
|
|
27
|
-
const listAllNeuronsWrapper = () => {
|
|
28
|
-
neuronsHandlerINIT.listAllNeurons();
|
|
29
|
-
};
|
|
30
|
-
// Update neuron properties
|
|
31
|
-
const updateNeuronPropertiesWrapper = async (neuron) => {
|
|
32
|
-
await neuronsHandlerINIT.updateNeuronProperties(neuron);
|
|
33
|
-
};
|
|
34
|
-
// Clone neuron
|
|
35
|
-
const cloneNeuronWrapper = async (neuron) => {
|
|
36
|
-
await neuronsHandlerINIT.cloneNeuron(neuron);
|
|
37
|
-
};
|
|
38
|
-
// Show neuron actions
|
|
39
|
-
const neuronConfigWrapper = async (neuron) => {
|
|
40
|
-
await neuronsHandlerINIT.neuronConfig(rl, neuron, updateNeuronPropertiesWrapper, cloneNeuronWrapper, showMenu);
|
|
41
|
-
};
|
|
42
|
-
/*
|
|
43
|
-
┳┓┏┓┳┳┳┓┏┓┓ ┳┓┏┓┏┳┓┓ ┏┏┓┳┓┓┏┓┏┓
|
|
44
|
-
┃┃┣ ┃┃┣┫┣┫┃ ┃┃┣ ┃ ┃┃┃┃┃┣┫┃┫ ┗┓
|
|
45
|
-
┛┗┗┛┗┛┛┗┛┗┗┛┛┗┗┛ ┻ ┗┻┛┗┛┛┗┛┗┛┗┛
|
|
46
|
-
neuralNetworks SECTION... */
|
|
47
|
-
const neuralnetworksHandlerINIT = NeuralNetworksHandler(rl);
|
|
48
|
-
const createNeuralNetworkWrapper = async () => {
|
|
49
|
-
await neuralnetworksHandlerINIT.createNeuronNetwork();
|
|
50
|
-
};
|
|
51
|
-
const listAllNeuralNetworksWrappers = async () => {
|
|
52
|
-
await neuralnetworksHandlerINIT.listAllNeuralNetworks();
|
|
53
|
-
};
|
|
54
|
-
/*
|
|
55
|
-
╦ ╔═╗╦ ╦╔═╗╦═╗╔═╗
|
|
56
|
-
║ ╠═╣╚╦╝║╣ ╠╦╝╚═╗
|
|
57
|
-
╩═╝╩ ╩ ╩ ╚═╝╩╚═╚═╝
|
|
58
|
-
layers section... */
|
|
59
|
-
const layersHandlerINIT = LayersHandler(rl);
|
|
60
|
-
const createLayerWrapper = async () => {
|
|
61
|
-
layersHandlerINIT.createLayer();
|
|
62
|
-
};
|
|
63
|
-
const listAllLayersWrapper = () => {
|
|
64
|
-
layersHandlerINIT.listAllLayers();
|
|
65
|
-
};
|
|
66
|
-
/*
|
|
67
|
-
╔╦╗╔═╗╦╔╗╔╔╦╗╔═╗╔╗╔╦ ╦
|
|
68
|
-
║║║╠═╣║║║║║║║║╣ ║║║║ ║
|
|
69
|
-
╩ ╩╩ ╩╩╝╚╝╩ ╩╚═╝╝╚╝╚═╝
|
|
70
|
-
main menu... */
|
|
71
|
-
// MAIN MENU OPTIONS - INDEX ENTRY POINT OF .ME CLI
|
|
72
|
-
let currentMenu = 'main';
|
|
73
|
-
const displayMainMenu = () => {
|
|
74
|
-
console.log('\nMain Menu:');
|
|
75
|
-
console.log('1. Neurons');
|
|
76
|
-
console.log('2. Neural networks');
|
|
77
|
-
console.log('3. Layer');
|
|
78
|
-
console.log('4. Show information about available classes and methods');
|
|
79
|
-
console.log('5. Exit');
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/*
|
|
83
|
-
┌─┐┌┬┐┌─┐┬─┐┌┬┐
|
|
84
|
-
└─┐ │ ├─┤├┬┘ │
|
|
85
|
-
└─┘ ┴ ┴ ┴┴└─ ┴
|
|
86
|
-
starting shell session npx .me shell ->*/
|
|
87
|
-
// Starting shell session
|
|
88
|
-
const startShellSession = () => {
|
|
89
|
-
rl.setPrompt('.me> '); // Display the initial prompt
|
|
90
|
-
rl.prompt();
|
|
91
|
-
// Handle user input
|
|
92
|
-
rl.on('line', async (input) => {
|
|
93
|
-
const command = input.trim();
|
|
94
|
-
if (command === '') {
|
|
95
|
-
// Empty input, just re-prompt the current menu
|
|
96
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
97
|
-
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
switch (currentMenu) {
|
|
101
|
-
case 'neuron':
|
|
102
|
-
switch (command) {
|
|
103
|
-
case '1':
|
|
104
|
-
await createNeuronWrapper();
|
|
105
|
-
break;
|
|
106
|
-
case '2':
|
|
107
|
-
listAllNeuronsWrapper();
|
|
108
|
-
break;
|
|
109
|
-
case '3':
|
|
110
|
-
promptNeuronConfig();
|
|
111
|
-
break;
|
|
112
|
-
default:
|
|
113
|
-
console.log('Invalid command. Type the number of the desired option.');
|
|
114
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
case 'neuralnetwork':
|
|
119
|
-
switch (command) {
|
|
120
|
-
case '1':
|
|
121
|
-
createNeuralNetworkWrapper();
|
|
122
|
-
break;
|
|
123
|
-
case '2':
|
|
124
|
-
listAllNeuralNetworksWrappers();
|
|
125
|
-
break;
|
|
126
|
-
case '3':
|
|
127
|
-
currentMenu = 'main';
|
|
128
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
129
|
-
|
|
130
|
-
break;
|
|
131
|
-
default:
|
|
132
|
-
console.log('Invalid command. Type the number of the desired option.');
|
|
133
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
break;
|
|
137
|
-
case 'layer':
|
|
138
|
-
switch (command) {
|
|
139
|
-
case '1':
|
|
140
|
-
createLayerWrapper();
|
|
141
|
-
break;
|
|
142
|
-
case '2':
|
|
143
|
-
listAllLayersWrapper();
|
|
144
|
-
break;
|
|
145
|
-
case '3':
|
|
146
|
-
currentMenu = 'main';
|
|
147
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
148
|
-
break;
|
|
149
|
-
default:
|
|
150
|
-
console.log('Invalid command. Type the number of the desired option.');
|
|
151
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
152
|
-
}
|
|
153
|
-
break;
|
|
154
|
-
default:
|
|
155
|
-
switch (command) {
|
|
156
|
-
case '1':
|
|
157
|
-
currentMenu = 'neuron';
|
|
158
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
159
|
-
|
|
160
|
-
break;
|
|
161
|
-
case '2':
|
|
162
|
-
currentMenu = 'neuralnetwork';
|
|
163
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
164
|
-
|
|
165
|
-
break;
|
|
166
|
-
case '3':
|
|
167
|
-
currentMenu = 'layer';
|
|
168
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
169
|
-
|
|
170
|
-
break;
|
|
171
|
-
case '4':
|
|
172
|
-
console.log('Available classes and methods:');
|
|
173
|
-
console.log(neurons);
|
|
174
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
175
|
-
|
|
176
|
-
break;
|
|
177
|
-
case '5':
|
|
178
|
-
rl.close();
|
|
179
|
-
break;
|
|
180
|
-
case 'menu':
|
|
181
|
-
case 'showmenu':
|
|
182
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
183
|
-
|
|
184
|
-
break;
|
|
185
|
-
default:
|
|
186
|
-
console.log('Invalid command. Type "exit" to quit the session or use "menu" to see options.');
|
|
187
|
-
showMenu(rl, neuronsHandlerINIT.showNeuronMenu);
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}).on('close', () => {
|
|
192
|
-
console.log('Exiting .me');
|
|
193
|
-
process.exit(0);
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
// Define the main 'shell' command
|
|
197
|
-
const mainCommand = process.argv[2];
|
|
198
|
-
if (mainCommand === 'shell') {
|
|
199
|
-
// Start the interactive shell session when the 'shell' command is run
|
|
200
|
-
startShellSession();
|
|
201
|
-
// Display the main menu
|
|
202
|
-
showMenu(rl, displayMainMenu); // Corrected line
|
|
203
|
-
} else {
|
|
204
|
-
// Show usage or help message when the main command is not recognized
|
|
205
|
-
console.log('Usage: .me shell');
|
|
206
|
-
console.log('Type ".me shell" to enter the interactive shell mode.');
|
|
207
|
-
}
|