this.me 2.7.6 → 2.7.8
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 +56 -194
- package/docs/Me.html +697 -0
- package/docs/README.md +91 -0
- package/docs/ThisMe.html +690 -0
- package/docs/cli_main.js.html +340 -0
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/global.html +454 -0
- package/docs/index.html +258 -0
- package/docs/me.js.html +211 -0
- package/docs/module-CLI.html +963 -0
- package/docs/neurons_logo.png +0 -0
- package/docs/scripts/app.min.js +1 -0
- package/docs/scripts/linenumber.js +26 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +39 -0
- package/docs/styles/app.min.css +1 -0
- package/docs/styles/iframe.css +13 -0
- package/docs/styles/jsdoc-default.css +358 -0
- package/docs/styles/prettify-jsdoc.css +111 -0
- package/docs/styles/prettify-tomorrow.css +132 -0
- package/docs/styles/reset.css +44 -0
- package/jsdoc.json +43 -0
- package/package.json +22 -29
- package/src/cli/main.js +176 -0
- package/src/env.js +8 -0
- package/{me.html → src/me.html} +1 -0
- package/src/me.js +47 -0
- package/src/os/unix/install_me.sh +5 -0
- package/src/this/video.js +0 -0
- package/crypto/crypto-browser.js +0 -20
- package/crypto/crypto-node.js +0 -16
- package/crypto/hash/hashWorker.js +0 -11
- package/crypto/hash/hashing.js +0 -43
- package/demo.js +0 -12
- package/main.js +0 -87
- package/me.js +0 -51
- package/me2.js +0 -57
- package/src/errorHandler.js +0 -9
- package/test.js +0 -36
- package/testHashIt.js +0 -3
- package/webpack.config.js +0 -18
- /package/{this/dir.js → index.js} +0 -0
- /package/{this/file.js → src/this/dir.js} +0 -0
- /package/{this/url.js → src/this/file.js} +0 -0
- /package/{this/video.js → src/this/url.js} +0 -0
package/README.md
CHANGED
|
@@ -1,230 +1,92 @@
|
|
|
1
|
-
<img src="
|
|
1
|
+
<img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
|
|
2
2
|
|
|
3
|
-
# .
|
|
4
|
-
For every recursive action, there's a repercussion.
|
|
3
|
+
# This.Me
|
|
5
4
|
|
|
6
|
-
```
|
|
7
|
-
npm install this.me
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Add to your project:
|
|
11
|
-
|
|
12
|
-
```js
|
|
13
|
-
let me = require('this.me');
|
|
14
|
-
```
|
|
15
|
-
**Docs:** [this.me](https://www.neurons.me/this-me)
|
|
16
|
-
### Conceptual Flow:
|
|
17
|
-
- [ ] Set up your context with [this.me.](https://www.npmjs.com/package/this.me)
|
|
18
|
-
- [ ] Create a neural network using [neurons.me](https://www.neurons.me).
|
|
19
|
-
- [ ] Define the data you'd like your neural network to recognize or process with [this.](https://www.neurons.me/this) modules.
|
|
20
|
-
- [ ] Use [this.be](https://www.npmjs.com/package/this.be) to maintain a state or context, - watching over [This](https://www.neurons.me/this) and any other states you define for example.
|
|
21
|
-
- [ ] Define desired status and handlers, [be.this](https://www.npmjs.com/package/be.this).
|
|
22
|
-
- [ ] Keep [i.mlearning](https://www.npmjs.com/package/i.mlearning).
|
|
23
5
|
|
|
24
|
-
|
|
6
|
+
**This.Me** is a digital identity representation of **Me** as it encapsulates the essence of an entity which is then passed for cryptographic guarantees.
|
|
25
7
|
|
|
26
|
-
|
|
8
|
+
Users no longer depend on centralized authorities for **identity and data management**. They hold the keys (literally) to their identity and data.
|
|
27
9
|
|
|
28
|
-
|
|
29
|
-
git clone https://github.com/suiGn/sandbox.git
|
|
30
|
-
```
|
|
31
|
-
2. **Navigate to the Project Directory**
|
|
10
|
+
Services become more **user-centric,** providing services based on cryptographic proofs rather than centralized authorities.
|
|
32
11
|
|
|
33
|
-
|
|
34
|
-
cd .me
|
|
35
|
-
```
|
|
36
|
-
3. **Install Dependencies**
|
|
37
|
-
You can use either Yarn or npm to install the necessary dependencies.
|
|
12
|
+
Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other.
|
|
38
13
|
|
|
39
|
-
|
|
14
|
+
## Getting Started:
|
|
40
15
|
|
|
41
16
|
```bash
|
|
42
|
-
|
|
17
|
+
npm i -g this.me
|
|
43
18
|
```
|
|
44
19
|
|
|
45
|
-
|
|
20
|
+
### Require it:
|
|
46
21
|
|
|
47
|
-
```
|
|
48
|
-
|
|
22
|
+
```js
|
|
23
|
+
const me = require('this.me');
|
|
49
24
|
```
|
|
50
25
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npx electron index.js
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
This model turns the traditional web model on its head. Users no longer depend on centralized authorities for identity or data management. They hold the keys (literally) to their identity and data. Services become more user-centric, providing services based on cryptographic proofs rather than centralized databases.
|
|
58
|
-
|
|
59
|
-
While this approach offers many benefits, including enhanced privacy and user sovereignty, it's still nascent and requires a paradigm shift in development, deployment, and user education.
|
|
60
|
-
|
|
61
|
-
In an audacious twist of fate, I decided to circumvent the monotony of user session code and dive into the cryptographic labyrinth. Rather than getting bogged down by yawn-worthy password management and playing custodian to a sea of data, I embraced a vision where every individual holds the scepter to their digital kingdom. Centralized authorities? Toss 'em out the window. Here, you own your identity, seal it with cryptographic flair, and let no one else govern it. Sure, crafting a cryptographic symphony is no walk in the park, but compared to the drudgery of traditional server management, it feels like reinventing the wheel... but in a world where wheels were never round to begin with. Behold a system where every user is a master, every piece of data a treasure, all guarded by codes and ciphers. A little unorthodox, perhaps, but in an age of digital renaissance, who wants orthodox anyway?
|
|
62
|
-
|
|
63
|
-
I'd sooner recode the Old and New Testaments, heck, throw in the Qabala too, in ASCII, before willingly plunging into the dull abyss of server-side user session management. Why swim in those murky waters when I can bask in the cryptographic labyrinth? Ditching the monotony of password management, I decided to champion a world where every individual becomes the keeper of their digital realms. Centralized authorities? More like relics of a bygone era. Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other. Crafting this cryptographic symphony may seem daunting, but compared to the tedium of server management?
|
|
64
|
-
|
|
65
|
-
POC || GTFO but for now I am traveling to new york.
|
|
66
|
-
|
|
67
|
-
# Setting up your Context. 👋🏻👋🏼👋🏽👋🏾👋🏿
|
|
68
|
-
Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services like **me.**
|
|
69
|
-
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.
|
|
70
|
-
|
|
71
|
-
The **SHA256 cryptographic hash function** is used to produce a unique, fixed-length sequence of characters (a hash) for the data. This setup does a thorough job of hashing the content of files or entire directories.
|
|
72
|
-
Even a tiny change in the content will result in a completely different hash.
|
|
73
|
-
[Read More.](https://www.neurons.me/this-me#h.sg59uu9ka8i8)
|
|
26
|
+
### Usage Example:
|
|
74
27
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Introduction:
|
|
78
|
-
|
|
79
|
-
Run node **demo.js** for quick example.
|
|
28
|
+
Use it like this:
|
|
80
29
|
|
|
81
30
|
```js
|
|
82
|
-
const
|
|
31
|
+
const ThisMe = require('this.me');
|
|
32
|
+
const user = new ThisMe('John', 'Doe', '1990-01-01', 'mypassword123', '1234');
|
|
33
|
+
const identityObject = user.getIdentityObject();
|
|
34
|
+
// identityObject can now be passed to Cleaker for hashing
|
|
83
35
|
```
|
|
84
36
|
|
|
85
|
-
|
|
86
|
-
// Create a new Me instance
|
|
87
|
-
const suign = new Me('Suign Name', 'suign@email.com', '01/01/1990', { city: 'SampleCity', country: 'SampleCountry' }, { theme: 'dark', notifications: true });
|
|
88
|
-
// Print out the public key (for demonstration purposes)
|
|
89
|
-
console.log("Suign's Public Key:", suign.getPublicKey());
|
|
90
|
-
// Example: Sign some data
|
|
91
|
-
const dataToSign = "Hello, World!";
|
|
92
|
-
const signature = suign.signData(dataToSign);
|
|
93
|
-
console.log("Signature for 'Hello, World!':", signature.toString('base64')); // Base64 encoding just to make the signature more readable in console.
|
|
94
|
-
// Example: Verify the signature
|
|
95
|
-
const isValidSignature = suign.verifySignature(dataToSign, signature);
|
|
96
|
-
console.log("Is the signature valid?", isValidSignature);
|
|
97
|
-
```
|
|
37
|
+
## Understanding .ME
|
|
98
38
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
### Key Features:
|
|
102
|
-
|
|
103
|
-
1. **Cryptographic Identity**:
|
|
104
|
-
- Every instance of `Me` has a private and public key pair.
|
|
105
|
-
- These keys provide cryptographic proof of identity, allowing entities to sign and verify messages securely.
|
|
106
|
-
2. **Profile Management**:
|
|
107
|
-
- `Me` contains information attributes such as name, email, birthdate, location, and preferences.
|
|
108
|
-
- These attributes can be updated and managed within the entity's lifecycle.
|
|
109
|
-
3. **Network Interactions**:
|
|
110
|
-
- Being cryptographically unique, `Me` can safely interact with services on a network.
|
|
111
|
-
- It can register, authenticate, and perform actions with a guarantee of its identity.
|
|
112
|
-
|
|
113
|
-
### Purpose:
|
|
114
|
-
|
|
115
|
-
1. **Enhanced Security**
|
|
116
|
-
- Traditional authentication systems have vulnerabilities (e.g., password breaches). `Me` ensures that without the private key, impersonation is nearly impossible.
|
|
117
|
-
2. **Decentralization Ready**
|
|
118
|
-
- `Me` fits perfectly in a decentralized environment, where trust is established not by central entities, but by cryptographic proofs.
|
|
119
|
-
3. **User Centricity**
|
|
120
|
-
- The user has full control over their `Me` entity. They manage their keys and therefore their identity, making it resistant to censorship and external control.
|
|
121
|
-
4. **Simplicity**
|
|
122
|
-
- Instead of managing multiple credentials for different services, `Me` offers a unified identity that's recognized across the network.
|
|
123
|
-
|
|
124
|
-
### Getting Started:
|
|
125
|
-
|
|
126
|
-
1. **Initialization**:
|
|
127
|
-
- Create an instance: `const myProfile = new Me('Name', 'email@email.com', 'birthdate', {location}, {preferences});`
|
|
128
|
-
2. **Key Management**:
|
|
129
|
-
- Use integrated cryptographic methods to sign and verify data.
|
|
130
|
-
- Always ensure the private key remains confidential.
|
|
131
|
-
3. **Interactions**:
|
|
132
|
-
- With the public key as an identifier, use `Me` to interact with services, sign transactions, or prove identity in network communications.
|
|
133
|
-
|
|
134
|
-
------
|
|
135
|
-
|
|
136
|
-
Remember, while `Me` provides enhanced security, the principle of key management is paramount. **Losing access to the private key might mean losing access to the associated identity.**
|
|
137
|
-
|
|
138
|
-
Let's delve into the importance of such declarations:
|
|
139
|
-
|
|
140
|
-
### Security Context:
|
|
141
|
-
Defining the environment ensures that both the user and the IA have a clear understanding of the boundary within which interactions take place.
|
|
142
|
-
Explicitly stating the environment can prevent unintended cross-boundary actions. For instance, without a clear declaration, an IA might access files or services that are beyond its permitted scope, leading to potential security vulnerabilities.
|
|
143
|
-
A well-defined environment acts as a sandbox that can restrict unauthorized or unintended activities. For instance, browsers use a similar principle to run JavaScript in a sandboxed environment for security reasons.
|
|
144
|
-
|
|
145
|
-
**Interoperability:**
|
|
146
|
-
As the ecosystem of software and services becomes increasingly diverse, ensuring your code can interact smoothly with other systems becomes crucial.
|
|
147
|
-
Declaring the environment or context helps ensure that all systems are on the "same page". For example, if an IA knows it's operating within the ".me" context, it can adjust its behavior, assumptions, and dependencies accordingly.
|
|
148
|
-
|
|
149
|
-
**Auditability and Compliance:**
|
|
150
|
-
For industries or applications where audit trails and compliance are important, having a clear declaration of the environment ensures that every interaction and operation can be traced back to a defined context.
|
|
151
|
-
Such clear demarcations can aid in forensic analysis if something goes wrong or if there's a need to understand the context of an interaction.
|
|
152
|
-
|
|
153
|
-
### Conclusion:
|
|
154
|
-
In the broader context of a dynamic and interactive environment like the one you're building, hashing becomes a powerful tool. It's not just about verifying code; it's about ensuring the entire ecosystem's security, integrity, and seamless operation. By employing a hashing mechanism, you're taking a proactive step towards establishing trust in the code and data that powers your system.
|
|
155
|
-
|
|
156
|
-
### Dependencies:
|
|
157
|
-
```json
|
|
158
|
-
"dependencies": {
|
|
159
|
-
"be.this": "^1.1.3",
|
|
160
|
-
"cleaker": "^2.2.9",
|
|
161
|
-
"i.mlearning": "^2.1.7",
|
|
162
|
-
"netget": "^2.1.6",
|
|
163
|
-
"neurons.me": "^2.6.3",
|
|
164
|
-
"this.atom": "^1.0.3",
|
|
165
|
-
"this.audio": "^1.0.0",
|
|
166
|
-
"this.be": "^2.1.3",
|
|
167
|
-
"this.dom": "^1.0.0",
|
|
168
|
-
"this.pixel": "^3.3.5",
|
|
169
|
-
"this.pixelgrid": "^3.3.2",
|
|
170
|
-
"this.text": "^1.0.0",
|
|
171
|
-
"v.path": "^2.1.7"
|
|
172
|
-
},
|
|
173
|
-
```
|
|
39
|
+
##### Structure of this.me Package:
|
|
174
40
|
|
|
175
|
-
|
|
41
|
+
**User Data Model:** Define a class or object structure to hold the user's data.
|
|
42
|
+
**Data Validation:** Functions to validate the input data.
|
|
43
|
+
**Data Processing:** Preparing data for hashing (by Cleaker).
|
|
44
|
+
**Exporting Data:** A method to export the processed data in a format that Cleaker can accept.
|
|
176
45
|
|
|
177
|
-
Traditional web development elements, from images to audio, are designed mainly for display and interaction. But what if they could be seamlessly converted into standardized formats primed for machine learning? That's the vision behind the **this.** modules.
|
|
178
46
|
|
|
179
|
-
An Introduction to the this. JavaScript Library: Standardizing Web Development Elements for Machine Learning.
|
|
180
47
|
|
|
181
|
-
## Principles Behind the this. Library:
|
|
182
48
|
|
|
183
|
-
|
|
49
|
+
# Setting up your Context. 👋🏻👋🏼👋🏽👋🏾👋🏿
|
|
50
|
+
Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services like **me.**
|
|
184
51
|
|
|
185
|
-
|
|
52
|
+
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.
|
|
186
53
|
|
|
187
|
-
- ### **Built on Web Standards:**
|
|
188
54
|
|
|
189
|
-
Rooted in JavaScript, the this. library builds upon public web development standards. The aim is to ensure that developers remain within familiar territories, even as they venture into the world of machine learning.
|
|
190
55
|
|
|
191
|
-
|
|
56
|
+
-----
|
|
192
57
|
|
|
193
|
-
The this. library champions open standards. By leveraging public web standards, it invites collaboration, hoping to create a community that continually refines and enhances the bridge between web development and machine learning.
|
|
194
58
|
|
|
195
|
-
[neurons.me](https://www.neurons.me)
|
|
196
59
|
|
|
197
|
-
|
|
60
|
+
`.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. Here's how this could be structured:
|
|
198
61
|
|
|
199
|
-
|
|
200
|
-
Welcome to the THIS.ME Playground, where the entire THIS.ME suite comes together with NEURONS.ME to provide a rich development and execution environment for your AI adventures.
|
|
62
|
+
### Local and Network Identity Management
|
|
201
63
|
|
|
202
|
-
|
|
203
|
-
|
|
64
|
+
1. **Local Identity**:
|
|
65
|
+
- When a `.me` object is created, it's initially configured with access to local host resources.
|
|
66
|
+
- Users can manage their local profile, which includes their personal settings, preferences, and local data access permissions.
|
|
67
|
+
2. **Network Identity**:
|
|
68
|
+
- To access resources on the network, a `.me` object must be authenticated against the network, possibly by a central authority or a decentralized consensus mechanism.
|
|
69
|
+
- Once authenticated, the `.me` object's hash is recognized across the network, granting the user access to network resources according to their permissions.
|
|
70
|
+
3. **Access Control**:
|
|
71
|
+
- Both local and network resources use access control lists (ACLs) that are tied to the `.me` object's hash.
|
|
72
|
+
- These ACLs determine what resources the `.me` object can access and the level of interaction permitted (read, write, execute).
|
|
73
|
+
4. **Data Fetching**:
|
|
74
|
+
- When fetching data, the system checks if the `.me` object is authenticated within the network.
|
|
75
|
+
- If authenticated, the `.me` object can retrieve data from across the network based on the established ACLs.
|
|
76
|
+
- If not authenticated, the `.me` object is limited to retrieving data from the local host.
|
|
77
|
+
5. **CLI Functionality**:
|
|
78
|
+
- The CLI tool facilitates the creation of `.me` objects, management of profiles, and authentication processes.
|
|
79
|
+
- It could include commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
|
|
80
|
+
6. **Data Sharing and Security**:
|
|
81
|
+
- Data sharing across the network should be secure, with encryption mechanisms in place to protect data in transit and at rest.
|
|
82
|
+
- The `.me` object's unique hash can be part of the encryption key, ensuring that only the intended `.me` object can decrypt and access the shared data.
|
|
204
83
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
### 3. Install Dependencies
|
|
213
|
-
You can use either Yarn or npm to install the necessary dependencies.
|
|
214
|
-
Using Yarn:
|
|
215
|
-
```bash
|
|
216
|
-
yarn install
|
|
217
|
-
```
|
|
218
|
-
Using npm:
|
|
219
|
-
```bash
|
|
220
|
-
npm install
|
|
221
|
-
```
|
|
222
|
-
### 4. Launch the Application
|
|
223
|
-
```
|
|
224
|
-
npx electron index.js
|
|
225
|
-
```
|
|
84
|
+
### Example CLI Commands
|
|
85
|
+
|
|
86
|
+
- `me init`: Initializes a new `.me` object on the local host.
|
|
87
|
+
- `me login`: Authenticates the `.me` object against the network to access network resources.
|
|
88
|
+
- `me logout`: De-authenticates the `.me` object from the network, reverting to local-only access.
|
|
89
|
+
- `me sync`: Synchronizes local `.me` object data with the network profile.
|
|
90
|
+
- `me fetch`: Retrieves data from the local host or network based on authentication status.
|
|
226
91
|
|
|
227
|
-
|
|
228
|
-
\- ***\*License\****: MIT License (see LICENSE for details).
|
|
229
|
-
\- ***\*Privacy Policy\****: Respects user privacy; no collection/storage of personal data.
|
|
230
|
-
\- ***\*Terms of Usage\****: Use responsibly. No guarantees/warranties provided. [Terms](https://www.neurons.me/terms-of-use) | [Privacy](https://www.neurons.me/privacy-policy)
|
|
92
|
+
By implementing this dual identity system, you enable a seamless transition for users between operating solely on their local device and engaging with a broader network, all while maintaining strict control over their data access rights.
|