@metamesh/generator-sdk 0.14.0 → 0.16.0

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 (197) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/contracts.d.ts +9 -2
  3. package/dist/contracts.d.ts.map +1 -1
  4. package/dist/docs/guides/authoring.md +12 -16
  5. package/dist/docs/guides/parameters.md +47 -52
  6. package/dist/docs/manifest.json +25 -6
  7. package/dist/docs/reference/fonts/FontSelection.md +1 -1
  8. package/dist/docs/reference/fonts/isFontSelection.md +1 -1
  9. package/dist/docs/reference/index/ArrayParameterDefinition.md +1 -1
  10. package/dist/docs/reference/index/BaseParameterDefinition.md +1 -1
  11. package/dist/docs/reference/index/BooleanParameterDefinition.md +1 -1
  12. package/dist/docs/reference/index/ChoiceOption.md +1 -1
  13. package/dist/docs/reference/index/ChoiceParameterDefinition.md +1 -1
  14. package/dist/docs/reference/index/ChoiceSetParameterDefinition.md +1 -1
  15. package/dist/docs/reference/index/ColorParameterDefinition.md +1 -1
  16. package/dist/docs/reference/index/ConditionExpression.md +1 -1
  17. package/dist/docs/reference/index/ContourAnchor.md +1 -1
  18. package/dist/docs/reference/index/ContourParameterDefinition.md +1 -1
  19. package/dist/docs/reference/index/ContourParameterUi.md +1 -1
  20. package/dist/docs/reference/index/ContourPoint.md +1 -1
  21. package/dist/docs/reference/index/ContourSegment.md +1 -1
  22. package/dist/docs/reference/index/ContourValue.md +1 -1
  23. package/dist/docs/reference/index/FontParameterDefinition.md +1 -1
  24. package/dist/docs/reference/index/FontSelection.md +1 -1
  25. package/dist/docs/reference/index/GeneratorDefinition.md +1 -1
  26. package/dist/docs/reference/index/GeneratorIssue.md +1 -1
  27. package/dist/docs/reference/index/GeneratorModule.md +1 -1
  28. package/dist/docs/reference/index/GeneratorModuleOptions.md +1 -1
  29. package/dist/docs/reference/index/GeneratorParamId.md +1 -1
  30. package/dist/docs/reference/index/GeneratorParams.md +1 -1
  31. package/dist/docs/reference/index/GeneratorPreset.md +1 -1
  32. package/dist/docs/reference/index/GeneratorProgram.md +1 -1
  33. package/dist/docs/reference/index/GeneratorServices.md +1 -1
  34. package/dist/docs/reference/index/GeneratorTextArcBaseline.md +2 -2
  35. package/dist/docs/reference/index/GeneratorTextLayout.md +1 -1
  36. package/dist/docs/reference/index/GeneratorTextMetrics.md +1 -1
  37. package/dist/docs/reference/index/GeneratorTextOptions.md +1 -1
  38. package/dist/docs/reference/index/MAX_CONTOUR_SEGMENTS.md +1 -1
  39. package/dist/docs/reference/index/MAX_SIDE_PROFILE_SEGMENTS.md +1 -1
  40. package/dist/docs/reference/index/NumberArrayItemDefinition.md +1 -1
  41. package/dist/docs/reference/index/NumberArrayParameterDefinition.md +1 -1
  42. package/dist/docs/reference/index/NumberParameterDefinition.md +1 -1
  43. package/dist/docs/reference/index/NumberParameterUi.md +1 -1
  44. package/dist/docs/reference/index/ParameterDefinition.md +1 -1
  45. package/dist/docs/reference/index/ParameterDefinitionDocument.md +1 -1
  46. package/dist/docs/reference/index/ParameterGroup.md +1 -1
  47. package/dist/docs/reference/index/ParameterIssue.md +1 -1
  48. package/dist/docs/reference/index/ParameterIssueCode.md +1 -1
  49. package/dist/docs/reference/index/ParameterIssueSeverity.md +1 -1
  50. package/dist/docs/reference/index/ParameterScaleReference.md +1 -1
  51. package/dist/docs/reference/index/ParameterUi.md +1 -1
  52. package/dist/docs/reference/index/ParameterValidationResult.md +1 -1
  53. package/dist/docs/reference/index/ParameterValue.md +1 -1
  54. package/dist/docs/reference/index/ParameterValues.md +1 -1
  55. package/dist/docs/reference/index/RowParameterUi.md +1 -1
  56. package/dist/docs/reference/index/ScalarParameterValue.md +1 -1
  57. package/dist/docs/reference/index/SideProfileAnchor.md +1 -1
  58. package/dist/docs/reference/index/SideProfileParameterDefinition.md +1 -1
  59. package/dist/docs/reference/index/SideProfileParameterUi.md +1 -1
  60. package/dist/docs/reference/index/SideProfilePoint.md +1 -1
  61. package/dist/docs/reference/index/SideProfileSegment.md +1 -1
  62. package/dist/docs/reference/index/SideProfileValue.md +1 -1
  63. package/dist/docs/reference/index/SourceVisibility.md +1 -1
  64. package/dist/docs/reference/index/StringArrayItemDefinition.md +1 -1
  65. package/dist/docs/reference/index/StringArrayParameterDefinition.md +1 -1
  66. package/dist/docs/reference/index/SvgParameterDefinition.md +1 -1
  67. package/dist/docs/reference/index/TextParameterDefinition.md +1 -1
  68. package/dist/docs/reference/index/UNPREPARED_GENERATOR_SERVICES.md +1 -1
  69. package/dist/docs/reference/index/cloneContourValue.md +1 -1
  70. package/dist/docs/reference/index/cloneSideProfileValue.md +1 -1
  71. package/dist/docs/reference/index/contourValuesEqual.md +1 -1
  72. package/dist/docs/reference/index/defineGenerator.md +1 -1
  73. package/dist/docs/reference/index/defineGeneratorModule.md +1 -1
  74. package/dist/docs/reference/index/definePresets.md +1 -1
  75. package/dist/docs/reference/index/evaluateCondition.md +1 -1
  76. package/dist/docs/reference/index/isContourValue.md +1 -1
  77. package/dist/docs/reference/index/isFontSelection.md +1 -1
  78. package/dist/docs/reference/index/isSideProfileValue.md +1 -1
  79. package/dist/docs/reference/index/sideProfileValuesEqual.md +1 -1
  80. package/dist/docs/reference/packages/GENERATOR_PACKAGE_FORMAT_VERSION.md +1 -1
  81. package/dist/docs/reference/packages/GeneratorAccess.md +1 -1
  82. package/dist/docs/reference/packages/GeneratorDefinitionIssue.md +1 -1
  83. package/dist/docs/reference/packages/GeneratorDefinitionParseResult.md +1 -1
  84. package/dist/docs/reference/packages/GeneratorDescriptor.md +1 -1
  85. package/dist/docs/reference/packages/GeneratorPackageManifest.md +1 -1
  86. package/dist/docs/reference/packages/GeneratorPackageSource.md +1 -1
  87. package/dist/docs/reference/packages/GeneratorPackageValidationError.md +1 -1
  88. package/dist/docs/reference/packages/GeneratorPreset.md +1 -1
  89. package/dist/docs/reference/packages/GeneratorRuntimeReference.md +1 -1
  90. package/dist/docs/reference/packages/InstalledGenerator.md +1 -1
  91. package/dist/docs/reference/packages/MAX_ARRAY_ITEMS.md +1 -1
  92. package/dist/docs/reference/packages/MAX_CONDITION_BRANCHES.md +1 -1
  93. package/dist/docs/reference/packages/MAX_CONDITION_DEPTH.md +1 -1
  94. package/dist/docs/reference/packages/MAX_DESCRIPTOR_LIST_ITEMS.md +1 -1
  95. package/dist/docs/reference/packages/MAX_GENERATOR_ID_LENGTH.md +1 -1
  96. package/dist/docs/reference/packages/MAX_GENERATOR_PACKAGE_BYTES.md +1 -1
  97. package/dist/docs/reference/packages/MAX_GENERATOR_PRESETS.md +1 -1
  98. package/dist/docs/reference/packages/MAX_METADATA_TEXT_LENGTH.md +1 -1
  99. package/dist/docs/reference/packages/MAX_PARAMETERS.md +1 -1
  100. package/dist/docs/reference/packages/MAX_PARAMETER_GROUPS.md +1 -1
  101. package/dist/docs/reference/packages/MAX_PARAMETER_OPTIONS.md +1 -1
  102. package/dist/docs/reference/packages/MAX_TEXT_PARAMETER_LENGTH.md +1 -1
  103. package/dist/docs/reference/packages/METAMESH_RUNTIME_VERSION.md +2 -2
  104. package/dist/docs/reference/packages/compareSemanticVersions.md +1 -1
  105. package/dist/docs/reference/packages/definitionIssuesFromZod.md +1 -1
  106. package/dist/docs/reference/packages/isRuntimeCompatible.md +1 -1
  107. package/dist/docs/reference/packages/parseGeneratorDefinition.md +1 -1
  108. package/dist/docs/reference/packages/parseGeneratorDescriptor.md +1 -1
  109. package/dist/docs/reference/packages/parseGeneratorPackageManifest.md +1 -1
  110. package/dist/docs/reference/packages/parseParameterDefinitionDocument.md +1 -1
  111. package/dist/docs/reference/packages/safeParseGeneratorDefinition.md +1 -1
  112. package/dist/docs/reference/packages/safeParseParameterDefinitionDocument.md +1 -1
  113. package/dist/docs/reference/packages/validateGeneratorPresets.md +1 -1
  114. package/dist/docs/reference/packages/validationErrorFromIssues.md +1 -1
  115. package/dist/docs/reference/packages/validationErrorFromZod.md +1 -1
  116. package/dist/docs/reference/parameters/EMPTY_SVG_PARAMETER_DEFAULT.md +1 -1
  117. package/dist/docs/reference/parameters/MAX_PARAMETER_ISSUES.md +1 -1
  118. package/dist/docs/reference/parameters/MAX_PARAMETER_ISSUE_MESSAGE_LENGTH.md +1 -1
  119. package/dist/docs/reference/parameters/MAX_PROJECT_SVG_PARAMETER_BYTES.md +1 -1
  120. package/dist/docs/reference/parameters/MAX_SVG_PARAMETER_BYTES.md +1 -1
  121. package/dist/docs/reference/parameters/ParamCodec.md +1 -1
  122. package/dist/docs/reference/parameters/ParamDecodeCode.md +1 -1
  123. package/dist/docs/reference/parameters/ParamDecodeError.md +1 -1
  124. package/dist/docs/reference/parameters/ParamDecodeIssue.md +1 -1
  125. package/dist/docs/reference/parameters/ParamParseResult.md +1 -1
  126. package/dist/docs/reference/parameters/PreparedParameters.md +1 -1
  127. package/dist/docs/reference/parameters/aggregateParameterIssues.md +1 -1
  128. package/dist/docs/reference/parameters/canonicalizeParameters.md +1 -1
  129. package/dist/docs/reference/parameters/createParamCodec.md +1 -1
  130. package/dist/docs/reference/parameters/getDefaultParameters.md +1 -1
  131. package/dist/docs/reference/parameters/normalizeParameters.md +1 -1
  132. package/dist/docs/reference/parameters/parameterValueEquals.md +1 -1
  133. package/dist/docs/reference/parameters/parseParameterIssues.md +1 -1
  134. package/dist/docs/reference/parameters/prepareParameters.md +1 -1
  135. package/dist/docs/reference/parameters/svgParameterBytes.md +1 -1
  136. package/dist/docs/reference/parameters/validateParameters.md +1 -1
  137. package/dist/docs/reference/runtime/ExecuteGeneratorOptions.md +1 -1
  138. package/dist/docs/reference/runtime/Export3mfRequest.md +1 -1
  139. package/dist/docs/reference/runtime/ExportError.md +1 -1
  140. package/dist/docs/reference/runtime/ExportSuccess.md +1 -1
  141. package/dist/docs/reference/runtime/ExportedFile.md +1 -1
  142. package/dist/docs/reference/runtime/GenerateRequest.md +1 -1
  143. package/dist/docs/reference/runtime/GeneratedModel.md +1 -1
  144. package/dist/docs/reference/runtime/GeneratedModelDelivery.md +1 -1
  145. package/dist/docs/reference/runtime/GeneratedPart.md +1 -1
  146. package/dist/docs/reference/runtime/GeneratedPartDelivery.md +1 -1
  147. package/dist/docs/reference/runtime/GeneratedPartsDecoder.md +1 -1
  148. package/dist/docs/reference/runtime/GeneratedPartsLimits.md +1 -1
  149. package/dist/docs/reference/runtime/GenerationError.md +1 -1
  150. package/dist/docs/reference/runtime/GenerationInvalid.md +1 -1
  151. package/dist/docs/reference/runtime/GenerationSuccess.md +1 -1
  152. package/dist/docs/reference/runtime/GeneratorExecutionGenerated.md +1 -1
  153. package/dist/docs/reference/runtime/GeneratorExecutionInvalid.md +1 -1
  154. package/dist/docs/reference/runtime/GeneratorExecutionResult.md +1 -1
  155. package/dist/docs/reference/runtime/MeshTopologyMode.md +1 -1
  156. package/dist/docs/reference/runtime/ModelBounds.md +1 -1
  157. package/dist/docs/reference/runtime/ModelStats.md +11 -4
  158. package/dist/docs/reference/runtime/ModelTimings.md +1 -1
  159. package/dist/docs/reference/runtime/ParsedGeneratorModule.md +1 -1
  160. package/dist/docs/reference/runtime/RuntimeError.md +1 -1
  161. package/dist/docs/reference/runtime/ValidateRequest.md +1 -1
  162. package/dist/docs/reference/runtime/ValidationError.md +1 -1
  163. package/dist/docs/reference/runtime/ValidationSuccess.md +1 -1
  164. package/dist/docs/reference/runtime/WorkerRequest.md +1 -1
  165. package/dist/docs/reference/runtime/WorkerResponse.md +1 -1
  166. package/dist/docs/reference/runtime/executeGenerator.md +1 -1
  167. package/dist/docs/reference/runtime/generationIssues.md +1 -1
  168. package/dist/docs/reference/runtime/isGeneratorModule.md +1 -1
  169. package/dist/docs/reference/runtime/parseGeneratedParts.md +1 -1
  170. package/dist/docs/reference/runtime/parseGenerationSentAt.md +1 -1
  171. package/dist/docs/reference/runtime/parseGeneratorModule.md +1 -1
  172. package/dist/generator-package/constants.d.ts +1 -1
  173. package/dist/generator-package/constants.d.ts.map +1 -1
  174. package/dist/generator-package/constants.js +2 -1
  175. package/dist/generator-package/constants.js.map +1 -1
  176. package/dist/generator-package/validate-manifest.d.ts.map +1 -1
  177. package/dist/generator-package/validate-manifest.js +4 -3
  178. package/dist/generator-package/validate-manifest.js.map +1 -1
  179. package/dist/generator-package/versions.spec.d.ts +2 -0
  180. package/dist/generator-package/versions.spec.d.ts.map +1 -0
  181. package/dist/generator-package/versions.spec.js +12 -0
  182. package/dist/generator-package/versions.spec.js.map +1 -0
  183. package/dist/generator-services.d.ts +1 -1
  184. package/dist/generator-services.d.ts.map +1 -1
  185. package/dist/parameters/recovery.d.ts +1 -2
  186. package/dist/parameters/recovery.d.ts.map +1 -1
  187. package/dist/parameters/recovery.js +39 -45
  188. package/dist/parameters/recovery.js.map +1 -1
  189. package/dist/parameters/strict.js +3 -3
  190. package/dist/parameters/strict.js.map +1 -1
  191. package/dist/parameters/values.d.ts.map +1 -1
  192. package/dist/parameters/values.js +2 -10
  193. package/dist/parameters/values.js.map +1 -1
  194. package/dist/runtime/generated-parts.d.ts.map +1 -1
  195. package/dist/runtime/generated-parts.js +9 -2
  196. package/dist/runtime/generated-parts.js.map +1 -1
  197. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @metamesh/generator-sdk
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fbd7276: Standardize immutable value interchange on domain names, Data representations, Input construction
8
+ forms, and toData(). Rename vector tuples and transform matrices to Vector2Data/Vector3Data and
9
+ Transform2Data/Transform3Data. Path2Data and Path3Data now preserve dimension, points, and closure;
10
+ path factories accept complete data records as well as coordinate collections. Advance the host
11
+ runtime to major 8 for the new value protocol, and update consumers, examples, and references.
12
+ - 1585391: Add immutable `bounds2()` and `bounds3()` values with fluent measurements, positioned containment,
13
+ and plain-data conversion. Path bounds now return these values. Rename plain bounds records to
14
+ `Bounds2Data` and `Bounds3Data` across geometry, model snapshots, CLI captures, and Testkit contracts.
15
+ Bounds values in recipe inputs and computed data use the runtime 8 value interchange protocol.
16
+ - 29e19a5: Add portable knuckle hinge joint recipes and a pure layout resolver, with captive, inserted-pin,
17
+ and lift-off construction, independent per-half mounting webs, and shared bounded physical sampling.
18
+ Per-half `barrelChamfer` sets the 45-degree outer-rim setback at both ends of every barrel;
19
+ web `zMin` places the lower face in the pin-centered frame, both in millimetres.
20
+ The operation uses the runtime 8 modeling contract.
21
+
22
+ ## 0.15.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 25561f6: Consolidate sampled paths into immutable `path2` and `path3` values with explicit closure,
27
+ transformation, resampling, measurements, and closest-point queries. Geometry accepts paths and
28
+ fluent vector collections directly; tuple path data is named `Path2Data` and `Path3Data`.
29
+ Remove redundant public path query and transform helpers and move mesh observation to
30
+ `solid.toTriangleMesh()`. Runtime protocol 7 rejects incompatible older compiled generators.
31
+
32
+ Complete dimensional XY patterning and fluent geometry interoperability. Consolidate degree-based
33
+ attachment options under `AttachOptions` and primitive `attachment`, rename immutable tolerance
34
+ changes to `withTolerance`, and use `analyzeTriangleMesh` as the single mesh measurement operation.
35
+ Geometry and text validation report structured errors; host lifecycle and copying contracts are explicit.
36
+
37
+ Use concise value factories and semantic degree options, including `anchor3`, `threadProfile`,
38
+ attachment `spin`, full thread `includedAngle`, and revolution `degrees`. Segment intersections use
39
+ `castSegment`; stroke APIs share `StrokeOptions`, `StrokeCap`, and `StrokeJoin`. Engines accept a
40
+ fixed `wasmUrl`. Remove superseded public names and update included consumers.
41
+
42
+ Make `components()` return disconnected material with holes and enclosed cavities intact.
43
+ Inspection uses `componentCount`; snapshots use `partCount`, `vertexCount`, `triangleCount`, and
44
+ `byteCount`, preserving instance counts and shared-storage accounting.
45
+
46
+ Inspect zero-volume Boolean contacts without treating their native boundary remnants as
47
+ material components. Retain thin material pieces and inward cavity boundaries without a volume
48
+ tolerance cutoff.
49
+
50
+ Keep ordinary component inspection on a certified native fast path, reserving exact arithmetic
51
+ for ambiguous contact boundaries. Reuse captured generation-data metadata during cache retention,
52
+ and include retention, commit, and cleanup in total generation timing.
53
+
54
+ Preserve shared snapshot buffers and rigid placements in Testkit part assertions. Validate CLI
55
+ capture bounds by coordinates, independently of JSON property order.
56
+
57
+ Use concise input bounds such as `maxTriangles`, `maxVertices`, `minSegments`, and `maxSegments`,
58
+ including mesh-optimization work budgets. Remove the superseded long option spellings.
59
+
60
+ Refresh Testkit sessions when prepared services change, validate CLI callback results against the
61
+ installed Modeling contract, and reject conflicting buffers for one generated geometry identity
62
+ and revision. Correct closest-point projection when finite path edges have overflowing squared lengths.
63
+
3
64
  ## 0.14.0
4
65
 
5
66
  ### Minor Changes
@@ -71,9 +71,16 @@ export interface ModelBounds {
71
71
  readonly min: Vector3;
72
72
  readonly max: Vector3;
73
73
  }
74
+ /** Aggregate model facts and execution timings supplied by the host. */
74
75
  export interface ModelStats {
75
- readonly triangles?: number | undefined;
76
- readonly vertices?: number | undefined;
76
+ /** Declared output parts, including repeated geometry instances. */
77
+ readonly partCount?: number | undefined;
78
+ /** Aggregate indexed triangles across output parts. */
79
+ readonly triangleCount?: number | undefined;
80
+ /** Aggregate position-buffer vertices across output parts. */
81
+ readonly vertexCount?: number | undefined;
82
+ /** Unique transferable backing-buffer bytes, counted once across output parts. */
83
+ readonly byteCount?: number | undefined;
77
84
  readonly generationMs?: number | undefined;
78
85
  readonly volumeMm3?: number | undefined;
79
86
  readonly timings?: ModelTimings | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,YAAY,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B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1
1
  # Design reusable controls
2
2
 
3
- Make a code Project useful to someone else with clear inputs, tested defaults, focused validation, and portable files.
3
+ Design clear controls, useful defaults, and recoverable validation for a reusable code Project.
4
4
 
5
5
  Turn a working authored Project into a model someone can adjust without reading its source.
6
6
  If you need a working model first, follow [Build your first code Project](https://metamesh.studio/docs/develop/code-projects).
@@ -37,7 +37,7 @@ for supported control types and their configuration.
37
37
 
38
38
  ## Make labels and units unambiguous
39
39
 
40
- Use labels that describe the finished model, such as **Outer Diameter**, rather than a variable
40
+ Use labels that describe the finished model, such as **Outer diameter**, rather than a variable
41
41
  name like `d2`. Add a short description when a measurement could have more than one interpretation:
42
42
  for example, whether Length includes an end cap.
43
43
 
@@ -50,8 +50,8 @@ messages; a clearer label should not require a different identifier.
50
50
 
51
51
  ## Choose defaults that demonstrate the model
52
52
 
53
- Choose representative defaults that produce a useful, recognizable result without validation
54
- errors and show the important features without requiring several edits.
53
+ Choose defaults that produce a useful, recognizable model without errors and show its important
54
+ features immediately.
55
55
 
56
56
  Try the model from the parameter panel with the code editor closed. Confirm that:
57
57
 
@@ -70,13 +70,11 @@ range depends on another control, such as a hole that must fit inside a plate.
70
70
 
71
71
  A helpful message identifies the problem and gives a next action: "Reduce Hole diameter or increase
72
72
  Width" is more useful than "Invalid parameters." Associate the message with the relevant control.
73
- Use an error for unsupported combinations and a warning for a trade-off the person can choose to
74
- accept. The [validation guide](parameters.md#add-cross-field-validation-in-typescript)
73
+ Use errors for unsupported combinations and warnings for trade-offs the reader can accept. The [validation guide](parameters.md#add-cross-field-validation-in-typescript)
75
74
  explains the implementation with examples.
76
75
 
77
- Test more than the default combination. Check the smallest and largest supported dimensions,
78
- optional features, and any choice or list combinations. After an error, confirm that the suggested
79
- correction produces a current model again.
76
+ Test the smallest and largest supported dimensions, optional features, and choice or list
77
+ combinations. After an error, confirm that the suggested correction generates a new model.
80
78
 
81
79
  For the plate above, test these decisions separately:
82
80
 
@@ -90,9 +88,8 @@ For the plate above, test these decisions separately:
90
88
 
91
89
  ## Keep related parts understandable
92
90
 
93
- Use named parts when one set of controls produces related outputs, such as a lid and its container.
94
- Give them stable, descriptive IDs so inspection and export remain understandable as dimensions
95
- change. The [part contract](https://metamesh.studio/docs/develop/code-project-contract#parts-and-placement) describes the
91
+ Use stable, descriptive part IDs for related outputs, such as a lid and container, so readers can
92
+ identify them during inspection and export as dimensions change. The [part contract](https://metamesh.studio/docs/develop/code-project-contract#parts-and-placement) describes the
96
93
  supported output shape.
97
94
 
98
95
  Inspect each output and check the exported model in its intended downstream tool. A valid solid
@@ -114,10 +111,9 @@ test runner; the CLI owns compilation and capture tools.
114
111
 
115
112
  ## Keep a portable copy
116
113
 
117
- Save the authored Project as a `.metamesh.json` file, then
118
- [import the Project file](https://metamesh.studio/docs/use/projects-and-offline#save-and-import-an-authored-project) to check its source,
119
- controls, and values. Keep the file in storage you control; browser storage is local to the device
120
- and profile.
114
+ Save a `.metamesh.json` file, then [import it](https://metamesh.studio/docs/use/projects-and-offline#save-and-import-an-authored-project)
115
+ to check its source, controls, and values. Keep the file in storage you control; browser storage
116
+ belongs to one device and profile.
121
117
 
122
118
  A saved Project is not a published catalog Generator. Check
123
119
  [publishing availability](https://metamesh.studio/docs/create/publishing-status) if you intend to distribute through
@@ -1,10 +1,10 @@
1
1
  # Define parameters and validation
2
2
 
3
- Define model controls, side profiles, closed cross sections, fonts, conditional visibility, and cross-field validation for an authored Project.
3
+ Define typed controls, editable profiles, conditional visibility, and validation for an authored Studio Project.
4
4
 
5
- A reusable code Project exposes meaningful design decisions through controls. Studio stores the
6
- control definition as JSON-safe Project data, types `params` through the imported `generate`
7
- helper, and runs executable cross-field validation from `model.ts`.
5
+ Define controls so readers can adjust a model without editing its source. Studio stores the
6
+ definition as JSON-safe Project data, infers `params` through `generate`, and runs cross-field
7
+ validation in `model.ts`.
8
8
 
9
9
  The JSON document contains required `groups` and `parameters` arrays. A parameter's `type`,
10
10
  default, units, bounds, and choices describe its value. Its optional `ui` object describes
@@ -13,11 +13,10 @@ Number and Slider both use `type: "number"`; a Slider also declares `ui.control:
13
13
  Options use `type: "choice"`, Side profile uses `type: "side-profile"`, and a closed outline uses
14
14
  `type: "contour"`. Changing a numeric widget does not change its saved value or valid range.
15
15
 
16
- JSON editing provides field completion, help, and inline validation. Reference completion suggests
17
- declared groups, parameters, and choice values. Errors prevent applying the draft; returning to
18
- Visual requires fixing or discarding invalid JSON.
19
- For other editors, the SDK ships `@metamesh/generator-sdk/parameters.schema.json`; the SDK parser
20
- also checks cross-field rules that JSON Schema cannot express.
16
+ JSON editing offers field completion, help, and inline validation, including references to declared
17
+ groups, parameters, and choice values. Fix or discard invalid JSON before applying it or returning
18
+ to Visual. For other editors, use `@metamesh/generator-sdk/parameters.schema.json`; the SDK parser
19
+ also checks rules that JSON Schema cannot express.
21
20
 
22
21
  ## Open the control editor
23
22
 
@@ -34,19 +33,19 @@ The Model controls editor's **Visual** and **JSON** views edit the same draft. C
34
33
 
35
34
  Preview values are temporary; they do not change the default or the Project's current values.
36
35
 
37
- Use labels to name the decision and descriptions for supplementary help. Defaults should produce a useful model immediately;
38
- minimum and maximum values should describe the supported input range rather than compensate for a
39
- missing cross-field rule.
36
+ Use labels to name the decision and descriptions for more detail. Defaults should produce a useful
37
+ model immediately. Use minimum and maximum values for supported field ranges and cross-field
38
+ rules for constraints between controls.
40
39
 
41
40
  ## Separate help from essential instructions
42
41
 
43
- Keep `description` for explanations, terminology, and examples. Studio shows it on demand when the
44
- user hovers, focuses, or taps the question-mark help button. Clicking the label focuses the input;
45
- hovering it does not open help.
46
- Use one optional static `ui.hint` for a short, essential instruction shown inline whenever the
47
- control is visible. Omit it when the label is enough. Put guidance covering multiple modes in
48
- `description`; hints have no conditions. Errors, warnings, and explanations for unavailable
49
- controls remain visible too.
42
+ Use `description` for explanations, terminology, and examples. Studio shows it when the reader
43
+ hovers, focuses, or taps the question-mark help button. Clicking the label focuses the input;
44
+ hovering the label does not open help.
45
+
46
+ Use optional `ui.hint` for one short, essential instruction beside the control. Omit it when the
47
+ label is enough. Hints are static and appear whenever the control is visible; put guidance for
48
+ multiple modes in `description`. Errors, warnings, and reasons a control is unavailable stay visible.
50
49
 
51
50
  In **Visual**, edit **Hint (optional)** as ordinary text. **Visual**, **JSON**, and the live preview
52
51
  use the same string field. Clearing it omits the hint when applying the definition. For example,
@@ -81,9 +80,9 @@ avoid repeating labels, units, or descriptions. A declared hint must be non-empt
81
80
  | Cross section | One closed XY outline for extrusion or a swept section |
82
81
  | Number List or Text List | An ordered sequence the user may add, remove, edit, and reorder |
83
82
 
84
- A Slider requires `min`, `max`, and a positive `ui.step`. Multiple choice may require a minimum or maximum
85
- selection count. List controls can bound their item count; number-list items can also have their own
86
- unit, limits, and `items.ui.step`.
83
+ A Slider requires `min`, `max`, and a positive `ui.step`. Multiple choice can limit the number of
84
+ selections. Lists can limit their item count; number-list items can also declare units, limits,
85
+ and `items.ui.step`.
87
86
 
88
87
  A Font value is a structured selection, not a family-name string. Pass the whole value in
89
88
  `services.text.layout(text, { font, fontSize })` inside generation, then pass its layout to
@@ -124,15 +123,14 @@ In **JSON**, give the controls the same `ui.row` identifier:
124
123
  ]
125
124
  ```
126
125
 
127
- These entries belong in the definition's `parameters` array. Row identifiers are local to each
128
- section, and controls in a row must remain adjacent within that section. Omit `ui.row` for an ordinary
129
- full-width control. Shared rows support number inputs, `choice`, and `text`; sliders and other control types use
130
- their own rows. Prefer full width for long option names or text values.
126
+ Add these entries to the definition's `parameters` array. Row IDs are local to each section, and
127
+ shared controls must stay adjacent. Omit `ui.row` for full width. Shared rows support number
128
+ inputs, `choice`, and `text`; sliders and other controls use their own rows. Prefer full width
129
+ for long option names or text.
131
130
 
132
- Shared fields have equal widths and compact labels. They stack when the panel is too
133
- narrow; when one field is hidden, the remaining field fills the row. Each field keeps its own
134
- value, units, validation, and history; `params.width` and `params.height` remain
135
- separate numbers.
131
+ Fields share equal widths and stack in narrow panels. If one is hidden, the other fills the row.
132
+ Each retains its own value, units, validation, and history; `params.width` and `params.height`
133
+ remain separate numbers.
136
134
 
137
135
  ## Define an editable side profile
138
136
 
@@ -310,20 +308,17 @@ In **JSON**, add `"role": "curve-resolution"` to a Number or Slider control to g
310
308
  }
311
309
  ```
312
310
 
313
- The control remains a saved parameter on `params`. Your source must apply it to geometry,
314
- for example by passing `resolution: { maxChordError: params.curveResolution }` to each
315
- affected primitive or Section operation. Share that ordinary options value where several curves
316
- use the same policy. The declaration alone
317
- does not change sampling. Keep supported limits and any feature-specific sampling in your model.
318
-
319
- Studio groups these fields under **Curve resolution** in Parameters, including the mobile sheet
320
- where draft validation errors can be corrected. The chosen value affects preview and export through
321
- the same generation path. Visual editing
322
- preserves the role; duplicating the control creates an ordinary numeric control. A Project may
323
- declare multiple Curve resolution controls, shown together in definition order.
324
- For example, declare separate **Coil path** and **Wire cross-section** values and pass each to the
325
- appropriate sampler. Your Generator decides which curves or parts each value affects; Studio saves
326
- the values without assigning them to parts automatically.
311
+ Your source must apply the saved parameter to geometry, for example by passing
312
+ `resolution: { maxChordError: params.curveResolution }` to each affected primitive or Section
313
+ operation. Share the options value when several curves use the same policy. The declaration alone
314
+ does not change sampling; keep supported limits and feature-specific sampling in your model.
315
+
316
+ Studio groups these controls under **Curve resolution** in definition order, including in the
317
+ mobile sheet. Visual editing preserves the role; duplicating a control creates an ordinary numeric
318
+ control. Each value saves with the Project and affects preview and export through generation.
319
+
320
+ You can declare separate values for **Coil path** and **Wire cross-section**, then pass each to its
321
+ sampler. Your source decides which curves or parts it affects; Studio does not assign it to parts.
327
322
 
328
323
  ## Reveal a control only when it applies
329
324
 
@@ -350,9 +345,9 @@ array; this example shows Hole diameter only while Add hole is enabled:
350
345
  }
351
346
  ```
352
347
 
353
- Use `eq` or `ne` for scalar comparisons, `gt`, `gte`, `lt`, or `lte` for numbers, and `contains`
354
- for Multiple choice membership. Combine conditions with `all`, `any`, or `not`. Font, Side profile, Cross section,
355
- Number List, and Text List values cannot be the referenced value in a condition.
348
+ Use `eq` or `ne` for scalar comparisons; `gt`, `gte`, `lt`, or `lte` for numbers; and `contains`
349
+ for Multiple choice membership. Combine conditions with `all`, `any`, or `not`. Conditions cannot
350
+ reference Font, Side profile, Cross section, Number List, or Text List values.
356
351
 
357
352
  The JSON root accepts only `groups` and `parameters`. Project identity, title, and version are
358
353
  managed separately by Studio.
@@ -387,11 +382,11 @@ than your model's recommended minimum. A zero wall stops generation; a 0.5 mm wa
387
382
  with a warning. Choose that minimum for the model and manufacturing process. A failed edit leaves
388
383
  the last valid preview and its export available. Warnings allow a current model to generate and export.
389
384
 
390
- Checks run in JavaScript order. Reading a computed value evaluates it when necessary, and a
391
- geometry observation must realize its input first. This also applies to draft validation: it runs
392
- declaration and reached assertions, without finalizing the returned parts. It does not prove full
393
- geometric validity. Keep exact layouts and shared dimensions in optional `computed` values so
394
- unrelated edits do not repeat expensive work. There is no separate preparation callback.
385
+ Checks follow JavaScript order: reading a computed value evaluates it when needed, and observing
386
+ geometry evaluates its input first. Draft validation checks declarations and reached assertions
387
+ without finalizing parts; it does not prove full geometric validity. Use optional `computed`
388
+ values to reuse expensive layouts or shared calculations across unrelated edits. There is no
389
+ separate preparation callback.
395
390
 
396
391
  ## Test the definition as a contract
397
392
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "formatVersion": 1,
3
3
  "packageName": "@metamesh/generator-sdk",
4
- "packageVersion": "0.14.0",
4
+ "packageVersion": "0.16.0",
5
5
  "documents": [
6
6
  {
7
7
  "id": "sdk/guide/authoring",
8
8
  "title": "Design reusable controls",
9
- "summary": "Make a code Project useful to someone else with clear inputs, tested defaults, focused validation, and portable files.",
9
+ "summary": "Design clear controls, useful defaults, and recoverable validation for a reusable code Project.",
10
10
  "path": "guides/authoring.md",
11
11
  "importPath": "@metamesh/generator-sdk",
12
12
  "availability": "Reusable controls in Studio code Projects",
@@ -15,7 +15,15 @@
15
15
  "guide",
16
16
  "authoring",
17
17
  "studio",
18
- "how-to"
18
+ "how-to",
19
+ "design-reusable-controls",
20
+ "choose-the-decisions-to-expose",
21
+ "make-labels-and-units-unambiguous",
22
+ "choose-defaults-that-demonstrate-the-model",
23
+ "explain-constraints-where-they-matter",
24
+ "keep-related-parts-understandable",
25
+ "use-the-same-design-in-a-local-module",
26
+ "keep-a-portable-copy"
19
27
  ]
20
28
  },
21
29
  {
@@ -35,7 +43,7 @@
35
43
  {
36
44
  "id": "sdk/guide/parameters",
37
45
  "title": "Define parameters and validation",
38
- "summary": "Define model controls, side profiles, closed cross sections, fonts, conditional visibility, and cross-field validation for an authored Project.",
46
+ "summary": "Define typed controls, editable profiles, conditional visibility, and validation for an authored Studio Project.",
39
47
  "path": "guides/parameters.md",
40
48
  "importPath": "@metamesh/generator-sdk/parameters",
41
49
  "availability": "Shared parameter contracts; control editing examples use Studio",
@@ -44,7 +52,18 @@
44
52
  "guide",
45
53
  "parameters",
46
54
  "studio",
47
- "how-to"
55
+ "how-to",
56
+ "define-parameters-and-validation",
57
+ "open-the-control-editor",
58
+ "separate-help-from-essential-instructions",
59
+ "choose-the-right-control",
60
+ "show-controls-side-by-side",
61
+ "define-an-editable-side-profile",
62
+ "define-an-editable-cross-section",
63
+ "expose-curve-resolution-in-parameters",
64
+ "reveal-a-control-only-when-it-applies",
65
+ "add-cross-field-validation-in-typescript",
66
+ "test-the-definition-as-a-contract"
48
67
  ]
49
68
  },
50
69
  {
@@ -2192,7 +2211,7 @@
2192
2211
  {
2193
2212
  "id": "sdk/reference/runtime/ModelStats",
2194
2213
  "title": "ModelStats",
2195
- "summary": "ModelStats exported from @metamesh/generator-sdk/runtime.",
2214
+ "summary": "Aggregate model facts and execution timings supplied by the host.",
2196
2215
  "path": "reference/runtime/ModelStats.md",
2197
2216
  "importPath": "@metamesh/generator-sdk/runtime",
2198
2217
  "availability": "Portable Generator contracts",
@@ -2,7 +2,7 @@
2
2
 
3
3
  An immutable catalog face; revision is the SHA-256 digest of the complete font file.
4
4
 
5
- Import from `@metamesh/generator-sdk/fonts` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk/fonts` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** An immutable catalog face; revision is the SHA-256 digest of the complete font file. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Checks only the portable value, without consulting a catalog or substituting fonts.
4
4
 
5
- Import from `@metamesh/generator-sdk/fonts` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk/fonts` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** Checks only the portable value, without consulting a catalog or substituting fonts. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  ArrayParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ArrayParameterDefinition extends ArrayParameterBase {
@@ -2,7 +2,7 @@
2
2
 
3
3
  BaseParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  BooleanParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface BooleanParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ChoiceOption exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ChoiceOption {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ChoiceParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ChoiceParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ChoiceSetParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ChoiceSetParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ColorParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ColorParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ConditionExpression exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export type ConditionExpression = {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Editing intent accompanies the explicit curve controls; no tangent is inferred at runtime.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** Editing intent accompanies the explicit curve controls; no tangent is inferred at runtime. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  ContourParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ContourParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ContourParameterUi exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface ContourParameterUi extends ParameterUi {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Normalized planar coordinates, with X rightward and Y upward, in the unit square.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** Normalized planar coordinates, with X rightward and Y upward, in the unit square. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  ContourSegment exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export type ContourSegment = {
@@ -2,7 +2,7 @@
2
2
 
3
3
  One explicitly closed planar contour. Generators own physical scaling and topology checks.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** One explicitly closed planar contour. Generators own physical scaling and topology checks. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  FontParameterDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface FontParameterDefinition extends BaseParameterDefinition {
@@ -2,7 +2,7 @@
2
2
 
3
3
  An immutable catalog face; revision is the SHA-256 digest of the complete font file.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** An immutable catalog face; revision is the SHA-256 digest of the complete font file. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  GeneratorDefinition exported from @metamesh/generator-sdk.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  export interface GeneratorDefinition extends ParameterDefinitionDocument {
@@ -2,7 +2,7 @@
2
2
 
3
3
  A validation issue whose optional parameter ID is tied to one definition.
4
4
 
5
- Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.14.0).
5
+ Import from `@metamesh/generator-sdk` (@metamesh/generator-sdk@0.16.0).
6
6
 
7
7
  ```ts
8
8
  /** A validation issue whose optional parameter ID is tied to one definition. */