lvkit 0.1.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 (167) hide show
  1. lvkit-0.1.0/.gitignore +103 -0
  2. lvkit-0.1.0/.pre-commit-config.yaml +32 -0
  3. lvkit-0.1.0/LICENSE +201 -0
  4. lvkit-0.1.0/PKG-INFO +199 -0
  5. lvkit-0.1.0/README.md +167 -0
  6. lvkit-0.1.0/pyproject.toml +98 -0
  7. lvkit-0.1.0/scripts/analyze_vi.py +75 -0
  8. lvkit-0.1.0/scripts/generate_docs.py +509 -0
  9. lvkit-0.1.0/scripts/generate_driver_data.py +1618 -0
  10. lvkit-0.1.0/scripts/generate_python.py +51 -0
  11. lvkit-0.1.0/scripts/populate_vilib.py +503 -0
  12. lvkit-0.1.0/scripts/sync_skills.sh +77 -0
  13. lvkit-0.1.0/src/lvkit/__init__.py +55 -0
  14. lvkit-0.1.0/src/lvkit/_data.py +24 -0
  15. lvkit-0.1.0/src/lvkit/cli.py +980 -0
  16. lvkit-0.1.0/src/lvkit/codegen/README.md +147 -0
  17. lvkit-0.1.0/src/lvkit/codegen/__init__.py +36 -0
  18. lvkit-0.1.0/src/lvkit/codegen/ast_optimizer.py +436 -0
  19. lvkit-0.1.0/src/lvkit/codegen/ast_utils.py +241 -0
  20. lvkit-0.1.0/src/lvkit/codegen/builder.py +754 -0
  21. lvkit-0.1.0/src/lvkit/codegen/class_builder.py +775 -0
  22. lvkit-0.1.0/src/lvkit/codegen/condition_builder.py +316 -0
  23. lvkit-0.1.0/src/lvkit/codegen/context.py +576 -0
  24. lvkit-0.1.0/src/lvkit/codegen/dataflow.py +241 -0
  25. lvkit-0.1.0/src/lvkit/codegen/error_handler.py +297 -0
  26. lvkit-0.1.0/src/lvkit/codegen/expressions.py +202 -0
  27. lvkit-0.1.0/src/lvkit/codegen/fragment.py +54 -0
  28. lvkit-0.1.0/src/lvkit/codegen/function.py +307 -0
  29. lvkit-0.1.0/src/lvkit/codegen/imports.py +132 -0
  30. lvkit-0.1.0/src/lvkit/codegen/nodes/__init__.py +102 -0
  31. lvkit-0.1.0/src/lvkit/codegen/nodes/base.py +50 -0
  32. lvkit-0.1.0/src/lvkit/codegen/nodes/case.py +345 -0
  33. lvkit-0.1.0/src/lvkit/codegen/nodes/compound.py +159 -0
  34. lvkit-0.1.0/src/lvkit/codegen/nodes/constant.py +33 -0
  35. lvkit-0.1.0/src/lvkit/codegen/nodes/invoke_node.py +83 -0
  36. lvkit-0.1.0/src/lvkit/codegen/nodes/loop.py +744 -0
  37. lvkit-0.1.0/src/lvkit/codegen/nodes/nmux.py +224 -0
  38. lvkit-0.1.0/src/lvkit/codegen/nodes/primitive.py +673 -0
  39. lvkit-0.1.0/src/lvkit/codegen/nodes/printf.py +70 -0
  40. lvkit-0.1.0/src/lvkit/codegen/nodes/property_node.py +106 -0
  41. lvkit-0.1.0/src/lvkit/codegen/nodes/sequence.py +65 -0
  42. lvkit-0.1.0/src/lvkit/codegen/nodes/subvi.py +789 -0
  43. lvkit-0.1.0/src/lvkit/codegen/stubs.py +184 -0
  44. lvkit-0.1.0/src/lvkit/codegen/unresolved.py +156 -0
  45. lvkit-0.1.0/src/lvkit/data/drivers/_index.json +15 -0
  46. lvkit-0.1.0/src/lvkit/data/drivers/daqmx.json +2708 -0
  47. lvkit-0.1.0/src/lvkit/data/drivers/nidcpower.json +545 -0
  48. lvkit-0.1.0/src/lvkit/data/drivers/nidigital.json +830 -0
  49. lvkit-0.1.0/src/lvkit/data/drivers/nidmm.json +620 -0
  50. lvkit-0.1.0/src/lvkit/data/drivers/nifgen.json +490 -0
  51. lvkit-0.1.0/src/lvkit/data/drivers/niscope.json +560 -0
  52. lvkit-0.1.0/src/lvkit/data/drivers/niswitch.json +475 -0
  53. lvkit-0.1.0/src/lvkit/data/drivers/serial.json +170 -0
  54. lvkit-0.1.0/src/lvkit/data/drivers/visa.json +542 -0
  55. lvkit-0.1.0/src/lvkit/data/labview_error_codes.json +1318 -0
  56. lvkit-0.1.0/src/lvkit/data/openg/_index.json +12 -0
  57. lvkit-0.1.0/src/lvkit/data/openg/array.json +6951 -0
  58. lvkit-0.1.0/src/lvkit/data/openg/file.json +876 -0
  59. lvkit-0.1.0/src/lvkit/data/openg/string.json +146 -0
  60. lvkit-0.1.0/src/lvkit/data/openg/time.json +98 -0
  61. lvkit-0.1.0/src/lvkit/data/openg/variant.json +33 -0
  62. lvkit-0.1.0/src/lvkit/data/primitives-from-pdf.json +8452 -0
  63. lvkit-0.1.0/src/lvkit/data/primitives.json +3166 -0
  64. lvkit-0.1.0/src/lvkit/data/vilib/_index.json +19 -0
  65. lvkit-0.1.0/src/lvkit/data/vilib/_pending_terminals.json +1391 -0
  66. lvkit-0.1.0/src/lvkit/data/vilib/_types.json +24 -0
  67. lvkit-0.1.0/src/lvkit/data/vilib/application-control.json +5408 -0
  68. lvkit-0.1.0/src/lvkit/data/vilib/array.json +2071 -0
  69. lvkit-0.1.0/src/lvkit/data/vilib/boolean.json +704 -0
  70. lvkit-0.1.0/src/lvkit/data/vilib/cluster.json +776 -0
  71. lvkit-0.1.0/src/lvkit/data/vilib/comparison.json +2388 -0
  72. lvkit-0.1.0/src/lvkit/data/vilib/error-handling.json +2274 -0
  73. lvkit-0.1.0/src/lvkit/data/vilib/file-io.json +4733 -0
  74. lvkit-0.1.0/src/lvkit/data/vilib/numeric.json +1538 -0
  75. lvkit-0.1.0/src/lvkit/data/vilib/other.json +87782 -0
  76. lvkit-0.1.0/src/lvkit/data/vilib/string.json +3582 -0
  77. lvkit-0.1.0/src/lvkit/data/vilib/structures.json +1040 -0
  78. lvkit-0.1.0/src/lvkit/data/vilib/variant.json +1343 -0
  79. lvkit-0.1.0/src/lvkit/docs/__init__.py +1 -0
  80. lvkit-0.1.0/src/lvkit/docs/generate.py +400 -0
  81. lvkit-0.1.0/src/lvkit/docs/html_generator.py +853 -0
  82. lvkit-0.1.0/src/lvkit/docs/template.css +398 -0
  83. lvkit-0.1.0/src/lvkit/docs/utils.py +109 -0
  84. lvkit-0.1.0/src/lvkit/extractor.py +98 -0
  85. lvkit-0.1.0/src/lvkit/graph/__init__.py +10 -0
  86. lvkit-0.1.0/src/lvkit/graph/analysis.py +158 -0
  87. lvkit-0.1.0/src/lvkit/graph/construction.py +1221 -0
  88. lvkit-0.1.0/src/lvkit/graph/core.py +321 -0
  89. lvkit-0.1.0/src/lvkit/graph/describe.py +493 -0
  90. lvkit-0.1.0/src/lvkit/graph/diff.py +387 -0
  91. lvkit-0.1.0/src/lvkit/graph/flowchart.py +281 -0
  92. lvkit-0.1.0/src/lvkit/graph/loading.py +716 -0
  93. lvkit-0.1.0/src/lvkit/graph/models.py +420 -0
  94. lvkit-0.1.0/src/lvkit/graph/operations.py +446 -0
  95. lvkit-0.1.0/src/lvkit/graph/queries.py +813 -0
  96. lvkit-0.1.0/src/lvkit/labview_error.py +146 -0
  97. lvkit-0.1.0/src/lvkit/labview_error_codes.py +48 -0
  98. lvkit-0.1.0/src/lvkit/mcp/__init__.py +7 -0
  99. lvkit-0.1.0/src/lvkit/mcp/schemas.py +239 -0
  100. lvkit-0.1.0/src/lvkit/mcp/server.py +647 -0
  101. lvkit-0.1.0/src/lvkit/mcp/tools.py +204 -0
  102. lvkit-0.1.0/src/lvkit/models.py +388 -0
  103. lvkit-0.1.0/src/lvkit/parser/__init__.py +96 -0
  104. lvkit-0.1.0/src/lvkit/parser/constants.py +158 -0
  105. lvkit-0.1.0/src/lvkit/parser/defaults.py +117 -0
  106. lvkit-0.1.0/src/lvkit/parser/flags.py +26 -0
  107. lvkit-0.1.0/src/lvkit/parser/front_panel.py +257 -0
  108. lvkit-0.1.0/src/lvkit/parser/metadata.py +290 -0
  109. lvkit-0.1.0/src/lvkit/parser/models.py +406 -0
  110. lvkit-0.1.0/src/lvkit/parser/naming.py +77 -0
  111. lvkit-0.1.0/src/lvkit/parser/node_types.py +600 -0
  112. lvkit-0.1.0/src/lvkit/parser/nodes/__init__.py +16 -0
  113. lvkit-0.1.0/src/lvkit/parser/nodes/base.py +80 -0
  114. lvkit-0.1.0/src/lvkit/parser/nodes/case.py +389 -0
  115. lvkit-0.1.0/src/lvkit/parser/nodes/constant.py +55 -0
  116. lvkit-0.1.0/src/lvkit/parser/nodes/loop.py +134 -0
  117. lvkit-0.1.0/src/lvkit/parser/nodes/sequence.py +150 -0
  118. lvkit-0.1.0/src/lvkit/parser/type_mapping.py +387 -0
  119. lvkit-0.1.0/src/lvkit/parser/type_resolution.py +254 -0
  120. lvkit-0.1.0/src/lvkit/parser/utils.py +124 -0
  121. lvkit-0.1.0/src/lvkit/parser/vi.py +1033 -0
  122. lvkit-0.1.0/src/lvkit/pipeline.py +683 -0
  123. lvkit-0.1.0/src/lvkit/primitive_resolver.py +633 -0
  124. lvkit-0.1.0/src/lvkit/project_store.py +480 -0
  125. lvkit-0.1.0/src/lvkit/py.typed +0 -0
  126. lvkit-0.1.0/src/lvkit/skill_templates/__init__.py +15 -0
  127. lvkit-0.1.0/src/lvkit/skill_templates/lvkit-convert/SKILL.md +141 -0
  128. lvkit-0.1.0/src/lvkit/skill_templates/lvkit-describe/SKILL.md +108 -0
  129. lvkit-0.1.0/src/lvkit/skill_templates/lvkit-idiomatic/SKILL.md +85 -0
  130. lvkit-0.1.0/src/lvkit/skill_templates/lvkit-resolve-primitive/SKILL.md +275 -0
  131. lvkit-0.1.0/src/lvkit/skill_templates/lvkit-resolve-vilib/SKILL.md +146 -0
  132. lvkit-0.1.0/src/lvkit/structure.py +788 -0
  133. lvkit-0.1.0/src/lvkit/terminal_collector.py +295 -0
  134. lvkit-0.1.0/src/lvkit/type_defaults.py +195 -0
  135. lvkit-0.1.0/src/lvkit/vilib_resolver.py +1160 -0
  136. lvkit-0.1.0/tests/__init__.py +0 -0
  137. lvkit-0.1.0/tests/conftest.py +28 -0
  138. lvkit-0.1.0/tests/helpers.py +67 -0
  139. lvkit-0.1.0/tests/test_ast_builder.py +1507 -0
  140. lvkit-0.1.0/tests/test_ast_optimizer.py +264 -0
  141. lvkit-0.1.0/tests/test_case_parser.py +216 -0
  142. lvkit-0.1.0/tests/test_codegen_context.py +139 -0
  143. lvkit-0.1.0/tests/test_compound_codegen.py +571 -0
  144. lvkit-0.1.0/tests/test_condition_builder.py +486 -0
  145. lvkit-0.1.0/tests/test_constant_decoding.py +348 -0
  146. lvkit-0.1.0/tests/test_diff.py +100 -0
  147. lvkit-0.1.0/tests/test_driver_codegen.py +323 -0
  148. lvkit-0.1.0/tests/test_dynamic_dispatch.py +283 -0
  149. lvkit-0.1.0/tests/test_e2e_codegen.py +271 -0
  150. lvkit-0.1.0/tests/test_error_codegen.py +570 -0
  151. lvkit-0.1.0/tests/test_error_handling.py +121 -0
  152. lvkit-0.1.0/tests/test_graceful_degradation.py +213 -0
  153. lvkit-0.1.0/tests/test_loop_codegen.py +688 -0
  154. lvkit-0.1.0/tests/test_lvpy.py +8 -0
  155. lvkit-0.1.0/tests/test_naming.py +73 -0
  156. lvkit-0.1.0/tests/test_new_codegen.py +487 -0
  157. lvkit-0.1.0/tests/test_parallel_codegen.py +405 -0
  158. lvkit-0.1.0/tests/test_parser.py +818 -0
  159. lvkit-0.1.0/tests/test_parser_regression.py +143 -0
  160. lvkit-0.1.0/tests/test_project_store.py +677 -0
  161. lvkit-0.1.0/tests/test_sequence.py +568 -0
  162. lvkit-0.1.0/tests/test_soft_codegen.py +410 -0
  163. lvkit-0.1.0/tests/test_type_driven_fixes.py +350 -0
  164. lvkit-0.1.0/tests/test_type_fields.py +88 -0
  165. lvkit-0.1.0/tests/test_type_loading.py +162 -0
  166. lvkit-0.1.0/tests/test_type_mapping.py +169 -0
  167. lvkit-0.1.0/tests/test_vi_graph.py +243 -0
lvkit-0.1.0/.gitignore ADDED
@@ -0,0 +1,103 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ *.manifest
29
+ *.spec
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Unit test / coverage reports
36
+ htmlcov/
37
+ .tox/
38
+ .nox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ *.py,cover
46
+ .hypothesis/
47
+ .pytest_cache/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Environments
54
+ .env
55
+ .venv
56
+ env/
57
+ venv/
58
+ ENV/
59
+ env.bak/
60
+ venv.bak/
61
+
62
+ # IDE
63
+ .idea/
64
+ .vscode/
65
+ *.swp
66
+ *.swo
67
+
68
+ # mypy
69
+ .mypy_cache/
70
+ .dmypy.json
71
+ dmypy.json
72
+
73
+ # ruff
74
+ .ruff_cache/
75
+
76
+ # LabVIEW files (keep these tracked for testing)
77
+ # *.vi
78
+ # *.lvproj
79
+
80
+ # Sample LabVIEW projects (external test data)
81
+ samples/
82
+
83
+ # Model files
84
+ models/
85
+ *.gguf
86
+
87
+ # Test outputs
88
+ outputs/
89
+ .tmp/
90
+
91
+ # Project-local resolution store. lvkit ships cleanroom — anything in .lvkit/
92
+ # may be derived from licensed LabVIEW sources and must NEVER be committed
93
+ # to lvkit's own repo. (Downstream users decide their own .lvkit/ gitignore
94
+ # policy in their own projects.)
95
+ .lvkit/
96
+
97
+ # Large binary docs and proprietary references.
98
+ # lvkit is cleanroom — NI's reference manual is not redistributable
99
+ # from this repo. Resolution skills look up function info via web
100
+ # search against ni.com/docs instead.
101
+ docs/*.pdf
102
+ docs/labview_ref_manual.txt
103
+ docs/labview_programming_reference_manual*
@@ -0,0 +1,32 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.11.4
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+
8
+ - repo: local
9
+ hooks:
10
+ - id: pyright
11
+ name: pyright
12
+ entry: python3 -m pyright src/lvkit/
13
+ language: system
14
+ types: [python]
15
+ pass_filenames: false
16
+
17
+ - id: pytest
18
+ name: pytest
19
+ entry: python3 -m pytest -q
20
+ language: system
21
+ types: [python]
22
+ pass_filenames: false
23
+
24
+ - id: sync-skills
25
+ name: sync skill templates
26
+ entry: scripts/sync_skills.sh
27
+ language: system
28
+ # Trigger on any SKILL.md change under either tree. The script
29
+ # discovers skills dynamically from src/lvkit/skill_templates/ —
30
+ # adding a new packaged skill requires no hook-config change.
31
+ files: '^(\.claude/skills/.*/SKILL\.md|src/lvkit/skill_templates/claude/.*/SKILL\.md)$'
32
+ pass_filenames: false
lvkit-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Ryan Friedman
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
lvkit-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: lvkit
3
+ Version: 0.1.0
4
+ Summary: Understand and convert LabVIEW VIs to Python without a LabVIEW license
5
+ Project-URL: Repository, https://github.com/pragmatest-dev/lvkit
6
+ Project-URL: Issues, https://github.com/pragmatest-dev/lvkit/issues
7
+ Author: Pragmatest
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: ast,code-generation,labview,mcp,ni,static-analysis,vi
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Software Development :: Code Generators
24
+ Classifier: Topic :: Software Development :: Compilers
25
+ Classifier: Topic :: Software Development :: Disassemblers
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: mcp>=0.9.0
28
+ Requires-Dist: networkx
29
+ Requires-Dist: pydantic>=2.0.0
30
+ Requires-Dist: pylabview
31
+ Description-Content-Type: text/markdown
32
+
33
+ # lvkit
34
+
35
+ Read, document, diff, and convert LabVIEW VI files — no LabVIEW license required.
36
+
37
+ lvkit parses `.vi`, `.ctl`, `.lvclass`, and `.lvlib` files directly into queryable dependency and dataflow graphs. Use it to document code, track changes in CI, feed VI structure to AI tools, or generate equivalent Python.
38
+
39
+ ## Contents
40
+
41
+ - [Quick Start](#quick-start)
42
+ - [What you can do with it](#what-you-can-do-with-it)
43
+ - [CLI Commands](#cli-commands)
44
+ - [How it works](#how-it-works)
45
+ - [AI and IDE integration](#ai-and-ide-integration)
46
+ - [Cleanroom approach](#cleanroom-approach)
47
+ - [Development](#development)
48
+
49
+ ## Quick Start
50
+
51
+ ```bash
52
+ pip install lvkit
53
+ lvkit init --skills all # create .lvkit/ + install Claude Code and Copilot skills
54
+ ```
55
+
56
+ * Use `--skills claude` or `--skills copilot` to install for one AI agent only.
57
+ * Use `lvkit init` alone if you don't want any AI agent skills installed.
58
+
59
+ ## What you can do with it
60
+
61
+ ### Describe what a VI does
62
+ Get a human-readable signature, inputs/outputs, operations, and control flow — without opening LabVIEW. Never requires primitive or vi.lib mappings.
63
+
64
+ ```
65
+ lvkit describe <path-to.vi> [--search-path <libraries/>] [--chart]
66
+ ```
67
+
68
+ `--chart` adds a Mermaid flowchart of the block diagram.
69
+
70
+ ### Generate documentation
71
+ Cross-referenced HTML docs for a `.vi`, `.lvlib`, or `.lvclass` — inputs, outputs, operations, wiring diagrams.
72
+
73
+ ```
74
+ lvkit docs <input-path> <output-dir> [--search-path <libraries/>]
75
+ ```
76
+
77
+ ### Diff two versions of a VI
78
+ See what changed between two `.vi` files — added/removed terminals, changed operations, rewired connections. Useful in code review and CI.
79
+
80
+ ```
81
+ lvkit diff <vi-a> <vi-b> [--long]
82
+ ```
83
+
84
+ `--long` gives a structured change report instead of a unified diff.
85
+
86
+ ### Generate Python
87
+ Convert a VI, library, or class to Python. Deterministic — same VI in, same Python out, every run, no LLM involved.
88
+
89
+ ```
90
+ lvkit generate <input-path> -o <output-dir> [--search-path <libraries>] [--placeholder-on-unresolved]
91
+ ```
92
+
93
+ `--placeholder-on-unresolved` lets the build succeed when mappings are missing — unresolved calls become inline `raise PrimitiveResolutionNeeded(...)` in the output so you can track them down at runtime.
94
+
95
+ Coverage is incremental — see [Cleanroom approach](#cleanroom-approach) for what that means in practice.
96
+
97
+ ## CLI Commands
98
+
99
+ | Command | Description |
100
+ |---------|-------------|
101
+ | `lvkit describe` | Human-readable VI description with signature and operations |
102
+ | `lvkit docs` | Generate cross-referenced HTML documentation |
103
+ | `lvkit diff` | Compare two VI versions — terminals, operations, wiring |
104
+ | `lvkit visualize` | Mermaid flowchart or interactive dependency graph |
105
+ | `lvkit generate` | Generate Python from a VI, library, or class |
106
+ | `lvkit structure` | Inspect `.lvlib` or `.lvclass` structure |
107
+ | `lvkit init` | Create `.lvkit/` resolution store; install AI editor skills |
108
+ | `lvkit mcp` | Start the MCP server for IDE integration |
109
+
110
+ `lvkit visualize --format interactive` requires `pip install pyvis`. All other commands work on a bare `pip install lvkit`.
111
+
112
+ ## How it works
113
+
114
+ lvkit reads VI binaries directly — no LabVIEW installation required. The pipeline has three stages:
115
+
116
+ 1. **Parse** — the VI binary is extracted to XML (via [pylabview](https://github.com/mefistotelis/pylabview)), then parsed into a typed representation of the block diagram: nodes, wires, constants, types, and front panel terminals.
117
+
118
+ 2. **Graph** — all loaded VIs are linked into a graph that captures two things: the dependency tree (which VIs call which) and the dataflow within each VI (how data moves between operations). This is what `describe`, `docs`, `diff`, and `visualize` query — no semantic mappings needed.
119
+
120
+ 3. **Generate** — the graph is walked deterministically to produce Python source, HTML documentation, or flowcharts. Code generation is pure AST construction: same VI in, same output every run, no LLM.
121
+
122
+ See [`docs/graph-reference.md`](docs/graph-reference.md) for the full graph type reference.
123
+
124
+ ## AI and IDE integration
125
+
126
+ The CLI works standalone from any terminal or CI script. For deeper IDE integration, lvkit ships two optional layers.
127
+
128
+ **AI editor skills** — install lvkit's built-in workflows into Claude Code or Copilot so your AI can describe VIs, convert them, and resolve unknowns without you writing prompts. All five workflows call the CLI under the hood — no MCP server required.
129
+
130
+ ```bash
131
+ lvkit init --skills claude # installs .claude/skills/lvkit-*
132
+ lvkit init --skills copilot # installs .github/prompts/ + router instruction
133
+ lvkit init --skills all # both
134
+ ```
135
+
136
+ Five workflows ship: `lvkit-describe`, `lvkit-convert`, `lvkit-resolve-primitive`, `lvkit-resolve-vilib`, `lvkit-idiomatic`.
137
+
138
+ **MCP server** — for interactive IDE sessions where your AI needs to load a graph, walk wires, and ask follow-up questions across multiple VIs:
139
+
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "lvkit": { "command": "uvx", "args": ["--from", "lvkit", "lvkit-mcp"] }
144
+ }
145
+ }
146
+ ```
147
+
148
+ | Tool | Description |
149
+ |------|-------------|
150
+ | `load` | Load VI into the in-memory graph |
151
+ | `list_loaded` | List loaded VIs |
152
+ | `get_context` | Full VI context: inputs, outputs, operations, wires |
153
+ | `generate_ast_code` | Generate Python from a loaded VI |
154
+ | `describe` | Human-readable VI description |
155
+ | `get_operations` | List operations in a VI |
156
+ | `get_dataflow` | Show wire connections |
157
+ | `get_structure` | Inspect a structure node (loop, case, sequence) |
158
+ | `get_constants` | List constant values |
159
+ | `analyze` | Parse and describe VI structure (stateless) |
160
+ | `generate_documents` | Generate HTML docs for VIs/libraries (stateless) |
161
+ | `generate_python` | Generate Python from a VI (stateless) |
162
+
163
+ ## Cleanroom approach
164
+
165
+ lvkit has no access to LabVIEW source code or runtime. LabVIEW's built-in primitives and standard library VIs are **semantically replaced**: each operation is mapped to an equivalent Python implementation in JSON data files (`src/lvkit/data/primitives.json`, `src/lvkit/data/vilib/`). These mappings are built from published documentation and observed behavior.
166
+
167
+ Coverage is incremental. When `lvkit generate` encounters an unmapped primitive or vi.lib VI, it raises an error with diagnostic context so the mapping can be added. `describe`, `docs`, `diff`, and `visualize` are unaffected — they work from the graph, not the semantic mappings.
168
+
169
+ ### Project-local resolution store (`.lvkit/`)
170
+
171
+ If you have a LabVIEW license, you can supplement the bundled mappings with a `.lvkit/` directory derived from your own install. lvkit reads `.lvkit/` first and falls back to its bundled data. The skills installed by `lvkit init` detect whether you're a lvkit maintainer or a downstream user and write mappings to the right destination.
172
+
173
+ When `lvkit generate` hits an unknown, you have two options:
174
+
175
+ 1. **Resolve up front** — install the resolve skills (`lvkit init --skills claude`) and let your AI editor write the mapping into `.lvkit/`.
176
+ 2. **Defer to runtime** — pass `--placeholder-on-unresolved`. lvkit emits an inline `raise PrimitiveResolutionNeeded(...)` in the generated Python with full diagnostic context. The build succeeds; runtime fails at the unresolved call.
177
+
178
+ ## Development
179
+
180
+ ```bash
181
+ uv sync
182
+ pytest
183
+ ruff check .
184
+ python -m pyright src/
185
+ ```
186
+
187
+ See [`CLAUDE.md`](CLAUDE.md) for contributor workflow, code style, and how to add primitive or vi.lib mappings.
188
+
189
+ ## License
190
+
191
+ Apache-2.0. See [LICENSE](LICENSE).
192
+
193
+ ## Further reading
194
+
195
+ - [`docs/graph-reference.md`](docs/graph-reference.md) — graph type reference (nodes, VIContext, operations, wires)
196
+ - [`docs/vi-xml-reference.md`](docs/vi-xml-reference.md) — pylabview XML format reference
197
+ - [`docs/highlight-reel.md`](docs/highlight-reel.md) — design narrative and architecture decisions
198
+ - [`docs/demo-script.md`](docs/demo-script.md) — 30-minute demo script / tutorial
199
+ - [pylabview](https://github.com/mefistotelis/pylabview) — the VI binary parser lvkit builds on