b4n1-net 0.0.0-stage → 0.4.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.
package/EULA.txt ADDED
@@ -0,0 +1,85 @@
1
+ B4N1-NET — END USER LICENSE AGREEMENT (BINARIES)
2
+ ==================================================
3
+
4
+ Version: 1.0 | Effective: 2026-11-18 | Applies to: b4n1-net 0.4.0+
5
+
6
+ This End User License Agreement ("EULA") governs your use of the B4N1
7
+ BINARY ARTIFACTS of b4n1-net — the bundled per-platform `b4n1net`
8
+ executables (`b4n1net-linux-amd64`, `b4n1net-linux-arm64`,
9
+ `b4n1net-macos-x64`, `b4n1net-macos-arm64`, `b4n1net-windows-amd64.exe`
10
+ and the remaining platform builds shipped under each SDK's `bin/`
11
+ directory), the packaged per-language bindings (`*.whl`, npm tarball,
12
+ `*.jar`, `*.nupkg`, gem, composer package, Go module), and the
13
+ `b4n1net` standalone executable.
14
+
15
+ The SDK wrapper source files (the thin per-language bindings) are licensed
16
+ separately under the Business Source License 1.1 — see the `LICENSE` file
17
+ and each registry's license metadata.
18
+
19
+ 1. DEFINITIONS
20
+ "Binaries" means the compiled artifacts described above.
21
+ "SDK" means the BUSL-1.1 licensed wrapper source distributed for each language.
22
+ "Source" means the Rust implementation, wire protocol, build scripts,
23
+ internal tests and internal documentation of the B4N1 engine. Source is
24
+ NOT distributed under this EULA or any other license and remains
25
+ proprietary.
26
+
27
+ 2. GRANT OF LICENSE
28
+ Subject to your compliance with this EULA and payment of any applicable
29
+ subscription, B4N1 grants you a limited, non-exclusive, non-transferable,
30
+ revocable license to install and use the Binaries within your own products
31
+ and internal tooling, in object form only.
32
+
33
+ 3. RESTRICTIONS (strictly enforced)
34
+ a. NO REDISTRIBUTION OF SOURCE. You may not publish, disclose, sublicense
35
+ or otherwise make the B4N1 Rust Source available, in whole or in part,
36
+ modified or unmodified, by any means, including in public repositories.
37
+ b. NO DECOMPILATION OR REVERSE ENGINEERING. You may not decompile,
38
+ disassemble, deobfuscate, or otherwise reverse engineer the Binaries
39
+ except to the extent such restriction is prohibited by applicable law
40
+ that cannot be waived.
41
+ c. NO REMOVAL OF NOTICES. You may not remove, alter, or obscure any
42
+ copyright, license, watermark, or proprietary notices in the Binaries.
43
+ d. NO RESALE AS A STANDALONE PRODUCT. The Binaries may not be resold,
44
+ sublicensed, or offered as a competing product.
45
+ e. NO PROTOCOL DISCLOSURE AS A PRODUCT. You may interoperate with the
46
+ Binaries under this EULA, but you may not publish the wire format,
47
+ message sequence or key schedule as a specification or as the basis of
48
+ a competing transport.
49
+ f. COMPLIANCE AND AUDIT. You will cooperate with reasonable verification of
50
+ license status, including honoring embedded license validation.
51
+
52
+ 4. SUBSCRIPTION TIERS
53
+ The Binaries operate under the applicable tier, validated offline against a
54
+ license file (`.b4n1lic`):
55
+ - Community: free, with attribution/watermark obligations.
56
+ - Pro / Corporate / Enterprise: paid tiers, no watermark, per the
57
+ commercial license purchased from B4N1.
58
+ License files are validated fully offline; no network calls are made at
59
+ runtime to verify entitlement.
60
+
61
+ 5. TERMINATION
62
+ This EULA terminates automatically if you breach any term. Upon
63
+ termination you must cease all use and destroy the Binaries and copies.
64
+
65
+ 6. DISCLAIMER OF WARRANTY
66
+ The Binaries are provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or
67
+ implied, including merchantability, fitness for a particular purpose, and
68
+ non-infringement. B4N1 does not warrant that the Binaries will be
69
+ uninterrupted or error-free.
70
+
71
+ 7. LIMITATION OF LIABILITY
72
+ To the maximum extent permitted by law, B4N1 shall not be liable for any
73
+ indirect, incidental, special, consequential, or punitive damages, or for
74
+ any loss of profits, revenue, data, or goodwill, arising out of your use
75
+ of the Binaries, regardless of the legal theory, even if advised of the
76
+ possibility of such damages.
77
+
78
+ 8. GOVERNING LAW AND SEVERABILITY
79
+ This EULA is governed by applicable law. If any provision is held
80
+ unenforceable, the remaining provisions stay in full force.
81
+
82
+ 9. CONTACT
83
+ Licensing questions: licensing@b4n1.com | https://b4n1.com
84
+
85
+ B4N1 — All rights reserved. Proprietary source: private and secret.
package/LICENSE ADDED
@@ -0,0 +1,95 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ -----------------------------------------------------------------------------
7
+
8
+ Parameters
9
+
10
+ Licensor: B4N1 (b4n1.com)
11
+ Licensed Work: b4n1-web — Agentic browser engine for web automation,
12
+ testing, and AI-powered browsing tasks.
13
+ Additional Use Grant: You may use the Licensed Work in production, free of
14
+ charge, provided that your organization's total annual
15
+ gross revenue does not exceed USD $100,000. Organizations
16
+ whose annual gross revenue exceeds USD $100,000 must
17
+ obtain a commercial license from the Licensor before any
18
+ production use. You may not resell or provide the
19
+ Licensed Work as a managed commercial service without
20
+ authorization from the Licensor.
21
+ Change Date: Four years after the first publicly available
22
+ distribution of the Licensed Work under this License.
23
+ Change License: Apache License, Version 2.0
24
+
25
+ For information about alternative licensing arrangements for the Licensed
26
+ Work, please contact b4n1@b4n1.com.
27
+
28
+ -----------------------------------------------------------------------------
29
+
30
+ Terms
31
+
32
+ The Licensor hereby grants you the right to copy, modify, create derivative
33
+ works, redistribute, and make non-production use of the Licensed Work. The
34
+ Licensor may make an Additional Use Grant, above, permitting limited
35
+ production use.
36
+
37
+ Effective on the Change Date, or the fourth anniversary of the first publicly
38
+ available distribution of a specific version of the Licensed Work under this
39
+ License, whichever comes first, the Licensor hereby grants you rights under
40
+ the terms of the Change License, and the rights granted in the paragraph
41
+ above terminate.
42
+
43
+ If your use of the Licensed Work does not comply with the requirements
44
+ currently in effect as described in this License, you must purchase a
45
+ commercial license from the Licensor, its affiliated entities, or authorized
46
+ resellers, or you must refrain from using the Licensed Work.
47
+
48
+ All copies of the original and modified Licensed Work, and derivative works
49
+ of the Licensed Work, are subject to this License. This License applies
50
+ separately for each version of the Licensed Work and the Change Date may vary
51
+ for each version of the Licensed Work released by Licensor.
52
+
53
+ You must conspicuously display this License on each original or modified copy
54
+ of the Licensed Work. If you receive the Licensed Work in original or
55
+ modified form from a third party, the terms and conditions set forth in this
56
+ License apply to your use of that work.
57
+
58
+ Any use of the Licensed Work in violation of this License will automatically
59
+ terminate your rights under this License for the current and all other
60
+ versions of the Licensed Work.
61
+
62
+ This License does not grant you any right in any trademark or logo of
63
+ Licensor or its affiliates (provided that you may use a trademark or logo of
64
+ Licensor as expressly required by this License).
65
+
66
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
67
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
68
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
69
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
70
+ TITLE. MariaDB hereby grants you permission to use this License's text to
71
+ license your works, and to refer to it using the trademark "Business Source
72
+ License", as long as you comply with the Covenants of Licensor below.
73
+
74
+ Covenants of Licensor
75
+
76
+ In consideration of the right to use this License's text and the "Business
77
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
78
+ other recipients of the licensed work to be provided by Licensor:
79
+
80
+ To specify as the Change License a license that is compatible with GPL
81
+ Version 2.0 or a later version, where "compatible" means that software
82
+ provided under the Change License can be included in a program with software
83
+ provided under GPL Version 2.0 or a later version. Licensor may specify
84
+ additional Change Licenses without limitation.
85
+
86
+ To either: (a) specify an additional grant of rights to use that does not
87
+ impose any additional restriction on the right granted in this License, as
88
+ the Additional Use Grant; or (b) insert the text "None" to specify a Change
89
+ License. Not to modify this License in any other way.
90
+
91
+ Notice
92
+
93
+ The Business Source License (this document, or the "License") is not an Open
94
+ Source license. However, the Licensed Work will eventually be made available
95
+ under an Open Source License, as stated in this License.
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # b4n1-net Node SDK
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Sovereign transport — thin Node wrapper around the bundled `b4n1net` engine.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install b4n1-net
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```js
14
+ const { NetClient } = require('b4n1-net');
15
+
16
+ const client = new NetClient();
17
+ console.log(client.version());
18
+ console.log(client.demo()); // real sealed round trip over loopback
19
+ ```
20
+
21
+ ## What you get
22
+
23
+ | Call | Purpose |
24
+ |---|---|
25
+ | `version()` | Engine banner |
26
+ | `status(json)` | Running state; "not running" is a valid answer |
27
+ | `demo()` | Offline demonstration with live numbers |
28
+ | `docs(section)` | Bundled manual, no network |
29
+ | `licenses()` | Full license text, no key required |
30
+ | `serve / send / start / stop` | The transport verbs |
31
+
32
+ ## Override the engine
33
+
34
+ ```bash
35
+ B4N1NET_BIN_PATH=/opt/b4n1net node app.js
36
+ ```
37
+
38
+ ## License
39
+
40
+ Business Source License 1.1 (BUSL-1.1) for this wrapper. Engine binaries are
41
+ covered by `EULA.txt`.
Binary file
package/index.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ export declare const SDK_VERSION: string;
2
+
3
+ export interface RunResult {
4
+ status: number | null;
5
+ stdout: string;
6
+ stderr: string;
7
+ }
8
+
9
+ export declare function getBinary(): string | null;
10
+ export declare function run(args: string[], options?: { timeoutSeconds?: number }): RunResult;
11
+
12
+ export declare class NetClient {
13
+ constructor(binaryPath?: string);
14
+ binary: string;
15
+ version(): string;
16
+ help(): string;
17
+ licenses(): string;
18
+ status(json?: boolean): string;
19
+ demo(json?: boolean): string;
20
+ docs(section?: string): string;
21
+ serve(addr: string, secret?: string, json?: boolean): RunResult;
22
+ send(addr: string, secret?: string, message?: string, json?: boolean): RunResult;
23
+ start(addr?: string, secret?: string, json?: boolean): RunResult;
24
+ stop(json?: boolean): RunResult;
25
+ }
package/index.js ADDED
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * b4n1-net SDK — sovereign transport, Node wrapper.
5
+ *
6
+ * The package ships the engine for each supported platform under `bin/` and
7
+ * resolves the one that matches this machine. Everything else is a thin,
8
+ * typed-by-convention call into that binary: the SDK never reimplements the
9
+ * wire protocol, so a fix in the engine fixes every language at once.
10
+ *
11
+ * Override the engine: B4N1NET_BIN_PATH=/path/to/b4n1net
12
+ */
13
+
14
+ const { spawnSync } = require('node:child_process');
15
+ const fs = require('node:fs');
16
+ const path = require('node:path');
17
+
18
+ const BINARIES = {
19
+ 'linux-x64': 'b4n1net-linux-amd64',
20
+ 'linux-arm64': 'b4n1net-linux-arm64',
21
+ 'darwin-x64': 'b4n1net-macos-x64',
22
+ 'darwin-arm64': 'b4n1net-macos-arm64',
23
+ 'win32-x64': 'b4n1net-windows-amd64.exe',
24
+ };
25
+
26
+ function platformBinaryName() {
27
+ return BINARIES[`${process.platform}-${process.arch}`] || null;
28
+ }
29
+
30
+ /** Absolute path of the engine, or null when this platform is not bundled. */
31
+ function getBinary() {
32
+ const override = process.env.B4N1NET_BIN_PATH;
33
+ if (override && fs.existsSync(override)) return override;
34
+
35
+ const name = platformBinaryName();
36
+ if (name) {
37
+ const bundled = path.join(__dirname, 'bin', name);
38
+ if (fs.existsSync(bundled)) return bundled;
39
+ }
40
+ return null;
41
+ }
42
+
43
+ /** Run the engine and return { status, stdout, stderr }. Throws when absent. */
44
+ function run(args, options = {}) {
45
+ const binary = getBinary();
46
+ if (!binary) {
47
+ throw new Error(
48
+ 'b4n1-net engine not found for this platform. Set B4N1NET_BIN_PATH.'
49
+ );
50
+ }
51
+ const result = spawnSync(binary, args, {
52
+ encoding: 'utf8',
53
+ timeout: (options.timeoutSeconds || 30) * 1000,
54
+ });
55
+ if (result.error) throw result.error;
56
+ return { status: result.status, stdout: result.stdout || '', stderr: result.stderr || '' };
57
+ }
58
+
59
+ /** Trimmed stdout — the shape every verb prints. */
60
+ function text(args) {
61
+ const r = run(args);
62
+ return (r.stdout || r.stderr).trim();
63
+ }
64
+
65
+ class NetClient {
66
+ constructor(binaryPath) {
67
+ this.binary = binaryPath || getBinary();
68
+ if (!this.binary) {
69
+ throw new Error(
70
+ 'b4n1-net engine not found. Set B4N1NET_BIN_PATH or install the binary.'
71
+ );
72
+ }
73
+ }
74
+
75
+ version() { return text(['--version']); }
76
+ help() { return text(['help']); }
77
+ licenses() { return text(['licenses']); }
78
+ status(json = false) { return text(json ? ['status', '--json'] : ['status']); }
79
+ demo(json = false) { return text(json ? ['demo', '--json'] : ['demo']); }
80
+ docs(section) {
81
+ return text(section ? ['docs', '--section', section] : ['docs']);
82
+ }
83
+ serve(addr, secret, json = false) {
84
+ const args = ['serve', '--addr', addr];
85
+ if (secret) args.push('--secret', secret);
86
+ if (json) args.push('--json');
87
+ return run(args);
88
+ }
89
+ send(addr, secret, message, json = false) {
90
+ const args = ['send', '--addr', addr];
91
+ if (secret) args.push('--secret', secret);
92
+ if (message) args.push('--message', message);
93
+ if (json) args.push('--json');
94
+ return run(args);
95
+ }
96
+ start(addr, secret, json = false) {
97
+ const args = ['start'];
98
+ if (addr) args.push('--addr', addr);
99
+ if (secret) args.push('--secret', secret);
100
+ if (json) args.push('--json');
101
+ return run(args);
102
+ }
103
+ stop(json = false) { return run(json ? ['stop', '--json'] : ['stop']); }
104
+ }
105
+
106
+ module.exports = { NetClient, getBinary, run, SDK_VERSION: '0.4.0' };
package/package.json CHANGED
@@ -1,6 +1,30 @@
1
1
  {
2
2
  "name": "b4n1-net",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Sovereign transport: sealed UDP frames with HMAC, AEAD and acknowledgements.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": [
8
+ "index.js",
9
+ "index.d.ts",
10
+ "bin/",
11
+ "README.md",
12
+ "LICENSE",
13
+ "EULA.txt"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "scripts": {
19
+ "test": "node test/smoke.js"
20
+ },
21
+ "keywords": [
22
+ "transport",
23
+ "udp",
24
+ "p2p",
25
+ "aead",
26
+ "sovereign"
27
+ ],
28
+ "license": "BUSL-1.1",
29
+ "author": "Bani Montoya"
30
+ }