platynui-cli 0.2.0.dev1__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.

Potentially problematic release.


This version of platynui-cli might be problematic. Click here for more details.

Files changed (326) hide show
  1. platynui_cli-0.2.0.dev1/PKG-INFO +148 -0
  2. platynui_cli-0.2.0.dev1/README.md +119 -0
  3. platynui_cli-0.2.0.dev1/crates/cli/Cargo.toml +66 -0
  4. platynui_cli-0.2.0.dev1/crates/cli/src/commands/focus.rs +115 -0
  5. platynui_cli-0.2.0.dev1/crates/cli/src/commands/highlight.rs +211 -0
  6. platynui_cli-0.2.0.dev1/crates/cli/src/commands/info.rs +155 -0
  7. platynui_cli-0.2.0.dev1/crates/cli/src/commands/keyboard.rs +212 -0
  8. platynui_cli-0.2.0.dev1/crates/cli/src/commands/list_providers.rs +113 -0
  9. platynui_cli-0.2.0.dev1/crates/cli/src/commands/mod.rs +10 -0
  10. platynui_cli-0.2.0.dev1/crates/cli/src/commands/pointer.rs +707 -0
  11. platynui_cli-0.2.0.dev1/crates/cli/src/commands/query.rs +306 -0
  12. platynui_cli-0.2.0.dev1/crates/cli/src/commands/screenshot.rs +205 -0
  13. platynui_cli-0.2.0.dev1/crates/cli/src/commands/watch.rs +252 -0
  14. platynui_cli-0.2.0.dev1/crates/cli/src/commands/window.rs +395 -0
  15. platynui_cli-0.2.0.dev1/crates/cli/src/lib.rs +231 -0
  16. platynui_cli-0.2.0.dev1/crates/cli/src/main.rs +6 -0
  17. platynui_cli-0.2.0.dev1/crates/cli/src/test_support.rs +24 -0
  18. platynui_cli-0.2.0.dev1/crates/cli/src/util/mod.rs +103 -0
  19. platynui_cli-0.2.0.dev1/crates/core/Cargo.toml +24 -0
  20. platynui_cli-0.2.0.dev1/crates/core/src/lib.rs +4 -0
  21. platynui_cli-0.2.0.dev1/crates/core/src/platform/desktop.rs +109 -0
  22. platynui_cli-0.2.0.dev1/crates/core/src/platform/error.rs +55 -0
  23. platynui_cli-0.2.0.dev1/crates/core/src/platform/highlight.rs +102 -0
  24. platynui_cli-0.2.0.dev1/crates/core/src/platform/keyboard.rs +301 -0
  25. platynui_cli-0.2.0.dev1/crates/core/src/platform/mod.rs +40 -0
  26. platynui_cli-0.2.0.dev1/crates/core/src/platform/module.rs +6 -0
  27. platynui_cli-0.2.0.dev1/crates/core/src/platform/pointer.rs +152 -0
  28. platynui_cli-0.2.0.dev1/crates/core/src/platform/registration.rs +40 -0
  29. platynui_cli-0.2.0.dev1/crates/core/src/platform/screenshot.rs +134 -0
  30. platynui_cli-0.2.0.dev1/crates/core/src/provider/descriptor.rs +59 -0
  31. platynui_cli-0.2.0.dev1/crates/core/src/provider/error.rs +66 -0
  32. platynui_cli-0.2.0.dev1/crates/core/src/provider/event.rs +45 -0
  33. platynui_cli-0.2.0.dev1/crates/core/src/provider/factory.rs +8 -0
  34. platynui_cli-0.2.0.dev1/crates/core/src/provider/mod.rs +24 -0
  35. platynui_cli-0.2.0.dev1/crates/core/src/provider/registration.rs +150 -0
  36. platynui_cli-0.2.0.dev1/crates/core/src/provider/tree_provider.rs +26 -0
  37. platynui_cli-0.2.0.dev1/crates/core/src/types/mod.rs +7 -0
  38. platynui_cli-0.2.0.dev1/crates/core/src/types/point.rs +150 -0
  39. platynui_cli-0.2.0.dev1/crates/core/src/types/rect.rs +255 -0
  40. platynui_cli-0.2.0.dev1/crates/core/src/types/size.rs +192 -0
  41. platynui_cli-0.2.0.dev1/crates/core/src/ui/attributes.rs +144 -0
  42. platynui_cli-0.2.0.dev1/crates/core/src/ui/contract/testkit.rs +576 -0
  43. platynui_cli-0.2.0.dev1/crates/core/src/ui/contract.rs +237 -0
  44. platynui_cli-0.2.0.dev1/crates/core/src/ui/identifiers.rs +139 -0
  45. platynui_cli-0.2.0.dev1/crates/core/src/ui/mod.rs +20 -0
  46. platynui_cli-0.2.0.dev1/crates/core/src/ui/namespace.rs +119 -0
  47. platynui_cli-0.2.0.dev1/crates/core/src/ui/node.rs +573 -0
  48. platynui_cli-0.2.0.dev1/crates/core/src/ui/pattern.rs +617 -0
  49. platynui_cli-0.2.0.dev1/crates/core/src/ui/value.rs +122 -0
  50. platynui_cli-0.2.0.dev1/crates/link/Cargo.toml +19 -0
  51. platynui_cli-0.2.0.dev1/crates/link/src/lib.rs +64 -0
  52. platynui_cli-0.2.0.dev1/crates/platform-linux-x11/Cargo.toml +15 -0
  53. platynui_cli-0.2.0.dev1/crates/platform-linux-x11/src/lib.rs +8 -0
  54. platynui_cli-0.2.0.dev1/crates/platform-macos/Cargo.toml +15 -0
  55. platynui_cli-0.2.0.dev1/crates/platform-macos/src/lib.rs +8 -0
  56. platynui_cli-0.2.0.dev1/crates/platform-mock/Cargo.toml +22 -0
  57. platynui_cli-0.2.0.dev1/crates/platform-mock/src/desktop.rs +88 -0
  58. platynui_cli-0.2.0.dev1/crates/platform-mock/src/highlight.rs +84 -0
  59. platynui_cli-0.2.0.dev1/crates/platform-mock/src/keyboard.rs +286 -0
  60. platynui_cli-0.2.0.dev1/crates/platform-mock/src/lib.rs +43 -0
  61. platynui_cli-0.2.0.dev1/crates/platform-mock/src/pointer.rs +135 -0
  62. platynui_cli-0.2.0.dev1/crates/platform-mock/src/screenshot.rs +302 -0
  63. platynui_cli-0.2.0.dev1/crates/platform-windows/Cargo.toml +29 -0
  64. platynui_cli-0.2.0.dev1/crates/platform-windows/src/desktop.rs +258 -0
  65. platynui_cli-0.2.0.dev1/crates/platform-windows/src/highlight.rs +553 -0
  66. platynui_cli-0.2.0.dev1/crates/platform-windows/src/init.rs +48 -0
  67. platynui_cli-0.2.0.dev1/crates/platform-windows/src/lib.rs +20 -0
  68. platynui_cli-0.2.0.dev1/crates/platform-windows/src/pointer.rs +184 -0
  69. platynui_cli-0.2.0.dev1/crates/platform-windows/src/screenshot.rs +116 -0
  70. platynui_cli-0.2.0.dev1/crates/provider-atspi/Cargo.toml +18 -0
  71. platynui_cli-0.2.0.dev1/crates/provider-atspi/src/lib.rs +60 -0
  72. platynui_cli-0.2.0.dev1/crates/provider-macos-ax/Cargo.toml +18 -0
  73. platynui_cli-0.2.0.dev1/crates/provider-macos-ax/src/lib.rs +60 -0
  74. platynui_cli-0.2.0.dev1/crates/provider-mock/Cargo.toml +24 -0
  75. platynui_cli-0.2.0.dev1/crates/provider-mock/assets/mock_tree.xml +116 -0
  76. platynui_cli-0.2.0.dev1/crates/provider-mock/src/events.rs +42 -0
  77. platynui_cli-0.2.0.dev1/crates/provider-mock/src/factory.rs +44 -0
  78. platynui_cli-0.2.0.dev1/crates/provider-mock/src/focus.rs +113 -0
  79. platynui_cli-0.2.0.dev1/crates/provider-mock/src/input.rs +350 -0
  80. platynui_cli-0.2.0.dev1/crates/provider-mock/src/lib.rs +29 -0
  81. platynui_cli-0.2.0.dev1/crates/provider-mock/src/node.rs +156 -0
  82. platynui_cli-0.2.0.dev1/crates/provider-mock/src/provider.rs +96 -0
  83. platynui_cli-0.2.0.dev1/crates/provider-mock/src/tests.rs +339 -0
  84. platynui_cli-0.2.0.dev1/crates/provider-mock/src/tree.rs +555 -0
  85. platynui_cli-0.2.0.dev1/crates/provider-mock/src/window.rs +350 -0
  86. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/Cargo.toml +34 -0
  87. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/com.rs +59 -0
  88. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/error.rs +27 -0
  89. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/lib.rs +20 -0
  90. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/map.rs +672 -0
  91. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/node.rs +1188 -0
  92. platynui_cli-0.2.0.dev1/crates/provider-windows-uia/src/provider.rs +177 -0
  93. platynui_cli-0.2.0.dev1/crates/runtime/Cargo.toml +36 -0
  94. platynui_cli-0.2.0.dev1/crates/runtime/src/keyboard.rs +246 -0
  95. platynui_cli-0.2.0.dev1/crates/runtime/src/keyboard_sequence.pest +697 -0
  96. platynui_cli-0.2.0.dev1/crates/runtime/src/keyboard_sequence.rs +336 -0
  97. platynui_cli-0.2.0.dev1/crates/runtime/src/lib.rs +26 -0
  98. platynui_cli-0.2.0.dev1/crates/runtime/src/pointer.rs +1574 -0
  99. platynui_cli-0.2.0.dev1/crates/runtime/src/provider/event.rs +154 -0
  100. platynui_cli-0.2.0.dev1/crates/runtime/src/provider/mod.rs +4 -0
  101. platynui_cli-0.2.0.dev1/crates/runtime/src/provider/registry.rs +246 -0
  102. platynui_cli-0.2.0.dev1/crates/runtime/src/runtime.rs +1692 -0
  103. platynui_cli-0.2.0.dev1/crates/runtime/src/test_support.rs +30 -0
  104. platynui_cli-0.2.0.dev1/crates/runtime/src/xpath.rs +1431 -0
  105. platynui_cli-0.2.0.dev1/crates/xpath/Cargo.toml +65 -0
  106. platynui_cli-0.2.0.dev1/crates/xpath/README.md +65 -0
  107. platynui_cli-0.2.0.dev1/crates/xpath/benches/advanced_benchmarks.rs +315 -0
  108. platynui_cli-0.2.0.dev1/crates/xpath/benches/benchmark_constant_folding.rs +69 -0
  109. platynui_cli-0.2.0.dev1/crates/xpath/benches/evaluate_first_benchmarks.rs +131 -0
  110. platynui_cli-0.2.0.dev1/crates/xpath/benches/parser_smallvec.rs +51 -0
  111. platynui_cli-0.2.0.dev1/crates/xpath/benches/performance_analysis.rs +302 -0
  112. platynui_cli-0.2.0.dev1/crates/xpath/benches/short_circuit_benchmarks.rs +134 -0
  113. platynui_cli-0.2.0.dev1/crates/xpath/benches/streaming_vs_materialized.rs +275 -0
  114. platynui_cli-0.2.0.dev1/crates/xpath/benches/xpath_benches.rs +243 -0
  115. platynui_cli-0.2.0.dev1/crates/xpath/docs/xpath20_coverage.md +90 -0
  116. platynui_cli-0.2.0.dev1/crates/xpath/examples/repl.rs +191 -0
  117. platynui_cli-0.2.0.dev1/crates/xpath/examples/simple.rs +58 -0
  118. platynui_cli-0.2.0.dev1/crates/xpath/src/compiler/ir.rs +527 -0
  119. platynui_cli-0.2.0.dev1/crates/xpath/src/compiler/mod.rs +886 -0
  120. platynui_cli-0.2.0.dev1/crates/xpath/src/compiler/optimizer.rs +395 -0
  121. platynui_cli-0.2.0.dev1/crates/xpath/src/consts.rs +18 -0
  122. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/collation.rs +142 -0
  123. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/eq.rs +480 -0
  124. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/evaluator.rs +5225 -0
  125. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/boolean.rs +56 -0
  126. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/collations.rs +62 -0
  127. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/common.rs +1861 -0
  128. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/constructors.rs +687 -0
  129. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/datetime.rs +509 -0
  130. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/diagnostics.rs +22 -0
  131. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/durations.rs +137 -0
  132. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/environment.rs +494 -0
  133. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/ids.rs +229 -0
  134. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/mod.rs +1433 -0
  135. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/numeric.rs +301 -0
  136. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/qnames.rs +290 -0
  137. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/regex.rs +52 -0
  138. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/sequences.rs +287 -0
  139. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/functions/strings.rs +361 -0
  140. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/mod.rs +5 -0
  141. platynui_cli-0.2.0.dev1/crates/xpath/src/engine/runtime.rs +1797 -0
  142. platynui_cli-0.2.0.dev1/crates/xpath/src/lib.rs +34 -0
  143. platynui_cli-0.2.0.dev1/crates/xpath/src/model/mod.rs +233 -0
  144. platynui_cli-0.2.0.dev1/crates/xpath/src/model/simple.rs +691 -0
  145. platynui_cli-0.2.0.dev1/crates/xpath/src/parser/ast.rs +233 -0
  146. platynui_cli-0.2.0.dev1/crates/xpath/src/parser/mod.rs +1252 -0
  147. platynui_cli-0.2.0.dev1/crates/xpath/src/parser/xpath2.pest +325 -0
  148. platynui_cli-0.2.0.dev1/crates/xpath/src/util/mod.rs +1 -0
  149. platynui_cli-0.2.0.dev1/crates/xpath/src/util/temporal.rs +262 -0
  150. platynui_cli-0.2.0.dev1/crates/xpath/src/xdm/mod.rs +672 -0
  151. platynui_cli-0.2.0.dev1/crates/xpath/tests/axes_wildcard_vs_node.rs +53 -0
  152. platynui_cli-0.2.0.dev1/crates/xpath/tests/cast_daytime_duration_negative.rs +20 -0
  153. platynui_cli-0.2.0.dev1/crates/xpath/tests/castable_matrix.rs +55 -0
  154. platynui_cli-0.2.0.dev1/crates/xpath/tests/casts_basic.rs +147 -0
  155. platynui_cli-0.2.0.dev1/crates/xpath/tests/casts_cardinality.rs +95 -0
  156. platynui_cli-0.2.0.dev1/crates/xpath/tests/casts_fractional_seconds.rs +71 -0
  157. platynui_cli-0.2.0.dev1/crates/xpath/tests/casts_matrix_full.rs +247 -0
  158. platynui_cli-0.2.0.dev1/crates/xpath/tests/casts_temporal_extended.rs +141 -0
  159. platynui_cli-0.2.0.dev1/crates/xpath/tests/comparisons_mixed_regression.rs +30 -0
  160. platynui_cli-0.2.0.dev1/crates/xpath/tests/comparisons_untyped_numeric_regression.rs +39 -0
  161. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_arith_logic.rs +42 -0
  162. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_comparisons_types.rs +102 -0
  163. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_control_flow.rs +17 -0
  164. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_for_multi.rs +27 -0
  165. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_let_expr.rs +34 -0
  166. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_literals.rs +47 -0
  167. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_negative_lowering.rs +39 -0
  168. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_paths_predicates.rs +272 -0
  169. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_quantifiers_for.rs +31 -0
  170. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_set_ops.rs +15 -0
  171. platynui_cli-0.2.0.dev1/crates/xpath/tests/compiler_vars_funcs.rs +35 -0
  172. platynui_cli-0.2.0.dev1/crates/xpath/tests/document_node_inner.rs +49 -0
  173. platynui_cli-0.2.0.dev1/crates/xpath/tests/duration_fractional_truncation.rs +22 -0
  174. platynui_cli-0.2.0.dev1/crates/xpath/tests/equality_date_time_eqkey.rs +32 -0
  175. platynui_cli-0.2.0.dev1/crates/xpath/tests/error_codes.rs +71 -0
  176. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluate_first.rs +170 -0
  177. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_aggregate_funcs.rs +86 -0
  178. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_arith_logic.rs +32 -0
  179. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_arith_promotion.rs +35 -0
  180. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_axes.rs +126 -0
  181. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_axes_siblings.rs +73 -0
  182. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_axis_namespace.rs +190 -0
  183. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_collation_comparisons.rs +42 -0
  184. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_extended.rs +110 -0
  185. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_comparison_matrix.rs +94 -0
  186. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_numeric_matrix.rs +90 -0
  187. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_type_errors.rs +21 -0
  188. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_comparisons_untyped.rs +35 -0
  189. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_ebv_consistency.rs +28 -0
  190. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_following_preceding.rs +145 -0
  191. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_for_expr.rs +43 -0
  192. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_general_comparisons.rs +88 -0
  193. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_general_incomparable.rs +30 -0
  194. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_kindtests_pi_document.rs +46 -0
  195. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_let_expr.rs +35 -0
  196. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_more.rs +155 -0
  197. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_nan_inf.rs +102 -0
  198. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_node_compare_cross_root.rs +46 -0
  199. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_funcs.rs +80 -0
  200. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_functions.rs +48 -0
  201. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_numeric_promotion.rs +34 -0
  202. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_overflow_policy.rs +46 -0
  203. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_path_filter_expr.rs +69 -0
  204. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_positional_predicates.rs +101 -0
  205. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers.rs +48 -0
  206. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_multi.rs +23 -0
  207. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_quantifiers_nested.rs +34 -0
  208. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_set_ops.rs +44 -0
  209. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_short_circuit.rs +124 -0
  210. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_streaming.rs +575 -0
  211. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_temporal.rs +65 -0
  212. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_temporal_edges.rs +119 -0
  213. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_text_vs_dot.rs +64 -0
  214. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_types.rs +69 -0
  215. platynui_cli-0.2.0.dev1/crates/xpath/tests/evaluator_value_comparisons.rs +43 -0
  216. platynui_cli-0.2.0.dev1/crates/xpath/tests/function_conversion_runtime.rs +686 -0
  217. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_aggregates_types.rs +107 -0
  218. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_avg_mixed.rs +30 -0
  219. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_boolean_and_zero_arity.rs +162 -0
  220. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_cardinality.rs +53 -0
  221. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_codepoint_equal.rs +24 -0
  222. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_codepoints.rs +65 -0
  223. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_collations_compare.rs +50 -0
  224. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_collations_minmax_deepequal.rs +71 -0
  225. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_collations_strings.rs +54 -0
  226. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_compare_empty_3arg.rs +15 -0
  227. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_concat.rs +48 -0
  228. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_contains_untyped.rs +24 -0
  229. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_data.rs +37 -0
  230. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_datetime_adjust.rs +55 -0
  231. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_datetime_snapshot.rs +122 -0
  232. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_deep_equal.rs +24 -0
  233. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_atomic_advanced.rs +37 -0
  234. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_namespaces.rs +34 -0
  235. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_deep_equal_nodes.rs +46 -0
  236. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_deepequal_nodes.rs +31 -0
  237. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_distinct_values.rs +78 -0
  238. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_doc_collection.rs +67 -0
  239. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_env_doc_root.rs +81 -0
  240. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_error_trace.rs +52 -0
  241. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_id_idref.rs +110 -0
  242. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_index_of.rs +35 -0
  243. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_index_of_collations.rs +39 -0
  244. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_minmax_empty.rs +15 -0
  245. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_namespace_uri.rs +79 -0
  246. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_nilled_unordered_duration.rs +160 -0
  247. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_node_name.rs +93 -0
  248. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_qname_edges.rs +104 -0
  249. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_qname_namespace.rs +66 -0
  250. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_regex_backrefs.rs +45 -0
  251. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_regex_errors.rs +40 -0
  252. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_regex_flags.rs +56 -0
  253. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_round_high_precision.rs +24 -0
  254. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_string_edges.rs +111 -0
  255. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_substring_subsequence.rs +67 -0
  256. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_sum_avg_nan.rs +23 -0
  257. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_temporal_errors.rs +35 -0
  258. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_uri_lang.rs +101 -0
  259. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_wrong_arity_message.rs +13 -0
  260. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_ws5_rest_sanity.rs +59 -0
  261. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors.rs +86 -0
  262. platynui_cli-0.2.0.dev1/crates/xpath/tests/functions_xs_constructors_more.rs +100 -0
  263. platynui_cli-0.2.0.dev1/crates/xpath/tests/kindtests_element_attribute.rs +65 -0
  264. platynui_cli-0.2.0.dev1/crates/xpath/tests/namespace_axis.rs +43 -0
  265. platynui_cli-0.2.0.dev1/crates/xpath/tests/namespace_wildcards.rs +103 -0
  266. platynui_cli-0.2.0.dev1/crates/xpath/tests/namespace_xml_binding.rs +50 -0
  267. platynui_cli-0.2.0.dev1/crates/xpath/tests/optimizer_constant_folding.rs +123 -0
  268. platynui_cli-0.2.0.dev1/crates/xpath/tests/optimizer_integration.rs +98 -0
  269. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_axes_full.rs +47 -0
  270. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_basic.rs +157 -0
  271. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_error_codes_more.rs +13 -0
  272. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_errors.rs +14 -0
  273. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_flwor_negative.rs +11 -0
  274. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_function_args_edges.rs +79 -0
  275. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_functions.rs +41 -0
  276. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_functions_aggregates.rs +43 -0
  277. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_if_expr_complex.rs +47 -0
  278. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_invalid_qnames.rs +23 -0
  279. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_kinds_basic.rs +41 -0
  280. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_names_wildcards.rs +54 -0
  281. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_negative_syntax.rs +15 -0
  282. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_nodes_ops.rs +27 -0
  283. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_numbers_strings.rs +43 -0
  284. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_param.rs +77 -0
  285. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_paths_axes.rs +65 -0
  286. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_precedence.rs +29 -0
  287. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_qnames_ns.rs +46 -0
  288. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_quantifiers_flwor.rs +28 -0
  289. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_reserved_functions.rs +87 -0
  290. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_schema_tests.rs +47 -0
  291. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_setops_casts.rs +36 -0
  292. platynui_cli-0.2.0.dev1/crates/xpath/tests/parser_types_more.rs +39 -0
  293. platynui_cli-0.2.0.dev1/crates/xpath/tests/property_deep_equal.rs +60 -0
  294. platynui_cli-0.2.0.dev1/crates/xpath/tests/proptest_nan.rs +29 -0
  295. platynui_cli-0.2.0.dev1/crates/xpath/tests/proptest_ordering.rs +48 -0
  296. platynui_cli-0.2.0.dev1/crates/xpath/tests/proptest_round.rs +63 -0
  297. platynui_cli-0.2.0.dev1/crates/xpath/tests/simple_node.rs +82 -0
  298. platynui_cli-0.2.0.dev1/crates/xpath/tests/simple_node_cross_doc_order.rs +24 -0
  299. platynui_cli-0.2.0.dev1/crates/xpath/tests/simple_node_ns_element.rs +25 -0
  300. platynui_cli-0.2.0.dev1/crates/xpath/tests/static_context.rs +139 -0
  301. platynui_cli-0.2.0.dev1/crates/xpath/tests/static_context_namespaces.rs +115 -0
  302. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_additional.rs +180 -0
  303. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_aggregates.rs +271 -0
  304. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_count_basic.rs +142 -0
  305. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_distinct_index.rs +124 -0
  306. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_strings.rs +189 -0
  307. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_transforms.rs +218 -0
  308. platynui_cli-0.2.0.dev1/crates/xpath/tests/stream_validation.rs +203 -0
  309. platynui_cli-0.2.0.dev1/crates/xpath/tests/streaming_behavior.rs +117 -0
  310. platynui_cli-0.2.0.dev1/crates/xpath/tests/string_value_concat.rs +27 -0
  311. platynui_cli-0.2.0.dev1/crates/xpath/tests/temporal_arith_matrix.rs +77 -0
  312. platynui_cli-0.2.0.dev1/crates/xpath/tests/temporal_parsing.rs +86 -0
  313. platynui_cli-0.2.0.dev1/crates/xpath/tests/test_sequence_cursors.rs +47 -0
  314. platynui_cli-0.2.0.dev1/crates/xpath/tests/test_util.rs +15 -0
  315. platynui_cli-0.2.0.dev1/crates/xpath/tests/treat_as_matrix.rs +54 -0
  316. platynui_cli-0.2.0.dev1/crates/xpath/tests/type_matching_atomic.rs +67 -0
  317. platynui_cli-0.2.0.dev1/crates/xpath/tests/untyped_atomic.rs +113 -0
  318. platynui_cli-0.2.0.dev1/crates/xpath/tests/value_comparisons_qname_notation.rs +45 -0
  319. platynui_cli-0.2.0.dev1/crates/xpath/tests/wildcard_document_node_bug.rs +115 -0
  320. platynui_cli-0.2.0.dev1/crates/xpath/tests/ws6_duration_numeric.rs +64 -0
  321. platynui_cli-0.2.0.dev1/packages/cli/.gitignore +72 -0
  322. platynui_cli-0.2.0.dev1/packages/cli/Cargo.lock +1633 -0
  323. platynui_cli-0.2.0.dev1/packages/cli/Cargo.toml +17 -0
  324. platynui_cli-0.2.0.dev1/packages/cli/README.md +119 -0
  325. platynui_cli-0.2.0.dev1/packages/cli/src/main.rs +6 -0
  326. platynui_cli-0.2.0.dev1/pyproject.toml +50 -0
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.4
2
+ Name: platynui-cli
3
+ Version: 0.2.0.dev1
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: Apache Software License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Rust
15
+ Classifier: Topic :: Software Development :: Testing
16
+ Classifier: Topic :: Software Development :: Quality Assurance
17
+ Classifier: Framework :: Robot Framework
18
+ Classifier: Framework :: Robot Framework :: Library
19
+ Summary: CLI for Robot Framework PlatynUI
20
+ Author-email: Daniel Biehl <daniel.biehl@imbus.de>
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+ Project-URL: Homepage, https://github.com/imbus/robotframework-PlatynUI
24
+ Project-URL: Documentation, https://github.com/imbus/robotframework-PlatynUI#readme
25
+ Project-URL: Changelog, https://github.com/imbus/robotframework-PlatynUI/blob/main/CHANGELOG.md
26
+ Project-URL: Issues, https://github.com/imbus/robotframework-PlatynUI/issues
27
+ Project-URL: Source, https://github.com/imbus/robotframework-PlatynUI
28
+
29
+ # Robot Framework PlatynUI – CLI
30
+
31
+ Command‑line interface for the PlatynUI toolkit. This tool lets you inspect the desktop, query the accessibility tree via XPath‑like expressions, highlight elements, take screenshots, and drive input (focus, window control, pointer, keyboard).
32
+
33
+ Status: early alpha. APIs and output may change.
34
+
35
+ > [!WARNING]
36
+ > Preview release on PyPI. This package is experimental and the CLI surface may change without notice. Use for evaluation, not production.
37
+
38
+ ## Install
39
+
40
+ Install the preview (pre-release) package from PyPI into your environment. After installation, the command `platynui-cli` is available on your PATH.
41
+
42
+ Examples:
43
+
44
+ ```pwsh
45
+ # In a virtual environment (uv)
46
+ uv pip install --pre robotframework-platynui-cli
47
+
48
+ # Or with pip
49
+ pip install --pre robotframework-platynui-cli
50
+
51
+ # Or install as a user-level tool (uv tool)
52
+ uv tool install --prerelease allow robotframework-platynui-cli
53
+ ```
54
+
55
+ Supported platforms: Windows, macOS, and Linux. The binary includes the platform providers for your OS.
56
+ Note: Because this is a pre-release, some installers require an explicit flag (e.g., `--pre`) to select preview versions.
57
+
58
+ ## Quick start
59
+
60
+ ```pwsh
61
+ platynui-cli list-providers
62
+ platynui-cli info --format json
63
+ platynui-cli query "//control:Button[@Name='OK']"
64
+ platynui-cli highlight "//control:Button[@Name='OK']" --duration-ms 1200
65
+ platynui-cli screenshot .\screen.png --rect 100,100,800,600
66
+ ```
67
+
68
+ Most commands support `--format text|json` (default: text) where it makes sense.
69
+
70
+ ## Commands
71
+
72
+ - list-providers
73
+ - List all known UI tree providers; marks which are currently active.
74
+ - Options: `--format text|json`
75
+
76
+ - info
77
+ - Show desktop and monitor metadata (bounds, OS, displays).
78
+ - Options: `--format text|json`
79
+
80
+ - query XPATH
81
+ - Evaluate an XPath expression against the UI tree. Prints nodes, attributes, or values.
82
+ - Options: `--format text|json`
83
+ - Example: `platynui-cli query "//control:Button[@Name='OK']"`
84
+
85
+ - watch
86
+ - Stream provider events (NodeAdded/Updated/Removed, TreeInvalidated).
87
+ - Options: `--format text|json`, `--expression XPATH` (optional additional query run per event), `--limit N`
88
+
89
+ - highlight [XPATH] | --rect X,Y,WIDTH,HEIGHT
90
+ - Draw a temporary highlight overlay for matched elements or a given rectangle.
91
+ - Options: `--duration-ms MS` (default 1500), `--clear` (clear existing highlights)
92
+ - Example: `platynui-cli highlight "//control:Button[@Name='OK']"`
93
+
94
+ - screenshot [FILE]
95
+ - Capture a PNG screenshot. If FILE is omitted, a timestamped name is created in the current directory.
96
+ - Options: `--rect X,Y,WIDTH,HEIGHT`
97
+
98
+ - focus XPATH
99
+ - Set input focus to the first node matched by the expression. Reports if the Focusable pattern is missing.
100
+
101
+ - window [XPATH] --list | --activate | --minimize | --maximize | --restore | --close | --move X Y | --resize W H
102
+ - List and/or control windows matched by XPATH. Without XPATH, defaults to `//control:Window`.
103
+ - Example: `platynui-cli window --list`
104
+ - Example: `platynui-cli window "//control:Window[@Name='Operations Console']" --activate --move 200 220 --resize 800 600`
105
+
106
+ - pointer …
107
+ - Drive pointer input. All subcommands accept advanced overrides (see below).
108
+ - Subcommands:
109
+ - `move [XPATH] [--point x,y]` – Move to element (uses @ActivationPoint or center of @Bounds) or to a point.
110
+ - `click [XPATH] [--point x,y] [--button left|right|middle|<code>] [--no-move]`
111
+ - `multi-click [XPATH] [--point x,y] [--button …] --count N [--no-move]`
112
+ - `press [XPATH] [--point x,y] [--button …] [--no-move]`
113
+ - `release [XPATH] [--button …] [--no-move]`
114
+ - `scroll <dx,dy> [--expr XPATH] [--no-move]`
115
+ - `drag --from x,y --to x,y [--from-expr XPATH] [--to-expr XPATH] [--button …]`
116
+ - `position` – Print current pointer position.
117
+ - Useful overrides (apply to all pointer subcommands via flags):
118
+ - `--origin desktop|bounds|absolute` with `--bounds x,y,w,h` or `--anchor x,y`
119
+ - Motion/profile: `--motion direct|linear|bezier|overshoot|jitter`, `--move-duration MS`, `--speed-factor F`,
120
+ `--acceleration constant|ease-in|ease-out|smooth-step`
121
+ - Timing: `--after-move MS`, `--after-input MS`, `--press-release MS`, `--after-click MS`,
122
+ `--before-next MS`, `--multi-click MS`, `--ensure-threshold PX`, `--ensure-timeout MS`,
123
+ `--scroll-delay MS`, `--scroll-step dx,dy`, `--move-time-per-pixel MS`
124
+
125
+ - keyboard …
126
+ - Send keyboard input.
127
+ - Subcommands:
128
+ - `type "SEQUENCE"` – Types text and chords. Example: `<Ctrl+A>Hallo`.
129
+ - `press "<Chord>"` – Press and hold keys. Example: `<Shift+Ctrl+S>`.
130
+ - `release "<Chord>"` – Release keys from a previous press.
131
+ - Timing overrides: `--delay-ms`, `--press-delay`, `--release-delay`, `--between-keys-delay`,
132
+ `--chord-press-delay`, `--chord-release-delay`, `--after-sequence-delay`, `--after-text-delay`
133
+
134
+ ## XPath quick notes
135
+
136
+ - Default namespace is `control` (e.g., `//control:Button`).
137
+ - Attributes use PascalCase, for example `@Name`, `@Bounds`, `@ActivationPoint`.
138
+ - `query` outputs a colored text view by default; use `--format json` for machine‑readable output.
139
+
140
+ ## Troubleshooting
141
+
142
+ - If nothing shows up in `list-providers`, ensure the build includes your OS provider (it is linked by default when building the CLI in this workspace).
143
+ - On Linux, accessibility needs to be enabled and AT‑SPI running. On macOS, grant accessibility permissions to your shell/terminal. On Windows, UIA should be available by default.
144
+
145
+ ## License
146
+
147
+ Apache-2.0. See the repository’s LICENSE file.
148
+
@@ -0,0 +1,119 @@
1
+ # Robot Framework PlatynUI – CLI
2
+
3
+ Command‑line interface for the PlatynUI toolkit. This tool lets you inspect the desktop, query the accessibility tree via XPath‑like expressions, highlight elements, take screenshots, and drive input (focus, window control, pointer, keyboard).
4
+
5
+ Status: early alpha. APIs and output may change.
6
+
7
+ > [!WARNING]
8
+ > Preview release on PyPI. This package is experimental and the CLI surface may change without notice. Use for evaluation, not production.
9
+
10
+ ## Install
11
+
12
+ Install the preview (pre-release) package from PyPI into your environment. After installation, the command `platynui-cli` is available on your PATH.
13
+
14
+ Examples:
15
+
16
+ ```pwsh
17
+ # In a virtual environment (uv)
18
+ uv pip install --pre robotframework-platynui-cli
19
+
20
+ # Or with pip
21
+ pip install --pre robotframework-platynui-cli
22
+
23
+ # Or install as a user-level tool (uv tool)
24
+ uv tool install --prerelease allow robotframework-platynui-cli
25
+ ```
26
+
27
+ Supported platforms: Windows, macOS, and Linux. The binary includes the platform providers for your OS.
28
+ Note: Because this is a pre-release, some installers require an explicit flag (e.g., `--pre`) to select preview versions.
29
+
30
+ ## Quick start
31
+
32
+ ```pwsh
33
+ platynui-cli list-providers
34
+ platynui-cli info --format json
35
+ platynui-cli query "//control:Button[@Name='OK']"
36
+ platynui-cli highlight "//control:Button[@Name='OK']" --duration-ms 1200
37
+ platynui-cli screenshot .\screen.png --rect 100,100,800,600
38
+ ```
39
+
40
+ Most commands support `--format text|json` (default: text) where it makes sense.
41
+
42
+ ## Commands
43
+
44
+ - list-providers
45
+ - List all known UI tree providers; marks which are currently active.
46
+ - Options: `--format text|json`
47
+
48
+ - info
49
+ - Show desktop and monitor metadata (bounds, OS, displays).
50
+ - Options: `--format text|json`
51
+
52
+ - query XPATH
53
+ - Evaluate an XPath expression against the UI tree. Prints nodes, attributes, or values.
54
+ - Options: `--format text|json`
55
+ - Example: `platynui-cli query "//control:Button[@Name='OK']"`
56
+
57
+ - watch
58
+ - Stream provider events (NodeAdded/Updated/Removed, TreeInvalidated).
59
+ - Options: `--format text|json`, `--expression XPATH` (optional additional query run per event), `--limit N`
60
+
61
+ - highlight [XPATH] | --rect X,Y,WIDTH,HEIGHT
62
+ - Draw a temporary highlight overlay for matched elements or a given rectangle.
63
+ - Options: `--duration-ms MS` (default 1500), `--clear` (clear existing highlights)
64
+ - Example: `platynui-cli highlight "//control:Button[@Name='OK']"`
65
+
66
+ - screenshot [FILE]
67
+ - Capture a PNG screenshot. If FILE is omitted, a timestamped name is created in the current directory.
68
+ - Options: `--rect X,Y,WIDTH,HEIGHT`
69
+
70
+ - focus XPATH
71
+ - Set input focus to the first node matched by the expression. Reports if the Focusable pattern is missing.
72
+
73
+ - window [XPATH] --list | --activate | --minimize | --maximize | --restore | --close | --move X Y | --resize W H
74
+ - List and/or control windows matched by XPATH. Without XPATH, defaults to `//control:Window`.
75
+ - Example: `platynui-cli window --list`
76
+ - Example: `platynui-cli window "//control:Window[@Name='Operations Console']" --activate --move 200 220 --resize 800 600`
77
+
78
+ - pointer …
79
+ - Drive pointer input. All subcommands accept advanced overrides (see below).
80
+ - Subcommands:
81
+ - `move [XPATH] [--point x,y]` – Move to element (uses @ActivationPoint or center of @Bounds) or to a point.
82
+ - `click [XPATH] [--point x,y] [--button left|right|middle|<code>] [--no-move]`
83
+ - `multi-click [XPATH] [--point x,y] [--button …] --count N [--no-move]`
84
+ - `press [XPATH] [--point x,y] [--button …] [--no-move]`
85
+ - `release [XPATH] [--button …] [--no-move]`
86
+ - `scroll <dx,dy> [--expr XPATH] [--no-move]`
87
+ - `drag --from x,y --to x,y [--from-expr XPATH] [--to-expr XPATH] [--button …]`
88
+ - `position` – Print current pointer position.
89
+ - Useful overrides (apply to all pointer subcommands via flags):
90
+ - `--origin desktop|bounds|absolute` with `--bounds x,y,w,h` or `--anchor x,y`
91
+ - Motion/profile: `--motion direct|linear|bezier|overshoot|jitter`, `--move-duration MS`, `--speed-factor F`,
92
+ `--acceleration constant|ease-in|ease-out|smooth-step`
93
+ - Timing: `--after-move MS`, `--after-input MS`, `--press-release MS`, `--after-click MS`,
94
+ `--before-next MS`, `--multi-click MS`, `--ensure-threshold PX`, `--ensure-timeout MS`,
95
+ `--scroll-delay MS`, `--scroll-step dx,dy`, `--move-time-per-pixel MS`
96
+
97
+ - keyboard …
98
+ - Send keyboard input.
99
+ - Subcommands:
100
+ - `type "SEQUENCE"` – Types text and chords. Example: `<Ctrl+A>Hallo`.
101
+ - `press "<Chord>"` – Press and hold keys. Example: `<Shift+Ctrl+S>`.
102
+ - `release "<Chord>"` – Release keys from a previous press.
103
+ - Timing overrides: `--delay-ms`, `--press-delay`, `--release-delay`, `--between-keys-delay`,
104
+ `--chord-press-delay`, `--chord-release-delay`, `--after-sequence-delay`, `--after-text-delay`
105
+
106
+ ## XPath quick notes
107
+
108
+ - Default namespace is `control` (e.g., `//control:Button`).
109
+ - Attributes use PascalCase, for example `@Name`, `@Bounds`, `@ActivationPoint`.
110
+ - `query` outputs a colored text view by default; use `--format json` for machine‑readable output.
111
+
112
+ ## Troubleshooting
113
+
114
+ - If nothing shows up in `list-providers`, ensure the build includes your OS provider (it is linked by default when building the CLI in this workspace).
115
+ - On Linux, accessibility needs to be enabled and AT‑SPI running. On macOS, grant accessibility permissions to your shell/terminal. On Windows, UIA should be available by default.
116
+
117
+ ## License
118
+
119
+ Apache-2.0. See the repository’s LICENSE file.
@@ -0,0 +1,66 @@
1
+ [package]
2
+ name = "platynui-cli"
3
+ description = "Command-line interface for PlatynUI automation toolkit"
4
+ version.workspace = true
5
+ keywords.workspace = true
6
+ categories.workspace = true
7
+ edition.workspace = true
8
+ homepage.workspace = true
9
+ documentation.workspace = true
10
+ repository.workspace = true
11
+ authors.workspace = true
12
+ license.workspace = true
13
+ rust-version.workspace = true
14
+
15
+ [features]
16
+ default = []
17
+ mock-provider = [
18
+ "platynui-runtime/mock-provider",
19
+ "dep:platynui-provider-mock",
20
+ "dep:platynui-platform-mock",
21
+ ]
22
+
23
+ [dependencies]
24
+ clap = { version = "4.5.48", features = ["derive"] }
25
+ anyhow = "1.0.89"
26
+ serde = { version = "1.0.228", features = ["derive"] }
27
+ serde_json = "1.0.145"
28
+ owo-colors = { version = "4.2.3", features = ["supports-colors"] }
29
+ png = "0.18.0"
30
+
31
+ platynui-runtime = { path = "../runtime", default-features = false }
32
+ platynui-core = { path = "../core" }
33
+
34
+ platynui-provider-mock = { path = "../provider-mock", optional = true }
35
+ platynui-platform-mock = { path = "../platform-mock", optional = true }
36
+
37
+ platynui-link = { path = "../link" }
38
+
39
+ [target.'cfg(target_os = "windows")'.dependencies]
40
+ platynui-platform-windows = { path = "../platform-windows" }
41
+ platynui-provider-windows-uia = { path = "../provider-windows-uia" }
42
+
43
+ [target.'cfg(target_os = "linux")'.dependencies]
44
+ platynui-platform-linux-x11 = { path = "../platform-linux-x11" }
45
+ platynui-provider-atspi = { path = "../provider-atspi" }
46
+
47
+ [target.'cfg(target_os = "macos")'.dependencies]
48
+ platynui-platform-macos = { path = "../platform-macos" }
49
+ platynui-provider-macos-ax = { path = "../provider-macos-ax" }
50
+
51
+
52
+
53
+ [dev-dependencies]
54
+ rstest = "0.26.1"
55
+ tempfile = "3.23.0"
56
+ serial_test = "3.2.0"
57
+ platynui-provider-mock = { path = "../provider-mock" }
58
+ platynui-platform-mock = { path = "../platform-mock" }
59
+
60
+ [lib]
61
+ name = "platynui_cli"
62
+ path = "src/lib.rs"
63
+
64
+ [[bin]]
65
+ name = "platynui-cli"
66
+ path = "src/main.rs"
@@ -0,0 +1,115 @@
1
+ use crate::util::{CliResult, map_evaluate_error};
2
+ use clap::Args;
3
+ use owo_colors::{OwoColorize, Stream};
4
+ use platynui_core::ui::{Namespace, UiNode};
5
+ use platynui_runtime::{EvaluationItem, FocusError, Runtime};
6
+ use std::sync::Arc;
7
+
8
+ #[derive(Args, Debug, Clone)]
9
+ pub struct FocusArgs {
10
+ #[arg(value_name = "XPATH", help = "XPath expression selecting nodes to focus.")]
11
+ pub expression: String,
12
+ }
13
+
14
+ pub fn run(runtime: &Runtime, args: &FocusArgs) -> CliResult<String> {
15
+ let item = runtime.evaluate_single(None, &args.expression).map_err(map_evaluate_error)?;
16
+ let Some(EvaluationItem::Node(node)) = item else {
17
+ anyhow::bail!("expression `{}` did not match any nodes", args.expression);
18
+ };
19
+
20
+ let mut lines = Vec::new();
21
+ match runtime.focus(&node) {
22
+ Ok(()) => {
23
+ lines.push("Focused 1 node(s):".to_owned());
24
+ lines.push(format!("- {}", render_node(&node)));
25
+ }
26
+ Err(FocusError::PatternMissing { .. }) => {
27
+ lines.push("Focused 0 node(s).".to_owned());
28
+ lines.push("Skipped (missing Focusable pattern):".to_owned());
29
+ lines.push(format!("- {}", render_node(&node)));
30
+ }
31
+ Err(FocusError::ActionFailed { source, .. }) => {
32
+ lines.push("Focused 0 node(s).".to_owned());
33
+ lines.push("Failed to focus:".to_owned());
34
+ lines.push(format!("- {}: {}", render_node(&node), source.message()));
35
+ }
36
+ }
37
+
38
+ Ok(lines.join("\n"))
39
+ }
40
+
41
+ fn render_node(node: &Arc<dyn UiNode>) -> String {
42
+ let namespace = node.namespace().as_str();
43
+ let prefix = if namespace == Namespace::Control.as_str() { String::new() } else { format!("{namespace}:") };
44
+
45
+ let role = node.role();
46
+ let name = node.name();
47
+
48
+ let label = if name.is_empty() {
49
+ format!("{prefix}{role}")
50
+ } else {
51
+ let quoted_name = serde_json::to_string(&name).unwrap_or_else(|_| format!("\"{name}\""));
52
+ format!("{prefix}{role} {quoted_name}")
53
+ };
54
+
55
+ let colored_label =
56
+ label.if_supports_color(Stream::Stdout, |text| text.bold().fg_rgb::<79, 166, 255>().to_string()).to_string();
57
+
58
+ format!("{colored_label} ({})", node.runtime_id().as_str())
59
+ }
60
+
61
+ #[cfg(test)]
62
+ mod tests {
63
+ use super::*;
64
+ use crate::test_support::runtime;
65
+ use crate::util::map_evaluate_error;
66
+ use platynui_core::ui::UiValue;
67
+ use platynui_core::ui::attribute_names::focusable;
68
+ use platynui_runtime::Runtime;
69
+ use rstest::rstest;
70
+ use serial_test::serial;
71
+
72
+ #[rstest]
73
+ #[serial]
74
+ fn focus_command_sets_focus(runtime: Runtime) {
75
+ let args = FocusArgs { expression: "//control:Button[@Name='OK']".into() };
76
+
77
+ let output = run(&runtime, &args).expect("focus execution");
78
+ assert!(output.contains("Focused 1 node"));
79
+ assert!(output.contains("mock://button/ok"));
80
+
81
+ let results =
82
+ runtime.evaluate(None, "//control:Button[@Name='OK']").map_err(map_evaluate_error).expect("evaluation");
83
+
84
+ let focused = results
85
+ .into_iter()
86
+ .find_map(|item| match item {
87
+ EvaluationItem::Node(node) => Some(node),
88
+ _ => None,
89
+ })
90
+ .expect("button node present");
91
+
92
+ let attr = focused.attribute(Namespace::Control, focusable::IS_FOCUSED).expect("focus attribute");
93
+ assert_eq!(attr.value(), UiValue::from(true));
94
+ }
95
+
96
+ #[rstest]
97
+ #[serial]
98
+ fn focus_command_reports_missing_pattern(runtime: Runtime) {
99
+ let args = FocusArgs { expression: "//control:Panel[@Name='Workspace']".into() };
100
+
101
+ let output = run(&runtime, &args).expect("focus execution");
102
+ assert!(output.contains("Skipped (missing Focusable pattern)"));
103
+ assert!(output.contains("mock://panel/workspace"));
104
+ assert!(output.contains("Focused 0 node"));
105
+ }
106
+
107
+ #[rstest]
108
+ #[serial]
109
+ fn focus_command_errors_on_empty_result(runtime: Runtime) {
110
+ let args = FocusArgs { expression: "//control:Button[@Name='Nonexistent']".into() };
111
+
112
+ let err = run(&runtime, &args).expect_err("no node should error");
113
+ assert!(err.to_string().contains("did not match any nodes"));
114
+ }
115
+ }
@@ -0,0 +1,211 @@
1
+ use crate::util::{CliResult, map_evaluate_error, map_platform_error};
2
+ use clap::Args;
3
+ use platynui_core::platform::HighlightRequest;
4
+ use platynui_core::types::Rect;
5
+ use platynui_core::ui::{Namespace, UiValue};
6
+ use platynui_runtime::{EvaluationItem, Runtime};
7
+ use std::time::Duration;
8
+
9
+ #[derive(Args, Debug, Clone)]
10
+ pub struct HighlightArgs {
11
+ #[arg(value_name = "XPATH", conflicts_with = "rect")]
12
+ pub expression: Option<String>,
13
+ #[arg(
14
+ long = "rect",
15
+ value_parser = parse_rect_arg,
16
+ value_name = "X,Y,WIDTH,HEIGHT",
17
+ allow_hyphen_values = true,
18
+ help = "Highlight a specific rectangle in desktop coordinates. Conflicts with XPATH."
19
+ )]
20
+ pub rect: Option<Rect>,
21
+ #[arg(
22
+ long = "duration-ms",
23
+ default_value_t = 1500u64,
24
+ help = "Duration in milliseconds the highlight stays visible before fading (default: 1500)."
25
+ )]
26
+ pub duration_ms: u64,
27
+ #[arg(long = "clear", help = "Clear existing highlights before applying a new one or alone.")]
28
+ pub clear: bool,
29
+ }
30
+
31
+ pub fn run(runtime: &Runtime, args: &HighlightArgs) -> CliResult<String> {
32
+ if args.expression.is_none() && args.rect.is_none() && !args.clear {
33
+ anyhow::bail!("highlight requires an XPath expression or --rect unless --clear is set");
34
+ }
35
+
36
+ let mut messages = Vec::new();
37
+
38
+ if args.clear {
39
+ runtime.clear_highlight().map_err(map_platform_error)?;
40
+ messages.push("Cleared existing highlights.".to_owned());
41
+ }
42
+
43
+ let mut highlighted = 0usize;
44
+ let mut hold_ms: Option<u64> = None;
45
+ if let Some(rect) = args.rect {
46
+ let req = HighlightRequest::new(rect).with_duration(Duration::from_millis(args.duration_ms));
47
+ runtime.highlight(&req).map_err(map_platform_error)?;
48
+ highlighted = 1;
49
+ hold_ms = Some(args.duration_ms);
50
+ } else if let Some(expression) = &args.expression {
51
+ let highlight = collect_highlight_requests(runtime, expression, Some(args.duration_ms))?;
52
+ if highlight.rects.is_empty() {
53
+ anyhow::bail!("no highlightable nodes for expression `{expression}`");
54
+ }
55
+ let mut req = HighlightRequest::from_rects(highlight.rects);
56
+ if let Some(ms) = highlight.duration_ms {
57
+ req = req.with_duration(Duration::from_millis(ms));
58
+ }
59
+ runtime.highlight(&req).map_err(map_platform_error)?;
60
+ highlighted = 1;
61
+ hold_ms = Some(args.duration_ms);
62
+ if !highlight.skipped.is_empty() {
63
+ let skipped = highlight.skipped.join(", ");
64
+ messages.push(format!("Skipped nodes without Bounds: {skipped}."));
65
+ }
66
+ }
67
+
68
+ // Keep the process alive so the overlay stays visible until the duration elapses.
69
+ if let Some(ms) = hold_ms
70
+ && !cfg!(test)
71
+ {
72
+ std::thread::sleep(Duration::from_millis(ms));
73
+ }
74
+
75
+ if messages.is_empty() {
76
+ if highlighted > 0 {
77
+ messages.push(format!("Highlighted {} region(s).", highlighted));
78
+ } else {
79
+ messages.push("No highlight action executed.".to_owned());
80
+ }
81
+ }
82
+
83
+ Ok(messages.join("\n"))
84
+ }
85
+
86
+ struct HighlightComputation {
87
+ rects: Vec<Rect>,
88
+ duration_ms: Option<u64>,
89
+ skipped: Vec<String>,
90
+ }
91
+
92
+ fn collect_highlight_requests(
93
+ runtime: &Runtime,
94
+ expression: &str,
95
+ duration_ms: Option<u64>,
96
+ ) -> CliResult<HighlightComputation> {
97
+ let results = runtime.evaluate(None, expression).map_err(map_evaluate_error)?;
98
+ let mut rects = Vec::new();
99
+ let mut skipped = Vec::new();
100
+
101
+ for item in results {
102
+ let EvaluationItem::Node(node) = item else {
103
+ continue;
104
+ };
105
+
106
+ let Some(attribute) = node.attribute(Namespace::Control, "Bounds") else {
107
+ skipped.push(node.runtime_id().as_str().to_owned());
108
+ continue;
109
+ };
110
+
111
+ let value = attribute.value();
112
+ let UiValue::Rect(bounds) = value else {
113
+ skipped.push(node.runtime_id().as_str().to_owned());
114
+ continue;
115
+ };
116
+
117
+ if bounds.is_empty() {
118
+ skipped.push(node.runtime_id().as_str().to_owned());
119
+ continue;
120
+ }
121
+
122
+ rects.push(bounds);
123
+ }
124
+ Ok(HighlightComputation { rects, duration_ms, skipped })
125
+ }
126
+
127
+ fn parse_rect_arg(value: &str) -> Result<Rect, String> {
128
+ let parts: Vec<_> = value.split(',').collect();
129
+ if parts.len() != 4 {
130
+ return Err(format!("expected four comma-separated values, got `{value}`"));
131
+ }
132
+ let mut nums = [0f64; 4];
133
+ for (i, part) in parts.iter().enumerate() {
134
+ nums[i] = part.trim().parse::<f64>().map_err(|_| format!("invalid number in rect `{value}`"))?;
135
+ }
136
+ Ok(Rect::new(nums[0], nums[1], nums[2], nums[3]))
137
+ }
138
+
139
+ #[cfg(test)]
140
+ mod tests {
141
+ use super::*;
142
+ // Link platform-mock inventory for highlight provider
143
+ use crate::test_support::runtime;
144
+ use platynui_platform_mock as _; // link platform-mock inventory
145
+ use platynui_platform_mock::{highlight_clear_count, reset_highlight_state, take_highlight_log};
146
+ use platynui_runtime::Runtime;
147
+ use rstest::rstest;
148
+ use std::sync::{LazyLock, Mutex};
149
+
150
+ static TEST_GUARD: LazyLock<Mutex<()>> = LazyLock::new(|| Mutex::new(()));
151
+
152
+ #[rstest]
153
+ fn highlight_records_requests(runtime: Runtime) {
154
+ let _lock = TEST_GUARD.lock().unwrap();
155
+ reset_highlight_state();
156
+
157
+ let args =
158
+ HighlightArgs { expression: Some("//control:Button".into()), rect: None, duration_ms: 500, clear: false };
159
+
160
+ let output = run(&runtime, &args).expect("highlight execution");
161
+ assert!(output.contains("Highlighted"));
162
+
163
+ let log = take_highlight_log();
164
+ assert!(!log.is_empty());
165
+ assert_eq!(log[0].duration, Some(Duration::from_millis(500)));
166
+
167
+ reset_highlight_state();
168
+ }
169
+
170
+ #[rstest]
171
+ fn highlight_clear_only_triggers_provider_clear(runtime: Runtime) {
172
+ let _lock = TEST_GUARD.lock().unwrap();
173
+ reset_highlight_state();
174
+
175
+ let args = HighlightArgs { expression: None, rect: None, duration_ms: 1500, clear: true };
176
+ let output = run(&runtime, &args).expect("highlight clear");
177
+ assert!(output.contains("Cleared"));
178
+ assert_eq!(highlight_clear_count(), 1);
179
+
180
+ reset_highlight_state();
181
+ }
182
+
183
+ #[rstest]
184
+ fn highlight_requires_expression_or_clear(runtime: Runtime) {
185
+ let _lock = TEST_GUARD.lock().unwrap();
186
+
187
+ let err = run(&runtime, &HighlightArgs { expression: None, rect: None, duration_ms: 1500, clear: false })
188
+ .expect_err("missing expression or rect should error");
189
+ assert!(err.to_string().contains("requires"));
190
+ }
191
+
192
+ #[rstest]
193
+ fn highlight_rect_path_uses_default_duration(runtime: Runtime) {
194
+ let _lock = TEST_GUARD.lock().unwrap();
195
+ reset_highlight_state();
196
+
197
+ let args = HighlightArgs {
198
+ expression: None,
199
+ rect: Some(Rect::new(10.0, 10.0, 40.0, 20.0)),
200
+ duration_ms: 1500,
201
+ clear: false,
202
+ };
203
+ let output = run(&runtime, &args).expect("highlight rect");
204
+ assert!(output.contains("Highlighted 1 region"));
205
+ let log = take_highlight_log();
206
+ assert_eq!(log.len(), 1);
207
+ assert_eq!(log[0].duration, Some(Duration::from_millis(1500)));
208
+
209
+ reset_highlight_state();
210
+ }
211
+ }