this.me 2.8.7 → 2.8.9

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/README.md CHANGED
@@ -1,11 +1,22 @@
1
- # This.Me
2
- <img src="./cleak_me-removebg.png" alt="SVG Image" style="width:89px;">
3
- <img src="./this.me.png" alt="SVG Image" style="width:89px;">
1
+ <img src="https://suign.github.io/assets/imgs/cleak_me-removebg.png" alt="DID Me Art" width="244">
2
+ <img src="https://suign.github.io/assets/imgs/Cleaker-removebg-preview.png" alt="Cleak Me Please" width="244">
3
+ # THIS.ME
4
4
 
5
- **This.Me** is a class focused on encapsulating user identity, specifically crafted to facilitate the creation of instances ready for hashing and cryptographic signature generation. It opens the door to coding and decoding through "me" signatures, offering a modular framework that prioritizes privacy and integrity in application-wide identity management.
5
+ -----------
6
+
7
+ ### [Project Status : Experimental and Under Development, Subject to Major Changes]
8
+ The module is in active development, and as such, it is subject to significant changes as we refine our approach and methodologies to best support our goals.
9
+ visit: https://neurons.me to learn more.
6
10
 
11
+ ----------
7
12
 
13
+ # Introduction
14
+ **This.Me** is a class focused on encapsulating user identity, specifically crafted to facilitate the creation of instances ready for hashing and cryptographic signature generation. It opens the door to coding and decoding through "me" signatures, offering a modular framework that prioritizes privacy and integrity in application-wide identity management.
8
15
 
16
+ Hello, I am .lisa
17
+ ? Who are you? (Use arrow keys)
18
+ ❯ add.me
19
+ ---
9
20
  1. **Install `this.me`:**
10
21
  Open your terminal and run the following command to install the `this.me` package:
11
22
 
@@ -42,23 +53,41 @@
42
53
 
43
54
  This quick start guide provides a straightforward path to incorporating `this.me` into your project, enabling you to manage user identities and prepare them for secure cryptographic processes efficiently.
44
55
 
45
- -----
56
+ ----------
57
+
58
+ # About All.This
59
+
60
+ ## Modular Data Structures:
61
+
62
+ **[this.me](https://suign.github.io/this.me) - [this.audio](https://suign.github.io/this.audio) - [this.text](https://suign.github.io/this.text) - [this.wallet](https://suign.github.io/this.wallet) - [this.img](https://suign.github.io/this.img) - [this.pixel](https://suign.github.io/Pixels) - [be.this](https://suign.github.io/be.this) - [this.DOM](https://suign.github.io/this.DOM) - [this.env](https://suign.github.io/this.env/) - [this.GUI](https://suign.github.io/this.GUI) - [this.be](https://suign.github.io/this.be) - [this.video](https://suign.github.io/this.video) - [this.atom](https://suign.github.io/this.atom) - [this.dictionaries](https://suign.github.io/this.dictionaries/)**
63
+
64
+ **Each module** in **[all.this](https://neurons.me/all-this)** represents a specific **datastructure**. These classes encapsulate the functionalities and **data specific to their domain.**
65
+
66
+ ## **Utils**
67
+
68
+ **[all.this](https://neurons.me/all-this)** not only aggregates these modules but also provides utilities to facilitate the integration, management, and enhancement of these data structures. **For example:**
69
+
70
+ *The integration with [cleaker](https://suign.github.io/cleaker/) ensures each module instance has a **unique cryptographic identity**, enhancing security and data integrity.*
71
+
72
+ ### Neurons.me Ecosystem Glossary:
73
+
74
+ visit: [Neurons.me Glossary](https://suign.github.io/neurons.me/Glossary)
75
+
76
+ ## License & Policies
46
77
 
47
- # What is All.This?
48
- **This.me** serves as the **identity representation** in our system.
78
+ - **License**: MIT License (see LICENSE for details).
49
79
 
50
- The `[all.this](https://www.neurons.me/what-is-all-this)` collection of packages, along with the proposed `cleaker` functionality, is an approach to create a modular system where each module (like `this.text`, `this.video`, `this.img`, etc.) (all.this family) represents a distinct data structure or class. These modules, when combined with `cleaker`, generate unique **public and private key pairs**, essentially giving each instance its cryptographic identity.
80
+ - **Privacy Policy**: Respects user privacy; no collection/storage of personal data.
51
81
 
82
+ - **Terms of Usage**: Use responsibly. No guarantees/warranties provided. [Terms](https://www.neurons.me/terms-of-use) | [Privacy](https://www.neurons.me/privacy-policy)
52
83
 
53
- ## Contextual Environment
54
- **This.Me** adapts to various environments, enabling `.me` objects to function both locally and within a network. A `.me` object authenticated on a network accesses data beyond the local scope, while unauthenticated instances are confined to local data. This dual functionality ensures seamless interoperability and heightened security.
84
+ **Learn more** at https://neurons.me
55
85
 
56
- ## Setting up your Context. 👋🏻👋🏼👋🏽👋🏾👋🏿
57
- Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services like **me.**
86
+ **Author:** SuiGn
58
87
 
59
- Having a clear declaration of the environment and the context can have a series of implications for security, interoperability, and clarity. The codebase is often vast, dynamic, and continually evolving. Given the dynamic nature of such environments, ensuring the integrity of the code and data becomes paramount. You wouldn't want an agent to execute or rely on code that has been tampered with or is different from the expected version. This is where hashing comes into play.
88
+ [By neurons.me](https://neurons.me)
60
89
 
61
- `.me` objects to serve as both a local identity on the user's host machine and as an identity within a larger network. When a `.me` object is authenticated on a network, it can access data not only on the local host but also from other nodes within that network. Conversely, if it's not authenticated or recognized by the network, it should only access local data.
90
+ <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="neurons.me logo" width="123" height="123" style="width123px; height:123px;">
62
91
 
63
92
 
64
93
 
package/index.js CHANGED
@@ -9,7 +9,11 @@
9
9
  * Command Definitions and Interactive Shell.*/
10
10
 
11
11
  // index.js in the `this.me` package
12
- export { default } from './src/me.js';
13
- console.log('this.me loaded successfully.');
14
- // this.me/index.js
15
- export { shell } from './src/cli/shell.js';
12
+ import Me from './src/me.js';
13
+ let ia = new Me('.Lisa');
14
+ let me = ia.getMe();
15
+
16
+ console.log('.me:', me);
17
+ console.log('Hello, I am', me);
18
+ console.log('Who are you?', Me);
19
+ export default Me;
package/jsdoc.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "source": {
3
- "include": ["./src", "./index.js", "./src/cli", "./src/cli/commands.js", "./src/cli/shell.js"]
3
+ "include": ["./src", "./index.js", "./README.md"]
4
4
  },
5
5
  "opts": {
6
6
  "destination": "./docs",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  {
35
35
  "label": "Github",
36
- "href": "https://github.com/suiGn/cleaker"
36
+ "href": "https://github.com/suiGn/this.me"
37
37
  },
38
38
  {
39
39
  "label": "Cleaker.me",
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "2.8.7",
4
- "description": "User-Centric.",
5
- "type": "module",
3
+ "version": "2.8.9",
4
+ "description": "_me-Centric.",
6
5
  "main": "index.js",
7
6
  "scripts": {
8
7
  "start": "node index.js",
9
8
  "test": "test"
10
9
  },
10
+ "bin": {
11
+ ".me": "src/.me.cli.js"
12
+ },
11
13
  "keywords": [
12
14
  "this.me",
13
15
  "user"
14
16
  ],
15
- "devDependencies": {
16
- "browserify": "^17.0.0"
17
- },
18
17
  "repository": {
19
18
  "type": "git",
20
19
  "url": "git+https://github.com/suiGn/this.me.git"
21
20
  },
22
21
  "homepage": "https://www.npmjs.com/package/this.me",
23
22
  "docs": "https://suiGn.github.io/this.me",
23
+ "type": "module",
24
24
  "author": "suiGn",
25
25
  "license": "MIT",
26
26
  "repoType": "NPM Package",
27
27
  "category": "dataformatter",
28
28
  "dependencies": {
29
- "commander": "^11.1.0",
30
- "inquirer": "^9.2.12"
29
+ "chalk": "^5.3.0",
30
+ "inquirer": "^9.2.16"
31
31
  }
32
32
  }
package/src/.me.cli.js ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+
3
+ import inquirer from 'inquirer';
4
+ import chalk from 'chalk';
5
+ import fs from 'fs';
6
+ import os from 'os';
7
+ import path from 'path';
8
+
9
+ let ia = ".Lisa";
10
+
11
+ // Load or initialize .me usernames from the configuration file
12
+ const getConfigPath = () => path.join(os.homedir(), '.me_config');
13
+ const getExistingUsers = () => {
14
+ const configPath = getConfigPath();
15
+ return fs.existsSync(configPath) ? fs.readFileSync(configPath, 'utf-8').split('\n').filter(Boolean) : [];
16
+ };
17
+
18
+ // Save a new .me username to the configuration file
19
+ const saveNewUser = (username) => {
20
+ const existingUsers = getExistingUsers();
21
+ existingUsers.push(username);
22
+ fs.writeFileSync(getConfigPath(), existingUsers.join('\n'));
23
+ };
24
+
25
+ // Define the main function
26
+ async function main() {
27
+ console.log(chalk.yellow(`Hello, I am ${ia}`));
28
+
29
+ try {
30
+ let existingUsers = getExistingUsers();
31
+ let choices = existingUsers.length > 0 ? existingUsers : ['Add.Me'];
32
+ if (!choices.includes('Add.Me')) {
33
+ choices.push('Add.Me');
34
+ }
35
+
36
+ // Ask for identification
37
+ const identification = await inquirer.prompt([
38
+ {
39
+ type: 'list',
40
+ name: 'me',
41
+ message: 'Who are you?',
42
+ choices: choices,
43
+ }
44
+ ]);
45
+
46
+ let usrme;
47
+ if (identification.me === 'Add.Me') {
48
+ const newMeResponse = await inquirer.prompt([
49
+ {
50
+ type: 'input',
51
+ name: 'user.me',
52
+ message: 'Enter your user.me:',
53
+ validate: input => /^[a-z]{1,12}$/.test(input) || 'Username must be 1-12 lowercase letters without special characters.',
54
+ }
55
+ ]);
56
+ usrme = newMeResponse.newMe;
57
+ saveNewUser(usrme);
58
+ console.log(chalk.green(`New .me username added: ${usrme}`));
59
+ } else {
60
+ usrme = identification.me;
61
+ console.log(chalk.green(`Identity confirmed: ${usrme}`));
62
+ }
63
+
64
+ // Proceed with host owner authentication and network identifier
65
+ console.log(chalk.yellow('Proceeding with Host Owner Authentication...'));
66
+ // Placeholder for authentication - implement the required logic here
67
+ console.log(chalk.green('Authenticated!'));
68
+
69
+ console.log(chalk.yellow('Retrieving Network Identifier (DID)...'));
70
+ // Placeholder for DID retrieval - implement the required logic here
71
+ console.log(chalk.green('Network Identifier (DID) retrieved!'));
72
+
73
+ } catch (error) {
74
+ console.error(chalk.red(`An error occurred: ${error.message}`));
75
+ }
76
+ }
77
+
78
+ // Execute the main function
79
+ main();
package/src/me.js CHANGED
@@ -1,49 +1,13 @@
1
- //src/me.js
2
- /**
3
- * Represents a user identity in the this.me system.
4
- */
5
- class Me {
6
- /**
7
- * Create a me instance.
8
- * @param {string} name - The first name of the user.
9
- * @param {string} lastname - The last name of the user.
10
- * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.
11
- * @param {string} password - The password chosen by the user.
12
- * @param {string} pin - The personal identification number chosen by the user.
13
- */
14
- constructor(name, lastname, birthday, password, pin) {
15
- this.name = name;
16
- this.lastname = lastname;
17
- this.birthday = birthday;
18
- this.password = password;
19
- this.pin = pin;
20
- }
1
+ // define .me class usrme
21
2
 
22
- /**
23
- * Validates the user data. Throws an error if any field is empty.
24
- * @throws Will throw an error if a required field is missing.
25
- */
26
- validateData() {
27
- if (!this.name || !this.lastname || !this.birthday || !this.password || !this.pin) {
28
- throw new Error("All fields must be filled");
29
- }
30
- // Further validation rules can be added here
31
- }
32
-
33
- /**
34
- * Prepares and returns the identity object for hashing .me.
35
- * @returns {Object} The identity object (.me) with user data.
36
- */
37
- getMe() {
38
- this.validateData();
39
- return {
40
- name: this.name,
41
- lastname: this.lastname,
42
- birthday: this.birthday,
43
- password: this.password, // Password as a separate field
44
- pin: this.pin // Pin as a separate field
45
- };
46
- }
3
+ // Define the .me class
4
+ class Me {
5
+ constructor(usrme) {
6
+ this.usrme = usrme;
7
+ }
8
+ getMe() {
9
+ return this.usrme;
10
+ }
47
11
  }
48
12
 
49
- export default Me;
13
+ export default Me;
@@ -0,0 +1,49 @@
1
+ //src/me.js
2
+ /**
3
+ * Represents a user identity in the this.me system.
4
+ */
5
+ class Me {
6
+ /**
7
+ * Create a me instance.
8
+ * @param {string} name - The first name of the user.
9
+ * @param {string} lastname - The last name of the user.
10
+ * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.
11
+ * @param {string} password - The password chosen by the user.
12
+ * @param {string} pin - The personal identification number chosen by the user.
13
+ */
14
+ constructor(name, lastname, birthday, password, pin) {
15
+ this.name = name;
16
+ this.lastname = lastname;
17
+ this.birthday = birthday;
18
+ this.password = password;
19
+ this.pin = pin;
20
+ }
21
+
22
+ /**
23
+ * Validates the user data. Throws an error if any field is empty.
24
+ * @throws Will throw an error if a required field is missing.
25
+ */
26
+ validateData() {
27
+ if (!this.name || !this.lastname || !this.birthday || !this.password || !this.pin) {
28
+ throw new Error("All fields must be filled");
29
+ }
30
+ // Further validation rules can be added here
31
+ }
32
+
33
+ /**
34
+ * Prepares and returns the identity object for hashing .me.
35
+ * @returns {Object} The identity object (.me) with user data.
36
+ */
37
+ getMe() {
38
+ this.validateData();
39
+ return {
40
+ name: this.name,
41
+ lastname: this.lastname,
42
+ birthday: this.birthday,
43
+ password: this.password, // Password as a separate field
44
+ pin: this.pin // Pin as a separate field
45
+ };
46
+ }
47
+ }
48
+
49
+ export default Me;
Binary file
package/this.me.png DELETED
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes