sealnet 1.2.0 → 1.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/dist/index.d.cts CHANGED
@@ -1,5 +1,8 @@
1
- /** What an intake request asks for (SPEC-AGENTS §4.4). */
2
- type IntakeKind = 'secret' | 'file' | 'any';
1
+ /**
2
+ * What an intake request asks for (SPEC-AGENTS §4.4): `pair` and `device`
3
+ * are the inbox's own (SPEC-ADDRESS F3), answered on box.seal.net.
4
+ */
5
+ type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device';
3
6
  /** A file's plaintext, and what it turned out to be once the stream ended. */
4
7
  interface OpenedStream {
5
8
  readonly stream: ReadableStream<Uint8Array>;
@@ -10,6 +13,12 @@ interface OpenedStream {
10
13
  }>;
11
14
  }
12
15
 
16
+ /** The inbox an agent is paired with: what the answer to `pair` carries. */
17
+ interface Pairing {
18
+ readonly address: string;
19
+ readonly name: string;
20
+ }
21
+
13
22
  type TTL = '5m' | '30m' | '1h' | '1d' | '7d';
14
23
  interface CreateAnonymousSealOptions {
15
24
  /** File data (File, ArrayBuffer, Uint8Array, or Blob) */
@@ -39,6 +48,19 @@ interface CreateAnonymousSealOptions {
39
48
  * only with their key and also lands in their inbox (`inbox()`).
40
49
  */
41
50
  to?: string;
51
+ /**
52
+ * The address of a person's SEAL inbox (`pair()`): the seal also lands
53
+ * there, for them to manage and revoke. Best effort: if the inbox refuses,
54
+ * the seal is sent anyway and `ownerCopy` is false.
55
+ */
56
+ owner?: string;
57
+ /**
58
+ * Your key: the recipient's and the owner's inbox show your address as the
59
+ * sender instead of an unproven one.
60
+ */
61
+ keyPair?: {
62
+ readonly secretKey: string;
63
+ };
42
64
  /**
43
65
  * Over 1 GB: the tier the person pays for once by card (`5gb` $9 90 days,
44
66
  * `50gb` $29 180 days, `500gb` $99 365 days). Needs `ttl` 1d or 7d and
@@ -86,6 +108,8 @@ interface CreateAnonymousSealResult {
86
108
  fileId: string;
87
109
  /** The link is in the recipient's inbox (`to` was given). */
88
110
  delivered: boolean;
111
+ /** The seal is in the owner's inbox (`owner` was given and it took it). */
112
+ ownerCopy: boolean;
89
113
  }
90
114
 
91
115
  /**
@@ -190,20 +214,44 @@ interface RequestOptions {
190
214
  readonly ttl?: number;
191
215
  /** Who asks, as the page names it. */
192
216
  readonly label?: string;
217
+ /** The address of a person's inbox (`pair()`): the request also waits there as a card. */
218
+ readonly to?: string;
193
219
  readonly signal?: AbortSignal;
194
220
  }
195
221
  interface RequestResult {
196
222
  readonly intakeId: string;
197
223
  /** Give this to the person — or to an MCP client as a URL-mode elicitation. */
198
224
  readonly url: string;
199
- /** Three emoji of your key; the page shows the same ones. */
225
+ /** Three words of your key, one space apart; the page shows the same ones. */
226
+ readonly words: string;
227
+ /** @deprecated Your key as the three emoji clients before 1.4 showed: use `words`. Removed in 2.0. */
200
228
  readonly emoji: string;
201
229
  readonly expiresAt: string;
202
230
  }
231
+ interface PairOptions {
232
+ /** Your key: the inbox sends to its public half. */
233
+ readonly keyPair: KeyPair;
234
+ /** How the inbox names you (default `sealnet`). */
235
+ readonly name?: string;
236
+ readonly signal?: AbortSignal;
237
+ }
238
+ interface PairResult {
239
+ /** Give this to the person: they open it on the device with their SEAL inbox. */
240
+ readonly url: string;
241
+ /** Three words of your key, one space apart; the page shows the same ones. */
242
+ readonly words: string;
243
+ /** @deprecated Your key as the three emoji clients before 1.4 showed: use `words`. Removed in 2.0. */
244
+ readonly emoji: string;
245
+ readonly expiresAt: string;
246
+ /** Wait until they connect: their inbox's address (use it as `owner`) and name. */
247
+ wait(): Promise<Pairing>;
248
+ }
203
249
  /** Something sent to your key: open it with `open(item, {keyPair})`. */
204
250
  interface InboxItem {
205
251
  readonly id: string;
206
- /** Three emoji of the sender's address when it proved one. */
252
+ /** Three words of the sender's address when it proved one. */
253
+ readonly fromWords: string | null;
254
+ /** @deprecated The sender's address as the three emoji clients before 1.4 showed: use `fromWords`. Removed in 2.0. */
207
255
  readonly from: string | null;
208
256
  /** What the sender called itself, in the clear: never content. */
209
257
  readonly label: string | null;
@@ -311,6 +359,13 @@ declare class SealClient {
311
359
  waitFor(intakeId: string, options: OpenOptions & {
312
360
  keyPair: KeyPair;
313
361
  }): Promise<OpenedSeal<OpenedSealFile>>;
362
+ /**
363
+ * Connect your key to a person's SEAL inbox, once: show them `url` and
364
+ * `words`, then `wait()` gives their inbox's address. Pass it as `owner` to
365
+ * {@link SealClient.send} (every seal lands in their inbox) or as `to` to
366
+ * {@link SealClient.request} (the request waits there).
367
+ */
368
+ pair(options: PairOptions): Promise<PairResult>;
314
369
  /** A fresh X25519 identity for addressed links and requests. */
315
370
  keygen(): Promise<KeyPair>;
316
371
  /**
@@ -324,6 +379,6 @@ declare class SealClient {
324
379
  revokedAt: string | null;
325
380
  }>;
326
381
  }
327
- declare const VERSION = "1.2.0";
382
+ declare const VERSION = "1.4.0";
328
383
 
329
- export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
384
+ export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- /** What an intake request asks for (SPEC-AGENTS §4.4). */
2
- type IntakeKind = 'secret' | 'file' | 'any';
1
+ /**
2
+ * What an intake request asks for (SPEC-AGENTS §4.4): `pair` and `device`
3
+ * are the inbox's own (SPEC-ADDRESS F3), answered on box.seal.net.
4
+ */
5
+ type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device';
3
6
  /** A file's plaintext, and what it turned out to be once the stream ended. */
4
7
  interface OpenedStream {
5
8
  readonly stream: ReadableStream<Uint8Array>;
@@ -10,6 +13,12 @@ interface OpenedStream {
10
13
  }>;
11
14
  }
12
15
 
16
+ /** The inbox an agent is paired with: what the answer to `pair` carries. */
17
+ interface Pairing {
18
+ readonly address: string;
19
+ readonly name: string;
20
+ }
21
+
13
22
  type TTL = '5m' | '30m' | '1h' | '1d' | '7d';
14
23
  interface CreateAnonymousSealOptions {
15
24
  /** File data (File, ArrayBuffer, Uint8Array, or Blob) */
@@ -39,6 +48,19 @@ interface CreateAnonymousSealOptions {
39
48
  * only with their key and also lands in their inbox (`inbox()`).
40
49
  */
41
50
  to?: string;
51
+ /**
52
+ * The address of a person's SEAL inbox (`pair()`): the seal also lands
53
+ * there, for them to manage and revoke. Best effort: if the inbox refuses,
54
+ * the seal is sent anyway and `ownerCopy` is false.
55
+ */
56
+ owner?: string;
57
+ /**
58
+ * Your key: the recipient's and the owner's inbox show your address as the
59
+ * sender instead of an unproven one.
60
+ */
61
+ keyPair?: {
62
+ readonly secretKey: string;
63
+ };
42
64
  /**
43
65
  * Over 1 GB: the tier the person pays for once by card (`5gb` $9 90 days,
44
66
  * `50gb` $29 180 days, `500gb` $99 365 days). Needs `ttl` 1d or 7d and
@@ -86,6 +108,8 @@ interface CreateAnonymousSealResult {
86
108
  fileId: string;
87
109
  /** The link is in the recipient's inbox (`to` was given). */
88
110
  delivered: boolean;
111
+ /** The seal is in the owner's inbox (`owner` was given and it took it). */
112
+ ownerCopy: boolean;
89
113
  }
90
114
 
91
115
  /**
@@ -190,20 +214,44 @@ interface RequestOptions {
190
214
  readonly ttl?: number;
191
215
  /** Who asks, as the page names it. */
192
216
  readonly label?: string;
217
+ /** The address of a person's inbox (`pair()`): the request also waits there as a card. */
218
+ readonly to?: string;
193
219
  readonly signal?: AbortSignal;
194
220
  }
195
221
  interface RequestResult {
196
222
  readonly intakeId: string;
197
223
  /** Give this to the person — or to an MCP client as a URL-mode elicitation. */
198
224
  readonly url: string;
199
- /** Three emoji of your key; the page shows the same ones. */
225
+ /** Three words of your key, one space apart; the page shows the same ones. */
226
+ readonly words: string;
227
+ /** @deprecated Your key as the three emoji clients before 1.4 showed: use `words`. Removed in 2.0. */
200
228
  readonly emoji: string;
201
229
  readonly expiresAt: string;
202
230
  }
231
+ interface PairOptions {
232
+ /** Your key: the inbox sends to its public half. */
233
+ readonly keyPair: KeyPair;
234
+ /** How the inbox names you (default `sealnet`). */
235
+ readonly name?: string;
236
+ readonly signal?: AbortSignal;
237
+ }
238
+ interface PairResult {
239
+ /** Give this to the person: they open it on the device with their SEAL inbox. */
240
+ readonly url: string;
241
+ /** Three words of your key, one space apart; the page shows the same ones. */
242
+ readonly words: string;
243
+ /** @deprecated Your key as the three emoji clients before 1.4 showed: use `words`. Removed in 2.0. */
244
+ readonly emoji: string;
245
+ readonly expiresAt: string;
246
+ /** Wait until they connect: their inbox's address (use it as `owner`) and name. */
247
+ wait(): Promise<Pairing>;
248
+ }
203
249
  /** Something sent to your key: open it with `open(item, {keyPair})`. */
204
250
  interface InboxItem {
205
251
  readonly id: string;
206
- /** Three emoji of the sender's address when it proved one. */
252
+ /** Three words of the sender's address when it proved one. */
253
+ readonly fromWords: string | null;
254
+ /** @deprecated The sender's address as the three emoji clients before 1.4 showed: use `fromWords`. Removed in 2.0. */
207
255
  readonly from: string | null;
208
256
  /** What the sender called itself, in the clear: never content. */
209
257
  readonly label: string | null;
@@ -311,6 +359,13 @@ declare class SealClient {
311
359
  waitFor(intakeId: string, options: OpenOptions & {
312
360
  keyPair: KeyPair;
313
361
  }): Promise<OpenedSeal<OpenedSealFile>>;
362
+ /**
363
+ * Connect your key to a person's SEAL inbox, once: show them `url` and
364
+ * `words`, then `wait()` gives their inbox's address. Pass it as `owner` to
365
+ * {@link SealClient.send} (every seal lands in their inbox) or as `to` to
366
+ * {@link SealClient.request} (the request waits there).
367
+ */
368
+ pair(options: PairOptions): Promise<PairResult>;
314
369
  /** A fresh X25519 identity for addressed links and requests. */
315
370
  keygen(): Promise<KeyPair>;
316
371
  /**
@@ -324,6 +379,6 @@ declare class SealClient {
324
379
  revokedAt: string | null;
325
380
  }>;
326
381
  }
327
- declare const VERSION = "1.2.0";
382
+ declare const VERSION = "1.4.0";
328
383
 
329
- export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
384
+ export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };