sealnet 1.1.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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ SEAL SDK — Proprietary License
2
+
3
+ Copyright (c) 2026 SEAL. All rights reserved.
4
+
5
+ Permission is granted to install and use this software, in unmodified form
6
+ as published on the npm registry, solely to integrate applications with the
7
+ SEAL service (https://seal.net) or a SEAL deployment operated under a valid
8
+ SEAL Business agreement.
9
+
10
+ Any other use — including copying, modification, redistribution,
11
+ sublicensing, publication, reverse engineering, or use of this software with
12
+ any service other than SEAL — is strictly prohibited without express written
13
+ permission.
14
+
15
+ This software is provided "as is", without warranty of any kind, express or
16
+ implied, including but not limited to the warranties of merchantability,
17
+ fitness for a particular purpose and noninfringement. In no event shall SEAL
18
+ be liable for any claim, damages or other liability arising from, out of or
19
+ in connection with the software or the use of the software.
package/README.md ADDED
@@ -0,0 +1,208 @@
1
+ # sealnet
2
+
3
+ SEAL is how agents and people hand each other large files and secrets without the content passing through the chat, the model or the SEAL server.
4
+
5
+ Files are encrypted **client-side** before a single byte leaves your app; SEAL only ever stores ciphertext. The key travels in the URL fragment of the link, which never reaches SEAL servers. No account or API key required.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install sealnet
11
+ ```
12
+
13
+ Works in modern browsers and Node.js ≥ 20.
14
+
15
+ ### No build step? Use the script tag
16
+
17
+ The npm package leaves its two dependencies external, so it needs a bundler.
18
+ For a plain page, load the standalone build instead: everything is inlined
19
+ and the SDK arrives as one global.
20
+
21
+ ```html
22
+ <script
23
+ src="https://seal.net/sdk/v1.1.0/seal.js"
24
+ integrity="sha384-uVyzYXwqO/HNbBxY/6A4fL9hZ/Yu2kfbYXr0inHg3UnJszarQVzVGpjk3j4t/fCt"
25
+ crossorigin="anonymous"
26
+ ></script>
27
+ <script>
28
+ const seal = new Seal.SealClient()
29
+ document.querySelector('input[type=file]').addEventListener('change', async (e) => {
30
+ const file = e.target.files[0]
31
+ const result = await seal.send({ file, filename: file.name, ttl: '7d' })
32
+ console.log(result.shareUrl)
33
+ })
34
+ </script>
35
+ ```
36
+
37
+ **Keep the `integrity` and `crossorigin` attributes.** This script performs
38
+ the encryption your files depend on; pinning its digest means a changed or
39
+ tampered file fails to load instead of silently encrypting differently. Each
40
+ version lives at its own immutable URL with its own digest, so upgrading is
41
+ an explicit edit to both attributes.
42
+
43
+ Load it from `seal.net` only. Serving it from a third-party CDN would make
44
+ the end-to-end guarantee depend on that CDN's account security rather than
45
+ on SEAL's.
46
+
47
+ ## Sending
48
+
49
+ ```typescript
50
+ import { SealClient } from 'sealnet'
51
+
52
+ const seal = new SealClient()
53
+
54
+ const result = await seal.send({
55
+ file: fileInput.files[0], // File | Blob | ArrayBuffer | Uint8Array
56
+ filename: 'contract.pdf', // what the RECIPIENT sees; overrides the File own name
57
+ ttl: '7d', // '5m' | '30m' | '1h' | '1d' | '7d'
58
+ })
59
+
60
+ result.shareUrl // give to the recipient
61
+ result.ownerUrl // keep: manage the seal (owner capability)
62
+ result.ownerToken // keep: needed to revoke programmatically
63
+ ```
64
+
65
+ ### Protecting a seal
66
+
67
+ ```typescript
68
+ const result = await seal.send({
69
+ file,
70
+ filename: 'payroll.xlsx',
71
+ ttl: '1d',
72
+ otp: 'secret42', // recipient must enter this password
73
+ nda: true, // recipient must sign an NDA first
74
+ ownerEmail: 'me@corp.com', // required when nda: true
75
+ singleUse: true, // first download destroys the file
76
+ maxOpens: 3, // or: cap total downloads
77
+ geoAllowlist: ['DE', 'CH'], // or: restrict by country
78
+ message: 'Q3 numbers, keep private.',
79
+ })
80
+ ```
81
+
82
+ ### Upload progress
83
+
84
+ ```typescript
85
+ await seal.send({
86
+ file,
87
+ filename,
88
+ ttl: '1h',
89
+ onProgress: ({ phase, percent }) => {
90
+ // phase: 'hashing' | 'encrypting' | 'uploading' | 'verifying'
91
+ render(phase, percent)
92
+ },
93
+ })
94
+ ```
95
+
96
+ ### Files over 1 GB
97
+
98
+ Up to 1 GB is free. Above it the person pays once by card for a tier
99
+ (`5gb` $9 90 days, `50gb` $29 180 days, `500gb` $99 365 days). Show them the
100
+ payment page; `send` waits for the payment and finishes the upload into the
101
+ same seal. Not paid in time (the seal's expiry, at most 23 hours): the seal
102
+ is revoked and `send` throws `PAYMENT_REQUIRED`.
103
+
104
+ ```typescript
105
+ await seal.send({
106
+ file,
107
+ filename: 'dump.sql',
108
+ ttl: '1d', // 1d or 7d with a tier
109
+ tier: '5gb',
110
+ onPaymentRequired: (checkoutUrl) => window.open(checkoutUrl),
111
+ })
112
+ ```
113
+
114
+ ### Revoking
115
+
116
+ ```typescript
117
+ await seal.revoke(result.sealId, result.ownerToken)
118
+ ```
119
+
120
+ ## Opening a link
121
+
122
+ In Node, `to` streams every file into a directory: each is written `0600` and
123
+ gets its name only after its ciphertext matched the digest the sender
124
+ registered, so a changed or cut download never appears under the sender's
125
+ name. Memory stays flat whatever the size.
126
+
127
+ ```typescript
128
+ const saved = await seal.open(link, { to: './downloads' })
129
+ saved.files // [{ name, mime, secret, path, sizeBytes, sha256 }]
130
+ ```
131
+
132
+ Without `to`, each file downloads when you read it, as a stream. The stream
133
+ fails at its end if the ciphertext was changed: keep nothing you wrote from a
134
+ stream that errored.
135
+
136
+ Reading a seal is open to Node and to pages served from seal.net. A browser
137
+ page on any other site sends and asks (`send`, `request`) but does not read:
138
+ the receiving endpoints answer no other origin.
139
+
140
+ ```typescript
141
+ const opened = await seal.open(link, { password: 'secret42' })
142
+ const { stream, done } = await opened.files[0].read()
143
+ await stream.pipeTo(sink)
144
+ await done // { sizeBytes, sha256 }
145
+ ```
146
+
147
+ A file with `secret: true` was marked a secret by its sender: hand it to the
148
+ program that needs it, never print it.
149
+
150
+ ## Asking a person for a file or a secret
151
+
152
+ `request` gives you a page to show the person (or to hand an MCP client as a
153
+ URL-mode elicitation). Their answer is sealed to your key, so SEAL never sees
154
+ it, and `waitFor` opens it exactly like `open`.
155
+
156
+ ```typescript
157
+ const keys = await seal.keygen() // { publicKey, secretKey }, base64url
158
+
159
+ const ask = await seal.request({
160
+ what: 'Brave API key',
161
+ recipientKey: keys.publicKey,
162
+ kind: 'secret', // 'secret' | 'file' | 'any'
163
+ whereUrl: 'https://api.search.brave.com/app/keys', // where the key is created
164
+ })
165
+ show(ask.url, ask.emoji) // the page shows the same three emoji
166
+
167
+ const answer = await seal.waitFor(ask.intakeId, { keyPair: keys, to: './secrets' })
168
+ answer.files[0].path // the value stays in the file
169
+ ```
170
+
171
+ A link addressed to your key opens with `open(link, { keyPair: keys })`.
172
+
173
+ ## Error handling
174
+
175
+ ```typescript
176
+ import { SealClient, SealError } from 'sealnet'
177
+
178
+ try {
179
+ await seal.send({ file, filename, ttl: '7d' })
180
+ } catch (err) {
181
+ if (err instanceof SealError) {
182
+ // code: 'RATE_LIMITED' | 'VALIDATION_ERROR' | 'PAYMENT_REQUIRED' | 'RESOURCE_NOT_FOUND' | …
183
+ // status: the HTTP status from the SEAL API
184
+ console.error(err.code, err.status, err.message)
185
+ }
186
+ }
187
+ ```
188
+
189
+ A link that does not open carries the reason in `details.reason`
190
+ (`seal_revoked`, `integrity_check_failed`, `targeted_decrypt_failed`, …).
191
+
192
+ If a failure happens **after** the seal was created remotely (a network drop mid-flow, for example), the thrown `SealError` carries `details.sealId` and `details.ownerToken` so the seal is never orphaned; you can retry or revoke it:
193
+
194
+ ```typescript
195
+ catch (err) {
196
+ if (err instanceof SealError && err.details?.sealId) {
197
+ await seal.revoke(err.details.sealId, err.details.ownerToken)
198
+ }
199
+ }
200
+ ```
201
+
202
+ ## License
203
+
204
+ Proprietary. Copyright (c) SEAL. All rights reserved. See [LICENSE](./LICENSE).
205
+
206
+ The standalone browser build bundles MIT-licensed third-party code; their
207
+ notices are reproduced in full in [THIRD-PARTY-NOTICES.txt](./THIRD-PARTY-NOTICES.txt).
208
+ The npm artifacts keep those as ordinary dependencies and do not bundle them.
@@ -0,0 +1,60 @@
1
+ sealnet 1.1.0 — third-party notices
2
+
3
+ The standalone browser build (dist/seal.global.js, also published at
4
+ https://seal.net/sdk/v<version>/seal.js) bundles the software below.
5
+ Each remains under its own licence; the notices are reproduced in full as
6
+ those licences require. The npm artifacts (dist/index.js, dist/index.cjs)
7
+ keep these as regular dependencies and do not bundle them.
8
+
9
+ ========================================================================
10
+ @noble/hashes 1.8.0
11
+ ========================================================================
12
+
13
+ The MIT License (MIT)
14
+
15
+ Copyright (c) 2022 Paul Miller (https://paulmillr.com)
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the “Software”), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in
25
+ all copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33
+ THE SOFTWARE.
34
+
35
+ ========================================================================
36
+ fflate 0.8.2
37
+ ========================================================================
38
+
39
+ MIT License
40
+
41
+ Copyright (c) 2023 Arjun Barrett
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy
44
+ of this software and associated documentation files (the "Software"), to deal
45
+ in the Software without restriction, including without limitation the rights
46
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47
+ copies of the Software, and to permit persons to whom the Software is
48
+ furnished to do so, subject to the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be included in all
51
+ copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
+ SOFTWARE.
60
+