rixleys 1.0.0

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.
Files changed (128) hide show
  1. package/LICENSE +21 -0
  2. package/README.MD +2969 -0
  3. package/WAProto/GenerateStatics.sh +4 -0
  4. package/WAProto/WAProto.proto +5479 -0
  5. package/WAProto/index.js +97692 -0
  6. package/WAProto/p.html +1 -0
  7. package/engine-requirements.js +10 -0
  8. package/lib/Defaults/index.js +120 -0
  9. package/lib/Defaults/rixleys-version.json +3 -0
  10. package/lib/Signal/Group/ciphertext-message.js +15 -0
  11. package/lib/Signal/Group/group-session-builder.js +64 -0
  12. package/lib/Signal/Group/group_cipher.js +96 -0
  13. package/lib/Signal/Group/index.js +57 -0
  14. package/lib/Signal/Group/keyhelper.js +55 -0
  15. package/lib/Signal/Group/queue-job.js +57 -0
  16. package/lib/Signal/Group/sender-chain-key.js +34 -0
  17. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  18. package/lib/Signal/Group/sender-key-message.js +69 -0
  19. package/lib/Signal/Group/sender-key-name.js +51 -0
  20. package/lib/Signal/Group/sender-key-record.js +53 -0
  21. package/lib/Signal/Group/sender-key-state.js +99 -0
  22. package/lib/Signal/Group/sender-message-key.js +29 -0
  23. package/lib/Signal/core/.eslintrc.json +31 -0
  24. package/lib/Signal/core/CODE_OF_CONDUCT.md +102 -0
  25. package/lib/Signal/core/LICENSE +621 -0
  26. package/lib/Signal/core/README.md +64 -0
  27. package/lib/Signal/core/SECURITY.md +78 -0
  28. package/lib/Signal/core/generate-proto.sh +1 -0
  29. package/lib/Signal/core/index.d.ts +55 -0
  30. package/lib/Signal/core/index.js +10 -0
  31. package/lib/Signal/core/protos/WhisperTextProtocol.proto +28 -0
  32. package/lib/Signal/core/src/.eslintrc.json +31 -0
  33. package/lib/Signal/core/src/WhisperTextProtocol.js +933 -0
  34. package/lib/Signal/core/src/base_key_type.js +7 -0
  35. package/lib/Signal/core/src/chain_type.js +6 -0
  36. package/lib/Signal/core/src/crypto.d.ts +19 -0
  37. package/lib/Signal/core/src/crypto.js +98 -0
  38. package/lib/Signal/core/src/curve.d.ts +22 -0
  39. package/lib/Signal/core/src/curve.js +142 -0
  40. package/lib/Signal/core/src/errors.js +33 -0
  41. package/lib/Signal/core/src/keyhelper.js +45 -0
  42. package/lib/Signal/core/src/numeric_fingerprint.js +72 -0
  43. package/lib/Signal/core/src/protobufs.js +10 -0
  44. package/lib/Signal/core/src/protocol_address.js +40 -0
  45. package/lib/Signal/core/src/queue_job.js +69 -0
  46. package/lib/Signal/core/src/session_builder.js +164 -0
  47. package/lib/Signal/core/src/session_cipher.js +336 -0
  48. package/lib/Signal/core/src/session_record.js +316 -0
  49. package/lib/Signal/libsignal.js +184 -0
  50. package/lib/Socket/Client/index.js +18 -0
  51. package/lib/Socket/Client/types.js +13 -0
  52. package/lib/Socket/Client/websocket.js +72 -0
  53. package/lib/Socket/business.js +260 -0
  54. package/lib/Socket/chats.js +997 -0
  55. package/lib/Socket/groups.js +418 -0
  56. package/lib/Socket/index.js +238 -0
  57. package/lib/Socket/messages-recv.js +1106 -0
  58. package/lib/Socket/messages-send.js +882 -0
  59. package/lib/Socket/newsletter.js +250 -0
  60. package/lib/Socket/socket.js +646 -0
  61. package/lib/Socket/usync.js +70 -0
  62. package/lib/Store/index.js +8 -0
  63. package/lib/Store/make-in-memory-store.js +439 -0
  64. package/lib/Store/make-ordered-dictionary.js +81 -0
  65. package/lib/Store/object-repository.js +27 -0
  66. package/lib/Types/Auth.js +2 -0
  67. package/lib/Types/Call.js +2 -0
  68. package/lib/Types/Chat.js +4 -0
  69. package/lib/Types/Contact.js +2 -0
  70. package/lib/Types/Events.js +2 -0
  71. package/lib/Types/GroupMetadata.js +2 -0
  72. package/lib/Types/Label.js +27 -0
  73. package/lib/Types/LabelAssociation.js +9 -0
  74. package/lib/Types/Message.js +7 -0
  75. package/lib/Types/Newsletter.js +18 -0
  76. package/lib/Types/Product.js +2 -0
  77. package/lib/Types/Signal.js +2 -0
  78. package/lib/Types/Socket.js +2 -0
  79. package/lib/Types/State.js +2 -0
  80. package/lib/Types/USync.js +2 -0
  81. package/lib/Types/index.js +42 -0
  82. package/lib/Utils/auth-utils.js +199 -0
  83. package/lib/Utils/browser-utils.js +35 -0
  84. package/lib/Utils/business.js +234 -0
  85. package/lib/Utils/chat-utils.js +730 -0
  86. package/lib/Utils/crypto.js +193 -0
  87. package/lib/Utils/decode-wa-message.js +217 -0
  88. package/lib/Utils/event-buffer.js +518 -0
  89. package/lib/Utils/generics.js +467 -0
  90. package/lib/Utils/history.js +94 -0
  91. package/lib/Utils/index.js +36 -0
  92. package/lib/Utils/link-preview.js +151 -0
  93. package/lib/Utils/logger.js +7 -0
  94. package/lib/Utils/lt-hash.js +51 -0
  95. package/lib/Utils/make-mutex.js +43 -0
  96. package/lib/Utils/message-retry-manager.js +185 -0
  97. package/lib/Utils/messages-media.js +879 -0
  98. package/lib/Utils/messages.js +1049 -0
  99. package/lib/Utils/noise-handler.js +150 -0
  100. package/lib/Utils/process-message.js +404 -0
  101. package/lib/Utils/rixleys-event-stream.js +63 -0
  102. package/lib/Utils/serializer.js +238 -0
  103. package/lib/Utils/signal.js +153 -0
  104. package/lib/Utils/use-multi-file-auth-state.js +124 -0
  105. package/lib/Utils/validate-connection.js +229 -0
  106. package/lib/WABinary/constants.js +1303 -0
  107. package/lib/WABinary/decode.js +265 -0
  108. package/lib/WABinary/encode.js +250 -0
  109. package/lib/WABinary/generic-utils.js +110 -0
  110. package/lib/WABinary/index.js +21 -0
  111. package/lib/WABinary/jid-utils.js +85 -0
  112. package/lib/WABinary/types.js +2 -0
  113. package/lib/WAM/BinaryInfo.js +13 -0
  114. package/lib/WAM/constants.js +15350 -0
  115. package/lib/WAM/encode.js +155 -0
  116. package/lib/WAM/index.js +19 -0
  117. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  118. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  119. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  120. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  121. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  122. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  123. package/lib/WAUSync/Protocols/index.js +20 -0
  124. package/lib/WAUSync/USyncQuery.js +89 -0
  125. package/lib/WAUSync/USyncUser.js +26 -0
  126. package/lib/WAUSync/index.js +19 -0
  127. package/lib/index.js +54 -0
  128. package/package.json +113 -0
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SenderKeyName = void 0;
4
+ function isNull(str) {
5
+ return str === null || str === '';
6
+ }
7
+ function intValue(num) {
8
+ const MAX_VALUE = 0x7fffffff;
9
+ const MIN_VALUE = -0x80000000;
10
+ if (num > MAX_VALUE || num < MIN_VALUE) {
11
+ return num & 0xffffffff;
12
+ }
13
+ return num;
14
+ }
15
+ function hashCode(strKey) {
16
+ let hash = 0;
17
+ if (!isNull(strKey)) {
18
+ for (let i = 0; i < strKey.length; i++) {
19
+ hash = hash * 31 + strKey.charCodeAt(i);
20
+ hash = intValue(hash);
21
+ }
22
+ }
23
+ return hash;
24
+ }
25
+ class SenderKeyName {
26
+ constructor(groupId, sender) {
27
+ this.groupId = groupId;
28
+ this.sender = sender;
29
+ }
30
+ getGroupId() {
31
+ return this.groupId;
32
+ }
33
+ getSender() {
34
+ return this.sender;
35
+ }
36
+ serialize() {
37
+ return `${this.groupId}::${this.sender.id}::${this.sender.deviceId}`;
38
+ }
39
+ toString() {
40
+ return this.serialize();
41
+ }
42
+ equals(other) {
43
+ if (other === null)
44
+ return false;
45
+ return this.groupId === other.groupId && this.sender.toString() === other.sender.toString();
46
+ }
47
+ hashCode() {
48
+ return hashCode(this.groupId) ^ hashCode(this.sender.toString());
49
+ }
50
+ }
51
+ exports.SenderKeyName = SenderKeyName;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SenderKeyRecord = void 0;
4
+ const generics_1 = require("../../Utils/generics");
5
+ const sender_key_state_1 = require("./sender-key-state");
6
+ class SenderKeyRecord {
7
+ constructor(serialized) {
8
+ this.MAX_STATES = 5;
9
+ this.senderKeyStates = [];
10
+ if (serialized) {
11
+ for (const structure of serialized) {
12
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(null, null, null, null, null, null, structure));
13
+ }
14
+ }
15
+ }
16
+ isEmpty() {
17
+ return this.senderKeyStates.length === 0;
18
+ }
19
+ getSenderKeyState(keyId) {
20
+ if (keyId === undefined && this.senderKeyStates.length) {
21
+ return this.senderKeyStates[this.senderKeyStates.length - 1];
22
+ }
23
+ return this.senderKeyStates.find(state => state.getKeyId() === keyId);
24
+ }
25
+ addSenderKeyState(id, iteration, chainKey, signatureKey) {
26
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, null, signatureKey));
27
+ if (this.senderKeyStates.length > this.MAX_STATES) {
28
+ this.senderKeyStates.shift();
29
+ }
30
+ }
31
+ setSenderKeyState(id, iteration, chainKey, keyPair) {
32
+ this.senderKeyStates.length = 0;
33
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, keyPair));
34
+ }
35
+ serialize() {
36
+ return this.senderKeyStates.map(state => state.getStructure());
37
+ }
38
+ static deserialize(data) {
39
+ let parsed;
40
+ if (typeof data === 'string') {
41
+ parsed = JSON.parse(data, generics_1.BufferJSON.reviver);
42
+ }
43
+ else if (data instanceof Uint8Array) {
44
+ const str = Buffer.from(data).toString('utf-8');
45
+ parsed = JSON.parse(str, generics_1.BufferJSON.reviver);
46
+ }
47
+ else {
48
+ parsed = data;
49
+ }
50
+ return new SenderKeyRecord(parsed);
51
+ }
52
+ }
53
+ exports.SenderKeyRecord = SenderKeyRecord;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SenderKeyState = void 0;
4
+ const sender_chain_key_1 = require("./sender-chain-key");
5
+ const sender_message_key_1 = require("./sender-message-key");
6
+ class SenderKeyState {
7
+ constructor(id, iteration, chainKey, signatureKeyPair, signatureKeyPublic, signatureKeyPrivate, senderKeyStateStructure) {
8
+ this.MAX_MESSAGE_KEYS = 2000;
9
+ if (senderKeyStateStructure) {
10
+ this.senderKeyStateStructure = senderKeyStateStructure;
11
+ }
12
+ else {
13
+ if (signatureKeyPair) {
14
+ signatureKeyPublic = signatureKeyPair.public;
15
+ signatureKeyPrivate = signatureKeyPair.private;
16
+ }
17
+ chainKey = typeof chainKey === 'string' ? Buffer.from(chainKey, 'base64') : chainKey;
18
+ const senderChainKeyStructure = {
19
+ iteration: iteration || 0,
20
+ seed: chainKey || Buffer.alloc(0)
21
+ };
22
+ const signingKeyStructure = {
23
+ public: typeof signatureKeyPublic === 'string'
24
+ ? Buffer.from(signatureKeyPublic, 'base64')
25
+ : signatureKeyPublic || Buffer.alloc(0)
26
+ };
27
+ if (signatureKeyPrivate) {
28
+ signingKeyStructure.private =
29
+ typeof signatureKeyPrivate === 'string' ? Buffer.from(signatureKeyPrivate, 'base64') : signatureKeyPrivate;
30
+ }
31
+ this.senderKeyStateStructure = {
32
+ senderKeyId: id || 0,
33
+ senderChainKey: senderChainKeyStructure,
34
+ senderSigningKey: signingKeyStructure,
35
+ senderMessageKeys: []
36
+ };
37
+ }
38
+ }
39
+ getKeyId() {
40
+ return this.senderKeyStateStructure.senderKeyId;
41
+ }
42
+ getSenderChainKey() {
43
+ return new sender_chain_key_1.SenderChainKey(this.senderKeyStateStructure.senderChainKey.iteration, this.senderKeyStateStructure.senderChainKey.seed);
44
+ }
45
+ setSenderChainKey(chainKey) {
46
+ this.senderKeyStateStructure.senderChainKey = {
47
+ iteration: chainKey.getIteration(),
48
+ seed: chainKey.getSeed()
49
+ };
50
+ }
51
+ getSigningKeyPublic() {
52
+ const publicKey = this.senderKeyStateStructure.senderSigningKey.public;
53
+ if (publicKey instanceof Buffer) {
54
+ return publicKey;
55
+ }
56
+ else if (typeof publicKey === 'string') {
57
+ return Buffer.from(publicKey, 'base64');
58
+ }
59
+ return Buffer.from(publicKey || []);
60
+ }
61
+ getSigningKeyPrivate() {
62
+ const privateKey = this.senderKeyStateStructure.senderSigningKey.private;
63
+ if (!privateKey) {
64
+ return undefined;
65
+ }
66
+ if (privateKey instanceof Buffer) {
67
+ return privateKey;
68
+ }
69
+ else if (typeof privateKey === 'string') {
70
+ return Buffer.from(privateKey, 'base64');
71
+ }
72
+ return Buffer.from(privateKey || []);
73
+ }
74
+ hasSenderMessageKey(iteration) {
75
+ return this.senderKeyStateStructure.senderMessageKeys.some(key => key.iteration === iteration);
76
+ }
77
+ addSenderMessageKey(senderMessageKey) {
78
+ this.senderKeyStateStructure.senderMessageKeys.push({
79
+ iteration: senderMessageKey.getIteration(),
80
+ seed: senderMessageKey.getSeed()
81
+ });
82
+ if (this.senderKeyStateStructure.senderMessageKeys.length > this.MAX_MESSAGE_KEYS) {
83
+ this.senderKeyStateStructure.senderMessageKeys.shift();
84
+ }
85
+ }
86
+ removeSenderMessageKey(iteration) {
87
+ const index = this.senderKeyStateStructure.senderMessageKeys.findIndex(key => key.iteration === iteration);
88
+ if (index !== -1) {
89
+ const messageKey = this.senderKeyStateStructure.senderMessageKeys[index];
90
+ this.senderKeyStateStructure.senderMessageKeys.splice(index, 1);
91
+ return new sender_message_key_1.SenderMessageKey(messageKey.iteration, messageKey.seed);
92
+ }
93
+ return null;
94
+ }
95
+ getStructure() {
96
+ return this.senderKeyStateStructure;
97
+ }
98
+ }
99
+ exports.SenderKeyState = SenderKeyState;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SenderMessageKey = void 0;
4
+ const crypto_1 = require("libsignal/src/crypto");
5
+ class SenderMessageKey {
6
+ constructor(iteration, seed) {
7
+ const derivative = (0, crypto_1.deriveSecrets)(seed, Buffer.alloc(32), Buffer.from('WhisperGroup'));
8
+ const keys = new Uint8Array(32);
9
+ keys.set(new Uint8Array(derivative[0].slice(16)));
10
+ keys.set(new Uint8Array(derivative[1].slice(0, 16)), 16);
11
+ this.iv = Buffer.from(derivative[0].slice(0, 16));
12
+ this.cipherKey = Buffer.from(keys.buffer);
13
+ this.iteration = iteration;
14
+ this.seed = seed;
15
+ }
16
+ getIteration() {
17
+ return this.iteration;
18
+ }
19
+ getIv() {
20
+ return this.iv;
21
+ }
22
+ getCipherKey() {
23
+ return this.cipherKey;
24
+ }
25
+ getSeed() {
26
+ return this.seed;
27
+ }
28
+ }
29
+ exports.SenderMessageKey = SenderMessageKey;
@@ -0,0 +1,31 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 8
4
+ },
5
+ "env": {
6
+ "es6": true,
7
+ "node": true
8
+ },
9
+ "extends": "eslint:recommended",
10
+ "rules": {
11
+ "quotes": "off",
12
+ "semi": [
13
+ "error",
14
+ "always"
15
+ ],
16
+ "no-console": "off",
17
+ "no-debugger": "off",
18
+ "no-unused-vars": [
19
+ "error",
20
+ {
21
+ "args": "none"
22
+ }
23
+ ],
24
+ "no-constant-condition": [
25
+ "error",
26
+ {
27
+ "checkLoops": false
28
+ }
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,102 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in the libsignal-node community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best for the overall community
18
+
19
+ Examples of unacceptable behavior:
20
+
21
+ - Sexualized language or imagery, or sexual attention or advances of any kind
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks
23
+ - Public or private harassment
24
+ - Publishing others' private information without explicit permission
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Project-Specific Conduct
28
+
29
+ `libsignal-node` is a cryptographic library. The cost of a bad change here is high: it's not "a feature breaks for one user," it's "every downstream Signal-Protocol application weakens or breaks session state for every account they manage." Contributions are held to a corresponding standard.
30
+
31
+ Contributions that fall into the following categories will be rejected:
32
+
33
+ - **Weakening crypto.** Replacing primitives, lowering iteration counts, swapping a constant-time comparison for a non-constant-time one, removing MAC checks, accepting unauthenticated payloads, or "optimizing" away anything that looks like a defensive check. If the goal of a change is to make the protocol *do less*, it needs a security review, not a merge.
34
+ - **Adding backdoors, key escrow, or "debug" modes that bypass authentication.** This is not negotiable, including under the framing of "but it's only on by default in development."
35
+ - **Breaking on-disk session formats without a migration story.** Downstream users have persisted state. Changes to serialization need explicit handling, not silent breakage.
36
+ - **Bypassing the Signal Protocol's intended properties** (forward secrecy, post-compromise security, deniability) for convenience — e.g., disabling ratchet stepping, persisting old chain keys, or logging plaintext into the store.
37
+
38
+ Discussion of these areas — *understanding* why a check exists, *proposing* a safer alternative, *fixing* a bug that happens to touch them — is welcome and necessary. The line is intent.
39
+
40
+ ## AI Policy
41
+
42
+ This project welcomes AI-assisted contributions. Most of us use them. For a cryptographic library, the rules are stricter than usual:
43
+
44
+ 1. **You are the author.** AI tools (Claude, Copilot, Cursor, Codex, ChatGPT, etc.) are tools. The human who opens the PR is responsible for every line in it — correctness, license compatibility, security implications, and adherence to the rest of this Code of Conduct. "The AI wrote it" is not a defense, and it's an especially weak one for crypto code.
45
+
46
+ 2. **Disclose AI use in PRs.** A one-line note in the PR description is enough — for example: *"Drafted with Claude Code, reviewed and tested by me."* You don't need to enumerate every prompt. The point is that reviewers know to look closer at things AI tools commonly get wrong (hallucinated APIs, invented protocol details, plausible-but-wrong refactors).
47
+
48
+ 3. **Review before you submit.** Don't open PRs with code you haven't read. Don't open PRs with code you don't understand well enough to defend in review. If a reviewer asks "why does this work?" and your answer is "the AI suggested it," the PR will be closed.
49
+
50
+ 4. **Test what the AI produced.** Run the test suite locally. AI tools confidently generate code that doesn't compile, doesn't pass existing tests, or — worse for this project — passes tests but quietly breaks an invariant the tests don't cover.
51
+
52
+ 5. **Don't paste secrets into AI tools.** This includes:
53
+ - Identity keys, signed prekeys, one-time prekeys, sender keys, sessions — any contents of a real `SignalProtocolStore`
54
+ - `.env` files, API tokens, signing keys
55
+ - Real user phone numbers, message content, or contact lists from production systems
56
+ Most AI providers retain prompts for some period; treat anything you paste as published.
57
+
58
+ 6. **Don't use AI to mass-generate issues, PRs, or comments.** Drive-by AI-generated PRs that "fix" non-bugs, add unnecessary tests, or reformat unrelated code waste maintainer time and will be closed without detailed review. If you're using an autonomous agent, supervise it — especially anywhere near crypto code.
59
+
60
+ 7. **Hallucinated protocol details are a security issue.** The Signal Protocol has a specific definition. AI tools will confidently invent ratchet behavior, key-derivation orderings, message-keys structures, and serialization layouts that look plausible and are wrong. Verify against the upstream Signal specification, the existing test vectors, or a known-good implementation before submitting anything that touches the protocol state machine.
61
+
62
+ 8. **License-compatible output only.** If you use an AI tool that may surface code from incompatible licenses (proprietary, or licenses incompatible with GPL-3.0), don't submit that output. We can't accept it. `libsignal-node` is GPL-3.0.
63
+
64
+ Following this policy doesn't slow you down — it just keeps the bar consistent between AI-assisted and hand-written contributions.
65
+
66
+ ## Enforcement
67
+
68
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the maintainers at **rajeh@reforward.dev**. All complaints will be reviewed and investigated promptly and fairly. The maintainers are obligated to respect the privacy and security of the reporter of any incident.
69
+
70
+ For security vulnerabilities (which are not Code of Conduct issues), see **[SECURITY.md](SECURITY.md)**.
71
+
72
+ ## Enforcement Guidelines
73
+
74
+ Maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
75
+
76
+ ### 1. Correction
77
+
78
+ **Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
79
+
80
+ **Consequence:** A private, written warning from the maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
81
+
82
+ ### 2. Warning
83
+
84
+ **Community Impact:** A violation through a single incident or series of actions.
85
+
86
+ **Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. Violating these terms may lead to a temporary or permanent ban.
87
+
88
+ ### 3. Temporary Ban
89
+
90
+ **Community Impact:** A serious violation of community standards, including sustained inappropriate behavior.
91
+
92
+ **Consequence:** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. Violating these terms may lead to a permanent ban.
93
+
94
+ ### 4. Permanent Ban
95
+
96
+ **Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. Also: contributions or behavior aimed at weakening the cryptographic guarantees of the library (see § Project-Specific Conduct).
97
+
98
+ **Consequence:** A permanent ban from any sort of public interaction within the community.
99
+
100
+ ## Attribution
101
+
102
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, with project-specific and AI-policy sections added by the maintainers of `libsignal-node`.