sysml-validate 0.10.15

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 (121) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +190 -0
  3. package/out/main.js +68477 -0
  4. package/out/main.js.map +7 -0
  5. package/package.json +57 -0
  6. package/resources/sysml.dimension-table.json +1 -0
  7. package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
  8. package/resources/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
  9. package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
  10. package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
  11. package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
  12. package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
  13. package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
  14. package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
  15. package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
  16. package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
  17. package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
  18. package/resources/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
  19. package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
  20. package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
  21. package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
  22. package/resources/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
  23. package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
  24. package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
  25. package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
  26. package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
  27. package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
  28. package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
  29. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
  30. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
  31. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
  32. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
  33. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
  34. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
  35. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
  36. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
  37. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
  38. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
  39. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
  40. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
  41. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
  42. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
  43. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
  44. package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
  45. package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
  46. package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
  47. package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
  48. package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
  49. package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
  50. package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
  51. package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
  52. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
  53. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
  54. package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
  55. package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
  56. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
  57. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
  58. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +177 -0
  59. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
  60. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
  61. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
  62. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
  63. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
  64. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
  65. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
  66. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
  67. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
  68. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
  69. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
  70. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
  71. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
  72. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
  73. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
  74. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
  75. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
  76. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
  77. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
  78. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
  79. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
  80. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
  81. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
  82. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
  83. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
  84. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
  85. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
  86. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
  87. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
  88. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
  89. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
  90. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
  91. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
  92. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
  93. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
  94. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
  95. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
  96. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
  97. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
  98. package/resources/sysml.library/LICENSE +277 -0
  99. package/resources/sysml.library/NOTICE.md +20 -0
  100. package/resources/sysml.library/Systems Library/Actions.sysml +557 -0
  101. package/resources/sysml.library/Systems Library/Allocations.sysml +29 -0
  102. package/resources/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
  103. package/resources/sysml.library/Systems Library/Attributes.sysml +25 -0
  104. package/resources/sysml.library/Systems Library/Calculations.sysml +37 -0
  105. package/resources/sysml.library/Systems Library/Cases.sysml +71 -0
  106. package/resources/sysml.library/Systems Library/Connections.sysml +60 -0
  107. package/resources/sysml.library/Systems Library/Constraints.sysml +44 -0
  108. package/resources/sysml.library/Systems Library/Flows.sysml +126 -0
  109. package/resources/sysml.library/Systems Library/Interfaces.sysml +89 -0
  110. package/resources/sysml.library/Systems Library/Items.sysml +153 -0
  111. package/resources/sysml.library/Systems Library/Metadata.sysml +32 -0
  112. package/resources/sysml.library/Systems Library/Parts.sysml +81 -0
  113. package/resources/sysml.library/Systems Library/Ports.sysml +54 -0
  114. package/resources/sysml.library/Systems Library/Requirements.sysml +194 -0
  115. package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
  116. package/resources/sysml.library/Systems Library/States.sysml +103 -0
  117. package/resources/sysml.library/Systems Library/SysML.sysml +539 -0
  118. package/resources/sysml.library/Systems Library/UseCases.sysml +57 -0
  119. package/resources/sysml.library/Systems Library/VerificationCases.sysml +103 -0
  120. package/resources/sysml.library/Systems Library/Views.sysml +164 -0
  121. package/resources/sysml.library.index.json +1 -0
package/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ SysML v2 Visual Studio Code Extension
2
+ Freeware License
3
+
4
+ Copyright (c) 2026 C. Ilie
5
+
6
+ Permission is granted to install and use this software free of charge.
7
+
8
+ The software is licensed, not sold.
9
+
10
+ You may:
11
+ - Use the software for personal purposes.
12
+ - Use the software for educational purposes.
13
+ - Use the software for commercial purposes.
14
+
15
+ You may not:
16
+ - Modify the software.
17
+ - Reverse engineer the software except where required by law.
18
+ - Redistribute the software.
19
+ - Sublicense the software.
20
+ - Sell the software.
21
+ - Create derivative works.
22
+
23
+ All intellectual property rights remain with the copyright holder.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
26
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
27
+ DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # sysml-validate
2
+
3
+ Headless SysML v2 / KerML validation. Runs the same parser, linker, and
4
+ diagnostics as the
5
+ [SysML v2 VS Code extension](https://marketplace.visualstudio.com/items?itemName=voidaliot.vscode-sysml-v2)
6
+ — the Problems panel, in a terminal or a CI job. No VS Code, no browser, no
7
+ display server.
8
+
9
+ ```bash
10
+ npx sysml-validate models/
11
+ ```
12
+
13
+ ```
14
+ models/control.sysml
15
+ 2:5 error SYN067 Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
16
+
17
+ models/vehicle.sysml
18
+ 12:23 error RES001 Could not resolve reference to Element named 'Engien'.
19
+
20
+ ✖ 2 problems (2 errors) in 2 of 2 files
21
+ ```
22
+
23
+ …and when the model is healthy:
24
+
25
+ ```
26
+ ✓ 2 files checked, no problems found
27
+ ```
28
+
29
+ Colour is used on a terminal and dropped everywhere else — a pipe, a log file,
30
+ or a coding agent's chat window gets exactly the plain text above. `--color` and
31
+ `--no-color` force it either way, and `NO_COLOR` is honoured.
32
+
33
+ ## Usage
34
+
35
+ ```
36
+ sysml-validate [paths...] [options]
37
+
38
+ --format <fmt> text | compact | json | sarif | github (default: text).
39
+ text grouped and aligned, colour on a terminal
40
+ compact file:line:col: severity [CODE]: message
41
+ --out <path> Write the report to a file instead of stdout.
42
+ --strict Fail on warnings as well as errors.
43
+ --max-warnings <n> Fail when more than n warnings are reported.
44
+ --all Report informational notices and hints too.
45
+ --lint-profile <p> Override sysml.lint.profile: default | quiet | strict.
46
+ --workspace <path> Project root holding .vscode/ (default: auto-detected).
47
+ --no-config Ignore .vscode/settings.json and .vscode/sysml/project.json.
48
+ --library <path> Standard-library directory (default: the bundled library).
49
+ --color, --no-color Force ANSI colour on or off (default: on a terminal only).
50
+ ```
51
+
52
+ Paths may be files or directories; directories are searched recursively for
53
+ `.sysml` and `.kerml`, skipping `node_modules`, VCS directories, build output,
54
+ and vendored library trees. With no path, the working directory is checked.
55
+
56
+ The OMG standard library ships with the package, so `Real`, `ISQ::*`, `SI::*`
57
+ and the rest resolve with nothing else installed.
58
+
59
+ ## Examples
60
+
61
+ **Check one file while you work.** Paths, positions, severity, and the
62
+ diagnostic code — everything needed to jump to the problem:
63
+
64
+ ```console
65
+ $ sysml-validate models/vehicle.sysml
66
+ models/vehicle.sysml
67
+ 12:23 error RES001 Could not resolve reference to Element named 'Engien'.
68
+
69
+ ✖ 1 problem (1 error) in 1 of 1 file
70
+ ```
71
+
72
+ **See the advisory notices too.** Hints and info are out of the way by default —
73
+ `--all` brings them in:
74
+
75
+ ```console
76
+ $ sysml-validate models/ --all
77
+ models/vehicle.sysml
78
+ 5:19 hint RES016 'power' shadows a standard-library element of the same name; the library symbol is hidden in this scope.
79
+ 16:21 hint SEM006 Requirement definition 'MassLimit' has no 'subject' declaration.
80
+
81
+ ▲ 2 problems (2 hints) in 1 of 2 files
82
+ ```
83
+
84
+ **One line per problem** for `grep`, an editor error matcher, or a coding agent
85
+ that wants to parse the output:
86
+
87
+ ```console
88
+ $ sysml-validate models/ --format compact
89
+ models/control.sysml:2:5: error [SYN067]: Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
90
+ models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
91
+ ```
92
+
93
+ Compact prints **nothing at all** on a clean run, so `[ -s report.txt ]` and
94
+ `if sysml-validate . --format compact | grep .` both behave.
95
+
96
+ **Structured output** for a script or a dashboard:
97
+
98
+ ```console
99
+ $ sysml-validate models/ --format json | jq '.counts, .diagnostics[0].code'
100
+ {
101
+ "error": 2,
102
+ "warning": 0,
103
+ "info": 0,
104
+ "hint": 0
105
+ }
106
+ "SYN067"
107
+ ```
108
+
109
+ **Gate a commit hook** on errors, and allow a small warning budget:
110
+
111
+ ```console
112
+ $ sysml-validate models/ --max-warnings 5 && echo "model is publishable"
113
+ ```
114
+
115
+ **Check just what changed**, letting the rest of the project resolve around it:
116
+
117
+ ```console
118
+ $ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate
119
+ ```
120
+
121
+ Cross-file references still resolve: the whole project is indexed for lookups,
122
+ while only the files you name are reported on.
123
+
124
+ **Use it from a coding agent.** The default output is plain text with a stable
125
+ one-line summary, so an agent can act on it directly:
126
+
127
+ ```console
128
+ $ sysml-validate models/ --format compact ; echo "exit=$?"
129
+ models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
130
+ exit=1
131
+ ```
132
+
133
+ ## Your project's configuration is honoured
134
+
135
+ The validator reads the settings your team commits, in the editor's own
136
+ precedence — `.vscode/settings.json` first, then `.vscode/sysml/project.json`:
137
+
138
+ | Setting | Effect |
139
+ |---|---|
140
+ | `sysml.lint.profile` | `default` / `quiet` / `strict` style-notice volume |
141
+ | `sysml.validation.severities` | Per-code severity overrides (e.g. `{ "SEM006": "warning" }`) |
142
+ | `sysml.diagnostics.unusedImports` | `off` / `warning` / `error` |
143
+ | `sysml.diagnostics.units` | UNIT001–UNIT005 dimensional analysis on/off |
144
+
145
+ `--lint-profile` overrides the profile for one run, and `--no-config` ignores
146
+ both files. Note that `sysml.validation.severities` covers the validator's own
147
+ codes; unresolved-reference errors (`RES001`) come from the linker and are
148
+ always errors.
149
+
150
+ ## Exit codes
151
+
152
+ | Code | Meaning |
153
+ |---|---|
154
+ | `0` | no blocking diagnostics |
155
+ | `1` | errors, or warnings under `--strict` / `--max-warnings` |
156
+ | `2` | the command line or the environment was wrong (bad flag, unreadable path) |
157
+
158
+ Informational notices and hints never fail a run; they are only printed with
159
+ `--all`.
160
+
161
+ ## GitHub Actions
162
+
163
+ Fail the build on model errors, with inline annotations on the diff:
164
+
165
+ ```yaml
166
+ - uses: actions/setup-node@v4
167
+ with: { node-version: 20 }
168
+
169
+ - name: Validate the SysML model
170
+ run: npx sysml-validate models/ --format github --strict
171
+ ```
172
+
173
+ Or upload SARIF so diagnostics land in **Security → Code scanning** and on the
174
+ pull request:
175
+
176
+ ```yaml
177
+ - name: Validate the SysML model
178
+ run: npx sysml-validate models/ --format sarif --out sysml.sarif
179
+ continue-on-error: true
180
+
181
+ - uses: github/codeql-action/upload-sarif@v3
182
+ with:
183
+ sarif_file: sysml.sarif
184
+ ```
185
+
186
+ ## License
187
+
188
+ The CLI uses the extension's Freeware License (see `LICENSE`). The vendored OMG
189
+ standard library under `resources/sysml.library` keeps its upstream OMG
190
+ LICENSE / LICENSE-GPL terms; see that directory's `NOTICE.md`.