@adapt-toolkit/mufl 0.10.5 → 0.10.7

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.
@@ -176,6 +176,43 @@ library address_document loads libraries address_document_types, key_storage, ke
176
176
  RETURN m_my_address_document?.
177
177
  }
178
178
 
179
+ // Build a v1 (pre-E2E) address document to present to an OLD peer during an
180
+ // invite/handshake down-level: the identity OMITS $e2e_bundle (the field is
181
+ // nullable — NIL for a v1 identity) and the document is stamped $version->1,
182
+ // exactly what a pre-E2E (0.11.x) node produces and what its strict version
183
+ // allow-list accepts. The self-signature loop signs whatever my_identity holds,
184
+ // so the signature commits to the bundle-less identity. The v2 memo
185
+ // (m_my_address_document) is deliberately NOT written here, so a per-peer
186
+ // down-level never poisons the cached current-version document.
187
+ produce_v1_address_document = fn (_) -> t_address_document
188
+ {
189
+ base_identity = key_storage::get_my_identity().
190
+ my_identity = ( $key_list -> (base_identity $key_list),
191
+ $default_keys -> (base_identity $default_keys),
192
+ $container_id -> (base_identity $container_id) ).
193
+ signatures IS crypto_signature(,) = (,).
194
+ hash = _value_id my_identity.
195
+
196
+ sc my_identity $key_list -- (key -> ) ?? key_get_function key == $SIGN {
197
+ sig = key_storage::sign hash (_crypto_get_key_id key).
198
+ signatures sig -> TRUE.
199
+ }
200
+
201
+ RETURN ($version->1, $identity->my_identity, $authorizations->signatures).
202
+ }
203
+
204
+ // The address document to hand a peer, down-levelled when the peer is a v1
205
+ // (pre-E2E) node. peer_is_v1 NIL/FALSE => the current (v2) document (memoised as
206
+ // usual); TRUE => a freshly built v1 document (not memoised). This is the single
207
+ // entry the invite/handshake down-level sites call.
208
+ get_my_address_document_versioned = fn (peer_is_v1: bool+) -> t_address_document
209
+ {
210
+ if (peer_is_v1 != NIL) && (peer_is_v1?) {
211
+ RETURN produce_v1_address_document().
212
+ }
213
+ RETURN get_my_address_document().
214
+ }
215
+
179
216
 
180
217
  trn register_container
181
218
  _:($ad -> ad: t_address_document) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adapt-toolkit/mufl",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "description": "The MUFL toolchain: prebuilt `mufl` (REPL) and `mufl-compile` (compiler) engine binaries plus the MUFL stdlib, meta, and transactions trees they need at run time. Linux x64 only; the binaries are proprietary (AEFL) — see LICENSE and NOTICE.",