From ddcd63893771dfb8cdee762fdb73fd6094db8341 Mon Sep 17 00:00:00 2001 From: Harvey Zuccon Date: Fri, 27 Feb 2026 00:31:06 +1100 Subject: [PATCH] Add a bit of info to whisper protocol --- src/protocols/whisper.ts | 18 ++++++++++++++++++ tests/utils/btree.test.ts | 1 + 2 files changed, 19 insertions(+) diff --git a/src/protocols/whisper.ts b/src/protocols/whisper.ts index db28d73..9699fd4 100644 --- a/src/protocols/whisper.ts +++ b/src/protocols/whisper.ts @@ -19,6 +19,24 @@ * Only allow specific parameters, unless prefixed with 'x-' */ +/** + * What I *think* this is: + * Deps: List of transports + * + * Recieving: + * 1. Create from a list of tranpsports and a lsit of items. + * 2. Starts listening on all of the transports and returns a URL (maybe a promise too? Not sure whether it should be a promise or event emitter. Maybe both?) + * 3. Once it recieves a message, decrypt it and resolve the promise with the message. + * + * Sending: + * 1. Create from a list of transports and the URL. + * 2. Encrypt the message + * 3. Send the encrypted message to all of the transports that are in both the requestURL and the list of transports. + * + * Possibilities: + * - Non-ephemeral. Keep listeners alive to allow for multiple requests + */ + import { z } from 'zod/v4'; import { PublicKey } from 'src/crypto/index.js'; diff --git a/tests/utils/btree.test.ts b/tests/utils/btree.test.ts index 06bf850..e4df967 100644 --- a/tests/utils/btree.test.ts +++ b/tests/utils/btree.test.ts @@ -181,6 +181,7 @@ describe('BPlusTree', () => { it('should handle range on empty tree', () => { expect(tree.range()).toEqual([]); + expect(tree.range(1, 2)).toEqual([]); }); it('should handle delete on empty tree', () => {