letify 3.0.6__tar.gz → 3.0.8__tar.gz

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 (331) hide show
  1. {letify-3.0.6 → letify-3.0.8}/.github/workflows/letify-link.yml +2 -2
  2. {letify-3.0.6 → letify-3.0.8}/PKG-INFO +1 -1
  3. {letify-3.0.6 → letify-3.0.8}/docs/SPEC.md +33 -0
  4. {letify-3.0.6 → letify-3.0.8}/letify/__init__.py +1 -1
  5. {letify-3.0.6 → letify-3.0.8}/letify-core/Cargo.lock +25 -2
  6. {letify-3.0.6 → letify-3.0.8}/letify-core/Cargo.toml +1 -1
  7. {letify-3.0.6 → letify-3.0.8}/letify-core/letify/Cargo.toml +3 -1
  8. {letify-3.0.6 → letify-3.0.8}/letify-core/letify/README.md +1 -1
  9. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/Cargo.toml +14 -0
  10. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/README.md +2 -0
  11. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/lib.rs +2 -0
  12. letify-3.0.8/letify-core/letify-link/src/rendezvous/demux.rs +338 -0
  13. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/rendezvous.rs +6 -0
  14. letify-3.0.8/letify-core/letify-link/src/signal.rs +592 -0
  15. letify-3.0.8/letify-core/letify-link/tests/demux.rs +375 -0
  16. letify-3.0.8/letify-core/letify-link/tests/signal.rs +509 -0
  17. {letify-3.0.6 → letify-3.0.8}/letify-ext/package-lock.json +2 -2
  18. {letify-3.0.6 → letify-3.0.8}/letify-ext/package.json +1 -1
  19. {letify-3.0.6 → letify-3.0.8}/pyproject.toml +1 -1
  20. {letify-3.0.6 → letify-3.0.8}/.github/workflows/ci.yml +0 -0
  21. {letify-3.0.6 → letify-3.0.8}/.github/workflows/docs.yml +0 -0
  22. {letify-3.0.6 → letify-3.0.8}/.github/workflows/publish-crates.yml +0 -0
  23. {letify-3.0.6 → letify-3.0.8}/.github/workflows/publish.yml +0 -0
  24. {letify-3.0.6 → letify-3.0.8}/.github/workflows/reserve-crates.yml +0 -0
  25. {letify-3.0.6 → letify-3.0.8}/.gitignore +0 -0
  26. {letify-3.0.6 → letify-3.0.8}/.researchtree +0 -0
  27. {letify-3.0.6 → letify-3.0.8}/CLAUDE.md +0 -0
  28. {letify-3.0.6 → letify-3.0.8}/LICENSE +0 -0
  29. {letify-3.0.6 → letify-3.0.8}/PROJECT.md +0 -0
  30. {letify-3.0.6 → letify-3.0.8}/README.md +0 -0
  31. {letify-3.0.6 → letify-3.0.8}/docs/COMPONENT.md +0 -0
  32. {letify-3.0.6 → letify-3.0.8}/docs/INTENT.md +0 -0
  33. {letify-3.0.6 → letify-3.0.8}/docs/NETWORK.md +0 -0
  34. {letify-3.0.6 → letify-3.0.8}/docs/ROADMAP-3.0.md +0 -0
  35. {letify-3.0.6 → letify-3.0.8}/docs/guide/01-getting-started.md +0 -0
  36. {letify-3.0.6 → letify-3.0.8}/docs/guide/02-providers.md +0 -0
  37. {letify-3.0.6 → letify-3.0.8}/docs/guide/03-execution-modes.md +0 -0
  38. {letify-3.0.6 → letify-3.0.8}/docs/guide/04-environments-and-data.md +0 -0
  39. {letify-3.0.6 → letify-3.0.8}/docs/guide/05-concurrency.md +0 -0
  40. {letify-3.0.6 → letify-3.0.8}/docs/guide/06-cost.md +0 -0
  41. {letify-3.0.6 → letify-3.0.8}/docs/guide/07-troubleshooting.md +0 -0
  42. {letify-3.0.6 → letify-3.0.8}/docs/guide/08-releasing.md +0 -0
  43. {letify-3.0.6 → letify-3.0.8}/docs/guide/09-agent.md +0 -0
  44. {letify-3.0.6 → letify-3.0.8}/docs/guide/README.md +0 -0
  45. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
  46. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
  47. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
  48. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md" +0 -0
  49. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
  50. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
  51. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
  52. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
  53. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
  54. {letify-3.0.6 → letify-3.0.8}/docs/guide/ko/README.md +0 -0
  55. {letify-3.0.6 → letify-3.0.8}/docs/locales/README_ko.md +0 -0
  56. {letify-3.0.6 → letify-3.0.8}/docs/mkdocs.yml +0 -0
  57. {letify-3.0.6 → letify-3.0.8}/examples/README.md +0 -0
  58. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/.letify.example +0 -0
  59. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/00_smoke.py +0 -0
  60. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/01_sweep.py +0 -0
  61. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/02_resume.py +0 -0
  62. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/03_watch.py +0 -0
  63. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/README.md +0 -0
  64. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/README_ko.md +0 -0
  65. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/common.py +0 -0
  66. {letify-3.0.6 → letify-3.0.8}/examples/nvfp4-lora/recipe.py +0 -0
  67. {letify-3.0.6 → letify-3.0.8}/letify/cli.py +0 -0
  68. {letify-3.0.6 → letify-3.0.8}/letify/config/__init__.py +0 -0
  69. {letify-3.0.6 → letify-3.0.8}/letify/config/inventory.py +0 -0
  70. {letify-3.0.6 → letify-3.0.8}/letify/config/login.py +0 -0
  71. {letify-3.0.6 → letify-3.0.8}/letify/config/schema.py +0 -0
  72. {letify-3.0.6 → letify-3.0.8}/letify/config/secrets.py +0 -0
  73. {letify-3.0.6 → letify-3.0.8}/letify/config/writer.py +0 -0
  74. {letify-3.0.6 → letify-3.0.8}/letify/declare/__init__.py +0 -0
  75. {letify-3.0.6 → letify-3.0.8}/letify/declare/cache.py +0 -0
  76. {letify-3.0.6 → letify-3.0.8}/letify/declare/env.py +0 -0
  77. {letify-3.0.6 → letify-3.0.8}/letify/declare/exit.py +0 -0
  78. {letify-3.0.6 → letify-3.0.8}/letify/declare/function.py +0 -0
  79. {letify-3.0.6 → letify-3.0.8}/letify/declare/instance.py +0 -0
  80. {letify-3.0.6 → letify-3.0.8}/letify/declare/reduce.py +0 -0
  81. {letify-3.0.6 → letify-3.0.8}/letify/declare/replicas.py +0 -0
  82. {letify-3.0.6 → letify-3.0.8}/letify/errors.py +0 -0
  83. {letify-3.0.6 → letify-3.0.8}/letify/install.py +0 -0
  84. {letify-3.0.6 → letify-3.0.8}/letify/launcher.py +0 -0
  85. {letify-3.0.6 → letify-3.0.8}/letify/paths.py +0 -0
  86. {letify-3.0.6 → letify-3.0.8}/letify/protocol/__init__.py +0 -0
  87. {letify-3.0.6 → letify-3.0.8}/letify/protocol/codec.py +0 -0
  88. {letify-3.0.6 → letify-3.0.8}/letify/protocol/driver.py +0 -0
  89. {letify-3.0.6 → letify-3.0.8}/letify/protocol/handle.py +0 -0
  90. {letify-3.0.6 → letify-3.0.8}/letify/protocol/wire.py +0 -0
  91. {letify-3.0.6 → letify-3.0.8}/letify/protocol/worker.py +0 -0
  92. {letify-3.0.6 → letify-3.0.8}/letify/providers/__init__.py +0 -0
  93. {letify-3.0.6 → letify-3.0.8}/letify/providers/base.py +0 -0
  94. {letify-3.0.6 → letify-3.0.8}/letify/providers/colab.py +0 -0
  95. {letify-3.0.6 → letify-3.0.8}/letify/providers/colab_files.py +0 -0
  96. {letify-3.0.6 → letify-3.0.8}/letify/providers/colab_keepalive.py +0 -0
  97. {letify-3.0.6 → letify-3.0.8}/letify/providers/elice.py +0 -0
  98. {letify-3.0.6 → letify-3.0.8}/letify/providers/kaggle.py +0 -0
  99. {letify-3.0.6 → letify-3.0.8}/letify/providers/kaggle_adapter.py +0 -0
  100. {letify-3.0.6 → letify-3.0.8}/letify/providers/local.py +0 -0
  101. {letify-3.0.6 → letify-3.0.8}/letify/providers/modal.py +0 -0
  102. {letify-3.0.6 → letify-3.0.8}/letify/providers/modal_adapter.py +0 -0
  103. {letify-3.0.6 → letify-3.0.8}/letify/providers/naming.py +0 -0
  104. {letify-3.0.6 → letify-3.0.8}/letify/providers/shell.py +0 -0
  105. {letify-3.0.6 → letify-3.0.8}/letify/providers/tunnel.py +0 -0
  106. {letify-3.0.6 → letify-3.0.8}/letify/providers/usage.py +0 -0
  107. {letify-3.0.6 → letify-3.0.8}/letify/remoting/__init__.py +0 -0
  108. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/__init__.py +0 -0
  109. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/client.py +0 -0
  110. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/cuda.py +0 -0
  111. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/executor.py +0 -0
  112. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/frames.py +0 -0
  113. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/guard.py +0 -0
  114. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/tensor.py +0 -0
  115. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/trace.py +0 -0
  116. {letify-3.0.6 → letify-3.0.8}/letify/remoting/device/value.py +0 -0
  117. {letify-3.0.6 → letify-3.0.8}/letify/render.py +0 -0
  118. {letify-3.0.6 → letify-3.0.8}/letify/runtime/__init__.py +0 -0
  119. {letify-3.0.6 → letify-3.0.8}/letify/runtime/bootstrap.py +0 -0
  120. {letify-3.0.6 → letify-3.0.8}/letify/runtime/broker.py +0 -0
  121. {letify-3.0.6 → letify-3.0.8}/letify/runtime/channel.py +0 -0
  122. {letify-3.0.6 → letify-3.0.8}/letify/runtime/control.py +0 -0
  123. {letify-3.0.6 → letify-3.0.8}/letify/runtime/lease.py +0 -0
  124. {letify-3.0.6 → letify-3.0.8}/letify/runtime/pool.py +0 -0
  125. {letify-3.0.6 → letify-3.0.8}/letify/runtime/reattach.py +0 -0
  126. {letify-3.0.6 → letify-3.0.8}/letify/runtime/session.py +0 -0
  127. {letify-3.0.6 → letify-3.0.8}/letify/runtime/takeover.py +0 -0
  128. {letify-3.0.6 → letify-3.0.8}/letify/runtime/telemetry.py +0 -0
  129. {letify-3.0.6 → letify-3.0.8}/letify/runtime/workers.py +0 -0
  130. {letify-3.0.6 → letify-3.0.8}/letify/store/__init__.py +0 -0
  131. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/__init__.py +0 -0
  132. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/drive.py +0 -0
  133. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/filesystem.py +0 -0
  134. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/google_auth.py +0 -0
  135. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/layout.py +0 -0
  136. {letify-3.0.6 → letify-3.0.8}/letify/store/backends/objects.py +0 -0
  137. {letify-3.0.6 → letify-3.0.8}/letify/store/cas.py +0 -0
  138. {letify-3.0.6 → letify-3.0.8}/letify/store/handoff.py +0 -0
  139. {letify-3.0.6 → letify-3.0.8}/letify/store/pathdata.py +0 -0
  140. {letify-3.0.6 → letify-3.0.8}/letify/store/sendorder.py +0 -0
  141. {letify-3.0.6 → letify-3.0.8}/letify/store/volume.py +0 -0
  142. {letify-3.0.6 → letify-3.0.8}/letify/stubs.py +0 -0
  143. {letify-3.0.6 → letify-3.0.8}/letify/tools.py +0 -0
  144. {letify-3.0.6 → letify-3.0.8}/letify/transport/__init__.py +0 -0
  145. {letify-3.0.6 → letify-3.0.8}/letify/transport/announce.py +0 -0
  146. {letify-3.0.6 → letify-3.0.8}/letify/transport/link.py +0 -0
  147. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkagent.py +0 -0
  148. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkchannel.py +0 -0
  149. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkd.py +0 -0
  150. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkmailbox.py +0 -0
  151. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkpump.py +0 -0
  152. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkshim.py +0 -0
  153. {letify-3.0.6 → letify-3.0.8}/letify/transport/linksignal.py +0 -0
  154. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkupload.py +0 -0
  155. {letify-3.0.6 → letify-3.0.8}/letify/transport/linkwebsocket.py +0 -0
  156. {letify-3.0.6 → letify-3.0.8}/letify/transport/nat.py +0 -0
  157. {letify-3.0.6 → letify-3.0.8}/letify/transport/pipeline.py +0 -0
  158. {letify-3.0.6 → letify-3.0.8}/letify/transport/portmap.py +0 -0
  159. {letify-3.0.6 → letify-3.0.8}/letify/transport/probe.py +0 -0
  160. {letify-3.0.6 → letify-3.0.8}/letify/transport/rendezvous.py +0 -0
  161. {letify-3.0.6 → letify-3.0.8}/letify/transport/sshopts.py +0 -0
  162. {letify-3.0.6 → letify-3.0.8}/letify/transport/strategies.py +0 -0
  163. {letify-3.0.6 → letify-3.0.8}/letify/useragent.py +0 -0
  164. {letify-3.0.6 → letify-3.0.8}/letify-core/.gitignore +0 -0
  165. {letify-3.0.6 → letify-3.0.8}/letify-core/build.py +0 -0
  166. {letify-3.0.6 → letify-3.0.8}/letify-core/letify/LICENSE +0 -0
  167. {letify-3.0.6 → letify-3.0.8}/letify-core/letify/src/lib.rs +0 -0
  168. {letify-3.0.6 → letify-3.0.8}/letify-core/letify/tests/link.rs +0 -0
  169. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/LICENSE +0 -0
  170. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/examples/bench.rs +0 -0
  171. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/examples/udp_rate.rs +0 -0
  172. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/acceptor.rs +0 -0
  173. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
  174. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/config.rs +0 -0
  175. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/driver.rs +0 -0
  176. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/error.rs +0 -0
  177. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/frame.rs +0 -0
  178. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/handshake.rs +0 -0
  179. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/hysteresis.rs +0 -0
  180. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/identity.rs +0 -0
  181. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/keys.rs +0 -0
  182. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/observe.rs +0 -0
  183. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/paths.rs +0 -0
  184. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/plan.rs +0 -0
  185. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/policing.rs +0 -0
  186. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/punch.rs +0 -0
  187. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/record.rs +0 -0
  188. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/relay.rs +0 -0
  189. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/replay.rs +0 -0
  190. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/session.rs +0 -0
  191. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/sidecar.rs +0 -0
  192. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/stream.rs +0 -0
  193. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/stun.rs +0 -0
  194. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/tcp.rs +0 -0
  195. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/trace.rs +0 -0
  196. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/src/udp.rs +0 -0
  197. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/acceptor.rs +0 -0
  198. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/api.rs +0 -0
  199. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/common/mod.rs +0 -0
  200. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/diag_sim.rs +0 -0
  201. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/driver.rs +0 -0
  202. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/fairness.rs +0 -0
  203. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/gauge.rs +0 -0
  204. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/handshake.rs +0 -0
  205. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/hysteresis.rs +0 -0
  206. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/keepalive.rs +0 -0
  207. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/mobile.rs +0 -0
  208. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/nat.rs +0 -0
  209. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/paths.rs +0 -0
  210. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/qad.rs +0 -0
  211. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/rekey.rs +0 -0
  212. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/relay.rs +0 -0
  213. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
  214. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/rendezvous.rs +0 -0
  215. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/reorder.rs +0 -0
  216. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/replay.rs +0 -0
  217. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/resume.rs +0 -0
  218. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/revoke.rs +0 -0
  219. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/session.rs +0 -0
  220. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/sidecar.rs +0 -0
  221. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/startup.rs +0 -0
  222. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/subflows.rs +0 -0
  223. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/trace.rs +0 -0
  224. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/udp.rs +0 -0
  225. {letify-3.0.6 → letify-3.0.8}/letify-core/letify-link/tests/udp_bench.rs +0 -0
  226. {letify-3.0.6 → letify-3.0.8}/letify-core/rust-toolchain.toml +0 -0
  227. {letify-3.0.6 → letify-3.0.8}/letify-ext/.vscodeignore +0 -0
  228. {letify-3.0.6 → letify-3.0.8}/letify-ext/LICENSE +0 -0
  229. {letify-3.0.6 → letify-3.0.8}/letify-ext/README.md +0 -0
  230. {letify-3.0.6 → letify-3.0.8}/letify-ext/media/icon.svg +0 -0
  231. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/cli.ts +0 -0
  232. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/extension.ts +0 -0
  233. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/history.ts +0 -0
  234. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/model.ts +0 -0
  235. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/poll.ts +0 -0
  236. {letify-3.0.6 → letify-3.0.8}/letify-ext/src/render.ts +0 -0
  237. {letify-3.0.6 → letify-3.0.8}/letify-ext/test/cli.test.ts +0 -0
  238. {letify-3.0.6 → letify-3.0.8}/letify-ext/test/manifest.test.ts +0 -0
  239. {letify-3.0.6 → letify-3.0.8}/letify-ext/test/model.test.ts +0 -0
  240. {letify-3.0.6 → letify-3.0.8}/letify-ext/test/regressions.test.ts +0 -0
  241. {letify-3.0.6 → letify-3.0.8}/letify-ext/tsconfig.json +0 -0
  242. {letify-3.0.6 → letify-3.0.8}/letify-signal/README.md +0 -0
  243. {letify-3.0.6 → letify-3.0.8}/letify-signal/cloudflare.config.ts +0 -0
  244. {letify-3.0.6 → letify-3.0.8}/letify-signal/package-lock.json +0 -0
  245. {letify-3.0.6 → letify-3.0.8}/letify-signal/package.json +0 -0
  246. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/auth.ts +0 -0
  247. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/ed25519.ts +0 -0
  248. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/handler.ts +0 -0
  249. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/index.ts +0 -0
  250. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/limiter.ts +0 -0
  251. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/mailbox.ts +0 -0
  252. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/objects.ts +0 -0
  253. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/protocol.ts +0 -0
  254. {letify-3.0.6 → letify-3.0.8}/letify-signal/src/storage.ts +0 -0
  255. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/auth.test.ts +0 -0
  256. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/ed25519.test.ts +0 -0
  257. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/helpers.ts +0 -0
  258. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/interop.test.ts +0 -0
  259. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/limiter.test.ts +0 -0
  260. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/mailbox.test.ts +0 -0
  261. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/objects.test.ts +0 -0
  262. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/setup.ts +0 -0
  263. {letify-3.0.6 → letify-3.0.8}/letify-signal/test/worker.test.ts +0 -0
  264. {letify-3.0.6 → letify-3.0.8}/letify-signal/tsconfig.json +0 -0
  265. {letify-3.0.6 → letify-3.0.8}/letify-signal/vitest.config.ts +0 -0
  266. {letify-3.0.6 → letify-3.0.8}/letify_providers.py +0 -0
  267. {letify-3.0.6 → letify-3.0.8}/scripts/publish-crates.sh +0 -0
  268. {letify-3.0.6 → letify-3.0.8}/scripts/sync-main.sh +0 -0
  269. {letify-3.0.6 → letify-3.0.8}/scripts/version.py +0 -0
  270. {letify-3.0.6 → letify-3.0.8}/tests/conftest.py +0 -0
  271. {letify-3.0.6 → letify-3.0.8}/tests/fake_kaggle_adapter.py +0 -0
  272. {letify-3.0.6 → letify-3.0.8}/tests/fake_modal_adapter.py +0 -0
  273. {letify-3.0.6 → letify-3.0.8}/tests/test_cli.py +0 -0
  274. {letify-3.0.6 → letify-3.0.8}/tests/test_cli_output.py +0 -0
  275. {letify-3.0.6 → letify-3.0.8}/tests/test_colab_keepalive.py +0 -0
  276. {letify-3.0.6 → letify-3.0.8}/tests/test_config.py +0 -0
  277. {letify-3.0.6 → letify-3.0.8}/tests/test_core.py +0 -0
  278. {letify-3.0.6 → letify-3.0.8}/tests/test_data.py +0 -0
  279. {letify-3.0.6 → letify-3.0.8}/tests/test_data_in_place.py +0 -0
  280. {letify-3.0.6 → letify-3.0.8}/tests/test_data_streaming.py +0 -0
  281. {letify-3.0.6 → letify-3.0.8}/tests/test_declare.py +0 -0
  282. {letify-3.0.6 → letify-3.0.8}/tests/test_device.py +0 -0
  283. {letify-3.0.6 → letify-3.0.8}/tests/test_device_compile.py +0 -0
  284. {letify-3.0.6 → letify-3.0.8}/tests/test_distributed.py +0 -0
  285. {letify-3.0.6 → letify-3.0.8}/tests/test_drive_handoff.py +0 -0
  286. {letify-3.0.6 → letify-3.0.8}/tests/test_drive_store.py +0 -0
  287. {letify-3.0.6 → letify-3.0.8}/tests/test_editor_sessions.py +0 -0
  288. {letify-3.0.6 → letify-3.0.8}/tests/test_elice.py +0 -0
  289. {letify-3.0.6 → letify-3.0.8}/tests/test_frames.py +0 -0
  290. {letify-3.0.6 → letify-3.0.8}/tests/test_install.py +0 -0
  291. {letify-3.0.6 → letify-3.0.8}/tests/test_kaggle.py +0 -0
  292. {letify-3.0.6 → letify-3.0.8}/tests/test_kaggle_cookie.py +0 -0
  293. {letify-3.0.6 → letify-3.0.8}/tests/test_kaggle_link.py +0 -0
  294. {letify-3.0.6 → letify-3.0.8}/tests/test_link_agent.py +0 -0
  295. {letify-3.0.6 → letify-3.0.8}/tests/test_link_channel.py +0 -0
  296. {letify-3.0.6 → letify-3.0.8}/tests/test_link_command_channel.py +0 -0
  297. {letify-3.0.6 → letify-3.0.8}/tests/test_link_exec.py +0 -0
  298. {letify-3.0.6 → letify-3.0.8}/tests/test_link_log.py +0 -0
  299. {letify-3.0.6 → letify-3.0.8}/tests/test_link_mailbox_close.py +0 -0
  300. {letify-3.0.6 → letify-3.0.8}/tests/test_link_opt_in.py +0 -0
  301. {letify-3.0.6 → letify-3.0.8}/tests/test_link_signal.py +0 -0
  302. {letify-3.0.6 → letify-3.0.8}/tests/test_link_ssh_stream.py +0 -0
  303. {letify-3.0.6 → letify-3.0.8}/tests/test_link_upload.py +0 -0
  304. {letify-3.0.6 → letify-3.0.8}/tests/test_linkd.py +0 -0
  305. {letify-3.0.6 → letify-3.0.8}/tests/test_network_guard.py +0 -0
  306. {letify-3.0.6 → letify-3.0.8}/tests/test_notebook.py +0 -0
  307. {letify-3.0.6 → letify-3.0.8}/tests/test_parallel_placement.py +0 -0
  308. {letify-3.0.6 → letify-3.0.8}/tests/test_paths.py +0 -0
  309. {letify-3.0.6 → letify-3.0.8}/tests/test_portmap.py +0 -0
  310. {letify-3.0.6 → letify-3.0.8}/tests/test_protocol.py +0 -0
  311. {letify-3.0.6 → letify-3.0.8}/tests/test_providers.py +0 -0
  312. {letify-3.0.6 → letify-3.0.8}/tests/test_punch_sockets.py +0 -0
  313. {letify-3.0.6 → letify-3.0.8}/tests/test_quic_removed.py +0 -0
  314. {letify-3.0.6 → letify-3.0.8}/tests/test_remoting.py +0 -0
  315. {letify-3.0.6 → letify-3.0.8}/tests/test_render.py +0 -0
  316. {letify-3.0.6 → letify-3.0.8}/tests/test_run_control.py +0 -0
  317. {letify-3.0.6 → letify-3.0.8}/tests/test_run_reattach.py +0 -0
  318. {letify-3.0.6 → letify-3.0.8}/tests/test_run_takeover.py +0 -0
  319. {letify-3.0.6 → letify-3.0.8}/tests/test_runtime.py +0 -0
  320. {letify-3.0.6 → letify-3.0.8}/tests/test_shell_workers.py +0 -0
  321. {letify-3.0.6 → letify-3.0.8}/tests/test_ship.py +0 -0
  322. {letify-3.0.6 → letify-3.0.8}/tests/test_store.py +0 -0
  323. {letify-3.0.6 → letify-3.0.8}/tests/test_strategies.py +0 -0
  324. {letify-3.0.6 → letify-3.0.8}/tests/test_stubs.py +0 -0
  325. {letify-3.0.6 → letify-3.0.8}/tests/test_suite_guards.py +0 -0
  326. {letify-3.0.6 → letify-3.0.8}/tests/test_tailcat_removed.py +0 -0
  327. {letify-3.0.6 → letify-3.0.8}/tests/test_transport.py +0 -0
  328. {letify-3.0.6 → letify-3.0.8}/tests/test_tunnel_agent_login.py +0 -0
  329. {letify-3.0.6 → letify-3.0.8}/tests/test_tunnel_setup.py +0 -0
  330. {letify-3.0.6 → letify-3.0.8}/tests/test_user_agent.py +0 -0
  331. {letify-3.0.6 → letify-3.0.8}/tests/test_version.py +0 -0
@@ -48,8 +48,8 @@ jobs:
48
48
  run: cargo clippy -p letify-link --all-targets --all-features --locked -- -D warnings
49
49
  - name: Build
50
50
  run: cargo build -p letify-link --all-features --locked
51
- - name: Test with the relay role
52
- run: cargo test -p letify-link --features relay --locked
51
+ - name: Test with the relay role and the signalling client
52
+ run: cargo test -p letify-link --features relay,signal --locked
53
53
 
54
54
  mobile-ios:
55
55
  name: check (aarch64-apple-ios)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: letify
3
- Version: 3.0.6
3
+ Version: 3.0.8
4
4
  Summary: Declarations that become infrastructure.
5
5
  Project-URL: Homepage, https://github.com/DarkPyonix/letify
6
6
  Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
@@ -2210,6 +2210,33 @@ A `PunchOffer` with no mappings is a punch with no sockets and nothing else. It
2210
2210
 
2211
2211
  letify implements the trait with its provider bootstraps (ssh, `colab exec`, the Kaggle API and the Drive mailbox), and these are its default rendezvous. The owner also operates a signalling service at `letify.darkpyonix.dev`, a Cloudflare Worker, which letify uses as an auxiliary rendezvous in three cases: reconnection and resumption after the client changed (a new network or a new machine), pairing of two runtimes under `host="distributed"` without the client, and nodes that have no bootstrap. The service carries only small messages, signed address records and punch timing, and never session data, so its cost is small. When the service is unreachable, letify uses the bootstrap. That changes only how addresses are exchanged, not the path that carries data, so it is not a fallback to a slower path. A relay never runs on the service: a Worker cannot accept UDP, and a relay is a node role as the [Relay](#link-relay) subsection says. Another program implements it with its own signalling. darkpyonix Ember, for example, would use a hub that publishes pkarr signed packets. The library holds no provider-specific code.
2212
2212
 
2213
+ #### Rendezvous demultiplexer <!-- id: link-rendezvous-demux -->
2214
+
2215
+ > One Rendezvous shared by many concurrent punches: `Demux` routes each message to the queue of its sender.
2216
+
2217
+ A node with one identity has one `Rendezvous` and one receive cursor. A punch (`driver::punch`, `punch_session`) reads that cursor and discards every message whose sender is not its peer, so two punches over the same Rendezvous at once steal and discard each other's messages. `letify_link::rendezvous::Demux<R>` removes that: it owns the Rendezvous `R`, runs one pump task that calls `R::recv()` and files each `(from, bytes)` under `from`, and hands out one `PeerRendezvous` per peer. The driver API is unchanged: a `PeerRendezvous` is a `Rendezvous` and is passed as `rdv`.
2218
+
2219
+ 1. **API.** `Demux::new(r: R) -> Demux<R>` (needs a running tokio runtime, spawns the pump). `Demux::peer(node) -> PeerRendezvous<R>` returns the handle of a node, for an initiator that knows whom it dials. `Demux::accept().await -> io::Result<(NodeId, PeerRendezvous<R>)>` waits for a sender that has no live handle and returns its handle, with every message already queued for it. `PeerRendezvous::send(to, msg)` passes straight to `R::send`, to any node. `PeerRendezvous::recv()` yields only the messages whose sender is the handle's node, in arrival order. Counters: `PeerRendezvous::dropped()`, `Demux::dropped()` (all handles and pending peers) and `Demux::refused()`.
2220
+ 2. **Bounded queues.** Each peer queue holds at most `PEER_QUEUE` (64) messages. A message that arrives at a full queue evicts the oldest message of that queue and adds 1 to the dropped counters, so one chatty sender loses only its own oldest messages and cannot grow memory or push out another peer. Messages are at most `MAX_MESSAGE` bytes, so a queue holds at most 256 KiB.
2221
+ 3. **Unclaimed peers.** A message from a sender with no live handle opens a pending peer holding its messages in a queue as in item 2. At most `MAX_PENDING_PEERS` (64) peers are pending; a message from a further new sender is discarded and counted in `refused()`, and messages from an already pending sender are still queued. A pending peer is removed `PENDING_TTL` (60 s, the signalling TTL) after its first message if nobody claimed it, and its messages are discarded. Expiry is checked when a message arrives and when `accept` or `peer` runs. `accept` returns pending peers oldest first. `peer(node)` for a node that is pending claims that pending peer with its messages, so `peer` and `accept` never both hand out the same pending peer.
2222
+ 4. **Handles.** `peer(node)` for a node that already has a live handle returns another handle on the same queue; the handles compete for its messages. A handle that is dropped discards the messages still queued for it, and when the last handle of a node is dropped the node has no live handle. The next message from that node is a new pending peer for `accept`, and a later `peer(node)` starts empty (plus what a pending peer holds). Messages are not kept for a dropped handle, so a device that retries after its first punch ended is accepted as a new peer.
2223
+ 5. **Pump errors.** An error of kind `BrokenPipe`, `NotConnected` or `UnexpectedEof` from `R::recv` means the Rendezvous is closed and ends the pump. Any other error is treated as transient: the pump waits 1 s, doubling to at most 30 s (`PUMP_RETRY_FIRST`, `PUMP_RETRY_MAX`), and calls `recv` again, and a recv that succeeds resets the wait. After `PUMP_MAX_RETRIES` (8) errors in a row the pump ends with the last error. When the pump ends, every `PeerRendezvous::recv` and `accept` first returns what is already queued, then fails with that error (same kind and message). Nothing is retried after that, and nothing falls back: the embedder builds a new `Demux`.
2224
+ 6. **Drop.** Dropping the `Demux` aborts the pump, which drops its reference to `R`. Handles keep `R` alive for `send`. A `recv` or `accept` after the drop returns what is queued, then fails with `BrokenPipe` ("the demux was dropped").
2225
+ 7. **Undecodable messages.** The pump routes raw bytes and does not decode them, so a message that fails `Message::decode` is delivered to the handle like any other and the driver skips it as it does today. Routing by sender trusts the sender reported by `R`, as the driver does; the session handshake authenticates the peer.
2226
+
2227
+ A server:
2228
+
2229
+ ```rust
2230
+ let demux = Demux::new(SignalRendezvous::new(url, identity.clone())?);
2231
+ loop {
2232
+ let (peer, rdv) = demux.accept().await?;
2233
+ tokio::spawn(async move {
2234
+ let got = punch_session(&rdv, peer, Endpoint::Responder { acceptor }, &opts).await;
2235
+ // use got.session; rdv is dropped when the punch ends
2236
+ });
2237
+ }
2238
+ ```
2239
+
2213
2240
  #### Signalling service <!-- id: link-signal -->
2214
2241
 
2215
2242
  > A Worker with one mailbox per node id carries signed bootstrap lines to a machine that has no address, so the machine needs no ssh.
@@ -2260,6 +2287,12 @@ The service is the auxiliary rendezvous of [Rendezvous trait](#link-rendezvous).
2260
2287
  - **The receiving agent never executes a command that the line supplies.** The agent is the program on the address-less machine that listens on its mailbox. It accepts a config line only from a node in its own list of paired nodes. Of the config line it takes `version`, `wait_s` (clamped to 1 to 600) and `resume_s` (clamped to 1 to 3600) and nothing else: `binary`, `python`, `bootstrap`, `relay`, `worker_command`, `relay_command`, `allow` and `bind` are ignored if present, and a test pins it. The agent builds the shim configuration from its own configuration: the `letify-link` binary it was installed with, its own Python, the worker and relay programs of its own installed letify, `allow` set to the verified sender and `bind` set to its own. Of the lines after the config, it passes to the shim only `rendezvous`, `punch` and `handover`, with the node they name set to the verified sender, and answers `ping` itself; any other `op` is dropped. An attacker who holds the paired node's key can start a worker on the machine, which is what pairing grants, and no one else can start anything.
2261
2288
  7. **No sources in the config line.** The 4 KiB cap leaves no room for `linkchannel.bootstrap_source` and `relay_program()`, and the agent must not run what it is sent. A signalled bootstrap therefore sends this config line and no more: `{"op":"config","version":"<letify version>","wait_s":<int>,"resume_s":<int>}`. `SignalBootstrap` reduces the config line `connect_over` writes to this one. The agent runs the worker and relay programs of its own installed letify. The `ready` line the agent forwards carries `version`, the agent's letify version. The two sides refuse to go on when the versions differ: the agent answers the config line with `{"event":"error","error":"letify version mismatch: client <a>, agent <b>"}`, and the local side turns a `ready` line whose `version` differs from its own into the same error. The reason reaches the user in the connect failure, as every infrastructure failure of [Sidecar interface](#link-sidecar) does.
2262
2289
  8. **Failure.** A service that does not answer, answers with a code above, or whose mailbox the agent never reads fails the bootstrap with the reason: `the signalling service ...`, or `the agent <node> did not answer in <s> s`. `SignalBootstrap.start` sends three `ping` lines before the shim config. The first only warms the connections, because it pays the TCP and TLS set-up of the send and the poll connection once, and its time is discarded. The larger of the round trips of the other two becomes `rtt_s` and so the lead of the punch, as for `MailboxBootstrap`. A ping that is not answered in `ping_timeout_s` fails the bootstrap, the first one included. No mailbox failure falls back to another bootstrap: the account's own order of bootstraps decides, as the [Rendezvous trait](#link-rendezvous) says.
2290
+ 9. **Rust client.** The `signal` feature of letify-link (`letify_link::signal`, forwarded by the letify crate as `signal`) adds `SignalRendezvous`, a [`Rendezvous`](#link-rendezvous) over this service, so an embedder needs no client of its own. `SignalRendezvous::new(base_url, identity)` takes the service URL (`DEFAULT_URL` is `https://letify.darkpyonix.dev`) and the node `Identity`, and `.user_agent(text)` sets the User-Agent, which defaults to `letify-link/<crate version>` (an embedder names itself, for example `ember/1.0`; the default library agents of an HTTP stack are blocked as item 1 says). It speaks HTTP/1.1 over rustls with the ring backend and the Mozilla trust roots of `webpki-roots`, on tokio, and reuses one idle connection between requests, retrying once on a new connection when a reused one fails before any reply byte. An unusable URL (not `http` or `https`, or with a path) fails the first request with `InvalidInput`. The feature adds `tokio-rustls`, `webpki-roots`, `sha2` and `base64` and nothing else to the build; the default build gains none of them.
2291
+ - **Endpoints.** `send(to, msg)` is `POST /send/<to>`, and `recv()` is a loop of `GET /recv/<own id>?after=<cursor>&wait=25`. It does not use `/ws`: a WebSocket needs a framing and handshake implementation that no crate in the lock provides, and an embedder that waits all day on a mailbox is not the case that item 1 reserves `/ws` for.
2292
+ - **Signing.** Each request carries the four headers of item 2. The signature covers `letify-signal v1\n<METHOD>\n<path and query as sent>\n<time>\n<nonce>\n<sha256 hex of the body>`, byte for byte as the Python client signs it, and the nonce is 16 random bytes as 32 lowercase hex.
2293
+ - **Messages.** A `Rendezvous` message is the body as it is, with no envelope: the `from` the service stamps is the sender, which the trait reports as the `NodeId`. A message over `MAX_MESSAGE` (4096 bytes) fails `send` with `InvalidInput` before any request.
2294
+ - **Cursor and duplicates.** The client keeps the highest `seq` it has returned. Its next `recv` request sends that as `after`, which also acknowledges everything up to it, and a message with a `seq` at or below it is dropped. Messages of one reply are returned one by one in `seq` order. A reply whose `from` is not a valid node id is skipped.
2295
+ - **Errors.** A status of 400 or above fails with `io::Error` whose text is `the signalling service refused the request: <code> (HTTP <status>)`, with `, retry in <s> s)` when the reply carries `Retry-After` (kind `WouldBlock` for 429, `InvalidData` for 413, `PermissionDenied` for 401 and 403, `Other` otherwise). A connection, TLS or timeout failure fails with `the signalling service did not answer: <reason>`. `recv` does not retry on its own; the caller decides, as the trait leaves it.
2263
2296
 
2264
2297
  #### Agent and pairing <!-- id: link-agent -->
2265
2298
 
@@ -70,7 +70,7 @@ distributed: Final = Host.distributed
70
70
  # The enum class stays importable from letify.declare.instance for letify's own use.
71
71
  del Host
72
72
 
73
- __version__ = "3.0.6"
73
+ __version__ = "3.0.8"
74
74
 
75
75
 
76
76
  def fetch(tensor): # type: ignore[no-untyped-def]
@@ -396,15 +396,16 @@ dependencies = [
396
396
 
397
397
  [[package]]
398
398
  name = "letify"
399
- version = "3.0.6"
399
+ version = "3.0.8"
400
400
  dependencies = [
401
401
  "letify-link",
402
402
  ]
403
403
 
404
404
  [[package]]
405
405
  name = "letify-link"
406
- version = "3.0.6"
406
+ version = "3.0.8"
407
407
  dependencies = [
408
+ "base64",
408
409
  "ed25519-dalek",
409
410
  "getrandom 0.2.17",
410
411
  "libc",
@@ -412,9 +413,12 @@ dependencies = [
412
413
  "rcgen",
413
414
  "rustls",
414
415
  "serde_json",
416
+ "sha2",
415
417
  "snow",
416
418
  "socket2 0.5.10",
417
419
  "tokio",
420
+ "tokio-rustls",
421
+ "webpki-roots",
418
422
  ]
419
423
 
420
424
  [[package]]
@@ -1008,6 +1012,16 @@ dependencies = [
1008
1012
  "syn 3.0.6",
1009
1013
  ]
1010
1014
 
1015
+ [[package]]
1016
+ name = "tokio-rustls"
1017
+ version = "0.26.6"
1018
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1019
+ checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"
1020
+ dependencies = [
1021
+ "rustls",
1022
+ "tokio",
1023
+ ]
1024
+
1011
1025
  [[package]]
1012
1026
  name = "tracing"
1013
1027
  version = "0.1.44"
@@ -1122,6 +1136,15 @@ dependencies = [
1122
1136
  "wasm-bindgen",
1123
1137
  ]
1124
1138
 
1139
+ [[package]]
1140
+ name = "webpki-roots"
1141
+ version = "1.0.12"
1142
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1143
+ checksum = "7265c9301c16a8711c992c2d8da90ee77ef54b1ed51482d6dfeb00dc756b1297"
1144
+ dependencies = [
1145
+ "rustls-pki-types",
1146
+ ]
1147
+
1125
1148
  [[package]]
1126
1149
  name = "windows-link"
1127
1150
  version = "0.2.1"
@@ -8,7 +8,7 @@ resolver = "3"
8
8
  members = ["letify", "letify-link"]
9
9
 
10
10
  [workspace.package]
11
- version = "3.0.6"
11
+ version = "3.0.8"
12
12
  edition = "2024"
13
13
  license = "Apache-2.0"
14
14
  repository = "https://github.com/DarkPyonix/letify"
@@ -14,8 +14,10 @@ categories = ["development-tools", "network-programming"]
14
14
  [dependencies]
15
15
  # The pin keeps a published letify on the letify-link of its own release. scripts/version.py
16
16
  # rewrites it with the version.
17
- letify-link = { version = "=3.0.6", path = "../letify-link" }
17
+ letify-link = { version = "=3.0.8", path = "../letify-link" }
18
18
 
19
19
  [features]
20
20
  # Enable the relay role of letify-link.
21
21
  relay = ["letify-link/relay"]
22
+ # Enable letify_link::signal, the Rendezvous over the signalling service.
23
+ signal = ["letify-link/signal"]
@@ -12,7 +12,7 @@ Source, documentation and issues are at <https://github.com/DarkPyonix/letify>.
12
12
 
13
13
  ## This crate
14
14
 
15
- This crate is the Rust face of the project. It re-exports the letify components that are meant for use outside letify. The first is the connection library [`letify-link`](https://crates.io/crates/letify-link), which provides NAT traversal and multipath links, as the module `letify::link`. The Cargo feature `relay` enables the relay role of `letify-link`. The crate also exports `VERSION`. Its version follows the Python package: crate `letify` 2.8.6 is released together with PyPI `letify` 2.8.6.
15
+ This crate is the Rust face of the project. It re-exports the letify components that are meant for use outside letify. The first is the connection library [`letify-link`](https://crates.io/crates/letify-link), which provides NAT traversal and multipath links, as the module `letify::link`. The Cargo feature `relay` enables the relay role of `letify-link`, and the feature `signal` enables `letify::link::signal`, the `Rendezvous` over the signalling service. The crate also exports `VERSION`. Its version follows the Python package: crate `letify` 2.8.6 is released together with PyPI `letify` 2.8.6.
16
16
 
17
17
  ## License
18
18
 
@@ -26,6 +26,13 @@ quinn = { version = "0.11", default-features = false, features = ["runtime-tokio
26
26
  rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
27
27
  rcgen = "0.13"
28
28
  serde_json = "1.0.154"
29
+ # The signal feature. rustls is the dependency above, with the ring backend. webpki-roots
30
+ # carries the Mozilla trust roots as data, so the client verifies the service the same way on
31
+ # Linux, macOS, Windows, iOS and Android without a platform verifier.
32
+ tokio-rustls = { version = "0.26", default-features = false, features = ["ring"], optional = true }
33
+ webpki-roots = { version = "1", optional = true }
34
+ sha2 = { version = "0.10", optional = true }
35
+ base64 = { version = "0.22", optional = true }
29
36
 
30
37
  [target.'cfg(unix)'.dependencies]
31
38
  # geteuid, to check who owns a key file.
@@ -35,6 +42,13 @@ libc = "0.2"
35
42
  # The relay role: a node that forwards session ciphertext between two authenticated nodes, and
36
43
  # the dialer that reaches a peer through one. The sidecar is built with it.
37
44
  relay = ["tokio/rt-multi-thread"]
45
+ # SignalRendezvous: the Rendezvous trait over the signalling service, for an embedder that
46
+ # wants the owner's Worker without writing a client. It adds tokio-rustls, webpki-roots, sha2
47
+ # and base64 to the build, and nothing when the feature is off.
48
+ signal = ["dep:tokio-rustls", "dep:webpki-roots", "dep:sha2", "dep:base64"]
38
49
 
39
50
  [dev-dependencies]
51
+ # The signal test verifies requests the way the Worker does.
52
+ sha2 = "0.10"
53
+ base64 = "0.22"
40
54
  tokio = { version = "1", features = ["full", "test-util"] }
@@ -9,6 +9,8 @@ letify-link is the connection layer of [letify](https://github.com/DarkPyonix/le
9
9
 
10
10
  The crate has a Cargo feature `relay`, which adds a node that forwards session ciphertext between two authenticated nodes.
11
11
 
12
+ The feature `signal` adds `signal::SignalRendezvous`, a `Rendezvous` over the owner's signalling service at `https://letify.darkpyonix.dev`: `SignalRendezvous::new(url, identity).user_agent("my-app/1.0")`. It adds `tokio-rustls`, `webpki-roots`, `sha2` and `base64`.
13
+
12
14
  ```sh
13
15
  cargo add letify-link
14
16
  ```
@@ -135,6 +135,8 @@ pub mod rendezvous;
135
135
  mod replay;
136
136
  mod session;
137
137
  pub mod sidecar;
138
+ #[cfg(feature = "signal")]
139
+ pub mod signal;
138
140
  mod stream;
139
141
  pub mod stun;
140
142
  pub mod tcp;
@@ -0,0 +1,338 @@
1
+ //! The rendezvous demultiplexer: one [`Rendezvous`] shared by many concurrent punches. It owns
2
+ //! the pump that reads the shared Rendezvous, the per-peer queues and their bounds. It does not
3
+ //! decode messages, authenticate senders or run punches. SPEC.md "Rendezvous demultiplexer".
4
+ //!
5
+ //! ```no_run
6
+ //! use std::sync::Arc;
7
+ //! use letify_link::driver::{Endpoint, PunchOptions, punch_session};
8
+ //! use letify_link::rendezvous::{Demux, MemoryHub};
9
+ //! use letify_link::{Acceptor, Config, Identity, PeerPolicy};
10
+ //!
11
+ //! # async fn run() -> std::io::Result<()> {
12
+ //! let identity = Identity::generate();
13
+ //! let hub = MemoryHub::new();
14
+ //! let acceptor = Arc::new(Acceptor::new(
15
+ //! identity.clone(),
16
+ //! PeerPolicy::from_fn(|_| true),
17
+ //! Config::default(),
18
+ //! ));
19
+ //! let demux = Demux::new(hub.endpoint(identity.node_id()));
20
+ //! loop {
21
+ //! let (peer, rdv) = demux.accept().await?;
22
+ //! let acceptor = acceptor.clone();
23
+ //! tokio::spawn(async move {
24
+ //! let opts = PunchOptions::default();
25
+ //! let _ = punch_session(&rdv, peer, Endpoint::Responder { acceptor }, &opts).await;
26
+ //! });
27
+ //! }
28
+ //! # }
29
+ //! ```
30
+
31
+ use std::collections::{HashMap, VecDeque};
32
+ use std::io;
33
+ use std::sync::{Arc, Mutex, MutexGuard};
34
+ use std::time::Duration;
35
+
36
+ use tokio::sync::Notify;
37
+ use tokio::task::JoinHandle;
38
+ use tokio::time::Instant;
39
+
40
+ use super::Rendezvous;
41
+ use crate::identity::NodeId;
42
+
43
+ /// The most messages queued for one peer. At the limit the oldest message is dropped.
44
+ pub const PEER_QUEUE: usize = 64;
45
+ /// The most peers waiting in [`Demux::accept`] at once.
46
+ pub const MAX_PENDING_PEERS: usize = 64;
47
+ /// How long an unclaimed peer waits, the time to live of the signalling service.
48
+ pub const PENDING_TTL: Duration = Duration::from_secs(60);
49
+ /// The first wait before the pump calls `recv` again after a transient error.
50
+ pub const PUMP_RETRY_FIRST: Duration = Duration::from_secs(1);
51
+ /// The longest wait between two retries of the pump.
52
+ pub const PUMP_RETRY_MAX: Duration = Duration::from_secs(30);
53
+ /// The pump ends after this many errors in a row.
54
+ pub const PUMP_MAX_RETRIES: u32 = 8;
55
+
56
+ #[derive(Default)]
57
+ struct Entry {
58
+ items: VecDeque<Vec<u8>>,
59
+ dropped: u64,
60
+ handles: usize,
61
+ notify: Arc<Notify>,
62
+ }
63
+
64
+ impl Entry {
65
+ fn push(&mut self, msg: Vec<u8>) -> bool {
66
+ let evicted = self.items.len() >= PEER_QUEUE;
67
+ if evicted {
68
+ self.items.pop_front();
69
+ self.dropped += 1;
70
+ }
71
+ self.items.push_back(msg);
72
+ evicted
73
+ }
74
+ }
75
+
76
+ #[derive(Default)]
77
+ struct State {
78
+ live: HashMap<NodeId, Entry>,
79
+ pending: VecDeque<(NodeId, Entry, Instant)>,
80
+ end: Option<(io::ErrorKind, String)>,
81
+ dropped: u64,
82
+ refused: u64,
83
+ }
84
+
85
+ impl State {
86
+ fn expire(&mut self) {
87
+ let now = Instant::now();
88
+ while let Some((_, _, first)) = self.pending.front() {
89
+ if now.duration_since(*first) < PENDING_TTL {
90
+ break;
91
+ }
92
+ self.pending.pop_front();
93
+ }
94
+ }
95
+
96
+ fn end_error(&self) -> Option<io::Error> {
97
+ self.end
98
+ .as_ref()
99
+ .map(|(kind, text)| io::Error::new(*kind, text.clone()))
100
+ }
101
+ }
102
+
103
+ struct Shared {
104
+ state: Mutex<State>,
105
+ accept_notify: Notify,
106
+ }
107
+
108
+ impl Shared {
109
+ fn lock(&self) -> MutexGuard<'_, State> {
110
+ self.state.lock().unwrap_or_else(|e| e.into_inner())
111
+ }
112
+
113
+ /// End the pump: queued messages stay readable, then every recv fails with `kind`.
114
+ fn finish(&self, kind: io::ErrorKind, text: String) {
115
+ let mut st = self.lock();
116
+ if st.end.is_none() {
117
+ st.end = Some((kind, text));
118
+ }
119
+ for entry in st.live.values() {
120
+ entry.notify.notify_waiters();
121
+ }
122
+ drop(st);
123
+ self.accept_notify.notify_waiters();
124
+ }
125
+
126
+ fn route(&self, from: NodeId, msg: Vec<u8>) {
127
+ let mut st = self.lock();
128
+ st.expire();
129
+ if let Some(entry) = st.live.get_mut(&from) {
130
+ let evicted = entry.push(msg);
131
+ let notify = entry.notify.clone();
132
+ st.dropped += u64::from(evicted);
133
+ drop(st);
134
+ notify.notify_waiters();
135
+ } else if let Some((_, entry, _)) = st.pending.iter_mut().find(|(n, _, _)| *n == from) {
136
+ let evicted = entry.push(msg);
137
+ st.dropped += u64::from(evicted);
138
+ } else if st.pending.len() < MAX_PENDING_PEERS {
139
+ let mut entry = Entry::default();
140
+ entry.push(msg);
141
+ st.pending.push_back((from, entry, Instant::now()));
142
+ drop(st);
143
+ self.accept_notify.notify_waiters();
144
+ } else {
145
+ st.refused += 1;
146
+ }
147
+ }
148
+ }
149
+
150
+ fn is_closed(kind: io::ErrorKind) -> bool {
151
+ matches!(
152
+ kind,
153
+ io::ErrorKind::BrokenPipe | io::ErrorKind::NotConnected | io::ErrorKind::UnexpectedEof
154
+ )
155
+ }
156
+
157
+ async fn pump<R: Rendezvous>(rdv: Arc<R>, shared: Arc<Shared>) {
158
+ let mut wait = PUMP_RETRY_FIRST;
159
+ let mut failures = 0u32;
160
+ loop {
161
+ match rdv.recv().await {
162
+ Ok((from, msg)) => {
163
+ failures = 0;
164
+ wait = PUMP_RETRY_FIRST;
165
+ shared.route(from, msg);
166
+ }
167
+ Err(e) => {
168
+ failures += 1;
169
+ if is_closed(e.kind()) || failures >= PUMP_MAX_RETRIES {
170
+ shared.finish(e.kind(), e.to_string());
171
+ return;
172
+ }
173
+ tokio::time::sleep(wait).await;
174
+ wait = (wait * 2).min(PUMP_RETRY_MAX);
175
+ }
176
+ }
177
+ }
178
+ }
179
+
180
+ /// Shares one [`Rendezvous`] between many concurrent punches by routing each message to the
181
+ /// queue of its sender. Dropping it stops the pump.
182
+ pub struct Demux<R: Rendezvous + 'static> {
183
+ rdv: Arc<R>,
184
+ shared: Arc<Shared>,
185
+ pump: JoinHandle<()>,
186
+ }
187
+
188
+ impl<R: Rendezvous + 'static> Demux<R> {
189
+ /// Take `rdv` and start the pump. Needs a running tokio runtime.
190
+ pub fn new(rdv: R) -> Self {
191
+ let rdv = Arc::new(rdv);
192
+ let shared = Arc::new(Shared {
193
+ state: Mutex::new(State::default()),
194
+ accept_notify: Notify::new(),
195
+ });
196
+ let pump = tokio::spawn(pump(rdv.clone(), shared.clone()));
197
+ Demux { rdv, shared, pump }
198
+ }
199
+
200
+ /// The handle of `node`. A pending peer of that node is claimed with its messages, and a
201
+ /// node that already has a handle gets another on the same queue.
202
+ pub fn peer(&self, node: NodeId) -> PeerRendezvous<R> {
203
+ let mut st = self.shared.lock();
204
+ st.expire();
205
+ if !st.live.contains_key(&node) {
206
+ let entry = match st.pending.iter().position(|(n, _, _)| *n == node) {
207
+ Some(i) => st.pending.remove(i).map(|(_, e, _)| e).unwrap_or_default(),
208
+ None => Entry::default(),
209
+ };
210
+ st.live.insert(node, entry);
211
+ }
212
+ self.handle(&mut st, node)
213
+ }
214
+
215
+ /// Wait for a sender that has no handle and return its handle, with the messages already
216
+ /// queued for it. Fails with the pump's error once the pump has ended and no peer waits.
217
+ pub async fn accept(&self) -> io::Result<(NodeId, PeerRendezvous<R>)> {
218
+ loop {
219
+ let notified = self.shared.accept_notify.notified();
220
+ tokio::pin!(notified);
221
+ notified.as_mut().enable();
222
+ {
223
+ let mut st = self.shared.lock();
224
+ st.expire();
225
+ if let Some((node, entry, _)) = st.pending.pop_front() {
226
+ st.live.insert(node, entry);
227
+ let handle = self.handle(&mut st, node);
228
+ return Ok((node, handle));
229
+ }
230
+ if let Some(e) = st.end_error() {
231
+ return Err(e);
232
+ }
233
+ }
234
+ notified.await;
235
+ }
236
+ }
237
+
238
+ fn handle(&self, st: &mut State, node: NodeId) -> PeerRendezvous<R> {
239
+ let entry = st.live.get_mut(&node).expect("entry was just inserted");
240
+ entry.handles += 1;
241
+ PeerRendezvous {
242
+ node,
243
+ rdv: self.rdv.clone(),
244
+ shared: self.shared.clone(),
245
+ notify: entry.notify.clone(),
246
+ }
247
+ }
248
+
249
+ /// Messages dropped so far because a queue was full, over all peers.
250
+ pub fn dropped(&self) -> u64 {
251
+ self.shared.lock().dropped
252
+ }
253
+
254
+ /// Messages discarded so far because [`MAX_PENDING_PEERS`] peers were already waiting.
255
+ pub fn refused(&self) -> u64 {
256
+ self.shared.lock().refused
257
+ }
258
+ }
259
+
260
+ impl<R: Rendezvous + 'static> Drop for Demux<R> {
261
+ fn drop(&mut self) {
262
+ self.pump.abort();
263
+ self.shared
264
+ .finish(io::ErrorKind::BrokenPipe, "the demux was dropped".into());
265
+ }
266
+ }
267
+
268
+ /// The view of a [`Demux`] for one peer: `recv` yields only that peer's messages and `send`
269
+ /// passes through. It is a [`Rendezvous`], so it is the `rdv` of `driver::punch`.
270
+ pub struct PeerRendezvous<R: Rendezvous + 'static> {
271
+ node: NodeId,
272
+ rdv: Arc<R>,
273
+ shared: Arc<Shared>,
274
+ notify: Arc<Notify>,
275
+ }
276
+
277
+ impl<R: Rendezvous + 'static> PeerRendezvous<R> {
278
+ /// The node whose messages this handle yields.
279
+ pub fn node(&self) -> NodeId {
280
+ self.node
281
+ }
282
+
283
+ /// Messages of this peer dropped so far because its queue was full.
284
+ pub fn dropped(&self) -> u64 {
285
+ self.shared
286
+ .lock()
287
+ .live
288
+ .get(&self.node)
289
+ .map_or(0, |e| e.dropped)
290
+ }
291
+ }
292
+
293
+ impl<R: Rendezvous + 'static> Drop for PeerRendezvous<R> {
294
+ fn drop(&mut self) {
295
+ let mut st = self.shared.lock();
296
+ if let Some(entry) = st.live.get_mut(&self.node) {
297
+ entry.handles -= 1;
298
+ if entry.handles == 0 {
299
+ st.live.remove(&self.node);
300
+ }
301
+ }
302
+ }
303
+ }
304
+
305
+ impl<R: Rendezvous + 'static> Rendezvous for PeerRendezvous<R> {
306
+ async fn send(&self, to: NodeId, msg: Vec<u8>) -> io::Result<()> {
307
+ self.rdv.send(to, msg).await
308
+ }
309
+
310
+ async fn recv(&self) -> io::Result<(NodeId, Vec<u8>)> {
311
+ loop {
312
+ let notified = self.notify.notified();
313
+ tokio::pin!(notified);
314
+ notified.as_mut().enable();
315
+ {
316
+ let mut st = self.shared.lock();
317
+ let end = st.end_error();
318
+ if let Some(entry) = st.live.get_mut(&self.node)
319
+ && let Some(msg) = entry.items.pop_front()
320
+ {
321
+ return Ok((self.node, msg));
322
+ }
323
+ if let Some(e) = end {
324
+ return Err(e);
325
+ }
326
+ }
327
+ notified.await;
328
+ }
329
+ }
330
+ }
331
+
332
+ impl<R: Rendezvous + 'static> std::fmt::Debug for PeerRendezvous<R> {
333
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
334
+ f.debug_struct("PeerRendezvous")
335
+ .field("node", &self.node)
336
+ .finish()
337
+ }
338
+ }
@@ -12,6 +12,12 @@ use std::time::Duration;
12
12
 
13
13
  use tokio::sync::mpsc;
14
14
 
15
+ mod demux;
16
+ pub use demux::{
17
+ Demux, MAX_PENDING_PEERS, PEER_QUEUE, PENDING_TTL, PUMP_MAX_RETRIES, PUMP_RETRY_FIRST,
18
+ PUMP_RETRY_MAX, PeerRendezvous,
19
+ };
20
+
15
21
  use crate::identity::NodeId;
16
22
  use crate::stun::NatType;
17
23