@novasamatech/statement-store 0.8.12 → 0.9.1

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 (41) hide show
  1. package/dist/crypto.js +2 -1
  2. package/dist/helpers.d.ts +0 -1
  3. package/dist/helpers.js +0 -3
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +3 -0
  6. package/dist/model/session.d.ts +1 -1
  7. package/dist/model/session.js +1 -1
  8. package/dist/model/sessionAccount.js +2 -1
  9. package/dist/session/codec/decoder.d.ts +68 -0
  10. package/dist/session/codec/decoder.js +96 -0
  11. package/dist/session/codec/decoder.spec.d.ts +1 -0
  12. package/dist/session/codec/decoder.spec.js +161 -0
  13. package/dist/session/codec/envelope.d.ts +55 -0
  14. package/dist/session/codec/envelope.js +115 -0
  15. package/dist/session/codec/envelope.spec.d.ts +1 -0
  16. package/dist/session/codec/envelope.spec.js +114 -0
  17. package/dist/session/codec/incomingTopics.d.ts +46 -0
  18. package/dist/session/codec/incomingTopics.js +69 -0
  19. package/dist/session/codec/outgoingBody.d.ts +46 -0
  20. package/dist/session/codec/outgoingBody.js +64 -0
  21. package/dist/session/core.d.ts +58 -0
  22. package/dist/session/core.js +609 -0
  23. package/dist/session/encyption.js +7 -7
  24. package/dist/session/encyption.spec.d.ts +1 -0
  25. package/dist/session/encyption.spec.js +43 -0
  26. package/dist/session/messageMapper.d.ts +3 -3
  27. package/dist/session/messageMapper.js +8 -8
  28. package/dist/session/multiDeviceSession.d.ts +49 -0
  29. package/dist/session/multiDeviceSession.js +62 -0
  30. package/dist/session/multiDeviceSession.spec.d.ts +6 -0
  31. package/dist/session/multiDeviceSession.spec.js +354 -0
  32. package/dist/session/scale/statementData.d.ts +40 -0
  33. package/dist/session/scale/statementData.js +34 -1
  34. package/dist/session/session.d.ts +15 -5
  35. package/dist/session/session.js +31 -633
  36. package/dist/session/session.spec.js +24 -7
  37. package/dist/session/stateMachine.d.ts +135 -0
  38. package/dist/session/stateMachine.js +203 -0
  39. package/dist/session/stateMachine.spec.d.ts +1 -0
  40. package/dist/session/stateMachine.spec.js +276 -0
  41. package/package.json +4 -3
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Single-device session (base-spec.md): the pairwise Request/Response transport used by
3
+ * SSO and any peer known to run exactly one device.
4
+ *
5
+ * See `multiDeviceSession.ts` for the mds.md variant, and `core.ts` for the shared driver.
6
+ */
1
7
  import type { StatementStoreAdapter } from '../adapter/types.js';
2
8
  import type { LocalSessionAccount, RemoteSessionAccount } from '../model/sessionAccount.js';
3
9
  import type { ExpiryAllocator } from '../submit/allocator.js';
@@ -31,13 +37,17 @@ export type SessionParams = {
31
37
  * identical to the previous per-session behavior.
32
38
  */
33
39
  allocator?: ExpiryAllocator;
40
+ /**
41
+ * Statement size budget in bytes; the batch is sized against
42
+ * `maxRequestSize - STATEMENT_OVERHEAD`. Defaults to
43
+ * {@link DEFAULT_MAX_REQUEST_SIZE} — override only to be MORE conservative than the
44
+ * chain, never less.
45
+ */
34
46
  maxRequestSize?: number;
35
47
  };
36
48
  /**
37
- * Fixed per-statement wire overhead reserved before sizing the request payload:
38
- * topic (32) + channel (32) + expiry (8) + proof signature (64) + signer (32).
39
- * Mirrors the Android/iOS sessions, which size message batches against
40
- * `maxStatementSize - overhead` rather than the raw statement limit.
49
+ * Single-device session (base-spec.md). Wire output is unchanged from before the
50
+ * multi-device seams existed: `StatementData.request`/`.response` on
51
+ * `SessionId(A, B)`, listening on `SessionId(B, A)`.
41
52
  */
42
- export declare const STATEMENT_OVERHEAD: number;
43
53
  export declare function createSession({ localAccount, remoteAccount, statementStore, encryption, prover, sessionKey, allocator, maxRequestSize, }: SessionParams): Session;