punt-lux-client 0.35.0__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 (370) hide show
  1. punt_lux_client-0.35.0/PKG-INFO +11 -0
  2. punt_lux_client-0.35.0/pyproject.toml +28 -0
  3. punt_lux_client-0.35.0/pyproject.toml.orig +21 -0
  4. punt_lux_client-0.35.0/src/punt_lux/applets/__init__.py +36 -0
  5. punt_lux_client-0.35.0/src/punt_lux/applets/board_ops.py +79 -0
  6. punt_lux_client-0.35.0/src/punt_lux/applets/claim.py +130 -0
  7. punt_lux_client-0.35.0/src/punt_lux/applets/figure.py +37 -0
  8. punt_lux_client-0.35.0/src/punt_lux/applets/identity.py +82 -0
  9. punt_lux_client-0.35.0/src/punt_lux/applets/latency.py +98 -0
  10. punt_lux_client-0.35.0/src/punt_lux/applets/leg.py +166 -0
  11. punt_lux_client-0.35.0/src/punt_lux/applets/menu_entry.py +41 -0
  12. punt_lux_client-0.35.0/src/punt_lux/applets/process_child.py +232 -0
  13. punt_lux_client-0.35.0/src/punt_lux/applets/process_exit.py +67 -0
  14. punt_lux_client-0.35.0/src/punt_lux/applets/program.py +66 -0
  15. punt_lux_client-0.35.0/src/punt_lux/applets/py.typed +0 -0
  16. punt_lux_client-0.35.0/src/punt_lux/applets/runner.py +113 -0
  17. punt_lux_client-0.35.0/src/punt_lux/applets/service.py +59 -0
  18. punt_lux_client-0.35.0/src/punt_lux/applets/serviced_click.py +118 -0
  19. punt_lux_client-0.35.0/src/punt_lux/applets/single_flight.py +57 -0
  20. punt_lux_client-0.35.0/src/punt_lux/applets/stage_times.py +110 -0
  21. punt_lux_client-0.35.0/src/punt_lux/applets/underway.py +53 -0
  22. punt_lux_client-0.35.0/src/punt_lux/applets/watch.py +99 -0
  23. punt_lux_client-0.35.0/src/punt_lux/client/__init__.py +40 -0
  24. punt_lux_client-0.35.0/src/punt_lux/client/_callback_ops.py +37 -0
  25. punt_lux_client-0.35.0/src/punt_lux/client/_display_link_ops.py +29 -0
  26. punt_lux_client-0.35.0/src/punt_lux/client/_link_reply.py +48 -0
  27. punt_lux_client-0.35.0/src/punt_lux/client/_rest_display.py +75 -0
  28. punt_lux_client-0.35.0/src/punt_lux/client/_rest_scenes.py +136 -0
  29. punt_lux_client-0.35.0/src/punt_lux/client/_rest_services.py +52 -0
  30. punt_lux_client-0.35.0/src/punt_lux/client/_rest_transport.py +341 -0
  31. punt_lux_client-0.35.0/src/punt_lux/client/_sync_ops.py +47 -0
  32. punt_lux_client-0.35.0/src/punt_lux/client/callback.py +40 -0
  33. punt_lux_client-0.35.0/src/punt_lux/client/cli_identity.py +55 -0
  34. punt_lux_client-0.35.0/src/punt_lux/client/display.py +116 -0
  35. punt_lux_client-0.35.0/src/punt_lux/client/error.py +28 -0
  36. punt_lux_client-0.35.0/src/punt_lux/client/event.py +28 -0
  37. punt_lux_client-0.35.0/src/punt_lux/client/facade.py +160 -0
  38. punt_lux_client-0.35.0/src/punt_lux/client/frame.py +35 -0
  39. punt_lux_client-0.35.0/src/punt_lux/client/hub_client.py +317 -0
  40. punt_lux_client-0.35.0/src/punt_lux/client/menu.py +35 -0
  41. punt_lux_client-0.35.0/src/punt_lux/client/py.typed +0 -0
  42. punt_lux_client-0.35.0/src/punt_lux/client/request_server.py +182 -0
  43. punt_lux_client-0.35.0/src/punt_lux/client/rest_error_body.py +110 -0
  44. punt_lux_client-0.35.0/src/punt_lux/client/rest_http_call.py +76 -0
  45. punt_lux_client-0.35.0/src/punt_lux/client/rest_loopback.py +56 -0
  46. punt_lux_client-0.35.0/src/punt_lux/client/rest_reply.py +90 -0
  47. punt_lux_client-0.35.0/src/punt_lux/client/rest_transport.py +45 -0
  48. punt_lux_client-0.35.0/src/punt_lux/client/scene.py +88 -0
  49. punt_lux_client-0.35.0/src/punt_lux/client/service.py +56 -0
  50. punt_lux_client-0.35.0/src/punt_lux/client/session.py +37 -0
  51. punt_lux_client-0.35.0/src/punt_lux/kernel/__init__.py +3 -0
  52. punt_lux_client-0.35.0/src/punt_lux/kernel/bounded_send.py +131 -0
  53. punt_lux_client-0.35.0/src/punt_lux/kernel/client_host.py +130 -0
  54. punt_lux_client-0.35.0/src/punt_lux/kernel/connection_id.py +9 -0
  55. punt_lux_client-0.35.0/src/punt_lux/kernel/connection_identity.py +65 -0
  56. punt_lux_client-0.35.0/src/punt_lux/kernel/connection_timing.py +59 -0
  57. punt_lux_client-0.35.0/src/punt_lux/kernel/credentials.py +41 -0
  58. punt_lux_client-0.35.0/src/punt_lux/kernel/display_defaults.py +5 -0
  59. punt_lux_client-0.35.0/src/punt_lux/kernel/first_report.py +57 -0
  60. punt_lux_client-0.35.0/src/punt_lux/kernel/home_paths.py +138 -0
  61. punt_lux_client-0.35.0/src/punt_lux/kernel/hub_defaults.py +5 -0
  62. punt_lux_client-0.35.0/src/punt_lux/kernel/hub_paths.py +81 -0
  63. punt_lux_client-0.35.0/src/punt_lux/kernel/local_host.py +54 -0
  64. punt_lux_client-0.35.0/src/punt_lux/kernel/log_level.py +23 -0
  65. punt_lux_client-0.35.0/src/punt_lux/kernel/logging_config.py +122 -0
  66. punt_lux_client-0.35.0/src/punt_lux/kernel/peer_connection.py +37 -0
  67. punt_lux_client-0.35.0/src/punt_lux/kernel/polled_event.py +21 -0
  68. punt_lux_client-0.35.0/src/punt_lux/kernel/proctitle.py +10 -0
  69. punt_lux_client-0.35.0/src/punt_lux/kernel/programmer_error.py +15 -0
  70. punt_lux_client-0.35.0/src/punt_lux/kernel/progress_clock.py +39 -0
  71. punt_lux_client-0.35.0/src/punt_lux/kernel/py.typed +0 -0
  72. punt_lux_client-0.35.0/src/punt_lux/kernel/repo_root.py +72 -0
  73. punt_lux_client-0.35.0/src/punt_lux/kernel/runtime.py +249 -0
  74. punt_lux_client-0.35.0/src/punt_lux/kernel/send_timeout.py +64 -0
  75. punt_lux_client-0.35.0/src/punt_lux/kernel/socket_owner.py +110 -0
  76. punt_lux_client-0.35.0/src/punt_lux/kernel/socket_writer.py +42 -0
  77. punt_lux_client-0.35.0/src/punt_lux/kernel/tracing.py +26 -0
  78. punt_lux_client-0.35.0/src/punt_lux/kernel/usage.py +96 -0
  79. punt_lux_client-0.35.0/src/punt_lux/kernel/wire_queue.py +60 -0
  80. punt_lux_client-0.35.0/src/punt_lux/kernel/write_progress.py +53 -0
  81. punt_lux_client-0.35.0/src/punt_lux/wire/__init__.py +5 -0
  82. punt_lux_client-0.35.0/src/punt_lux/wire/model/__init__.py +152 -0
  83. punt_lux_client-0.35.0/src/punt_lux/wire/model/_typing.py +85 -0
  84. punt_lux_client-0.35.0/src/punt_lux/wire/model/_wire_fields.py +64 -0
  85. punt_lux_client-0.35.0/src/punt_lux/wire/model/agent_factory.py +67 -0
  86. punt_lux_client-0.35.0/src/punt_lux/wire/model/anonymizable.py +28 -0
  87. punt_lux_client-0.35.0/src/punt_lux/wire/model/applet_name_format.py +49 -0
  88. punt_lux_client-0.35.0/src/punt_lux/wire/model/client_identity.py +222 -0
  89. punt_lux_client-0.35.0/src/punt_lux/wire/model/codec_protocols.py +35 -0
  90. punt_lux_client-0.35.0/src/punt_lux/wire/model/composite.py +35 -0
  91. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/__init__.py +21 -0
  92. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/client_details.py +101 -0
  93. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/filtered_table_model.py +285 -0
  94. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/table_chrome.py +203 -0
  95. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/table_composition.py +99 -0
  96. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/table_composition_spec.py +70 -0
  97. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/table_filter_handlers.py +85 -0
  98. punt_lux_client-0.35.0/src/punt_lux/wire/model/compositions/table_selection_handlers.py +76 -0
  99. punt_lux_client-0.35.0/src/punt_lux/wire/model/connection.py +160 -0
  100. punt_lux_client-0.35.0/src/punt_lux/wire/model/connection_scoped_id.py +68 -0
  101. punt_lux_client-0.35.0/src/punt_lux/wire/model/container_interaction.py +181 -0
  102. punt_lux_client-0.35.0/src/punt_lux/wire/model/element.py +41 -0
  103. punt_lux_client-0.35.0/src/punt_lux/wire/model/element_abc.py +342 -0
  104. punt_lux_client-0.35.0/src/punt_lux/wire/model/element_checkpoint.py +58 -0
  105. punt_lux_client-0.35.0/src/punt_lux/wire/model/element_factory.py +96 -0
  106. punt_lux_client-0.35.0/src/punt_lux/wire/model/element_identity.py +49 -0
  107. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/__init__.py +131 -0
  108. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/_util.py +12 -0
  109. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_capability.py +24 -0
  110. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_container_kinds.py +96 -0
  111. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_di_defaults.py +39 -0
  112. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_codec.py +34 -0
  113. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_names.py +81 -0
  114. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_spec.py +76 -0
  115. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_specs.py +136 -0
  116. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_table.py +55 -0
  117. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_kind_verify.py +99 -0
  118. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_leaf_kinds.py +159 -0
  119. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_leaf_spec.py +108 -0
  120. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_registry.py +76 -0
  121. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/abc_static_leaf_kinds.py +105 -0
  122. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/button.py +228 -0
  123. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/button_codec.py +198 -0
  124. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/button_publish.py +179 -0
  125. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/button_sugar.py +75 -0
  126. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/checkbox.py +157 -0
  127. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/checkbox_codec.py +154 -0
  128. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/collapsing_header.py +185 -0
  129. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/collapsing_header_codec.py +185 -0
  130. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/color_picker.py +222 -0
  131. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/color_picker_codec.py +192 -0
  132. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/combo.py +213 -0
  133. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/combo_codec.py +145 -0
  134. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/container_dispatch.py +77 -0
  135. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/dialog.py +280 -0
  136. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/dialog_codec.py +194 -0
  137. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw.py +154 -0
  138. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_bounds.py +109 -0
  139. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_codec.py +99 -0
  140. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_command_kind.py +64 -0
  141. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_commands_curve.py +67 -0
  142. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_commands_line.py +113 -0
  143. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_commands_shape.py +155 -0
  144. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_commands_text.py +48 -0
  145. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_decoder.py +152 -0
  146. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_values.py +197 -0
  147. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/draw_wire.py +124 -0
  148. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/element_wire.py +192 -0
  149. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/group.py +165 -0
  150. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/group_codec.py +142 -0
  151. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/image.py +222 -0
  152. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/image_codec.py +101 -0
  153. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/image_source.py +149 -0
  154. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/image_source_spec.py +45 -0
  155. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/input_number.py +254 -0
  156. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/input_number_codec.py +199 -0
  157. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/input_text.py +185 -0
  158. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/input_text_codec.py +189 -0
  159. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/markdown.py +109 -0
  160. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/markdown_codec.py +90 -0
  161. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/modal.py +267 -0
  162. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/modal_codec.py +199 -0
  163. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/numeric_input_checks.py +139 -0
  164. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/patch_field.py +81 -0
  165. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/plot.py +201 -0
  166. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/plot_codec.py +100 -0
  167. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/plot_series.py +108 -0
  168. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/progress.py +152 -0
  169. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/progress_codec.py +98 -0
  170. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/radio.py +213 -0
  171. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/radio_codec.py +145 -0
  172. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/rgba_color.py +108 -0
  173. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/selectable.py +165 -0
  174. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/selectable_codec.py +157 -0
  175. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/selection_wire.py +80 -0
  176. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/separator.py +117 -0
  177. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/separator_codec.py +90 -0
  178. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/slider.py +282 -0
  179. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/slider_codec.py +188 -0
  180. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/spinner.py +166 -0
  181. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/spinner_codec.py +95 -0
  182. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/split_pane.py +133 -0
  183. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tab.py +30 -0
  184. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tab_bar.py +249 -0
  185. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tab_bar_codec.py +210 -0
  186. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tab_id_synthesizer.py +59 -0
  187. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table.py +300 -0
  188. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table_codec.py +314 -0
  189. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table_flags.py +82 -0
  190. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table_selection_model.py +125 -0
  191. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table_validation.py +119 -0
  192. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/table_wire.py +55 -0
  193. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/terminal.py +165 -0
  194. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/terminal_placement.py +33 -0
  195. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/text.py +157 -0
  196. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/text_codec.py +102 -0
  197. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree.py +157 -0
  198. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_codec.py +94 -0
  199. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_model.py +72 -0
  200. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_node.py +59 -0
  201. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_nodes_state.py +82 -0
  202. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_selection_facade.py +30 -0
  203. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_selection_model.py +164 -0
  204. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/tree_validation.py +72 -0
  205. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/value_change_handlers.py +109 -0
  206. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/window.py +186 -0
  207. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/window_chrome.py +104 -0
  208. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/window_codec.py +107 -0
  209. punt_lux_client-0.35.0/src/punt_lux/wire/model/elements/wire_require.py +44 -0
  210. punt_lux_client-0.35.0/src/punt_lux/wire/model/encoder_factory.py +38 -0
  211. punt_lux_client-0.35.0/src/punt_lux/wire/model/error.py +93 -0
  212. punt_lux_client-0.35.0/src/punt_lux/wire/model/event.py +95 -0
  213. punt_lux_client-0.35.0/src/punt_lux/wire/model/event_handler_host.py +240 -0
  214. punt_lux_client-0.35.0/src/punt_lux/wire/model/event_kinds.py +22 -0
  215. punt_lux_client-0.35.0/src/punt_lux/wire/model/event_payload.py +89 -0
  216. punt_lux_client-0.35.0/src/punt_lux/wire/model/event_protocol.py +32 -0
  217. punt_lux_client-0.35.0/src/punt_lux/wire/model/frame_ending.py +77 -0
  218. punt_lux_client-0.35.0/src/punt_lux/wire/model/frame_header.py +9 -0
  219. punt_lux_client-0.35.0/src/punt_lux/wire/model/frame_ownership.py +43 -0
  220. punt_lux_client-0.35.0/src/punt_lux/wire/model/frame_reader.py +95 -0
  221. punt_lux_client-0.35.0/src/punt_lux/wire/model/framing.py +109 -0
  222. punt_lux_client-0.35.0/src/punt_lux/wire/model/geometry.py +58 -0
  223. punt_lux_client-0.35.0/src/punt_lux/wire/model/handler_decoder.py +245 -0
  224. punt_lux_client-0.35.0/src/punt_lux/wire/model/handler_failed_error.py +15 -0
  225. punt_lux_client-0.35.0/src/punt_lux/wire/model/handler_writes.py +134 -0
  226. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/__init__.py +38 -0
  227. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/button_catalog.py +90 -0
  228. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/decorator_registry.py +109 -0
  229. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/decorators.py +127 -0
  230. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/dialog_catalog.py +47 -0
  231. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/publish_sink.py +26 -0
  232. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/remote_dispatch.py +149 -0
  233. punt_lux_client-0.35.0/src/punt_lux/wire/model/handlers/verb_vocabulary.py +73 -0
  234. punt_lux_client-0.35.0/src/punt_lux/wire/model/header_value.py +111 -0
  235. punt_lux_client-0.35.0/src/punt_lux/wire/model/hostname.py +45 -0
  236. punt_lux_client-0.35.0/src/punt_lux/wire/model/hub_id.py +107 -0
  237. punt_lux_client-0.35.0/src/punt_lux/wire/model/hub_id_token.py +52 -0
  238. punt_lux_client-0.35.0/src/punt_lux/wire/model/hub_scoped_key.py +34 -0
  239. punt_lux_client-0.35.0/src/punt_lux/wire/model/hub_scoped_store.py +144 -0
  240. punt_lux_client-0.35.0/src/punt_lux/wire/model/id_separator.py +30 -0
  241. punt_lux_client-0.35.0/src/punt_lux/wire/model/id_uniqueness.py +80 -0
  242. punt_lux_client-0.35.0/src/punt_lux/wire/model/identity.py +19 -0
  243. punt_lux_client-0.35.0/src/punt_lux/wire/model/identity_header_field.py +62 -0
  244. punt_lux_client-0.35.0/src/punt_lux/wire/model/identity_headers.py +170 -0
  245. punt_lux_client-0.35.0/src/punt_lux/wire/model/ids.py +25 -0
  246. punt_lux_client-0.35.0/src/punt_lux/wire/model/in_memory_connection.py +112 -0
  247. punt_lux_client-0.35.0/src/punt_lux/wire/model/inspectable.py +27 -0
  248. punt_lux_client-0.35.0/src/punt_lux/wire/model/interaction.py +144 -0
  249. punt_lux_client-0.35.0/src/punt_lux/wire/model/interaction_errors.py +94 -0
  250. punt_lux_client-0.35.0/src/punt_lux/wire/model/json_payload.py +67 -0
  251. punt_lux_client-0.35.0/src/punt_lux/wire/model/lease_term.py +76 -0
  252. punt_lux_client-0.35.0/src/punt_lux/wire/model/menu_action.py +144 -0
  253. punt_lux_client-0.35.0/src/punt_lux/wire/model/menu_models.py +195 -0
  254. punt_lux_client-0.35.0/src/punt_lux/wire/model/menu_name.py +155 -0
  255. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/__init__.py +89 -0
  256. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/_wiring.py +142 -0
  257. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/callback_menu_message.py +42 -0
  258. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/connect_message.py +95 -0
  259. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/introspect.py +209 -0
  260. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/lifecycle.py +202 -0
  261. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/listen.py +112 -0
  262. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/menu.py +66 -0
  263. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/model_unpickler.py +48 -0
  264. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/observer.py +61 -0
  265. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/pickled_element_codec.py +88 -0
  266. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/registry.py +89 -0
  267. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/relay_frames.py +69 -0
  268. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/remote_invocation.py +65 -0
  269. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/scene.py +65 -0
  270. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/scene_codec.py +156 -0
  271. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/unknown_message.py +40 -0
  272. punt_lux_client-0.35.0/src/punt_lux/wire/model/messages/wire_vocabulary.py +68 -0
  273. punt_lux_client-0.35.0/src/punt_lux/wire/model/nesting_cap.py +141 -0
  274. punt_lux_client-0.35.0/src/punt_lux/wire/model/notification_buffer.py +47 -0
  275. punt_lux_client-0.35.0/src/punt_lux/wire/model/observer_entries.py +90 -0
  276. punt_lux_client-0.35.0/src/punt_lux/wire/model/observer_state.py +55 -0
  277. punt_lux_client-0.35.0/src/punt_lux/wire/model/ownership.py +38 -0
  278. punt_lux_client-0.35.0/src/punt_lux/wire/model/painted_geometry.py +94 -0
  279. punt_lux_client-0.35.0/src/punt_lux/wire/model/patch_batch.py +117 -0
  280. punt_lux_client-0.35.0/src/punt_lux/wire/model/property_observers.py +108 -0
  281. punt_lux_client-0.35.0/src/punt_lux/wire/model/raising_publish_sink.py +63 -0
  282. punt_lux_client-0.35.0/src/punt_lux/wire/model/remote_dispatch_spec.py +58 -0
  283. punt_lux_client-0.35.0/src/punt_lux/wire/model/renderer.py +81 -0
  284. punt_lux_client-0.35.0/src/punt_lux/wire/model/renderers/__init__.py +28 -0
  285. punt_lux_client-0.35.0/src/punt_lux/wire/model/renderers/raising.py +45 -0
  286. punt_lux_client-0.35.0/src/punt_lux/wire/model/renderers/recording.py +121 -0
  287. punt_lux_client-0.35.0/src/punt_lux/wire/model/scene_presentation.py +112 -0
  288. punt_lux_client-0.35.0/src/punt_lux/wire/model/scope.py +79 -0
  289. punt_lux_client-0.35.0/src/punt_lux/wire/model/selection_interaction.py +100 -0
  290. punt_lux_client-0.35.0/src/punt_lux/wire/model/session_callback.py +149 -0
  291. punt_lux_client-0.35.0/src/punt_lux/wire/model/setter_priority.py +61 -0
  292. punt_lux_client-0.35.0/src/punt_lux/wire/model/snapshot.py +56 -0
  293. punt_lux_client-0.35.0/src/punt_lux/wire/model/span.py +44 -0
  294. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_button_handler.py +47 -0
  295. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_collapsing_header_handler.py +54 -0
  296. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_color_picker_handler.py +52 -0
  297. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_input_number_handler.py +52 -0
  298. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_input_text_handler.py +52 -0
  299. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_modal_handler.py +54 -0
  300. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_row_selection_handler.py +52 -0
  301. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_slider_handler.py +52 -0
  302. punt_lux_client-0.35.0/src/punt_lux/wire/model/standalone_tab_bar_handler.py +54 -0
  303. punt_lux_client-0.35.0/src/punt_lux/wire/model/submission_gate.py +53 -0
  304. punt_lux_client-0.35.0/src/punt_lux/wire/model/subscription.py +37 -0
  305. punt_lux_client-0.35.0/src/punt_lux/wire/model/transaction_scope.py +34 -0
  306. punt_lux_client-0.35.0/src/punt_lux/wire/model/update.py +150 -0
  307. punt_lux_client-0.35.0/src/punt_lux/wire/model/validation.py +73 -0
  308. punt_lux_client-0.35.0/src/punt_lux/wire/model/validation_walk.py +77 -0
  309. punt_lux_client-0.35.0/src/punt_lux/wire/model/wire_event.py +77 -0
  310. punt_lux_client-0.35.0/src/punt_lux/wire/model/wire_value.py +119 -0
  311. punt_lux_client-0.35.0/src/punt_lux/wire/model/write_errors.py +129 -0
  312. punt_lux_client-0.35.0/src/punt_lux/wire/operations/__init__.py +75 -0
  313. punt_lux_client-0.35.0/src/punt_lux/wire/operations/callback_fields.py +25 -0
  314. punt_lux_client-0.35.0/src/punt_lux/wire/operations/callbacks.py +42 -0
  315. punt_lux_client-0.35.0/src/punt_lux/wire/operations/common.py +76 -0
  316. punt_lux_client-0.35.0/src/punt_lux/wire/operations/config.py +83 -0
  317. punt_lux_client-0.35.0/src/punt_lux/wire/operations/dashboard.py +164 -0
  318. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_frames.py +78 -0
  319. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_identity.py +28 -0
  320. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_info.py +30 -0
  321. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_link.py +62 -0
  322. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_perf.py +72 -0
  323. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_probe.py +27 -0
  324. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_state.py +59 -0
  325. punt_lux_client-0.35.0/src/punt_lux/wire/operations/display_write.py +55 -0
  326. punt_lux_client-0.35.0/src/punt_lux/wire/operations/hub_connection.py +57 -0
  327. punt_lux_client-0.35.0/src/punt_lux/wire/operations/identity.py +20 -0
  328. punt_lux_client-0.35.0/src/punt_lux/wire/operations/inspect_scope.py +38 -0
  329. punt_lux_client-0.35.0/src/punt_lux/wire/operations/menu_results.py +59 -0
  330. punt_lux_client-0.35.0/src/punt_lux/wire/operations/patches.py +86 -0
  331. punt_lux_client-0.35.0/src/punt_lux/wire/operations/pubsub.py +37 -0
  332. punt_lux_client-0.35.0/src/punt_lux/wire/operations/pubsub_acks.py +36 -0
  333. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_clients.py +42 -0
  334. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_errors.py +43 -0
  335. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_events.py +44 -0
  336. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_geometry.py +110 -0
  337. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_inspection.py +52 -0
  338. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_ownership.py +23 -0
  339. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_quarantine.py +25 -0
  340. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_scenes.py +68 -0
  341. punt_lux_client-0.35.0/src/punt_lux/wire/operations/query_visibility.py +63 -0
  342. punt_lux_client-0.35.0/src/punt_lux/wire/operations/render.py +152 -0
  343. punt_lux_client-0.35.0/src/punt_lux/wire/operations/scene_results.py +26 -0
  344. punt_lux_client-0.35.0/src/punt_lux/wire/operations/service_requests.py +50 -0
  345. punt_lux_client-0.35.0/src/punt_lux/wire/operations/service_results.py +36 -0
  346. punt_lux_client-0.35.0/src/punt_lux/wire/operations/table.py +124 -0
  347. punt_lux_client-0.35.0/src/punt_lux/wire/operations/theme.py +70 -0
  348. punt_lux_client-0.35.0/src/punt_lux/wire/operations/window.py +45 -0
  349. punt_lux_client-0.35.0/src/punt_lux/wire/ops/__init__.py +259 -0
  350. punt_lux_client-0.35.0/src/punt_lux/wire/ops/display_perf.py +18 -0
  351. punt_lux_client-0.35.0/src/punt_lux/wire/ops/display_state.py +17 -0
  352. punt_lux_client-0.35.0/src/punt_lux/wire/ops/frame.py +19 -0
  353. punt_lux_client-0.35.0/src/punt_lux/wire/ops/topic.py +39 -0
  354. punt_lux_client-0.35.0/src/punt_lux/wire/py.typed +0 -0
  355. punt_lux_client-0.35.0/src/punt_lux/wire/stream/__init__.py +3 -0
  356. punt_lux_client-0.35.0/src/punt_lux/wire/stream/attach.py +63 -0
  357. punt_lux_client-0.35.0/src/punt_lux/wire/stream/control.py +69 -0
  358. punt_lux_client-0.35.0/src/punt_lux/wire/stream/control_fields.py +60 -0
  359. punt_lux_client-0.35.0/src/punt_lux/wire/stream/control_json.py +61 -0
  360. punt_lux_client-0.35.0/src/punt_lux/wire/stream/frame_types.py +20 -0
  361. punt_lux_client-0.35.0/src/punt_lux/wire/stream/frames.py +124 -0
  362. punt_lux_client-0.35.0/src/punt_lux/wire/stream/hello.py +48 -0
  363. punt_lux_client-0.35.0/src/punt_lux/wire/stream/launcher_name.py +30 -0
  364. punt_lux_client-0.35.0/src/punt_lux/wire/stream/menu_name.py +32 -0
  365. punt_lux_client-0.35.0/src/punt_lux/wire/stream/new_request.py +68 -0
  366. punt_lux_client-0.35.0/src/punt_lux/wire/stream/replies.py +70 -0
  367. punt_lux_client-0.35.0/src/punt_lux/wire/stream/reply_envelope.py +60 -0
  368. punt_lux_client-0.35.0/src/punt_lux/wire/stream/session_events.py +83 -0
  369. punt_lux_client-0.35.0/src/punt_lux/wire/stream/session_label.py +37 -0
  370. punt_lux_client-0.35.0/src/punt_lux/wire/stream/session_requests.py +62 -0
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: punt-lux-client
3
+ Version: 0.35.0
4
+ Summary: Headless Lux client, wire contracts, kernel and applet helpers.
5
+ Author: Punt Labs
6
+ License-Expression: MIT
7
+ Requires-Dist: pydantic>=2.0.0,<3
8
+ Requires-Dist: websockets>=16.0,<18
9
+ Requires-Dist: punt-observe==0.1.1
10
+ Requires-Dist: setproctitle>=1.3.0
11
+ Requires-Python: >=3.13
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "punt-lux-client"
3
+ version = "0.35.0"
4
+ description = "Headless Lux client, wire contracts, kernel and applet helpers."
5
+ requires-python = ">=3.13"
6
+ license = "MIT"
7
+ dependencies = [
8
+ "pydantic>=2.0.0,<3",
9
+ "websockets>=16.0,<18",
10
+ "punt-observe==0.1.1",
11
+ "setproctitle>=1.3.0",
12
+ ]
13
+
14
+ [[project.authors]]
15
+ name = "Punt Labs"
16
+
17
+ [build-system]
18
+ requires = ["uv_build>=0.9.14,<0.14.0"]
19
+ build-backend = "uv_build"
20
+
21
+ [tool.uv.build-backend]
22
+ module-name = [
23
+ "punt_lux.kernel",
24
+ "punt_lux.wire",
25
+ "punt_lux.client",
26
+ "punt_lux.applets",
27
+ ]
28
+ namespace = true
@@ -0,0 +1,21 @@
1
+ [project]
2
+ name = "punt-lux-client"
3
+ version = "0.35.0"
4
+ description = "Headless Lux client, wire contracts, kernel and applet helpers."
5
+ requires-python = ">=3.13"
6
+ license = "MIT"
7
+ authors = [{ name = "Punt Labs" }]
8
+ dependencies = [
9
+ "pydantic>=2.0.0,<3",
10
+ "websockets>=16.0,<18",
11
+ "punt-observe==0.1.1",
12
+ "setproctitle>=1.3.0",
13
+ ]
14
+
15
+ [build-system]
16
+ requires = ["uv_build>=0.9.14,<0.14.0"]
17
+ build-backend = "uv_build"
18
+
19
+ [tool.uv.build-backend]
20
+ module-name = ["punt_lux.kernel", "punt_lux.wire", "punt_lux.client", "punt_lux.applets"]
21
+ namespace = true
@@ -0,0 +1,36 @@
1
+ """Applets — small session-bound programs that put an entry in the Lux menu.
2
+
3
+ An applet is a program, not a daemon and not part of luxd. It runs for the life
4
+ of one Claude Code session, in that session's repository and shell, holding the
5
+ Lux client's two legs: the WebSocket its clicks arrive on and the REST calls its
6
+ work pushes. Everything luxd cannot do itself lives here — launchd starts luxd
7
+ with no ``PATH``, no repository and no credentials, so it can no more run ``bd``
8
+ than read the user's mail.
9
+
10
+ They are for software Punt Labs did not build. Beads is the first; the shape is
11
+ the same for anything else with a command-line front door.
12
+
13
+ One module each: an :class:`AppletIdentity` to be known by, a
14
+ :class:`SessionClaim` on the session, an :class:`AppletLeg` to serve it on, a
15
+ :class:`SessionWatch` that ends it, and :class:`AppletProgram`, which runs them.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from punt_lux.applets.claim import SessionClaim
21
+ from punt_lux.applets.identity import AppletIdentity
22
+ from punt_lux.applets.latency import ClickLatency
23
+ from punt_lux.applets.leg import AppletLeg
24
+ from punt_lux.applets.program import AppletProgram
25
+ from punt_lux.applets.service import AppletService
26
+ from punt_lux.applets.watch import SessionWatch
27
+
28
+ __all__ = [
29
+ "AppletIdentity",
30
+ "AppletLeg",
31
+ "AppletProgram",
32
+ "AppletService",
33
+ "ClickLatency",
34
+ "SessionClaim",
35
+ "SessionWatch",
36
+ ]
@@ -0,0 +1,79 @@
1
+ """``BoardOps`` -- the Hub-write surface a board push needs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Protocol, Self, final, runtime_checkable
6
+
7
+ if TYPE_CHECKING:
8
+ from punt_lux.client._sync_ops import SyncOps
9
+ from punt_lux.client.facade import LuxClient
10
+ from punt_lux.wire.operations import (
11
+ OpError,
12
+ RenderRequest,
13
+ RenderTableRequest,
14
+ SceneShown,
15
+ Scope,
16
+ )
17
+
18
+ __all__ = ["BoardOps", "ScopedBoardOps"]
19
+
20
+
21
+ @runtime_checkable
22
+ class BoardOps(Protocol):
23
+ """The Hub-write surface a board push needs: install a scene.
24
+
25
+ Deliberately narrow -- every applet-internal class collectively calls
26
+ exactly these two methods, not the full ``SceneOps`` family they belong
27
+ to Hub-side. Reached through :class:`ScopedBoardOps`, never through
28
+ ``LuxClient.sync`` directly.
29
+ """
30
+
31
+ def render(
32
+ self, request: RenderRequest | OpError, *, scope: Scope | None = None
33
+ ) -> SceneShown | OpError:
34
+ """Install a whole scene."""
35
+ ...
36
+
37
+ def render_table(
38
+ self, request: RenderTableRequest | OpError, *, scope: Scope | None = None
39
+ ) -> SceneShown | OpError:
40
+ """Install a composed table scene."""
41
+ ...
42
+
43
+
44
+ @final
45
+ class ScopedBoardOps:
46
+ """A ``BoardOps`` binding one fixed :class:`Scope` to a ``SyncOps`` transport.
47
+
48
+ Binds the scope once, at the one place the identity is known, and
49
+ forwards every call with it filled in.
50
+ """
51
+
52
+ _ops: SyncOps
53
+ _scope: Scope
54
+ __slots__ = ("_ops", "_scope")
55
+
56
+ def __new__(cls, ops: SyncOps, scope: Scope) -> Self:
57
+ self = super().__new__(cls)
58
+ self._ops = ops
59
+ self._scope = scope
60
+ return self
61
+
62
+ @classmethod
63
+ def for_client(cls, client: LuxClient) -> Self:
64
+ """Bind a ``LuxClient``'s own transport and scope in one call."""
65
+ return cls(client.sync, client.scope)
66
+
67
+ def render(
68
+ self, request: RenderRequest | OpError, *, scope: Scope | None = None
69
+ ) -> SceneShown | OpError:
70
+ """Install a whole scene under this adapter's bound scope."""
71
+ del scope # this adapter always installs under its own bound scope
72
+ return self._ops.render(request, scope=self._scope)
73
+
74
+ def render_table(
75
+ self, request: RenderTableRequest | OpError, *, scope: Scope | None = None
76
+ ) -> SceneShown | OpError:
77
+ """Install a composed table scene under this adapter's bound scope."""
78
+ del scope
79
+ return self._ops.render_table(request, scope=self._scope)
@@ -0,0 +1,130 @@
1
+ """SessionClaim — the one applet a session gets, and how it says so.
2
+
3
+ A session's start hook fires more than once for one session: ``/resume`` and
4
+ ``/clear`` both fire it again against the same process. Every firing would
5
+ otherwise start another applet under the same session identity, and one identity
6
+ is one Hub connection — so each new applet takes the session's callbacks from the
7
+ one before it, the menu entry flaps between them, and the ones that lost keep
8
+ reconnecting until the session dies. An applet therefore claims its session
9
+ before it serves it, and one that cannot claim it leaves.
10
+
11
+ The claim is an advisory lock on a file named after the session, not a comparison
12
+ of the pid written inside it. Two properties follow, and both are why it is a
13
+ lock:
14
+
15
+ - the kernel drops the lock when the holder dies, however it died, so there is no
16
+ stale claim to recognise and no recycled pid to mistake for a live sibling;
17
+ - taking it is one atomic operation, so two applets starting at the same instant
18
+ cannot both find it free.
19
+
20
+ The pid written inside is for the reader — a person looking in the directory —
21
+ and never decides anything.
22
+
23
+ Two rules keep the lock honest. The file is never unlinked: removing it would let
24
+ a third applet create a new file and lock that while a second still held the lock
25
+ on the old one, and both would then be serving. And the open file is held for as
26
+ long as the claim object is, because closing it releases the lock — so whoever
27
+ takes a claim keeps it for the life of the process.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import fcntl
33
+ import logging
34
+ import os
35
+ from io import TextIOWrapper
36
+ from pathlib import Path
37
+ from typing import Protocol, Self, final, runtime_checkable
38
+
39
+ from punt_lux.kernel.home_paths import LuxHome
40
+
41
+ logger = logging.getLogger(__name__)
42
+
43
+ __all__ = ["AppletClaim", "NoClaim", "SessionClaim"]
44
+
45
+
46
+ @runtime_checkable
47
+ class AppletClaim(Protocol):
48
+ """What an applet takes before it serves, and answers to if it may not."""
49
+
50
+ def take(self) -> bool:
51
+ """Return whether this process may serve, saying why in the log if not."""
52
+ ...
53
+
54
+
55
+ @final
56
+ class NoClaim:
57
+ """Nothing to claim: the applet was run by hand and serves nobody's session.
58
+
59
+ The Null Object for the one case with no session behind it. A developer
60
+ running an applet in a terminal is not competing with a second copy of
61
+ themselves, so there is nothing here to arbitrate.
62
+ """
63
+
64
+ __slots__ = ()
65
+
66
+ def take(self) -> bool:
67
+ """Yield unconditionally because there cannot be a sibling for this session."""
68
+ return True
69
+
70
+
71
+ @final
72
+ class SessionClaim:
73
+ """The lock a session's applet holds for as long as it is the one serving."""
74
+
75
+ _file: TextIOWrapper
76
+ _path: Path
77
+ __slots__ = ("_file", "_path")
78
+
79
+ def __new__(cls, path: Path) -> Self:
80
+ self = super().__new__(cls)
81
+ self._path = path
82
+ # Opened for update rather than truncated, so losing the claim leaves the
83
+ # holder's pid intact for whoever reads it. Not inheritable, or a ``bd``
84
+ # child would hold the claim open after the applet that took it had gone.
85
+ # Not through a symlink either: the directory may be shared with other
86
+ # users, and taking the claim writes to whatever this opens.
87
+ self._file = os.fdopen(
88
+ os.open(
89
+ path,
90
+ os.O_RDWR | os.O_CREAT | os.O_CLOEXEC | os.O_NOFOLLOW,
91
+ 0o600,
92
+ ),
93
+ "r+",
94
+ )
95
+ return self
96
+
97
+ @classmethod
98
+ def for_session(cls, program: str, session_pid: int) -> Self:
99
+ """Open the claim for this applet and process in Lux's private session store."""
100
+ return cls(LuxHome.resolve().session_claim(program, session_pid))
101
+
102
+ def take(self) -> bool:
103
+ """Take the claim unless a live applet holds it, and say which happened.
104
+
105
+ A refusal is the ordinary outcome of a hook that fired twice rather than
106
+ a failure, so it is one line and a false: the caller leaves, and the
107
+ applet already serving the session keeps its entry and its callbacks.
108
+ """
109
+ try:
110
+ fcntl.flock(self._file.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
111
+ except BlockingIOError:
112
+ logger.info(
113
+ "an applet is already serving this session (%s is held); leaving",
114
+ self._path,
115
+ )
116
+ return False
117
+ self._record()
118
+ return True
119
+
120
+ def _record(self) -> None:
121
+ """Write this process's pid into the claim it has just taken.
122
+
123
+ What was there was a dead applet's pid, so it is replaced whole rather
124
+ than appended to. The lock is what arbitrates; this is what a person
125
+ reads.
126
+ """
127
+ self._file.seek(0)
128
+ self._file.truncate()
129
+ self._file.write(f"{os.getpid()}\n")
130
+ self._file.flush()
@@ -0,0 +1,37 @@
1
+ """Figure — one phrase of a click's line: a stage, its milliseconds, its say.
2
+
3
+ The line a click reports is a walk through the click, and this is one step of
4
+ that walk. A stage that had something to say about itself says it in parentheses
5
+ after its number, because the number alone cannot tell two clicks apart: 28 ms
6
+ answering with a board the applet already had and 28 ms answering with the word
7
+ "Loading" are the same figure and different clicks.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import Self, final
13
+
14
+ __all__ = ["Figure"]
15
+
16
+
17
+ @final
18
+ class Figure:
19
+ """A stage's name, how long it took, and whatever it said about itself."""
20
+
21
+ _ms: float
22
+ _name: str
23
+ _said: str
24
+ __slots__ = ("_ms", "_name", "_said")
25
+
26
+ def __new__(cls, name: str, ms: float, said: str) -> Self:
27
+ self = super().__new__(cls)
28
+ self._name = name
29
+ self._ms = ms
30
+ self._said = said
31
+ return self
32
+
33
+ def text(self) -> str:
34
+ """Format this timing figure for the click report."""
35
+ if self._said:
36
+ return f"{self._name} {self._ms:.0f} ms ({self._said})"
37
+ return f"{self._name} {self._ms:.0f} ms"
@@ -0,0 +1,82 @@
1
+ """AppletIdentity — what one applet declares itself to be.
2
+
3
+ An applet owns two legs into the Hub: the WebSocket it holds open for its menu
4
+ clicks, and the REST calls it makes to push what those clicks produce. Both
5
+ must resolve to one Hub connection, so both declare this identity, and
6
+ :class:`~punt_lux.kernel.connection_identity.ConnectionSeed` derives the shared
7
+ connection id from its fields.
8
+
9
+ The name reads as one uniform shape — ``lux · <repository> · #<session> ·
10
+ <program>`` — with each part carrying a distinct guarantee. The session id
11
+ keeps two Claude Code sessions on one repository from collapsing onto one
12
+ connection (the second's WebSocket would silently take over the first's
13
+ clicks). The program name keeps two applets in one session from doing the
14
+ same. Empty, whitespace-only, and NUL-carrying programs are rejected.
15
+
16
+ The declared lease is short: the Hub sweeps a session whose lease lapses, and
17
+ the listen client renews well inside that window, so a live session never
18
+ lapses and a dead one is gone within the minute.
19
+
20
+ The name is composed here and parsed by
21
+ :mod:`~punt_lux.wire.model.applet_name_format`; the round-trip test pins both.
22
+ """
23
+
24
+ from __future__ import annotations
25
+
26
+ from typing import Self, final
27
+
28
+ from punt_lux.kernel.repo_root import RepoRoot
29
+ from punt_lux.wire.model import applet_name_format
30
+ from punt_lux.wire.model.client_identity import ClientIdentity
31
+
32
+ __all__ = ["AppletIdentity"]
33
+
34
+ # What an applet outside any repository calls itself.
35
+ _HEADLESS_NAME = "lux-session"
36
+
37
+ # Sweep-cadence bounds: longer than several 15s keepalives, short enough that
38
+ # a killed session's menu entry leaves the bar within the minute.
39
+ _LEASE_TTL_SECONDS = 60.0
40
+
41
+
42
+ @final
43
+ class AppletIdentity:
44
+ """One applet's declared identity, and the menu label derived from it."""
45
+
46
+ _client: ClientIdentity
47
+ __slots__ = ("_client",)
48
+
49
+ def __new__(cls, client: ClientIdentity) -> Self:
50
+ self = super().__new__(cls)
51
+ self._client = client
52
+ return self
53
+
54
+ @classmethod
55
+ def for_session(cls, program: str, session_pid: int) -> Self:
56
+ """Derive this applet's identity from its program, session, and repository."""
57
+ program = cls._validate_program(program)
58
+ repo = RepoRoot.of(_HEADLESS_NAME)
59
+ return cls(
60
+ ClientIdentity(
61
+ kind="applet",
62
+ name=applet_name_format.format_name(repo.name, session_pid, program),
63
+ repo=repo.declared_path,
64
+ lease_ttl=_LEASE_TTL_SECONDS,
65
+ )
66
+ )
67
+
68
+ @staticmethod
69
+ def _validate_program(program: str) -> str:
70
+ """Return *program* stripped, or raise if empty or NUL-carrying."""
71
+ if not (program := program.strip()):
72
+ msg = "program must be a non-empty, non-whitespace label"
73
+ raise ValueError(msg)
74
+ if "\x00" in program:
75
+ msg = "program must not contain a NUL character"
76
+ raise ValueError(msg)
77
+ return program
78
+
79
+ @property
80
+ def client(self) -> ClientIdentity:
81
+ """The identity both Hub legs declare."""
82
+ return self._client
@@ -0,0 +1,98 @@
1
+ """ClickLatency — the clock a click starts, and the budget it is held to.
2
+
3
+ A menu entry has to launch in the time a user reads as instant, and that is a
4
+ number, not an aspiration, so it is measured on every click rather than assumed.
5
+ The clock starts where the click arrives — on the receive loop, before the hop to
6
+ the worker — so the hop is inside the number rather than hidden beside it.
7
+
8
+ The visible answer is the only stage held to that budget, but it is not the whole
9
+ click: the work behind it is what the user waits through while the window says
10
+ "Loading" — or does not wait through at all, when the answer was a board they can
11
+ already read. Every stage of it is timed and reported, in
12
+ :class:`~punt_lux.applets.stage_times.StageTimes`, which is where the line and
13
+ its figures live. What lives here is the contract: what a click owes the user,
14
+ and what happens when it is not met.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import logging
20
+ from typing import TYPE_CHECKING, Self, final
21
+
22
+ from punt_lux.applets.stage_times import ANSWERED, StageTimes
23
+
24
+ if TYPE_CHECKING:
25
+ from contextlib import AbstractContextManager
26
+
27
+ logger = logging.getLogger(__name__)
28
+
29
+ __all__ = ["ClickLatency"]
30
+
31
+ # What a click has to answer within to read as instant. It is the reason the
32
+ # servicing is split in two: the visible response is measured against this, and
33
+ # the work behind it is not.
34
+ _RESPONSE_BUDGET_MS = 100.0
35
+
36
+
37
+ @final
38
+ class ClickLatency:
39
+ """One click's clock, and the one line that says how it went.
40
+
41
+ What the answered stage measures is the contract: a click must produce a
42
+ visible response inside :data:`_RESPONSE_BUDGET_MS`. The clock therefore
43
+ starts where the click arrives — on the receive loop, before the hop to the
44
+ worker — so the hop is inside the number rather than hidden beside it. The
45
+ stages after the answer are under no budget, but they are the rest of the
46
+ user's wait, so they are measured on the same clock.
47
+ """
48
+
49
+ _callback_id: str
50
+ _times: StageTimes
51
+ __slots__ = ("_callback_id", "_times")
52
+
53
+ def __new__(cls, callback_id: str) -> Self:
54
+ self = super().__new__(cls)
55
+ self._callback_id = callback_id
56
+ self._times = StageTimes()
57
+ return self
58
+
59
+ def answering(self) -> AbstractContextManager[None]:
60
+ """Time the click's visible answer — the one stage held to the budget."""
61
+ return self._times.timing(ANSWERED)
62
+
63
+ def stage(self, name: str) -> AbstractContextManager[None]:
64
+ """Time one stage of the click's servicing and record it under ``name``."""
65
+ return self._times.timing(name)
66
+
67
+ def note(self, said: str) -> None:
68
+ """Say what the stage now being timed did, on the line that reports it.
69
+
70
+ A figure alone cannot tell two clicks apart. Answering in 28 ms with the
71
+ board the applet already had is a different click from answering in
72
+ 28 ms with the word "Loading", and a four-second read is a different
73
+ problem depending on whether the four seconds were ``bd``'s or ours. The
74
+ stage says which; the figure says how long.
75
+ """
76
+ self._times.note(said)
77
+
78
+ def report(self) -> None:
79
+ """Log where this click's time went, and whether it owed the user faster.
80
+
81
+ One line rather than one per stage, because its reader is a user who has
82
+ been asked what happened — pasting the line answers it. A click that
83
+ broke the budget says so on the same line, at a level this process logs
84
+ at whether or not anyone asked for the ordinary ones.
85
+ """
86
+ if self._times.answered_ms > _RESPONSE_BUDGET_MS:
87
+ logger.warning(
88
+ "click %s: %s — answered over the %.0f ms budget",
89
+ self._callback_id,
90
+ self._line(),
91
+ _RESPONSE_BUDGET_MS,
92
+ )
93
+ return
94
+ logger.info("click %s: %s", self._callback_id, self._line())
95
+
96
+ def _line(self) -> str:
97
+ """Format the click timings shared by both reports."""
98
+ return self._times.line()