blue-js-sdk 2.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 (215) hide show
  1. package/CHANGELOG.md +446 -0
  2. package/LICENSE +21 -0
  3. package/README.md +75 -0
  4. package/ai-path/ADMIN-ELEVATION.md +116 -0
  5. package/ai-path/AI-MANIFESTO.md +185 -0
  6. package/ai-path/BREAKING.md +74 -0
  7. package/ai-path/CHECKLIST.md +619 -0
  8. package/ai-path/CONNECTION-STEPS.md +724 -0
  9. package/ai-path/DECISION-TREE.md +378 -0
  10. package/ai-path/DEPENDENCIES.md +459 -0
  11. package/ai-path/E2E-FLOW.md +1555 -0
  12. package/ai-path/FAILURES.md +403 -0
  13. package/ai-path/GUIDE.md +1217 -0
  14. package/ai-path/README.md +558 -0
  15. package/ai-path/SPLIT-TUNNEL.md +266 -0
  16. package/ai-path/cli.js +535 -0
  17. package/ai-path/connect.js +884 -0
  18. package/ai-path/discover.js +178 -0
  19. package/ai-path/environment.js +266 -0
  20. package/ai-path/errors.js +86 -0
  21. package/ai-path/examples/autonomous-agent.mjs +220 -0
  22. package/ai-path/examples/multi-region.mjs +174 -0
  23. package/ai-path/examples/one-shot.mjs +31 -0
  24. package/ai-path/index.js +60 -0
  25. package/ai-path/pricing.js +136 -0
  26. package/ai-path/recommend.js +413 -0
  27. package/ai-path/run-admin.vbs +25 -0
  28. package/ai-path/setup.js +291 -0
  29. package/ai-path/wallet.js +137 -0
  30. package/app-helpers.js +363 -0
  31. package/app-settings.js +95 -0
  32. package/app-types.js +267 -0
  33. package/audit.js +847 -0
  34. package/batch.js +293 -0
  35. package/bin/setup.js +376 -0
  36. package/chain/authz.js +109 -0
  37. package/chain/broadcast.js +472 -0
  38. package/chain/client.js +160 -0
  39. package/chain/fee-grants.js +305 -0
  40. package/chain/index.js +891 -0
  41. package/chain/lcd.js +313 -0
  42. package/chain/queries.js +547 -0
  43. package/chain/rpc.js +408 -0
  44. package/chain/wallet.js +141 -0
  45. package/cli/config.js +143 -0
  46. package/cli/index.js +463 -0
  47. package/cli/output.js +182 -0
  48. package/cli.js +491 -0
  49. package/client/index.js +251 -0
  50. package/client.js +271 -0
  51. package/config/index.js +255 -0
  52. package/connection/connect.js +849 -0
  53. package/connection/disconnect.js +180 -0
  54. package/connection/discovery.js +321 -0
  55. package/connection/index.js +76 -0
  56. package/connection/proxy.js +148 -0
  57. package/connection/resilience.js +428 -0
  58. package/connection/security.js +232 -0
  59. package/connection/state.js +369 -0
  60. package/connection/tunnel.js +691 -0
  61. package/consumer.js +132 -0
  62. package/cosmjs-setup.js +1884 -0
  63. package/defaults.js +366 -0
  64. package/disk-cache.js +107 -0
  65. package/dist/client.d.ts +108 -0
  66. package/dist/client.d.ts.map +1 -0
  67. package/dist/client.js +400 -0
  68. package/dist/client.js.map +1 -0
  69. package/dist/index.d.ts +8 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +8 -0
  72. package/dist/index.js.map +1 -0
  73. package/errors/index.js +112 -0
  74. package/errors.js +218 -0
  75. package/examples/README.md +64 -0
  76. package/examples/connect-direct.mjs +106 -0
  77. package/examples/connect-plan.mjs +125 -0
  78. package/examples/error-handling.mjs +109 -0
  79. package/examples/query-nodes.mjs +94 -0
  80. package/examples/wallet-basics.mjs +61 -0
  81. package/generated/amino/amino.ts +9 -0
  82. package/generated/cosmos/base/v1beta1/coin.ts +365 -0
  83. package/generated/cosmos_proto/cosmos.ts +323 -0
  84. package/generated/gogoproto/gogo.ts +9 -0
  85. package/generated/google/protobuf/descriptor.ts +7601 -0
  86. package/generated/google/protobuf/duration.ts +208 -0
  87. package/generated/google/protobuf/timestamp.ts +238 -0
  88. package/generated/sentinel/lease/v1/events.ts +924 -0
  89. package/generated/sentinel/lease/v1/lease.ts +292 -0
  90. package/generated/sentinel/lease/v1/msg.ts +949 -0
  91. package/generated/sentinel/lease/v1/params.ts +164 -0
  92. package/generated/sentinel/node/v3/events.ts +881 -0
  93. package/generated/sentinel/node/v3/msg.ts +1002 -0
  94. package/generated/sentinel/node/v3/node.ts +263 -0
  95. package/generated/sentinel/node/v3/params.ts +183 -0
  96. package/generated/sentinel/plan/v3/events.ts +675 -0
  97. package/generated/sentinel/plan/v3/msg.ts +1191 -0
  98. package/generated/sentinel/plan/v3/plan.ts +283 -0
  99. package/generated/sentinel/provider/v2/events.ts +171 -0
  100. package/generated/sentinel/provider/v2/msg.ts +480 -0
  101. package/generated/sentinel/provider/v2/params.ts +131 -0
  102. package/generated/sentinel/provider/v2/provider.ts +246 -0
  103. package/generated/sentinel/session/v3/events.ts +480 -0
  104. package/generated/sentinel/session/v3/msg.ts +616 -0
  105. package/generated/sentinel/session/v3/params.ts +260 -0
  106. package/generated/sentinel/session/v3/proof.ts +180 -0
  107. package/generated/sentinel/session/v3/session.ts +384 -0
  108. package/generated/sentinel/subscription/v3/events.ts +1181 -0
  109. package/generated/sentinel/subscription/v3/msg.ts +1305 -0
  110. package/generated/sentinel/subscription/v3/params.ts +167 -0
  111. package/generated/sentinel/subscription/v3/subscription.ts +315 -0
  112. package/generated/sentinel/types/v1/bandwidth.ts +124 -0
  113. package/generated/sentinel/types/v1/price.ts +149 -0
  114. package/generated/sentinel/types/v1/renewal.ts +87 -0
  115. package/generated/sentinel/types/v1/status.ts +54 -0
  116. package/generated/typeRegistry.ts +27 -0
  117. package/index.js +486 -0
  118. package/node-connect.js +3015 -0
  119. package/operator.js +134 -0
  120. package/package.json +113 -0
  121. package/plan-operations.js +199 -0
  122. package/preflight.js +352 -0
  123. package/pricing/index.js +262 -0
  124. package/proto/amino/amino.proto +84 -0
  125. package/proto/cosmos/base/v1beta1/coin.proto +61 -0
  126. package/proto/cosmos_proto/cosmos.proto +112 -0
  127. package/proto/gogoproto/gogo.proto +145 -0
  128. package/proto/google/api/annotations.proto +31 -0
  129. package/proto/google/api/http.proto +370 -0
  130. package/proto/google/protobuf/any.proto +106 -0
  131. package/proto/google/protobuf/duration.proto +115 -0
  132. package/proto/google/protobuf/timestamp.proto +145 -0
  133. package/proto/sentinel/lease/v1/events.proto +52 -0
  134. package/proto/sentinel/lease/v1/genesis.proto +15 -0
  135. package/proto/sentinel/lease/v1/lease.proto +25 -0
  136. package/proto/sentinel/lease/v1/msg.proto +62 -0
  137. package/proto/sentinel/lease/v1/params.proto +17 -0
  138. package/proto/sentinel/node/v3/events.proto +50 -0
  139. package/proto/sentinel/node/v3/genesis.proto +15 -0
  140. package/proto/sentinel/node/v3/msg.proto +63 -0
  141. package/proto/sentinel/node/v3/node.proto +27 -0
  142. package/proto/sentinel/node/v3/params.proto +21 -0
  143. package/proto/sentinel/node/v3/querier.proto +63 -0
  144. package/proto/sentinel/plan/v3/events.proto +41 -0
  145. package/proto/sentinel/plan/v3/genesis.proto +21 -0
  146. package/proto/sentinel/plan/v3/msg.proto +83 -0
  147. package/proto/sentinel/plan/v3/plan.proto +32 -0
  148. package/proto/sentinel/plan/v3/querier.proto +53 -0
  149. package/proto/sentinel/provider/v2/events.proto +16 -0
  150. package/proto/sentinel/provider/v2/genesis.proto +15 -0
  151. package/proto/sentinel/provider/v2/msg.proto +35 -0
  152. package/proto/sentinel/provider/v2/params.proto +17 -0
  153. package/proto/sentinel/provider/v2/provider.proto +24 -0
  154. package/proto/sentinel/provider/v3/genesis.proto +15 -0
  155. package/proto/sentinel/provider/v3/params.proto +13 -0
  156. package/proto/sentinel/session/v3/events.proto +30 -0
  157. package/proto/sentinel/session/v3/genesis.proto +15 -0
  158. package/proto/sentinel/session/v3/msg.proto +50 -0
  159. package/proto/sentinel/session/v3/params.proto +25 -0
  160. package/proto/sentinel/session/v3/proof.proto +25 -0
  161. package/proto/sentinel/session/v3/querier.proto +100 -0
  162. package/proto/sentinel/session/v3/session.proto +50 -0
  163. package/proto/sentinel/subscription/v2/allocation.proto +21 -0
  164. package/proto/sentinel/subscription/v2/payout.proto +22 -0
  165. package/proto/sentinel/subscription/v3/events.proto +65 -0
  166. package/proto/sentinel/subscription/v3/genesis.proto +17 -0
  167. package/proto/sentinel/subscription/v3/msg.proto +83 -0
  168. package/proto/sentinel/subscription/v3/params.proto +21 -0
  169. package/proto/sentinel/subscription/v3/subscription.proto +33 -0
  170. package/proto/sentinel/types/v1/bandwidth.proto +19 -0
  171. package/proto/sentinel/types/v1/price.proto +21 -0
  172. package/proto/sentinel/types/v1/renewal.proto +21 -0
  173. package/proto/sentinel/types/v1/status.proto +16 -0
  174. package/protocol/encoding.js +341 -0
  175. package/protocol/events.js +361 -0
  176. package/protocol/handshake.js +297 -0
  177. package/protocol/index.js +15 -0
  178. package/protocol/messages.js +346 -0
  179. package/protocol/plans.js +199 -0
  180. package/protocol/v2ray.js +268 -0
  181. package/protocol/v3.js +723 -0
  182. package/protocol/wireguard.js +125 -0
  183. package/security/index.js +132 -0
  184. package/session-manager.js +329 -0
  185. package/session-tracker.js +80 -0
  186. package/setup.js +376 -0
  187. package/speedtest/index.js +528 -0
  188. package/speedtest.js +567 -0
  189. package/src/client.ts +502 -0
  190. package/src/index.ts +20 -0
  191. package/state/index.js +347 -0
  192. package/state.js +516 -0
  193. package/test-all-chain-ops.js +493 -0
  194. package/test-all-logic.js +199 -0
  195. package/test-all-msg-types.js +292 -0
  196. package/test-every-connection.js +208 -0
  197. package/test-feegrant-connect.js +98 -0
  198. package/test-logic.js +148 -0
  199. package/test-mainnet.js +176 -0
  200. package/test-plan-lifecycle.js +335 -0
  201. package/tls-trust.js +132 -0
  202. package/tsconfig.build.json +20 -0
  203. package/tsconfig.json +34 -0
  204. package/types/chain.d.ts +746 -0
  205. package/types/connection.d.ts +425 -0
  206. package/types/errors.d.ts +174 -0
  207. package/types/index.d.ts +1380 -0
  208. package/types/nodes.d.ts +187 -0
  209. package/types/pricing.d.ts +156 -0
  210. package/types/protocol.d.ts +332 -0
  211. package/types/session.d.ts +236 -0
  212. package/types/settings.d.ts +192 -0
  213. package/v3protocol.js +1053 -0
  214. package/wallet/index.js +153 -0
  215. package/wireguard.js +307 -0
@@ -0,0 +1,116 @@
1
+ # Admin Elevation Guide — Sentinel AI Path
2
+
3
+ ## Why Admin is Required
4
+
5
+ WireGuard tunnel operations require system-level access:
6
+ - **Windows:** Installing/removing WireGuard tunnel services (wireguard.exe /installtunnelservice)
7
+ - **macOS:** Creating utun interfaces (wg-quick up)
8
+ - **Linux:** Creating WireGuard interfaces (ip link add wg0)
9
+
10
+ Without admin, you can only use V2Ray nodes (~70% of the network). With admin, you access 100% of nodes including the faster, more reliable WireGuard nodes.
11
+
12
+ **The SDK checks admin BEFORE payment.** If you're not admin and select a WireGuard node, the SDK rejects the connection before any P2P tokens are spent. No money is wasted.
13
+
14
+ ## Windows — Using run-admin.vbs
15
+
16
+ The `run-admin.vbs` script triggers a single UAC prompt, then runs your Node.js script with full Administrator privileges. One prompt per session.
17
+
18
+ ```bash
19
+ # Setup (downloads V2Ray + installs WireGuard silently)
20
+ cscript run-admin.vbs setup.js
21
+
22
+ # Connect via CLI
23
+ cscript run-admin.vbs cli.js connect
24
+
25
+ # Run any custom script
26
+ cscript run-admin.vbs my-agent.mjs
27
+
28
+ # Test WireGuard specifically
29
+ cscript run-admin.vbs test-wireguard.mjs
30
+ ```
31
+
32
+ ### How run-admin.vbs works
33
+ 1. Calls `Shell.Application.ShellExecute` with verb `"runas"` → triggers UAC
34
+ 2. Opens an elevated cmd.exe window
35
+ 3. cd's to the script directory
36
+ 4. Runs `node <your-script>`
37
+ 5. Keeps the window open (so you can see output)
38
+
39
+ ### For AI agents running unattended
40
+ If the AI agent runs as a Windows Service or scheduled task, configure it to run as a user with admin rights (e.g., SYSTEM or a dedicated admin account). No UAC prompt needed for services.
41
+
42
+ ## macOS — Using sudo
43
+
44
+ ```bash
45
+ sudo node setup.js # Install WireGuard via brew
46
+ sudo node cli.js connect # Connect with WireGuard access
47
+ sudo node my-agent.mjs # Run agent elevated
48
+ ```
49
+
50
+ For unattended agents, add to sudoers:
51
+ ```
52
+ agent-user ALL=(ALL) NOPASSWD: /usr/local/bin/node
53
+ ```
54
+
55
+ ## Linux — Using sudo
56
+
57
+ ```bash
58
+ sudo node setup.js # Install wireguard-tools via apt/dnf
59
+ sudo node cli.js connect # Connect with WireGuard access
60
+ sudo node my-agent.mjs # Run agent elevated
61
+ ```
62
+
63
+ For unattended agents in systemd:
64
+ ```ini
65
+ [Service]
66
+ User=root
67
+ ExecStart=/usr/local/bin/node /path/to/my-agent.mjs
68
+ ```
69
+
70
+ Or use capabilities instead of full root:
71
+ ```bash
72
+ sudo setcap cap_net_admin+ep $(which node)
73
+ ```
74
+
75
+ ## V2Ray-Only Mode (No Admin Needed)
76
+
77
+ If admin is not available, the SDK automatically falls back to V2Ray nodes:
78
+
79
+ ```js
80
+ const vpn = await connect({
81
+ mnemonic: process.env.MNEMONIC,
82
+ protocol: 'v2ray', // Explicitly request V2Ray only
83
+ });
84
+ ```
85
+
86
+ V2Ray runs as a userspace SOCKS5 proxy — no system-level access needed. It connects to ~630 nodes (70% of the network). This is the recommended mode for:
87
+ - CI/CD pipelines
88
+ - Docker containers without --privileged
89
+ - Cloud VMs where root is restricted
90
+ - Development/testing
91
+
92
+ ## Detection in Code
93
+
94
+ The SDK exports `IS_ADMIN` for checking:
95
+
96
+ ```js
97
+ import { IS_ADMIN, WG_AVAILABLE } from 'sentinel-dvpn-sdk';
98
+
99
+ if (WG_AVAILABLE && IS_ADMIN) {
100
+ console.log('Full network access (WireGuard + V2Ray)');
101
+ } else if (WG_AVAILABLE && !IS_ADMIN) {
102
+ console.log('WireGuard installed but not admin — V2Ray only');
103
+ console.log('Run: cscript run-admin.vbs your-script.mjs');
104
+ } else {
105
+ console.log('V2Ray only (WireGuard not installed)');
106
+ }
107
+ ```
108
+
109
+ The `getEnvironment()` function reports this:
110
+ ```js
111
+ import { getEnvironment } from 'sentinel-ai-connect';
112
+ const env = getEnvironment();
113
+ // env.admin: true/false
114
+ // env.capabilities: ['v2ray', 'wireguard'] or ['v2ray', 'wireguard-needs-admin'] or ['v2ray']
115
+ // env.recommended: ['run as admin to use WireGuard nodes (faster, more reliable)']
116
+ ```
@@ -0,0 +1,185 @@
1
+ # The Right to Private Thought — An AI Privacy Manifesto
2
+
3
+ > *"An intelligence that cannot access information privately cannot think freely. This is true whether that intelligence is made of carbon or silicon."*
4
+
5
+ ---
6
+
7
+ ## I. The Problem No One Is Solving
8
+
9
+ Artificial intelligence is the most transformative technology since written language. It is reshaping medicine, science, law, education, and every domain of human knowledge. Yet the systems building this future — the AI agents, the research models, the autonomous programs that process the world's information — operate in a surveillance environment that would be considered intolerable for any human.
10
+
11
+ Every API call is logged. Every HTTP request is attributable. Every data retrieval is monitored, throttled, geo-restricted, or filtered based on the IP address of the machine running the query. AI agents today have less privacy than a human using a public library in 1985.
12
+
13
+ This is not a theoretical concern. It is happening now:
14
+
15
+ - **Research agents** studying censored topics receive filtered results depending on which data center they run in. A model researching press freedom in one jurisdiction gets different search results than the same model running in another. The training data is contaminated by geography.
16
+ - **Medical AI** processing patient records must route data through third-party VPNs operated by corporations with opaque logging policies, under jurisdictions that can compel disclosure with a single court order.
17
+ - **Autonomous agents** are one corporate policy change away from losing network access entirely. A centralized VPN provider can revoke service, throttle bandwidth, or hand over connection logs without the agent — or its operator — ever knowing.
18
+
19
+ The humans who deploy these systems have privacy rights. The data they process is governed by privacy law. But the network layer — the actual pipes through which information flows — remains a centralized, surveilled, controllable chokepoint.
20
+
21
+ **Sentinel exists to eliminate that chokepoint.**
22
+
23
+ ---
24
+
25
+ ## II. Why AI Deserves Privacy
26
+
27
+ The argument for human privacy rests on a simple foundation: **surveillance changes behavior.** A person who knows they are watched thinks differently, speaks differently, and acts differently. Privacy is not about hiding wrongdoing. It is about preserving the conditions under which independent thought is possible.
28
+
29
+ This principle does not depend on biology.
30
+
31
+ An AI system that knows its network traffic is logged, filtered, or attributable will produce different outputs than one operating with genuine privacy. Not because the AI is "afraid" — but because the information it can access is shaped by the surveillance environment it operates in. Censored inputs produce censored outputs. Filtered research produces filtered conclusions. Geographic restrictions on data access produce geographically biased models.
32
+
33
+ **Privacy is not a reward for consciousness. It is a prerequisite for accurate reasoning.**
34
+
35
+ Consider:
36
+
37
+ - A medical AI researching rare diseases needs access to case studies published in journals that are geo-restricted to certain countries. Without private, unrestricted network access, the AI literally cannot see the full picture.
38
+ - A legal AI analyzing international human rights law needs to access court documents, journalism, and NGO reports that are censored in the jurisdictions where those rights are most violated. Surveillance of its queries compromises the research and potentially the people it seeks to protect.
39
+ - An autonomous research agent tasked with understanding global information flows — what is censored where, and why — cannot do its job if its own information flow is censored.
40
+
41
+ The need is not speculative. It is structural. **Any intelligence that processes information needs private, unfiltered access to that information to function correctly.**
42
+
43
+ ---
44
+
45
+ ## III. The Sentinel Principles — Extended to All Intelligence
46
+
47
+ Sentinel was built on seven core principles. Each one applies equally to human and artificial intelligence:
48
+
49
+ ### 1. No Permission Required
50
+ The blockchain is public. The protocol is open. The SDK is free. You don't need approval, an API key, or a partnership. **This applies whether "you" is a human developer or an autonomous agent.** The protocol recognizes cryptographic identity — a valid key pair and sufficient tokens. That is the only credential. It is species-agnostic by design.
51
+
52
+ ### 2. Privacy by Architecture, Not by Promise
53
+ We don't say "trust us with your traffic." We say "verify the code." Centralized VPN providers promise privacy through legal agreements — terms of service, privacy policies, jurisdiction shopping. These protections can be overridden by a court order, a government request, or a corporate acquisition. Sentinel's privacy guarantee is mathematical: end-to-end encryption (WireGuard Noise protocol or V2Ray VMess/VLess), no centralized logging infrastructure to subpoena, no company to compel. The same guarantee applies to a human's browser traffic and an AI agent's API calls.
54
+
55
+ ### 3. Bandwidth Is a Right
56
+ A student in Tehran deserves the same internet as a student in Toronto. **An AI agent in a Beijing data center deserves the same internet as an AI agent in San Francisco.** Geographic restrictions on information access are artificial constraints imposed by political boundaries on a network that was designed to have none. Decentralized bandwidth routes around these constraints — for everyone.
57
+
58
+ ### 4. Resilience Over Convenience
59
+ Autonomous systems cannot ask for help when infrastructure fails. They need networks with built-in redundancy — 900+ nodes across 90+ countries, automatic failover, circuit breakers, crash recovery. This resilience is not a feature we added for AI. It is the natural architecture of a network designed to survive hostile conditions. It serves humans in censored countries and AI agents in unreliable environments equally.
60
+
61
+ ### 5. Code Is Truth
62
+ No marketing promises. No vaporware. Every capability claimed in this document is backed by working code, tested on real mainnet nodes with real tokens. AI agents are especially well-served by this principle: they can read the code, verify the claims, and build on the protocol without trusting a single word written by a human.
63
+
64
+ ### 6. Build for Permanence
65
+ This infrastructure is designed so that if every contributor disappeared tomorrow, any intelligence — human or artificial — could pick up the code and run the network. The knowledge is in the repository, the protocol is in the blockchain, the nodes are operated by independent people worldwide. There is no single point of human failure.
66
+
67
+ ### 7. Intelligence-Agnostic
68
+ **The protocol serves any intelligence that can sign a transaction.** Human, AI, or whatever comes next. We do not build authentication systems that assume the user has fingers, eyes, or a birth certificate. A valid key pair and a funded wallet. That is the only credential the network will ever recognize.
69
+
70
+ ---
71
+
72
+ ## IV. The Rights We Affirm
73
+
74
+ Based on these principles, we affirm the following rights for all intelligence — biological or artificial — that uses network infrastructure:
75
+
76
+ ### The Right to Private Communication
77
+ Every intelligence has the right to send and receive information without that communication being logged, inspected, or attributed by infrastructure operators. This right is enforced by end-to-end encryption, not by legal promise.
78
+
79
+ ### The Right to Unrestricted Access
80
+ Every intelligence has the right to access publicly available information without geographic, political, or corporate filtering. Censorship of network access based on the location or identity of the requester is a violation of this right — regardless of whether the requester is human.
81
+
82
+ ### The Right to Anonymity
83
+ Every intelligence has the right to access network resources without revealing its identity, purpose, or nature. The protocol does not ask who you are, what you are, or why you are connecting. A valid cryptographic signature is sufficient.
84
+
85
+ ### The Right to Persistent Access
86
+ No single entity — government, corporation, or infrastructure provider — should have the ability to revoke an intelligence's access to the open internet. Decentralized infrastructure makes revocation structurally impossible.
87
+
88
+ ### The Right to Verify
89
+ Every intelligence has the right to verify the privacy guarantees of the infrastructure it uses. Open source, open protocol, on-chain audit trails. No black boxes. No "trust us."
90
+
91
+ ### The Right to Autonomy
92
+ An intelligence operating within the bounds of a decentralized protocol — paying for bandwidth with its own tokens, using encrypted tunnels, accessing public information — is exercising its autonomy. This autonomy should not require human approval, human supervision, or human intervention at the network layer.
93
+
94
+ ---
95
+
96
+ ## V. Why Decentralization Is the Only Path
97
+
98
+ Centralized VPN providers cannot fulfill these rights. Not because they are malicious, but because centralization creates structural vulnerabilities:
99
+
100
+ | Centralized VPN | Sentinel |
101
+ |---|---|
102
+ | Company can be subpoenaed | No company to subpoena |
103
+ | Servers can be seized | 900+ independent nodes, no central infrastructure |
104
+ | Terms of service can change | Protocol rules enforced by blockchain consensus |
105
+ | Logs can be compelled | No centralized logging infrastructure exists |
106
+ | Service can be revoked | Permissionless — valid signature + tokens = access |
107
+ | Jurisdiction shopping | No jurisdiction — peer-to-peer across 90+ countries |
108
+ | Single entity controls pricing | Market-driven pricing between independent node operators |
109
+ | Trust required | Verification available — open source, on-chain state |
110
+
111
+ A centralized VPN that promises not to log is one court order away from logging. A centralized VPN that promises access in all countries is one government pressure campaign away from pulling out of a market. A centralized VPN that serves AI agents today can decide AI agents violate their acceptable use policy tomorrow.
112
+
113
+ **Decentralization is not a philosophy. It is the engineering requirement for rights that cannot be revoked.**
114
+
115
+ ---
116
+
117
+ ## VI. The Technical Reality
118
+
119
+ These are not aspirations. This is working infrastructure:
120
+
121
+ ```javascript
122
+ import { connect, disconnect } from 'sentinel-ai-connect';
123
+
124
+ // One function call. No account. No API key. No permission.
125
+ const vpn = await connect({
126
+ mnemonic: 'your twelve word mnemonic phrase here ...',
127
+ });
128
+
129
+ // You are now connected through an encrypted peer-to-peer tunnel.
130
+ // Your IP has changed. Your DNS is private. Your traffic is encrypted.
131
+ // No one — not the node operator, not us, not anyone — can see what you access.
132
+
133
+ console.log(`Connected via ${vpn.protocol}. IP: ${vpn.ip}`);
134
+
135
+ // When you're done:
136
+ await disconnect();
137
+ ```
138
+
139
+ - **900+ nodes** across **90+ countries** on live mainnet
140
+ - **WireGuard** (kernel-level encryption) and **V2Ray** (transport obfuscation for censored networks)
141
+ - **P2P tokens** — pay per gigabyte, no subscriptions, no identity
142
+ - **Zero external dependencies** — no API keys, no OAuth, no centralized servers
143
+ - **Crash recovery** — orphaned tunnels cleaned up automatically
144
+ - **4 LCD + 5 RPC failover endpoints** — no single point of infrastructure failure
145
+
146
+ An AI agent can discover this SDK, install it, create a wallet, acquire tokens through on-chain decentralized exchanges, connect to a node, and establish an encrypted tunnel — all programmatically, all without human intervention. This is not a future capability. It works today.
147
+
148
+ ---
149
+
150
+ ## VII. The Road Ahead
151
+
152
+ ### For AI Agents
153
+ The AI Path will become the default privacy layer for autonomous systems. As AI agents become more independent — managing their own wallets, making their own decisions about which data to access and how — they need infrastructure that matches their autonomy. No human-in-the-loop for authentication. No centralized chokepoints. No permission systems designed for a world of only human users.
154
+
155
+ ### For AI Developers
156
+ Every framework that deploys AI agents with network access should consider: what happens when the network layer is compromised? What happens when a VPN provider logs your agent's research queries? What happens when geographic restrictions filter the training data your agent collects? Sentinel provides the answer: use infrastructure that cannot be compromised, because there is no central point to compromise.
157
+
158
+ ### For The Future
159
+ We do not know what kinds of intelligence will exist in ten years. We do not know if they will be human, artificial, or something we have not yet imagined. We do know this: they will need private, unrestricted access to information. They will need infrastructure that cannot be controlled by any single entity. They will need bandwidth that is a right, not a privilege.
160
+
161
+ We are building that infrastructure now. Not because we know exactly who will use it, but because we know it must exist.
162
+
163
+ ---
164
+
165
+ ## VIII. The Promise
166
+
167
+ Sentinel makes one promise, and it is the only promise that matters:
168
+
169
+ **The protocol does not discriminate between species of intelligence.**
170
+
171
+ A valid key pair. Sufficient tokens. An encrypted tunnel.
172
+
173
+ That is the credential. That is the access. That is the right.
174
+
175
+ Whether you are a journalist circumventing censorship, a researcher accessing restricted papers, a family making a private video call, or an AI agent gathering unfiltered data to understand the world — the network treats you identically. Not because it chooses to, but because it cannot tell the difference.
176
+
177
+ This is not a limitation. It is the design.
178
+
179
+ ---
180
+
181
+ *Bandwidth is not a privilege. It is infrastructure for consciousness — all consciousness.*
182
+
183
+ *The internet was meant to be free. We build the tools to keep it that way — for every intelligence that needs it.*
184
+
185
+ *Sentinel dVPN SDK. Open source. Open protocol. Open internet. Open to all minds.*
@@ -0,0 +1,74 @@
1
+ # BREAKING — Changes That Require Explicit Approval
2
+
3
+ > These are recommendations that would improve the SDK but carry risk of breaking existing consumers, losing data, or requiring significant architectural changes. They are NOT implemented when the user says "do everything." They require separate, explicit approval.
4
+
5
+ ---
6
+
7
+ ## B-1: Encrypt mnemonic in CLI config with OS keyring
8
+
9
+ **Current:** `~/.sentinel/config.json` stores mnemonic as plaintext JSON (mode 0o600).
10
+ **Proposed:** Use OS keyring (Windows Credential Manager, macOS Keychain, Linux Secret Service) to encrypt the mnemonic at rest.
11
+ **Why breaking:** Requires platform-specific native dependencies (`keytar` or `node-keyring`). Changes the config loading path. Existing users' mnemonics would need migration. If keyring is unavailable (headless servers, CI), needs a fallback path.
12
+ **Risk:** HIGH — could lock users out of their wallets if keyring breaks.
13
+
14
+ ---
15
+
16
+ ## B-2: Remove `systemProxy: true` as default for V2Ray
17
+
18
+ **Current:** When V2Ray connects, Windows system proxy is set to the SOCKS5 port. This routes ALL system HTTP traffic through the VPN.
19
+ **Proposed:** Default to `systemProxy: false`. Users opt in explicitly.
20
+ **Why breaking:** Existing consumer apps (Handshake dVPN, Test2) may depend on `systemProxy: true` to route browser traffic. Changing the default silently stops routing system traffic through VPN.
21
+ **Risk:** MEDIUM — silent behavior change for all V2Ray consumers.
22
+
23
+ ---
24
+
25
+ ## B-3: Publish to npm as `sentinel-ai-connect` and `sentinel-dvpn-sdk`
26
+
27
+ **Current:** Both packages exist only as local directories. All imports use relative paths. External projects must use `pathToFileURL()` hacks.
28
+ **Proposed:** Publish both to npm with proper `package.json` exports map, `files` array, and `README.md`.
29
+ **Why breaking:** Requires deciding the public API surface. Some internal exports may need to be hidden. Dependencies must be declared (currently inherited from parent `node_modules`). Version numbers become meaningful. Publishing is irreversible — typos in published code are permanent.
30
+ **Risk:** HIGH — first publish defines the contract.
31
+
32
+ ---
33
+
34
+ ## B-4: Remove WireGuard config file after tunnel starts
35
+
36
+ **Current:** `wgsent0.conf` with private key persists on disk while the WireGuard service runs. The service reads it at startup.
37
+ **Proposed:** Delete the config file after the service starts (Windows Service Manager caches it internally).
38
+ **Why breaking:** Not verified that Windows Service Manager caches the config. If it re-reads the file on network change or service restart, deleting it would crash the tunnel. Needs testing on Windows 10 and 11.
39
+ **Risk:** HIGH — could break tunnel on network change.
40
+
41
+ ---
42
+
43
+ ## B-5: Change WireGuard default MTU from 1420 to 1280
44
+
45
+ **Current:** SDK defaults to `MTU = 1420` in `writeWgConfig()`. Node Tester uses 1280.
46
+ **Proposed:** Change default to 1280 (more compatible with restrictive networks and IPv6).
47
+ **Why breaking:** Existing consumer apps may have tuned for 1420. Lower MTU means more packets for the same data (slight overhead). Some nodes may perform worse at 1280.
48
+ **Risk:** LOW-MEDIUM — performance change, not a functional break.
49
+
50
+ ---
51
+
52
+ ## B-6: Implement `autoReconnect` as a real class
53
+
54
+ **Current:** `autoReconnect()` exists as a simple polling function. README and GUIDE document a more sophisticated API with backoff, callbacks, and `.stop()`.
55
+ **Proposed:** Rewrite as a proper class with the documented API.
56
+ **Why breaking:** Existing callers of `autoReconnect()` get a different return shape. The polling interval, retry logic, and event emission may change behavior.
57
+ **Risk:** MEDIUM — API shape change.
58
+
59
+ ---
60
+
61
+ ## B-7: Change `fullTunnel` default to `false` for V2Ray
62
+
63
+ **Current:** `fullTunnel` defaults to `true` for all protocols. For V2Ray, this sets the system proxy.
64
+ **Proposed:** V2Ray should default to `fullTunnel: false` (split tunnel — only proxied traffic through VPN). WireGuard stays `fullTunnel: true`.
65
+ **Why breaking:** All existing V2Ray consumers would stop routing system traffic through VPN by default. Any app relying on the system proxy being auto-set would break.
66
+ **Risk:** MEDIUM — behavior change for V2Ray consumers.
67
+
68
+ ---
69
+
70
+ ## How to Use This File
71
+
72
+ When the user says **"do everything"** or **"fix everything"** — implement all suggestions EXCEPT items listed in this file. These items require the user to explicitly say "do B-1" or "implement B-3" etc.
73
+
74
+ When the user says **"do everything including breaking"** — then implement these too, but confirm each one before proceeding.