@driftsys/markspec 0.4.0 → 0.6.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.
- package/README.md +74 -20
- package/esm/ast/build.d.ts +60 -0
- package/esm/ast/build.d.ts.map +1 -0
- package/esm/ast/build.js +516 -0
- package/esm/ast/equivalence.d.ts +18 -0
- package/esm/ast/equivalence.d.ts.map +1 -0
- package/esm/ast/equivalence.js +56 -0
- package/esm/ast/nodes.d.ts +189 -0
- package/esm/ast/nodes.d.ts.map +1 -0
- package/esm/ast/nodes.js +17 -0
- package/esm/ast/normalize.d.ts +58 -0
- package/esm/ast/normalize.d.ts.map +1 -0
- package/esm/ast/normalize.js +197 -0
- package/esm/ast/render.d.ts +34 -0
- package/esm/ast/render.d.ts.map +1 -0
- package/esm/ast/render.js +215 -0
- package/esm/compiler/constants.d.ts +16 -0
- package/esm/compiler/constants.d.ts.map +1 -0
- package/esm/compiler/constants.js +26 -0
- package/esm/compiler/discipline_classifier.d.ts +55 -0
- package/esm/compiler/discipline_classifier.d.ts.map +1 -0
- package/esm/compiler/discipline_classifier.js +191 -0
- package/esm/compiler/inverses.d.ts +2 -1
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +33 -14
- package/esm/compiler/manifest.d.ts +59 -0
- package/esm/compiler/manifest.d.ts.map +1 -0
- package/esm/compiler/manifest.js +48 -0
- package/esm/compiler/mod.d.ts +38 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +202 -50
- package/esm/compiler/ndjson_writer.d.ts +50 -0
- package/esm/compiler/ndjson_writer.d.ts.map +1 -0
- package/esm/compiler/ndjson_writer.js +73 -0
- package/esm/compiler/schema.d.ts +33 -1
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +30 -9
- package/esm/config/markspec.d.ts +5 -0
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +17 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +54 -0
- package/esm/formatter/mod.d.ts +55 -4
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +423 -46
- package/esm/formatter/synth_ulid.d.ts +21 -0
- package/esm/formatter/synth_ulid.d.ts.map +1 -0
- package/esm/formatter/synth_ulid.js +64 -0
- package/esm/lexicons/loader.d.ts +35 -0
- package/esm/lexicons/loader.d.ts.map +1 -0
- package/esm/lexicons/loader.js +51 -0
- package/esm/lexicons/mod.d.ts +13 -0
- package/esm/lexicons/mod.d.ts.map +1 -0
- package/esm/lexicons/mod.js +12 -0
- package/esm/lint/glossary.d.ts +45 -0
- package/esm/lint/glossary.d.ts.map +1 -0
- package/esm/lint/glossary.js +85 -0
- package/esm/lint/mod.d.ts +14 -0
- package/esm/lint/mod.d.ts.map +1 -0
- package/esm/lint/mod.js +9 -0
- package/esm/lint/range_util.d.ts +25 -0
- package/esm/lint/range_util.d.ts.map +1 -0
- package/esm/lint/range_util.js +50 -0
- package/esm/lint/rules/ears.d.ts +39 -0
- package/esm/lint/rules/ears.d.ts.map +1 -0
- package/esm/lint/rules/ears.js +316 -0
- package/esm/lint/rules/incose_sentence.d.ts +46 -0
- package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
- package/esm/lint/rules/incose_sentence.js +417 -0
- package/esm/lint/rules/lexicon.d.ts +24 -0
- package/esm/lint/rules/lexicon.d.ts.map +1 -0
- package/esm/lint/rules/lexicon.js +236 -0
- package/esm/lint/rules/modal_sentence.d.ts +46 -0
- package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
- package/esm/lint/rules/modal_sentence.js +146 -0
- package/esm/lint/rules/passive.d.ts +64 -0
- package/esm/lint/rules/passive.d.ts.map +1 -0
- package/esm/lint/rules/passive.js +282 -0
- package/esm/lint/rules/struct.d.ts +17 -0
- package/esm/lint/rules/struct.d.ts.map +1 -0
- package/esm/lint/rules/struct.js +55 -0
- package/esm/lint/rules/suppression.d.ts +54 -0
- package/esm/lint/rules/suppression.d.ts.map +1 -0
- package/esm/lint/rules/suppression.js +129 -0
- package/esm/lint/rules/xref.d.ts +19 -0
- package/esm/lint/rules/xref.d.ts.map +1 -0
- package/esm/lint/rules/xref.js +248 -0
- package/esm/lint/runner.d.ts +59 -0
- package/esm/lint/runner.d.ts.map +1 -0
- package/esm/lint/runner.js +153 -0
- package/esm/lint/score.d.ts +64 -0
- package/esm/lint/score.d.ts.map +1 -0
- package/esm/lint/score.js +163 -0
- package/esm/lint/segmenter.d.ts +32 -0
- package/esm/lint/segmenter.d.ts.map +1 -0
- package/esm/lint/segmenter.js +79 -0
- package/esm/lint/types.d.ts +31 -0
- package/esm/lint/types.d.ts.map +1 -0
- package/esm/lint/types.js +9 -0
- package/esm/lock/canonical_edges.d.ts +31 -0
- package/esm/lock/canonical_edges.d.ts.map +1 -0
- package/esm/lock/canonical_edges.js +57 -0
- package/esm/lock/check.d.ts +24 -0
- package/esm/lock/check.d.ts.map +1 -0
- package/esm/lock/check.js +127 -0
- package/esm/lock/hash.d.ts +12 -0
- package/esm/lock/hash.d.ts.map +1 -0
- package/esm/lock/hash.js +32 -0
- package/esm/lock/mod.d.ts +19 -0
- package/esm/lock/mod.d.ts.map +1 -0
- package/esm/lock/mod.js +14 -0
- package/esm/lock/model.d.ts +81 -0
- package/esm/lock/model.d.ts.map +1 -0
- package/esm/lock/model.js +7 -0
- package/esm/lock/parser.d.ts +26 -0
- package/esm/lock/parser.d.ts.map +1 -0
- package/esm/lock/parser.js +195 -0
- package/esm/lock/resolve.d.ts +142 -0
- package/esm/lock/resolve.d.ts.map +1 -0
- package/esm/lock/resolve.js +389 -0
- package/esm/lock/serializer.d.ts +14 -0
- package/esm/lock/serializer.d.ts.map +1 -0
- package/esm/lock/serializer.js +104 -0
- package/esm/mod.d.ts +28 -8
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +23 -4
- package/esm/model/attributes.d.ts +6 -0
- package/esm/model/attributes.d.ts.map +1 -1
- package/esm/model/attributes.js +200 -2
- package/esm/model/discipline.d.ts +53 -0
- package/esm/model/discipline.d.ts.map +1 -0
- package/esm/model/discipline.js +50 -0
- package/esm/model/discriminating_attr.d.ts +33 -0
- package/esm/model/discriminating_attr.d.ts.map +1 -0
- package/esm/model/discriminating_attr.js +74 -0
- package/esm/model/mod.d.ts +267 -14
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +99 -3
- package/esm/model/profile.d.ts +102 -27
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/model/source_introspection.d.ts +26 -0
- package/esm/model/source_introspection.d.ts.map +1 -0
- package/esm/model/source_introspection.js +77 -0
- package/esm/model/type_hierarchy.d.ts +51 -0
- package/esm/model/type_hierarchy.d.ts.map +1 -0
- package/esm/model/type_hierarchy.js +126 -0
- package/esm/model/uri_scheme_map.d.ts +21 -0
- package/esm/model/uri_scheme_map.d.ts.map +1 -0
- package/esm/model/uri_scheme_map.js +66 -0
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +10 -16
- package/esm/parser/body_tokens.d.ts +35 -0
- package/esm/parser/body_tokens.d.ts.map +1 -0
- package/esm/parser/body_tokens.js +232 -0
- package/esm/parser/glossary.d.ts +51 -0
- package/esm/parser/glossary.d.ts.map +1 -0
- package/esm/parser/glossary.js +219 -0
- package/esm/parser/grammars.d.ts +5 -3
- package/esm/parser/grammars.d.ts.map +1 -1
- package/esm/parser/grammars.js +12 -4
- package/esm/parser/language_spec.d.ts +55 -0
- package/esm/parser/language_spec.d.ts.map +1 -0
- package/esm/parser/language_spec.js +419 -0
- package/esm/parser/line_map.d.ts +60 -0
- package/esm/parser/line_map.d.ts.map +1 -0
- package/esm/parser/line_map.js +41 -0
- package/esm/parser/markdown.d.ts +9 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +317 -25
- package/esm/parser/mod.d.ts +5 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +31 -8
- package/esm/parser/source.d.ts +53 -2
- package/esm/parser/source.d.ts.map +1 -1
- package/esm/parser/source.js +158 -68
- package/esm/parser/translate.d.ts +24 -0
- package/esm/parser/translate.d.ts.map +1 -0
- package/esm/parser/translate.js +99 -0
- package/esm/profile/chain.d.ts +8 -0
- package/esm/profile/chain.d.ts.map +1 -1
- package/esm/profile/chain.js +32 -14
- package/esm/profile/colors.js +1 -1
- package/esm/profile/default_profile.d.ts +25 -0
- package/esm/profile/default_profile.d.ts.map +1 -0
- package/esm/profile/default_profile.js +43 -0
- package/esm/profile/discipline_mode.d.ts +64 -0
- package/esm/profile/discipline_mode.d.ts.map +1 -0
- package/esm/profile/discipline_mode.js +133 -0
- package/esm/profile/discipline_registry.d.ts +41 -0
- package/esm/profile/discipline_registry.d.ts.map +1 -0
- package/esm/profile/discipline_registry.js +67 -0
- package/esm/profile/introspect.d.ts +135 -0
- package/esm/profile/introspect.d.ts.map +1 -0
- package/esm/profile/introspect.js +378 -0
- package/esm/profile/load.d.ts +3 -1
- package/esm/profile/load.d.ts.map +1 -1
- package/esm/profile/load.js +91 -5
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +512 -90
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +251 -39
- package/esm/profile/mod.d.ts +4 -4
- package/esm/profile/mod.d.ts.map +1 -1
- package/esm/profile/mod.js +7 -2
- package/esm/reporter/mod.js +4 -4
- package/esm/sync/locked_attributes.d.ts +19 -0
- package/esm/sync/locked_attributes.d.ts.map +1 -0
- package/esm/sync/locked_attributes.js +27 -0
- package/esm/sync/log.d.ts +34 -0
- package/esm/sync/log.d.ts.map +1 -0
- package/esm/sync/log.js +48 -0
- package/esm/sync/mapping.d.ts +66 -0
- package/esm/sync/mapping.d.ts.map +1 -0
- package/esm/sync/mapping.js +165 -0
- package/esm/sync/mod.d.ts +16 -0
- package/esm/sync/mod.d.ts.map +1 -0
- package/esm/sync/mod.js +12 -0
- package/esm/sync/status.d.ts +23 -0
- package/esm/sync/status.d.ts.map +1 -0
- package/esm/sync/status.js +21 -0
- package/esm/typl/ast.d.ts +87 -0
- package/esm/typl/ast.d.ts.map +1 -0
- package/esm/typl/ast.js +21 -0
- package/esm/typl/bridge.d.ts +32 -0
- package/esm/typl/bridge.d.ts.map +1 -0
- package/esm/typl/bridge.js +27 -0
- package/esm/typl/bullet.d.ts +34 -0
- package/esm/typl/bullet.d.ts.map +1 -0
- package/esm/typl/bullet.js +44 -0
- package/esm/typl/diagnostics.d.ts +43 -0
- package/esm/typl/diagnostics.d.ts.map +1 -0
- package/esm/typl/diagnostics.js +61 -0
- package/esm/typl/fence.d.ts +31 -0
- package/esm/typl/fence.d.ts.map +1 -0
- package/esm/typl/fence.js +24 -0
- package/esm/typl/grammar.d.ts +20 -0
- package/esm/typl/grammar.d.ts.map +1 -0
- package/esm/typl/grammar.js +471 -0
- package/esm/typl/inline.d.ts +34 -0
- package/esm/typl/inline.d.ts.map +1 -0
- package/esm/typl/inline.js +48 -0
- package/esm/typl/lexer.d.ts +37 -0
- package/esm/typl/lexer.d.ts.map +1 -0
- package/esm/typl/lexer.js +234 -0
- package/esm/typl/mod.d.ts +23 -0
- package/esm/typl/mod.d.ts.map +1 -0
- package/esm/typl/mod.js +16 -0
- package/esm/typl/registry.d.ts +42 -0
- package/esm/typl/registry.d.ts.map +1 -0
- package/esm/typl/registry.js +26 -0
- package/esm/typl/validator.d.ts +29 -0
- package/esm/typl/validator.d.ts.map +1 -0
- package/esm/typl/validator.js +141 -0
- package/esm/util/fence.d.ts +30 -0
- package/esm/util/fence.d.ts.map +1 -0
- package/esm/util/fence.js +40 -0
- package/esm/util/line_endings.d.ts +33 -0
- package/esm/util/line_endings.d.ts.map +1 -0
- package/esm/util/line_endings.js +53 -0
- package/esm/util/modals.d.ts +29 -0
- package/esm/util/modals.d.ts.map +1 -0
- package/esm/util/modals.js +38 -0
- package/esm/validator/attributes.d.ts +3 -3
- package/esm/validator/attributes.d.ts.map +1 -1
- package/esm/validator/attributes.js +1 -18
- package/esm/validator/body_blocks.d.ts +38 -0
- package/esm/validator/body_blocks.d.ts.map +1 -0
- package/esm/validator/body_blocks.js +218 -0
- package/esm/validator/caption_convention.d.ts +29 -0
- package/esm/validator/caption_convention.d.ts.map +1 -0
- package/esm/validator/caption_convention.js +58 -0
- package/esm/validator/captions.d.ts +22 -0
- package/esm/validator/captions.d.ts.map +1 -0
- package/esm/validator/captions.js +137 -0
- package/esm/validator/component_schemes.d.ts +73 -0
- package/esm/validator/component_schemes.d.ts.map +1 -0
- package/esm/validator/component_schemes.js +375 -0
- package/esm/validator/discipline.d.ts +35 -0
- package/esm/validator/discipline.d.ts.map +1 -0
- package/esm/validator/discipline.js +204 -0
- package/esm/validator/feature_ac.d.ts +28 -0
- package/esm/validator/feature_ac.d.ts.map +1 -0
- package/esm/validator/feature_ac.js +102 -0
- package/esm/validator/listing.d.ts +42 -0
- package/esm/validator/listing.d.ts.map +1 -0
- package/esm/validator/listing.js +295 -0
- package/esm/validator/mod.d.ts +3 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +275 -13
- package/esm/validator/modal_keywords.d.ts +25 -0
- package/esm/validator/modal_keywords.d.ts.map +1 -0
- package/esm/validator/modal_keywords.js +54 -0
- package/esm/validator/pattern.d.ts +15 -8
- package/esm/validator/pattern.d.ts.map +1 -1
- package/esm/validator/pattern.js +42 -19
- package/esm/validator/per_type_attrs.d.ts +29 -0
- package/esm/validator/per_type_attrs.d.ts.map +1 -0
- package/esm/validator/per_type_attrs.js +75 -0
- package/esm/validator/pipeline.d.ts +18 -2
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +76 -21
- package/esm/validator/trace_types.d.ts +26 -0
- package/esm/validator/trace_types.d.ts.map +1 -0
- package/esm/validator/trace_types.js +232 -0
- package/esm/validator/traceability.d.ts +3 -4
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +5 -10
- package/esm/validator/type_resolution.d.ts +67 -0
- package/esm/validator/type_resolution.d.ts.map +1 -0
- package/esm/validator/type_resolution.js +162 -0
- package/esm/validator/types.d.ts +45 -0
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +128 -16
- package/esm/validator/value_types.d.ts +8 -0
- package/esm/validator/value_types.d.ts.map +1 -1
- package/esm/validator/value_types.js +8 -1
- package/package.json +2 -2
- package/script/ast/build.d.ts +60 -0
- package/script/ast/build.d.ts.map +1 -0
- package/script/ast/build.js +521 -0
- package/script/ast/equivalence.d.ts +18 -0
- package/script/ast/equivalence.d.ts.map +1 -0
- package/script/ast/equivalence.js +59 -0
- package/script/ast/nodes.d.ts +189 -0
- package/script/ast/nodes.d.ts.map +1 -0
- package/script/ast/nodes.js +18 -0
- package/script/ast/normalize.d.ts +58 -0
- package/script/ast/normalize.d.ts.map +1 -0
- package/script/ast/normalize.js +200 -0
- package/script/ast/render.d.ts +34 -0
- package/script/ast/render.d.ts.map +1 -0
- package/script/ast/render.js +218 -0
- package/script/compiler/constants.d.ts +16 -0
- package/script/compiler/constants.d.ts.map +1 -0
- package/script/compiler/constants.js +29 -0
- package/script/compiler/discipline_classifier.d.ts +55 -0
- package/script/compiler/discipline_classifier.d.ts.map +1 -0
- package/script/compiler/discipline_classifier.js +196 -0
- package/script/compiler/inverses.d.ts +2 -1
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +33 -14
- package/script/compiler/manifest.d.ts +59 -0
- package/script/compiler/manifest.d.ts.map +1 -0
- package/script/compiler/manifest.js +51 -0
- package/script/compiler/mod.d.ts +38 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +206 -54
- package/script/compiler/ndjson_writer.d.ts +50 -0
- package/script/compiler/ndjson_writer.d.ts.map +1 -0
- package/script/compiler/ndjson_writer.js +78 -0
- package/script/compiler/schema.d.ts +33 -1
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +30 -8
- package/script/config/markspec.d.ts +5 -0
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +17 -2
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +54 -0
- package/script/formatter/mod.d.ts +55 -4
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +426 -46
- package/script/formatter/synth_ulid.d.ts +21 -0
- package/script/formatter/synth_ulid.d.ts.map +1 -0
- package/script/formatter/synth_ulid.js +67 -0
- package/script/lexicons/loader.d.ts +35 -0
- package/script/lexicons/loader.d.ts.map +1 -0
- package/script/lexicons/loader.js +55 -0
- package/script/lexicons/mod.d.ts +13 -0
- package/script/lexicons/mod.d.ts.map +1 -0
- package/script/lexicons/mod.js +17 -0
- package/script/lint/glossary.d.ts +45 -0
- package/script/lint/glossary.d.ts.map +1 -0
- package/script/lint/glossary.js +88 -0
- package/script/lint/mod.d.ts +14 -0
- package/script/lint/mod.d.ts.map +1 -0
- package/script/lint/mod.js +17 -0
- package/script/lint/range_util.d.ts +25 -0
- package/script/lint/range_util.d.ts.map +1 -0
- package/script/lint/range_util.js +53 -0
- package/script/lint/rules/ears.d.ts +39 -0
- package/script/lint/rules/ears.d.ts.map +1 -0
- package/script/lint/rules/ears.js +320 -0
- package/script/lint/rules/incose_sentence.d.ts +46 -0
- package/script/lint/rules/incose_sentence.d.ts.map +1 -0
- package/script/lint/rules/incose_sentence.js +421 -0
- package/script/lint/rules/lexicon.d.ts +24 -0
- package/script/lint/rules/lexicon.d.ts.map +1 -0
- package/script/lint/rules/lexicon.js +240 -0
- package/script/lint/rules/modal_sentence.d.ts +46 -0
- package/script/lint/rules/modal_sentence.d.ts.map +1 -0
- package/script/lint/rules/modal_sentence.js +150 -0
- package/script/lint/rules/passive.d.ts +64 -0
- package/script/lint/rules/passive.d.ts.map +1 -0
- package/script/lint/rules/passive.js +286 -0
- package/script/lint/rules/struct.d.ts +17 -0
- package/script/lint/rules/struct.d.ts.map +1 -0
- package/script/lint/rules/struct.js +59 -0
- package/script/lint/rules/suppression.d.ts +54 -0
- package/script/lint/rules/suppression.d.ts.map +1 -0
- package/script/lint/rules/suppression.js +136 -0
- package/script/lint/rules/xref.d.ts +19 -0
- package/script/lint/rules/xref.d.ts.map +1 -0
- package/script/lint/rules/xref.js +251 -0
- package/script/lint/runner.d.ts +59 -0
- package/script/lint/runner.d.ts.map +1 -0
- package/script/lint/runner.js +157 -0
- package/script/lint/score.d.ts +64 -0
- package/script/lint/score.d.ts.map +1 -0
- package/script/lint/score.js +167 -0
- package/script/lint/segmenter.d.ts +32 -0
- package/script/lint/segmenter.d.ts.map +1 -0
- package/script/lint/segmenter.js +82 -0
- package/script/lint/types.d.ts +31 -0
- package/script/lint/types.d.ts.map +1 -0
- package/script/lint/types.js +10 -0
- package/script/lock/canonical_edges.d.ts +31 -0
- package/script/lock/canonical_edges.d.ts.map +1 -0
- package/script/lock/canonical_edges.js +61 -0
- package/script/lock/check.d.ts +24 -0
- package/script/lock/check.d.ts.map +1 -0
- package/script/lock/check.js +130 -0
- package/script/lock/hash.d.ts +12 -0
- package/script/lock/hash.d.ts.map +1 -0
- package/script/lock/hash.js +36 -0
- package/script/lock/mod.d.ts +19 -0
- package/script/lock/mod.d.ts.map +1 -0
- package/script/lock/mod.js +31 -0
- package/script/lock/model.d.ts +81 -0
- package/script/lock/model.d.ts.map +1 -0
- package/script/lock/model.js +10 -0
- package/script/lock/parser.d.ts +26 -0
- package/script/lock/parser.d.ts.map +1 -0
- package/script/lock/parser.js +198 -0
- package/script/lock/resolve.d.ts +142 -0
- package/script/lock/resolve.d.ts.map +1 -0
- package/script/lock/resolve.js +397 -0
- package/script/lock/serializer.d.ts +14 -0
- package/script/lock/serializer.d.ts.map +1 -0
- package/script/lock/serializer.js +107 -0
- package/script/mod.d.ts +28 -8
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +129 -32
- package/script/model/attributes.d.ts +6 -0
- package/script/model/attributes.d.ts.map +1 -1
- package/script/model/attributes.js +201 -3
- package/script/model/discipline.d.ts +53 -0
- package/script/model/discipline.d.ts.map +1 -0
- package/script/model/discipline.js +53 -0
- package/script/model/discriminating_attr.d.ts +33 -0
- package/script/model/discriminating_attr.d.ts.map +1 -0
- package/script/model/discriminating_attr.js +77 -0
- package/script/model/mod.d.ts +267 -14
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +111 -3
- package/script/model/profile.d.ts +102 -27
- package/script/model/profile.d.ts.map +1 -1
- package/script/model/source_introspection.d.ts +26 -0
- package/script/model/source_introspection.d.ts.map +1 -0
- package/script/model/source_introspection.js +80 -0
- package/script/model/type_hierarchy.d.ts +51 -0
- package/script/model/type_hierarchy.d.ts.map +1 -0
- package/script/model/type_hierarchy.js +130 -0
- package/script/model/uri_scheme_map.d.ts +21 -0
- package/script/model/uri_scheme_map.d.ts.map +1 -0
- package/script/model/uri_scheme_map.js +69 -0
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +10 -16
- package/script/parser/body_tokens.d.ts +35 -0
- package/script/parser/body_tokens.d.ts.map +1 -0
- package/script/parser/body_tokens.js +235 -0
- package/script/parser/glossary.d.ts +51 -0
- package/script/parser/glossary.d.ts.map +1 -0
- package/script/parser/glossary.js +224 -0
- package/script/parser/grammars.d.ts +5 -3
- package/script/parser/grammars.d.ts.map +1 -1
- package/script/parser/grammars.js +15 -8
- package/script/parser/language_spec.d.ts +55 -0
- package/script/parser/language_spec.d.ts.map +1 -0
- package/script/parser/language_spec.js +423 -0
- package/script/parser/line_map.d.ts +60 -0
- package/script/parser/line_map.d.ts.map +1 -0
- package/script/parser/line_map.js +44 -0
- package/script/parser/markdown.d.ts +9 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +315 -23
- package/script/parser/mod.d.ts +5 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +36 -7
- package/script/parser/source.d.ts +53 -2
- package/script/parser/source.d.ts.map +1 -1
- package/script/parser/source.js +159 -69
- package/script/parser/translate.d.ts +24 -0
- package/script/parser/translate.d.ts.map +1 -0
- package/script/parser/translate.js +102 -0
- package/script/profile/chain.d.ts +8 -0
- package/script/profile/chain.d.ts.map +1 -1
- package/script/profile/chain.js +32 -14
- package/script/profile/colors.js +1 -1
- package/script/profile/default_profile.d.ts +25 -0
- package/script/profile/default_profile.d.ts.map +1 -0
- package/script/profile/default_profile.js +46 -0
- package/script/profile/discipline_mode.d.ts +64 -0
- package/script/profile/discipline_mode.d.ts.map +1 -0
- package/script/profile/discipline_mode.js +138 -0
- package/script/profile/discipline_registry.d.ts +41 -0
- package/script/profile/discipline_registry.d.ts.map +1 -0
- package/script/profile/discipline_registry.js +70 -0
- package/script/profile/introspect.d.ts +135 -0
- package/script/profile/introspect.d.ts.map +1 -0
- package/script/profile/introspect.js +381 -0
- package/script/profile/load.d.ts +3 -1
- package/script/profile/load.d.ts.map +1 -1
- package/script/profile/load.js +91 -5
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +511 -89
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +251 -39
- package/script/profile/mod.d.ts +4 -4
- package/script/profile/mod.d.ts.map +1 -1
- package/script/profile/mod.js +12 -6
- package/script/reporter/mod.js +4 -4
- package/script/sync/locked_attributes.d.ts +19 -0
- package/script/sync/locked_attributes.d.ts.map +1 -0
- package/script/sync/locked_attributes.js +30 -0
- package/script/sync/log.d.ts +34 -0
- package/script/sync/log.d.ts.map +1 -0
- package/script/sync/log.js +52 -0
- package/script/sync/mapping.d.ts +66 -0
- package/script/sync/mapping.d.ts.map +1 -0
- package/script/sync/mapping.js +169 -0
- package/script/sync/mod.d.ts +16 -0
- package/script/sync/mod.d.ts.map +1 -0
- package/script/sync/mod.js +21 -0
- package/script/sync/status.d.ts +23 -0
- package/script/sync/status.d.ts.map +1 -0
- package/script/sync/status.js +24 -0
- package/script/typl/ast.d.ts +87 -0
- package/script/typl/ast.d.ts.map +1 -0
- package/script/typl/ast.js +24 -0
- package/script/typl/bridge.d.ts +32 -0
- package/script/typl/bridge.d.ts.map +1 -0
- package/script/typl/bridge.js +30 -0
- package/script/typl/bullet.d.ts +34 -0
- package/script/typl/bullet.d.ts.map +1 -0
- package/script/typl/bullet.js +47 -0
- package/script/typl/diagnostics.d.ts +43 -0
- package/script/typl/diagnostics.d.ts.map +1 -0
- package/script/typl/diagnostics.js +65 -0
- package/script/typl/fence.d.ts +31 -0
- package/script/typl/fence.d.ts.map +1 -0
- package/script/typl/fence.js +27 -0
- package/script/typl/grammar.d.ts +20 -0
- package/script/typl/grammar.d.ts.map +1 -0
- package/script/typl/grammar.js +474 -0
- package/script/typl/inline.d.ts +34 -0
- package/script/typl/inline.d.ts.map +1 -0
- package/script/typl/inline.js +51 -0
- package/script/typl/lexer.d.ts +37 -0
- package/script/typl/lexer.d.ts.map +1 -0
- package/script/typl/lexer.js +237 -0
- package/script/typl/mod.d.ts +23 -0
- package/script/typl/mod.d.ts.map +1 -0
- package/script/typl/mod.js +29 -0
- package/script/typl/registry.d.ts +42 -0
- package/script/typl/registry.d.ts.map +1 -0
- package/script/typl/registry.js +29 -0
- package/script/typl/validator.d.ts +29 -0
- package/script/typl/validator.d.ts.map +1 -0
- package/script/typl/validator.js +144 -0
- package/script/util/fence.d.ts +30 -0
- package/script/util/fence.d.ts.map +1 -0
- package/script/util/fence.js +44 -0
- package/script/util/line_endings.d.ts +33 -0
- package/script/util/line_endings.d.ts.map +1 -0
- package/script/util/line_endings.js +58 -0
- package/script/util/modals.d.ts +29 -0
- package/script/util/modals.d.ts.map +1 -0
- package/script/util/modals.js +42 -0
- package/script/validator/attributes.d.ts +3 -3
- package/script/validator/attributes.d.ts.map +1 -1
- package/script/validator/attributes.js +1 -18
- package/script/validator/body_blocks.d.ts +38 -0
- package/script/validator/body_blocks.d.ts.map +1 -0
- package/script/validator/body_blocks.js +221 -0
- package/script/validator/caption_convention.d.ts +29 -0
- package/script/validator/caption_convention.d.ts.map +1 -0
- package/script/validator/caption_convention.js +61 -0
- package/script/validator/captions.d.ts +22 -0
- package/script/validator/captions.d.ts.map +1 -0
- package/script/validator/captions.js +140 -0
- package/script/validator/component_schemes.d.ts +73 -0
- package/script/validator/component_schemes.d.ts.map +1 -0
- package/script/validator/component_schemes.js +384 -0
- package/script/validator/discipline.d.ts +35 -0
- package/script/validator/discipline.d.ts.map +1 -0
- package/script/validator/discipline.js +207 -0
- package/script/validator/feature_ac.d.ts +28 -0
- package/script/validator/feature_ac.d.ts.map +1 -0
- package/script/validator/feature_ac.js +105 -0
- package/script/validator/listing.d.ts +42 -0
- package/script/validator/listing.d.ts.map +1 -0
- package/script/validator/listing.js +298 -0
- package/script/validator/mod.d.ts +3 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +278 -14
- package/script/validator/modal_keywords.d.ts +25 -0
- package/script/validator/modal_keywords.d.ts.map +1 -0
- package/script/validator/modal_keywords.js +57 -0
- package/script/validator/pattern.d.ts +15 -8
- package/script/validator/pattern.d.ts.map +1 -1
- package/script/validator/pattern.js +42 -19
- package/script/validator/per_type_attrs.d.ts +29 -0
- package/script/validator/per_type_attrs.d.ts.map +1 -0
- package/script/validator/per_type_attrs.js +78 -0
- package/script/validator/pipeline.d.ts +18 -2
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +78 -22
- package/script/validator/trace_types.d.ts +26 -0
- package/script/validator/trace_types.d.ts.map +1 -0
- package/script/validator/trace_types.js +235 -0
- package/script/validator/traceability.d.ts +3 -4
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +5 -10
- package/script/validator/type_resolution.d.ts +67 -0
- package/script/validator/type_resolution.d.ts.map +1 -0
- package/script/validator/type_resolution.js +168 -0
- package/script/validator/types.d.ts +45 -0
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +131 -16
- package/script/validator/value_types.d.ts +8 -0
- package/script/validator/value_types.d.ts.map +1 -1
- package/script/validator/value_types.js +10 -2
package/esm/model/profile.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Profile data model — TypeScript types that mirror ADR-008 §4 manifest
|
|
5
5
|
* schema. Used by the profile loader, merger, and validator.
|
|
6
6
|
*/
|
|
7
|
-
import type { EntryShape } from "./mod.js";
|
|
8
7
|
/** All 14 attribute value-type keywords recognized by the core. */
|
|
9
8
|
export declare const VALUE_TYPES: readonly ["id", "id-list", "uri", "url", "path", "path-or-id", "enum", "tag-list", "text", "citation", "external-id", "integer", "date", "boolean"];
|
|
10
9
|
export type ValueType = typeof VALUE_TYPES[number];
|
|
@@ -28,21 +27,50 @@ export interface AttrDecl {
|
|
|
28
27
|
readonly cardinality: Cardinality;
|
|
29
28
|
readonly values?: readonly string[];
|
|
30
29
|
readonly inverse?: InverseDecl;
|
|
30
|
+
readonly description?: string;
|
|
31
31
|
}
|
|
32
32
|
/** Target matcher: either a type name or a shape matcher object. */
|
|
33
33
|
export type TargetMatcher = string | {
|
|
34
|
-
readonly shape: "
|
|
34
|
+
readonly shape: "Authored" | "Reference";
|
|
35
35
|
};
|
|
36
36
|
/** Traceability rule declared on a shape or type scope. */
|
|
37
37
|
export interface TraceRule {
|
|
38
38
|
readonly target: readonly TargetMatcher[];
|
|
39
39
|
readonly cardinality?: Cardinality;
|
|
40
40
|
readonly required: boolean;
|
|
41
|
+
readonly description?: string;
|
|
42
|
+
}
|
|
43
|
+
export type LabelConcernKind = "enum" | "set" | "flag";
|
|
44
|
+
export interface LabelValue {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly description?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface LabelConcern {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly kind: LabelConcernKind;
|
|
51
|
+
readonly description?: string;
|
|
52
|
+
readonly values: readonly LabelValue[];
|
|
53
|
+
}
|
|
54
|
+
export interface ProfileConvention {
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolved discipline mode per ADR-017 Slice 5. The mode shapes
|
|
61
|
+
* downstream behaviour (Doctor reporting, LSP scaffold ordering,
|
|
62
|
+
* Slice 4 mixed-allocation rule activation).
|
|
63
|
+
*/
|
|
64
|
+
export type DisciplineMode = "flat" | "tiered" | "none";
|
|
65
|
+
/** A profile-declared discipline kind. */
|
|
66
|
+
export interface KindDecl {
|
|
67
|
+
readonly description?: string;
|
|
41
68
|
}
|
|
42
69
|
export type EnforcementMode = "off" | "warn" | "error";
|
|
43
70
|
export interface TypeDef {
|
|
44
71
|
readonly name: string;
|
|
45
|
-
|
|
72
|
+
/** The core type this profile type extends (e.g., "Requirement", "Test"). */
|
|
73
|
+
readonly extends: string;
|
|
46
74
|
readonly displayIdPattern?: string;
|
|
47
75
|
readonly displayIdPatternEnforcement: EnforcementMode;
|
|
48
76
|
readonly required: readonly string[];
|
|
@@ -50,6 +78,13 @@ export interface TypeDef {
|
|
|
50
78
|
readonly traceability: ReadonlyMap<string, TraceRule>;
|
|
51
79
|
/** Optional semantic color-role name (key into `ProfileManifest.colors`). */
|
|
52
80
|
readonly color?: string;
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Discipline kind explicitly assigned to this type. When absent, the
|
|
84
|
+
* effective discipline registry auto-inherits from the type's `extends:`
|
|
85
|
+
* ancestor (see core/profile/discipline_registry.ts).
|
|
86
|
+
*/
|
|
87
|
+
readonly discipline?: string;
|
|
53
88
|
}
|
|
54
89
|
export interface DocTypeDef {
|
|
55
90
|
readonly id: string;
|
|
@@ -70,17 +105,21 @@ export type ProfileSpecifier = {
|
|
|
70
105
|
readonly scope?: string;
|
|
71
106
|
readonly name: string;
|
|
72
107
|
readonly range: string;
|
|
108
|
+
} | {
|
|
109
|
+
readonly kind: "builtin";
|
|
73
110
|
};
|
|
74
111
|
/** Parsed `markspec.yaml` content — the manifest authored in a profile. */
|
|
75
112
|
export interface ProfileManifest {
|
|
76
113
|
readonly id: string;
|
|
77
114
|
readonly version: string;
|
|
115
|
+
/** The `markspec-schema:` pin declaring the core schema version targeted. */
|
|
116
|
+
readonly markspecSchema?: string;
|
|
78
117
|
readonly description?: string;
|
|
79
118
|
readonly license?: string;
|
|
80
119
|
readonly extends?: ProfileSpecifier;
|
|
81
|
-
readonly universalRequired: readonly string[];
|
|
82
120
|
readonly universalAttributes: readonly AttrDecl[];
|
|
83
|
-
readonly labels: readonly
|
|
121
|
+
readonly labels: readonly LabelConcern[];
|
|
122
|
+
readonly conventions: readonly ProfileConvention[];
|
|
84
123
|
/**
|
|
85
124
|
* Semantic color-role bindings authored on this manifest.
|
|
86
125
|
* Maps a profile-author-chosen name (e.g. "primary") to a palette hue
|
|
@@ -88,20 +127,36 @@ export interface ProfileManifest {
|
|
|
88
127
|
* Empty when the manifest does not declare `profile.colors:`.
|
|
89
128
|
*/
|
|
90
129
|
readonly colors: ReadonlyMap<string, string>;
|
|
91
|
-
readonly identified: {
|
|
92
|
-
readonly required: readonly string[];
|
|
93
|
-
readonly attributes: readonly AttrDecl[];
|
|
94
|
-
readonly traceability: ReadonlyMap<string, TraceRule>;
|
|
95
|
-
};
|
|
96
|
-
readonly referenced: {
|
|
97
|
-
readonly required: readonly string[];
|
|
98
|
-
readonly attributes: readonly AttrDecl[];
|
|
99
|
-
};
|
|
100
130
|
readonly types: ReadonlyMap<string, TypeDef>;
|
|
101
131
|
readonly documents: {
|
|
102
132
|
readonly types: readonly DocTypeDef[];
|
|
103
133
|
readonly frontMatter: readonly AttrDecl[];
|
|
104
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* Profile-declared discipline kinds (ADR-017 Invariant 2). Maps kind
|
|
137
|
+
* name → declaration metadata. Empty when the manifest does not declare
|
|
138
|
+
* `profile.kinds:`.
|
|
139
|
+
*/
|
|
140
|
+
readonly kinds: ReadonlyMap<string, KindDecl>;
|
|
141
|
+
/**
|
|
142
|
+
* Prose-analysis configuration. All lexicon lists are additive across
|
|
143
|
+
* the profile chain (parent entries first, child entries appended,
|
|
144
|
+
* duplicates dropped).
|
|
145
|
+
*/
|
|
146
|
+
readonly prose: {
|
|
147
|
+
readonly lexicons: {
|
|
148
|
+
/** Extra tokens that are never flagged as undefined capitalized terms. */
|
|
149
|
+
readonly "capitalized-allow": readonly string[];
|
|
150
|
+
/** Extra abbreviation tokens that suppress false sentence-end detection. */
|
|
151
|
+
readonly "sentence-abbrev": readonly string[];
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Author-declared discipline mode (ADR-017 Slice 5). `undefined` when
|
|
156
|
+
* the manifest does not declare `profile.discipline-mode:`; the merge
|
|
157
|
+
* layer then runs inference to populate `EffectiveProfile.disciplineMode`.
|
|
158
|
+
*/
|
|
159
|
+
readonly disciplineMode?: DisciplineMode;
|
|
105
160
|
}
|
|
106
161
|
/**
|
|
107
162
|
* A profile after it has been resolved and parsed. One tier of a
|
|
@@ -148,18 +203,11 @@ export interface ProvenancedMapEntry<V> {
|
|
|
148
203
|
}
|
|
149
204
|
/** Map with per-entry provenance. Keys are always strings (attr/type/link names). */
|
|
150
205
|
export type ProvenancedMap<V> = ReadonlyMap<string, ProvenancedMapEntry<V>>;
|
|
151
|
-
/** Shape-scope rules after merging (identified or referenced). */
|
|
152
|
-
export interface EffectiveShapeScope {
|
|
153
|
-
readonly required: ProvenancedValue<readonly string[]>;
|
|
154
|
-
readonly attributes: ProvenancedMap<AttrDecl>;
|
|
155
|
-
/** Referenced scope's traceability is always empty (referenced entries don't originate links). */
|
|
156
|
-
readonly traceability: ProvenancedMap<TraceRule>;
|
|
157
|
-
}
|
|
158
206
|
/** Type-scope rules after merging. */
|
|
159
207
|
export interface EffectiveTypeDef {
|
|
160
208
|
readonly name: string;
|
|
161
|
-
/**
|
|
162
|
-
readonly
|
|
209
|
+
/** The core type this profile type extends — frozen at declaration, never changes across the chain. */
|
|
210
|
+
readonly extends: string;
|
|
163
211
|
readonly displayIdPattern: ProvenancedValue<string | undefined>;
|
|
164
212
|
readonly displayIdPatternEnforcement: ProvenancedValue<EnforcementMode>;
|
|
165
213
|
/** Resolved semantic color-role name, or `undefined` when unset. */
|
|
@@ -167,23 +215,50 @@ export interface EffectiveTypeDef {
|
|
|
167
215
|
readonly required: ProvenancedValue<readonly string[]>;
|
|
168
216
|
readonly attributes: ProvenancedMap<AttrDecl>;
|
|
169
217
|
readonly traceability: ProvenancedMap<TraceRule>;
|
|
218
|
+
readonly description: ProvenancedValue<string | undefined>;
|
|
219
|
+
readonly attrDescriptions: ProvenancedMap<string>;
|
|
220
|
+
readonly relationDescriptions: ProvenancedMap<string>;
|
|
221
|
+
/**
|
|
222
|
+
* Discipline kind explicitly assigned to this type by some tier of the
|
|
223
|
+
* profile chain. `value` is `undefined` when no tier assigned one — the
|
|
224
|
+
* registry builder then walks the `extends:` chain to resolve.
|
|
225
|
+
*/
|
|
226
|
+
readonly discipline: ProvenancedValue<string | undefined>;
|
|
170
227
|
}
|
|
171
228
|
/**
|
|
172
229
|
* The merged, validator-ready view of a profile chain. Every field carries
|
|
173
230
|
* per-rule provenance so a diagnostic can blame the right tier.
|
|
174
231
|
*/
|
|
175
232
|
export interface EffectiveProfile {
|
|
176
|
-
readonly required: ProvenancedValue<readonly string[]>;
|
|
177
233
|
readonly attributes: ProvenancedMap<AttrDecl>;
|
|
178
|
-
readonly labels:
|
|
234
|
+
readonly labels: ProvenancedMap<LabelConcern>;
|
|
235
|
+
readonly conventions: ProvenancedMap<ProfileConvention>;
|
|
179
236
|
/** Semantic color-role bindings merged across the chain. */
|
|
180
237
|
readonly colors: ProvenancedMap<string>;
|
|
181
|
-
readonly identified: EffectiveShapeScope;
|
|
182
|
-
readonly referenced: EffectiveShapeScope;
|
|
183
238
|
readonly types: ProvenancedMap<EffectiveTypeDef>;
|
|
184
239
|
readonly documents: {
|
|
185
240
|
readonly types: ProvenancedMap<DocTypeDef>;
|
|
186
241
|
readonly frontMatter: ProvenancedMap<AttrDecl>;
|
|
187
242
|
};
|
|
243
|
+
/** Discipline kinds declared across the profile chain (ADR-017). */
|
|
244
|
+
readonly kinds: ProvenancedMap<KindDecl>;
|
|
245
|
+
/**
|
|
246
|
+
* Prose-analysis configuration merged across the chain. Each lexicon list
|
|
247
|
+
* is list-additive: parent entries first, child entries appended, duplicates
|
|
248
|
+
* dropped (profile-schema §5.1).
|
|
249
|
+
*/
|
|
250
|
+
readonly prose: {
|
|
251
|
+
readonly lexicons: {
|
|
252
|
+
readonly "capitalized-allow": ProvenancedValue<readonly string[]>;
|
|
253
|
+
readonly "sentence-abbrev": ProvenancedValue<readonly string[]>;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Resolved discipline mode after the chain folds (ADR-017 Slice 5).
|
|
258
|
+
* Always defined — `origin` is `"declared"` when at least one tier
|
|
259
|
+
* supplied a value, otherwise `"inferred"` (computed from the
|
|
260
|
+
* effective type graph by `inferDisciplineMode()`).
|
|
261
|
+
*/
|
|
262
|
+
readonly disciplineMode: ProvenancedValue<DisciplineMode>;
|
|
188
263
|
}
|
|
189
264
|
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/model/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/model/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,mEAAmE;AACnE,eAAO,MAAM,WAAW,qJAed,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAEnD,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAGlD,CAAC;AAMH,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAMD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
|
+
* `Source:` value looks like a recognised manifest, source-code
|
|
7
|
+
* file, interface description, or bus description; `undefined`
|
|
8
|
+
* otherwise.
|
|
9
|
+
*
|
|
10
|
+
* Match order is significant — manifests must run before generic
|
|
11
|
+
* extension matches so `path/to/something.json` doesn't shadow
|
|
12
|
+
* `package.json`. The list is conservative: only patterns ADR-003
|
|
13
|
+
* §Part 5 lists normatively are encoded here; profiles extend the
|
|
14
|
+
* map later.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Infer a core type from a `Source:` attribute value. The value
|
|
18
|
+
* may be a filesystem path or a URI — only the filename portion
|
|
19
|
+
* is matched. Whitespace is trimmed before matching.
|
|
20
|
+
*
|
|
21
|
+
* Returns `undefined` when no pattern matches; callers should treat
|
|
22
|
+
* that as "Source: didn't classify" and fall through to step 4 of
|
|
23
|
+
* the resolution chain.
|
|
24
|
+
*/
|
|
25
|
+
export declare function inferTypeFromSource(source: string): string | undefined;
|
|
26
|
+
//# sourceMappingURL=source_introspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source_introspection.d.ts","sourceRoot":"","sources":["../../src/model/source_introspection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwDH;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMtE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module model/source_introspection
|
|
3
|
+
*
|
|
4
|
+
* `Source:` → core type inference per spec §1.3.1 step 3 and
|
|
5
|
+
* ADR-003 §Part 5. Returns the inferred core type when the
|
|
6
|
+
* `Source:` value looks like a recognised manifest, source-code
|
|
7
|
+
* file, interface description, or bus description; `undefined`
|
|
8
|
+
* otherwise.
|
|
9
|
+
*
|
|
10
|
+
* Match order is significant — manifests must run before generic
|
|
11
|
+
* extension matches so `path/to/something.json` doesn't shadow
|
|
12
|
+
* `package.json`. The list is conservative: only patterns ADR-003
|
|
13
|
+
* §Part 5 lists normatively are encoded here; profiles extend the
|
|
14
|
+
* map later.
|
|
15
|
+
*/
|
|
16
|
+
const SOURCE_PATTERNS = [
|
|
17
|
+
// Build manifests → SoftwareComponent. Anchored at filename
|
|
18
|
+
// boundary so `weird-Cargo.toml` doesn't match unintentionally.
|
|
19
|
+
{ pattern: /(?:^|\/)Cargo\.toml$/, type: "SoftwareComponent" },
|
|
20
|
+
{ pattern: /(?:^|\/)package\.json$/, type: "SoftwareComponent" },
|
|
21
|
+
{ pattern: /(?:^|\/)pom\.xml$/, type: "SoftwareComponent" },
|
|
22
|
+
{ pattern: /(?:^|\/)deno\.json$/, type: "SoftwareComponent" },
|
|
23
|
+
{ pattern: /(?:^|\/)go\.mod$/, type: "SoftwareComponent" },
|
|
24
|
+
{ pattern: /(?:^|\/)pyproject\.toml$/, type: "SoftwareComponent" },
|
|
25
|
+
{ pattern: /(?:^|\/)setup\.py$/, type: "SoftwareComponent" },
|
|
26
|
+
{ pattern: /(?:^|\/)pubspec\.yaml$/, type: "SoftwareComponent" },
|
|
27
|
+
{ pattern: /(?:^|\/)[^/]+\.csproj$/, type: "SoftwareComponent" },
|
|
28
|
+
// Interface description files → SoftwareInterface. Run BEFORE the
|
|
29
|
+
// generic source-code extensions so `.openapi.yaml` wins over `.yaml`.
|
|
30
|
+
{ pattern: /\.openapi\.(?:yaml|yml|json)$/, type: "SoftwareInterface" },
|
|
31
|
+
{ pattern: /\.asyncapi\.(?:yaml|yml|json)$/, type: "SoftwareInterface" },
|
|
32
|
+
{ pattern: /\.proto$/, type: "SoftwareInterface" },
|
|
33
|
+
{ pattern: /\.graphql$/, type: "SoftwareInterface" },
|
|
34
|
+
{ pattern: /\.wsdl$/, type: "SoftwareInterface" },
|
|
35
|
+
{ pattern: /\.arxml$/, type: "SoftwareInterface" },
|
|
36
|
+
{ pattern: /\.idl$/, type: "SoftwareInterface" },
|
|
37
|
+
{ pattern: /\.ridl$/, type: "SoftwareInterface" },
|
|
38
|
+
// Bus description files → HardwareInterface.
|
|
39
|
+
{ pattern: /\.dbc$/, type: "HardwareInterface" },
|
|
40
|
+
{ pattern: /\.ldf$/, type: "HardwareInterface" },
|
|
41
|
+
{ pattern: /\.fibex$/, type: "HardwareInterface" },
|
|
42
|
+
// Source-code files → SoftwareUnit.
|
|
43
|
+
{ pattern: /\.rs$/, type: "SoftwareUnit" },
|
|
44
|
+
{ pattern: /\.kt$/, type: "SoftwareUnit" },
|
|
45
|
+
{ pattern: /\.kts$/, type: "SoftwareUnit" },
|
|
46
|
+
{ pattern: /\.java$/, type: "SoftwareUnit" },
|
|
47
|
+
{ pattern: /\.py$/, type: "SoftwareUnit" },
|
|
48
|
+
{ pattern: /\.ts$/, type: "SoftwareUnit" },
|
|
49
|
+
{ pattern: /\.tsx$/, type: "SoftwareUnit" },
|
|
50
|
+
{ pattern: /\.js$/, type: "SoftwareUnit" },
|
|
51
|
+
{ pattern: /\.jsx$/, type: "SoftwareUnit" },
|
|
52
|
+
{ pattern: /\.go$/, type: "SoftwareUnit" },
|
|
53
|
+
{ pattern: /\.cpp$/, type: "SoftwareUnit" },
|
|
54
|
+
{ pattern: /\.cc$/, type: "SoftwareUnit" },
|
|
55
|
+
{ pattern: /\.cxx$/, type: "SoftwareUnit" },
|
|
56
|
+
{ pattern: /\.c$/, type: "SoftwareUnit" },
|
|
57
|
+
{ pattern: /\.h$/, type: "SoftwareUnit" },
|
|
58
|
+
{ pattern: /\.hpp$/, type: "SoftwareUnit" },
|
|
59
|
+
{ pattern: /\.hxx$/, type: "SoftwareUnit" },
|
|
60
|
+
];
|
|
61
|
+
/**
|
|
62
|
+
* Infer a core type from a `Source:` attribute value. The value
|
|
63
|
+
* may be a filesystem path or a URI — only the filename portion
|
|
64
|
+
* is matched. Whitespace is trimmed before matching.
|
|
65
|
+
*
|
|
66
|
+
* Returns `undefined` when no pattern matches; callers should treat
|
|
67
|
+
* that as "Source: didn't classify" and fall through to step 4 of
|
|
68
|
+
* the resolution chain.
|
|
69
|
+
*/
|
|
70
|
+
export function inferTypeFromSource(source) {
|
|
71
|
+
const trimmed = source.trim();
|
|
72
|
+
for (const { pattern, type } of SOURCE_PATTERNS) {
|
|
73
|
+
if (pattern.test(trimmed))
|
|
74
|
+
return type;
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module model/type_hierarchy
|
|
3
|
+
*
|
|
4
|
+
* Core type hierarchy from ADR-003 §Part 2. Encodes the per-type
|
|
5
|
+
* attribute catalogue for the 15 built-in concrete types and the four
|
|
6
|
+
* abstract parents. Attributes flow downward via inheritance; this
|
|
7
|
+
* module exposes lookup helpers consumed by the validator's MSL-T022
|
|
8
|
+
* check and by future profile-resolution work.
|
|
9
|
+
*/
|
|
10
|
+
/** Per-type definition: parent in the hierarchy + locally declared attrs. */
|
|
11
|
+
export interface CoreTypeDef {
|
|
12
|
+
/** Parent type name, or `null` for `Item` (the root). */
|
|
13
|
+
readonly parent: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Attributes declared by this type. Subtype attribute sets include
|
|
16
|
+
* everything declared on ancestor types, per ADR-003 §Part 2.
|
|
17
|
+
*/
|
|
18
|
+
readonly ownAttrs: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Attributes inherited from ancestors that are "not applicable" on
|
|
21
|
+
* this subtype per ADR-003 §Part 2 (e.g., `Allocated-to` on Test).
|
|
22
|
+
* Removed during {@linkcode attributesForType} resolution.
|
|
23
|
+
*/
|
|
24
|
+
readonly excludedAttrs?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Built-in type hierarchy. Keyed by the canonical TitleCase / lower-with-
|
|
28
|
+
* hyphens name as it would appear in a `Type:` attribute value.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CORE_TYPE_HIERARCHY: Readonly<Record<string, CoreTypeDef>>;
|
|
31
|
+
/**
|
|
32
|
+
* Collect every attribute valid on `typeName` by walking the parent
|
|
33
|
+
* chain and subtracting any `excludedAttrs` declared along the way.
|
|
34
|
+
* Returns a {@linkcode Set} of attribute keys (TitleCase or
|
|
35
|
+
* lowercase-with-hyphens as declared). Returns an empty set for
|
|
36
|
+
* unknown type names — the caller treats unknown types separately.
|
|
37
|
+
*
|
|
38
|
+
* Exclusion semantics: an attribute marked `excludedAttrs` on a
|
|
39
|
+
* subtype is removed from the final set even if an ancestor declared
|
|
40
|
+
* it. The subtype cannot re-add the attribute later — only its own
|
|
41
|
+
* `ownAttrs` list contributes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function attributesForType(typeName: string): Set<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Union of every type-scoped attribute name declared anywhere in the
|
|
46
|
+
* core hierarchy. Used by the validator to suppress `MSL-R010`
|
|
47
|
+
* (unknown attribute) for keys that are core-known but appear on the
|
|
48
|
+
* "wrong" type — those cases get the more specific `MSL-T022`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CORE_TYPE_SCOPED_ATTRS: ReadonlySet<string>;
|
|
51
|
+
//# sourceMappingURL=type_hierarchy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type_hierarchy.d.ts","sourceRoot":"","sources":["../../src/model/type_hierarchy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA0ErE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAa/D;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAMnD,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module model/type_hierarchy
|
|
3
|
+
*
|
|
4
|
+
* Core type hierarchy from ADR-003 §Part 2. Encodes the per-type
|
|
5
|
+
* attribute catalogue for the 15 built-in concrete types and the four
|
|
6
|
+
* abstract parents. Attributes flow downward via inheritance; this
|
|
7
|
+
* module exposes lookup helpers consumed by the validator's MSL-T022
|
|
8
|
+
* check and by future profile-resolution work.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Built-in type hierarchy. Keyed by the canonical TitleCase / lower-with-
|
|
12
|
+
* hyphens name as it would appear in a `Type:` attribute value.
|
|
13
|
+
*/
|
|
14
|
+
export const CORE_TYPE_HIERARCHY = {
|
|
15
|
+
// Root
|
|
16
|
+
Item: { parent: null, ownAttrs: [] },
|
|
17
|
+
// Specification family (ADR-003 §Part 2 — Specification)
|
|
18
|
+
Specification: {
|
|
19
|
+
parent: "Item",
|
|
20
|
+
ownAttrs: ["Derived-from", "Satisfies", "Allocated-to"],
|
|
21
|
+
},
|
|
22
|
+
Requirement: { parent: "Specification", ownAttrs: [] },
|
|
23
|
+
Test: {
|
|
24
|
+
parent: "Specification",
|
|
25
|
+
ownAttrs: ["Verifies", "Tests"],
|
|
26
|
+
// ADR-003 §Part 2 — Test: "Allocated-to: not applicable —
|
|
27
|
+
// tests are not allocated to components".
|
|
28
|
+
excludedAttrs: ["Allocated-to"],
|
|
29
|
+
},
|
|
30
|
+
Contract: { parent: "Specification", ownAttrs: ["Schema-language"] },
|
|
31
|
+
Record: { parent: "Specification", ownAttrs: ["Caused-by", "Affects"] },
|
|
32
|
+
Risk: { parent: "Specification", ownAttrs: ["Caused-by", "Mitigated-by"] },
|
|
33
|
+
// Component family (ADR-003 §Part 2 — Component)
|
|
34
|
+
Component: {
|
|
35
|
+
parent: "Item",
|
|
36
|
+
ownAttrs: [
|
|
37
|
+
"Kind",
|
|
38
|
+
"Part-of",
|
|
39
|
+
"Realizes",
|
|
40
|
+
"Depends-on",
|
|
41
|
+
"Provides",
|
|
42
|
+
"Requires",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
SoftwareComponent: {
|
|
46
|
+
parent: "Component",
|
|
47
|
+
ownAttrs: ["License", "Build-manifest", "Package-manager"],
|
|
48
|
+
},
|
|
49
|
+
HardwareComponent: {
|
|
50
|
+
parent: "Component",
|
|
51
|
+
ownAttrs: ["Manufacturer", "Part-number", "Datasheet"],
|
|
52
|
+
},
|
|
53
|
+
SoftwareInterface: { parent: "Component", ownAttrs: [] },
|
|
54
|
+
HardwareInterface: {
|
|
55
|
+
parent: "Component",
|
|
56
|
+
ownAttrs: [
|
|
57
|
+
"Bus-protocol",
|
|
58
|
+
"Connector-type",
|
|
59
|
+
"Voltage-level",
|
|
60
|
+
"Signal-direction",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
// Unit family (ADR-003 §Part 2 — Unit)
|
|
64
|
+
Unit: {
|
|
65
|
+
parent: "Item",
|
|
66
|
+
ownAttrs: ["Part-of", "Realizes", "Depends-on"],
|
|
67
|
+
},
|
|
68
|
+
SoftwareUnit: {
|
|
69
|
+
parent: "Unit",
|
|
70
|
+
ownAttrs: ["Source", "Symbol", "Language"],
|
|
71
|
+
},
|
|
72
|
+
HardwareUnit: {
|
|
73
|
+
parent: "Unit",
|
|
74
|
+
ownAttrs: [
|
|
75
|
+
"Manufacturer",
|
|
76
|
+
"Part-number",
|
|
77
|
+
"Datasheet",
|
|
78
|
+
"Footprint",
|
|
79
|
+
"Value",
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
// Standalone subtype of Item (ADR-003 §Part 2 — Definition)
|
|
83
|
+
Definition: { parent: "Item", ownAttrs: ["Aliases", "See-also"] },
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Collect every attribute valid on `typeName` by walking the parent
|
|
87
|
+
* chain and subtracting any `excludedAttrs` declared along the way.
|
|
88
|
+
* Returns a {@linkcode Set} of attribute keys (TitleCase or
|
|
89
|
+
* lowercase-with-hyphens as declared). Returns an empty set for
|
|
90
|
+
* unknown type names — the caller treats unknown types separately.
|
|
91
|
+
*
|
|
92
|
+
* Exclusion semantics: an attribute marked `excludedAttrs` on a
|
|
93
|
+
* subtype is removed from the final set even if an ancestor declared
|
|
94
|
+
* it. The subtype cannot re-add the attribute later — only its own
|
|
95
|
+
* `ownAttrs` list contributes.
|
|
96
|
+
*/
|
|
97
|
+
export function attributesForType(typeName) {
|
|
98
|
+
const result = new Set();
|
|
99
|
+
const excluded = new Set();
|
|
100
|
+
let cursor = typeName;
|
|
101
|
+
while (cursor !== null && CORE_TYPE_HIERARCHY[cursor]) {
|
|
102
|
+
for (const a of CORE_TYPE_HIERARCHY[cursor].ownAttrs)
|
|
103
|
+
result.add(a);
|
|
104
|
+
for (const a of CORE_TYPE_HIERARCHY[cursor].excludedAttrs ?? []) {
|
|
105
|
+
excluded.add(a);
|
|
106
|
+
}
|
|
107
|
+
cursor = CORE_TYPE_HIERARCHY[cursor].parent;
|
|
108
|
+
}
|
|
109
|
+
for (const a of excluded)
|
|
110
|
+
result.delete(a);
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Union of every type-scoped attribute name declared anywhere in the
|
|
115
|
+
* core hierarchy. Used by the validator to suppress `MSL-R010`
|
|
116
|
+
* (unknown attribute) for keys that are core-known but appear on the
|
|
117
|
+
* "wrong" type — those cases get the more specific `MSL-T022`.
|
|
118
|
+
*/
|
|
119
|
+
export const CORE_TYPE_SCOPED_ATTRS = (() => {
|
|
120
|
+
const set = new Set();
|
|
121
|
+
for (const def of Object.values(CORE_TYPE_HIERARCHY)) {
|
|
122
|
+
for (const a of def.ownAttrs)
|
|
123
|
+
set.add(a);
|
|
124
|
+
}
|
|
125
|
+
return set;
|
|
126
|
+
})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module model/uri_scheme_map
|
|
3
|
+
*
|
|
4
|
+
* Reference-shape URI → core type inference per ADR-003 §Part 6.
|
|
5
|
+
* Used by spec §1.3.1 step 5 of the type-resolution chain: a Reference
|
|
6
|
+
* entry whose `Id:` is a recognised URI scheme can infer its core type
|
|
7
|
+
* without an explicit `Type:` attribute.
|
|
8
|
+
*
|
|
9
|
+
* The map is intentionally conservative: only patterns the spec lists
|
|
10
|
+
* normatively are encoded. Profile extensions to the scheme map land
|
|
11
|
+
* in the profile layer.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Infer a core type name from a Reference-shape `Id:` value (a URI).
|
|
15
|
+
* Returns `undefined` when no rule matches — the caller should leave
|
|
16
|
+
* the entry type unresolved rather than guess.
|
|
17
|
+
*
|
|
18
|
+
* @param idValue The raw `Id:` value (a scheme-qualified URI).
|
|
19
|
+
*/
|
|
20
|
+
export declare function inferTypeFromUriScheme(idValue: string): string | undefined;
|
|
21
|
+
//# sourceMappingURL=uri_scheme_map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uri_scheme_map.d.ts","sourceRoot":"","sources":["../../src/model/uri_scheme_map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6DH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK1E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module model/uri_scheme_map
|
|
3
|
+
*
|
|
4
|
+
* Reference-shape URI → core type inference per ADR-003 §Part 6.
|
|
5
|
+
* Used by spec §1.3.1 step 5 of the type-resolution chain: a Reference
|
|
6
|
+
* entry whose `Id:` is a recognised URI scheme can infer its core type
|
|
7
|
+
* without an explicit `Type:` attribute.
|
|
8
|
+
*
|
|
9
|
+
* The map is intentionally conservative: only patterns the spec lists
|
|
10
|
+
* normatively are encoded. Profile extensions to the scheme map land
|
|
11
|
+
* in the profile layer.
|
|
12
|
+
*/
|
|
13
|
+
const URI_SCHEME_RULES = [
|
|
14
|
+
// Package URLs (purl) — Software components
|
|
15
|
+
{ pattern: /^pkg:cargo\//, type: "SoftwareComponent" },
|
|
16
|
+
{ pattern: /^pkg:npm\//, type: "SoftwareComponent" },
|
|
17
|
+
{ pattern: /^pkg:maven\//, type: "SoftwareComponent" },
|
|
18
|
+
{ pattern: /^pkg:pypi\//, type: "SoftwareComponent" },
|
|
19
|
+
{ pattern: /^pkg:go\//, type: "SoftwareComponent" },
|
|
20
|
+
{ pattern: /^pkg:nuget\//, type: "SoftwareComponent" },
|
|
21
|
+
{ pattern: /^pkg:deno\//, type: "SoftwareComponent" },
|
|
22
|
+
{ pattern: /^pkg:swift\//, type: "SoftwareComponent" },
|
|
23
|
+
{ pattern: /^pkg:firmware\//, type: "SoftwareComponent" },
|
|
24
|
+
// Package URLs — Hardware components
|
|
25
|
+
{ pattern: /^pkg:hw\//, type: "HardwareComponent" },
|
|
26
|
+
{ pattern: /^pkg:device\//, type: "HardwareComponent" },
|
|
27
|
+
// Standards / regulations / RFCs / papers
|
|
28
|
+
{ pattern: /^urn:iso:std:iso:/, type: "Requirement" },
|
|
29
|
+
{ pattern: /^urn:iso:std:iec:/, type: "Requirement" },
|
|
30
|
+
{ pattern: /^urn:iso:std:iso:iec:ieee:/, type: "Requirement" },
|
|
31
|
+
{ pattern: /^urn:ietf:rfc:/, type: "Requirement" },
|
|
32
|
+
{ pattern: /^urn:nist:/, type: "Requirement" },
|
|
33
|
+
{ pattern: /^urn:unece:/, type: "Requirement" },
|
|
34
|
+
{ pattern: /^doi:/, type: "Requirement" },
|
|
35
|
+
// External tracker schemes — Requirement (proxy item in external system)
|
|
36
|
+
{ pattern: /^codebeamer:/, type: "Requirement" },
|
|
37
|
+
{ pattern: /^doors:/, type: "Requirement" },
|
|
38
|
+
{ pattern: /^polarion:/, type: "Requirement" },
|
|
39
|
+
// Interface description schemes
|
|
40
|
+
{ pattern: /^urn:openapi:/, type: "Contract" },
|
|
41
|
+
{ pattern: /^urn:asyncapi:/, type: "Contract" },
|
|
42
|
+
{ pattern: /^urn:protobuf:/, type: "Contract" },
|
|
43
|
+
{ pattern: /^urn:wsdl:/, type: "Contract" },
|
|
44
|
+
{ pattern: /^urn:autosar:port:/, type: "Contract" },
|
|
45
|
+
// Hardware interfaces (bus networks)
|
|
46
|
+
{ pattern: /^urn:can-bus:/, type: "HardwareInterface" },
|
|
47
|
+
// Glossary terms
|
|
48
|
+
{ pattern: /^urn:refhub:term:/, type: "Definition" },
|
|
49
|
+
{ pattern: /^urn:driftsys:refhub:term:/, type: "Definition" },
|
|
50
|
+
// PLM
|
|
51
|
+
{ pattern: /^plm:/, type: "HardwareComponent" },
|
|
52
|
+
];
|
|
53
|
+
/**
|
|
54
|
+
* Infer a core type name from a Reference-shape `Id:` value (a URI).
|
|
55
|
+
* Returns `undefined` when no rule matches — the caller should leave
|
|
56
|
+
* the entry type unresolved rather than guess.
|
|
57
|
+
*
|
|
58
|
+
* @param idValue The raw `Id:` value (a scheme-qualified URI).
|
|
59
|
+
*/
|
|
60
|
+
export function inferTypeFromUriScheme(idValue) {
|
|
61
|
+
for (const rule of URI_SCHEME_RULES) {
|
|
62
|
+
if (rule.pattern.test(idValue))
|
|
63
|
+
return rule.type;
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/parser/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/parser/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAalE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAgBrE;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA6B,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,eAAe,CA6BjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GACd,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA+BpB"}
|