@driftsys/markspec 0.5.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 +11 -21
- package/esm/ast/build.d.ts.map +1 -1
- package/esm/ast/build.js +50 -139
- package/esm/ast/nodes.d.ts +11 -43
- package/esm/ast/nodes.d.ts.map +1 -1
- package/esm/ast/nodes.js +6 -1
- package/esm/ast/normalize.d.ts +8 -17
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +14 -72
- 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 +7 -0
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +1 -18
- package/esm/compiler/mod.d.ts +30 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +198 -65
- package/esm/compiler/schema.d.ts +15 -0
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +12 -0
- 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/formatter/mod.d.ts +9 -3
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +97 -49
- 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 +4 -0
- package/esm/lint/mod.d.ts.map +1 -1
- package/esm/lint/mod.js +2 -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/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/suppression.d.ts +38 -3
- package/esm/lint/rules/suppression.d.ts.map +1 -1
- package/esm/lint/rules/suppression.js +58 -4
- 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 +31 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +67 -26
- 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 +12 -0
- package/esm/lint/types.d.ts.map +1 -1
- 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 +16 -9
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +12 -4
- package/esm/model/attributes.d.ts +6 -0
- package/esm/model/attributes.d.ts.map +1 -1
- package/esm/model/attributes.js +37 -0
- 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/mod.d.ts +188 -30
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +42 -1
- package/esm/model/profile.d.ts +69 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +1 -10
- 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 +8 -0
- package/esm/parser/glossary.d.ts.map +1 -1
- package/esm/parser/glossary.js +6 -4
- 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 +107 -31
- package/esm/parser/mod.d.ts +4 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +30 -8
- package/esm/parser/source.d.ts +39 -8
- package/esm/parser/source.d.ts.map +1 -1
- package/esm/parser/source.js +155 -65
- 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 +29 -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/load.d.ts +3 -1
- package/esm/profile/load.d.ts.map +1 -1
- package/esm/profile/load.js +24 -5
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +253 -20
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +112 -0
- package/esm/profile/mod.d.ts +2 -0
- package/esm/profile/mod.d.ts.map +1 -1
- package/esm/profile/mod.js +2 -0
- 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/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/discipline.d.ts +35 -0
- package/esm/validator/discipline.d.ts.map +1 -0
- package/esm/validator/discipline.js +204 -0
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +23 -2
- package/esm/validator/modal_keywords.d.ts +15 -13
- package/esm/validator/modal_keywords.d.ts.map +1 -1
- package/esm/validator/modal_keywords.js +26 -109
- 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 +2 -2
- package/esm/validator/per_type_attrs.d.ts.map +1 -1
- package/esm/validator/per_type_attrs.js +2 -2
- package/esm/validator/pipeline.d.ts +11 -0
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +37 -15
- package/esm/validator/type_resolution.d.ts +3 -3
- package/esm/validator/type_resolution.d.ts.map +1 -1
- package/esm/validator/type_resolution.js +31 -9
- package/package.json +2 -2
- package/script/ast/build.d.ts +11 -21
- package/script/ast/build.d.ts.map +1 -1
- package/script/ast/build.js +51 -140
- package/script/ast/nodes.d.ts +11 -43
- package/script/ast/nodes.d.ts.map +1 -1
- package/script/ast/nodes.js +6 -1
- package/script/ast/normalize.d.ts +8 -17
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +16 -74
- 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 +7 -0
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +2 -19
- package/script/compiler/mod.d.ts +30 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +202 -69
- package/script/compiler/schema.d.ts +15 -0
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +12 -0
- 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/formatter/mod.d.ts +9 -3
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +99 -51
- 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 +4 -0
- package/script/lint/mod.d.ts.map +1 -1
- package/script/lint/mod.js +6 -1
- 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/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/suppression.d.ts +38 -3
- package/script/lint/rules/suppression.d.ts.map +1 -1
- package/script/lint/rules/suppression.js +59 -3
- 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 +31 -11
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +67 -26
- 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 +12 -0
- package/script/lint/types.d.ts.map +1 -1
- 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 +16 -9
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +111 -38
- package/script/model/attributes.d.ts +6 -0
- package/script/model/attributes.d.ts.map +1 -1
- package/script/model/attributes.js +38 -1
- 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/mod.d.ts +188 -30
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +48 -1
- package/script/model/profile.d.ts +69 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +1 -10
- 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 +8 -0
- package/script/parser/glossary.d.ts.map +1 -1
- package/script/parser/glossary.js +7 -4
- 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 +105 -29
- package/script/parser/mod.d.ts +4 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +32 -7
- package/script/parser/source.d.ts +39 -8
- package/script/parser/source.d.ts.map +1 -1
- package/script/parser/source.js +156 -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 +29 -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/load.d.ts +3 -1
- package/script/profile/load.d.ts.map +1 -1
- package/script/profile/load.js +24 -5
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +252 -19
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +112 -0
- package/script/profile/mod.d.ts +2 -0
- package/script/profile/mod.d.ts.map +1 -1
- package/script/profile/mod.js +6 -1
- 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/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/discipline.d.ts +35 -0
- package/script/validator/discipline.d.ts.map +1 -0
- package/script/validator/discipline.js +207 -0
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +23 -1
- package/script/validator/modal_keywords.d.ts +15 -13
- package/script/validator/modal_keywords.d.ts.map +1 -1
- package/script/validator/modal_keywords.js +26 -109
- 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 +2 -2
- package/script/validator/per_type_attrs.d.ts.map +1 -1
- package/script/validator/per_type_attrs.js +2 -2
- package/script/validator/pipeline.d.ts +11 -0
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +40 -17
- package/script/validator/type_resolution.d.ts +3 -3
- package/script/validator/type_resolution.d.ts.map +1 -1
- package/script/validator/type_resolution.js +31 -9
- package/esm/parser/entity_refs.d.ts +0 -53
- package/esm/parser/entity_refs.d.ts.map +0 -1
- package/esm/parser/entity_refs.js +0 -151
- package/script/parser/entity_refs.d.ts +0 -53
- package/script/parser/entity_refs.d.ts.map +0 -1
- package/script/parser/entity_refs.js +0 -155
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/resolve
|
|
3
|
+
*
|
|
4
|
+
* Shared upstream-resolution layer. Both `markspec lock` and
|
|
5
|
+
* `markspec compile` call {@linkcode resolveUpstreams}. All
|
|
6
|
+
* world-touching operations (HTTP fetch, clock) flow through
|
|
7
|
+
* callbacks so unit tests inject deterministic stubs.
|
|
8
|
+
*
|
|
9
|
+
* Implementation arrives in Tasks 15–18; this file ships the type
|
|
10
|
+
* surface and a stub.
|
|
11
|
+
*/
|
|
12
|
+
import { inferLockedAttributes } from "../sync/locked_attributes.js";
|
|
13
|
+
import { sha256Bytes } from "./hash.js";
|
|
14
|
+
import { hashCanonicalEdges } from "./canonical_edges.js";
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Reference resolution (Task 15)
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
/**
|
|
19
|
+
* Extract the "resolved version" segment from a Reference's URI.
|
|
20
|
+
*
|
|
21
|
+
* Heuristics covering the URI schemes the lock CLI is expected to see:
|
|
22
|
+
* - `urn:iso:std:iso:26262:-6:ed-2` → `ed-2` (last `:`-segment)
|
|
23
|
+
* - `pkg:cargo/serde@1.0.0` → `1.0.0` (everything after the last `@`)
|
|
24
|
+
* - `doi:…`, `isbn:…`, plain `https://…` → undefined
|
|
25
|
+
*/
|
|
26
|
+
function extractResolvedVersion(uri) {
|
|
27
|
+
const urnMatch = uri.match(/^urn:[^:]+(?:::|:)([^:]+)$/);
|
|
28
|
+
if (urnMatch)
|
|
29
|
+
return urnMatch[1];
|
|
30
|
+
const pkgMatch = uri.match(/@([^?]+)$/);
|
|
31
|
+
if (pkgMatch)
|
|
32
|
+
return pkgMatch[1];
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
/** First raw-attribute value matching `key`, or undefined. */
|
|
36
|
+
function attrValue(entry, key) {
|
|
37
|
+
for (const a of entry.rawAttributes) {
|
|
38
|
+
if (a.key === key)
|
|
39
|
+
return a.value;
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolve every Reference entry to an upstream record. Deduplicates by
|
|
45
|
+
* display ID (first occurrence wins). When `Reference-url:` is set, the
|
|
46
|
+
* bytes are fetched and `sha256:*`-hashed; otherwise an MSL-L010 info
|
|
47
|
+
* diagnostic is attached and the upstream is identity-only. Fetch
|
|
48
|
+
* failures attach MSL-L101 and degrade to identity-only.
|
|
49
|
+
*/
|
|
50
|
+
export async function resolveReferences(entries, fetchUrl) {
|
|
51
|
+
const out = [];
|
|
52
|
+
const seenSlugs = new Set();
|
|
53
|
+
for (const entry of entries) {
|
|
54
|
+
if (entry.shape !== "Reference")
|
|
55
|
+
continue;
|
|
56
|
+
if (seenSlugs.has(entry.displayId))
|
|
57
|
+
continue;
|
|
58
|
+
seenSlugs.add(entry.displayId);
|
|
59
|
+
const id = entry.id;
|
|
60
|
+
if (id === undefined)
|
|
61
|
+
continue;
|
|
62
|
+
const refUrl = attrValue(entry, "Reference-url");
|
|
63
|
+
const diagnostics = [];
|
|
64
|
+
let hash;
|
|
65
|
+
let source;
|
|
66
|
+
if (refUrl === undefined) {
|
|
67
|
+
diagnostics.push({
|
|
68
|
+
code: "MSL-L010",
|
|
69
|
+
severity: "info",
|
|
70
|
+
message: `Reference '${entry.displayId}' has no Reference-url:; identity-only lock (no hash, no drift detection).`,
|
|
71
|
+
location: entry.location,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const fetched = await fetchUrl(refUrl);
|
|
76
|
+
if (fetched instanceof Uint8Array) {
|
|
77
|
+
hash = await sha256Bytes(fetched);
|
|
78
|
+
source = refUrl;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
diagnostics.push({
|
|
82
|
+
code: "MSL-L101",
|
|
83
|
+
severity: "warning",
|
|
84
|
+
message: `Failed to fetch Reference-url for '${entry.displayId}' (${refUrl}): ${fetched.error}. Recording identity-only.`,
|
|
85
|
+
location: entry.location,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
out.push({
|
|
90
|
+
upstream: {
|
|
91
|
+
kind: "reference",
|
|
92
|
+
slug: entry.displayId,
|
|
93
|
+
id,
|
|
94
|
+
resolved: extractResolvedVersion(id),
|
|
95
|
+
hash,
|
|
96
|
+
source,
|
|
97
|
+
},
|
|
98
|
+
diagnostics,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Full upstream resolution (Tasks 16–18)
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* Project an entry list to canonical edge quads. Walks the eleven core
|
|
108
|
+
* trace-link attributes (Satisfies, Derived-from, Verified-by, …) and
|
|
109
|
+
* emits one quad per resolved target ID, splitting CSV values on `,`
|
|
110
|
+
* or whitespace. Every quad is provenance `"local"` — externally
|
|
111
|
+
* sourced edges are folded in later (post-MVP).
|
|
112
|
+
*/
|
|
113
|
+
export function extractEdgeQuads(entries) {
|
|
114
|
+
const TRACE_KEYS = [
|
|
115
|
+
"Satisfies",
|
|
116
|
+
"Derived-from",
|
|
117
|
+
"Verified-by",
|
|
118
|
+
"References",
|
|
119
|
+
"Tests",
|
|
120
|
+
"Depends-on",
|
|
121
|
+
"Part-of",
|
|
122
|
+
"Allocated-to",
|
|
123
|
+
"Realizes",
|
|
124
|
+
"Generated-from",
|
|
125
|
+
"Supersedes",
|
|
126
|
+
];
|
|
127
|
+
const out = [];
|
|
128
|
+
for (const entry of entries) {
|
|
129
|
+
for (const a of entry.rawAttributes) {
|
|
130
|
+
if (!TRACE_KEYS.includes(a.key))
|
|
131
|
+
continue;
|
|
132
|
+
const targets = a.value.split(/[\s,]+/).filter((t) => t.length > 0);
|
|
133
|
+
for (const target of targets) {
|
|
134
|
+
out.push({
|
|
135
|
+
source: entry.displayId,
|
|
136
|
+
relation: a.key,
|
|
137
|
+
target,
|
|
138
|
+
provenance: "local",
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Resolve every upstream the lockfile needs: References, profile chain
|
|
147
|
+
* tiers, federated registries, and bound entries. Computes the
|
|
148
|
+
* canonical edge hash from the same entry set. Returns the aggregate
|
|
149
|
+
* `ResolvedUpstreams` payload ready for {@link serializeLockfile}.
|
|
150
|
+
*
|
|
151
|
+
* The four sub-resolvers run sequentially (not concurrently) because
|
|
152
|
+
* (a) the callbacks they share — `fetchUrl`, `readFile` — may themselves
|
|
153
|
+
* serialize work, and (b) the diagnostics output is easier to reason
|
|
154
|
+
* about with a deterministic order. Wrap inside `Promise.all` only when
|
|
155
|
+
* profiling shows a clear win.
|
|
156
|
+
*/
|
|
157
|
+
export async function resolveUpstreams(opts) {
|
|
158
|
+
const now = (opts.now ?? (() => new Date()))();
|
|
159
|
+
const lockedAt = now.toISOString();
|
|
160
|
+
const refResults = await resolveReferences(opts.entries, opts.fetchUrl);
|
|
161
|
+
const profResults = await resolveProfileChain(opts.profileChain, opts.readFile);
|
|
162
|
+
const regResults = await resolveRegistries(opts.config, opts.fetchUrl);
|
|
163
|
+
const boundResults = await resolveBoundEntries(opts.entries, opts.mappings);
|
|
164
|
+
const edges = extractEdgeQuads(opts.entries);
|
|
165
|
+
const canonicalEdgeHash = await hashCanonicalEdges(edges);
|
|
166
|
+
const diagnostics = [
|
|
167
|
+
...refResults.flatMap((r) => r.diagnostics),
|
|
168
|
+
...profResults.flatMap((r) => r.diagnostics),
|
|
169
|
+
...regResults.flatMap((r) => r.diagnostics),
|
|
170
|
+
...boundResults.flatMap((r) => r.diagnostics),
|
|
171
|
+
];
|
|
172
|
+
return {
|
|
173
|
+
references: refResults,
|
|
174
|
+
profiles: profResults,
|
|
175
|
+
registries: regResults,
|
|
176
|
+
boundEntries: boundResults,
|
|
177
|
+
canonicalEdgeHash,
|
|
178
|
+
canonicalEdgeCount: edges.length,
|
|
179
|
+
lockedAt,
|
|
180
|
+
diagnostics,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
// ---------------------------------------------------------------------------
|
|
184
|
+
// Profile chain resolution (Task 16)
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
186
|
+
/**
|
|
187
|
+
* Format a `ProfileSpecifier` into the lockfile-canonical specifier string.
|
|
188
|
+
*
|
|
189
|
+
* Strings are stable across runs so the lockfile diff captures only meaningful
|
|
190
|
+
* changes:
|
|
191
|
+
* - `builtin` — bundled default
|
|
192
|
+
* - `local:<path>` — on-disk profile
|
|
193
|
+
* - `git:<repo>#<tag>` or `git:<repo>//<subpath>#<tag>`
|
|
194
|
+
* - `npm:<scope?><name>@<range>`
|
|
195
|
+
*/
|
|
196
|
+
function formatSpecifier(spec) {
|
|
197
|
+
switch (spec.kind) {
|
|
198
|
+
case "builtin":
|
|
199
|
+
return "builtin";
|
|
200
|
+
case "local":
|
|
201
|
+
return `local:${spec.path}`;
|
|
202
|
+
case "git":
|
|
203
|
+
return spec.subpath !== undefined
|
|
204
|
+
? `git:${spec.repo}//${spec.subpath}#${spec.tag}`
|
|
205
|
+
: `git:${spec.repo}#${spec.tag}`;
|
|
206
|
+
case "npm": {
|
|
207
|
+
const name = spec.scope !== undefined
|
|
208
|
+
? `${spec.scope}/${spec.name}`
|
|
209
|
+
: spec.name;
|
|
210
|
+
return `npm:${name}@${spec.range}`;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Resolve every profile chain tier into an upstream record. Each tier's
|
|
216
|
+
* `markspec.yaml` is read from `tier.sourcePath` via `readFile` and
|
|
217
|
+
* `sha256:*`-hashed; a read failure attaches MSL-L102 and degrades the
|
|
218
|
+
* tier's hash to `sha256:0` (identity-only).
|
|
219
|
+
*
|
|
220
|
+
* The `extends` chain is reconstructed from list order: tiers are
|
|
221
|
+
* already root-parent → leaf-child, so each tier's `extends` points to
|
|
222
|
+
* the previous tier's id. The root tier has `extends: undefined`.
|
|
223
|
+
*/
|
|
224
|
+
export async function resolveProfileChain(chain, readFile) {
|
|
225
|
+
if (Array.isArray(chain))
|
|
226
|
+
return [];
|
|
227
|
+
const realChain = chain;
|
|
228
|
+
const out = [];
|
|
229
|
+
let parentId = undefined;
|
|
230
|
+
for (const tier of realChain.tiers) {
|
|
231
|
+
const diagnostics = [];
|
|
232
|
+
let hash = "sha256:0";
|
|
233
|
+
const fetched = await readFile(tier.sourcePath);
|
|
234
|
+
if (fetched instanceof Uint8Array) {
|
|
235
|
+
hash = await sha256Bytes(fetched);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
diagnostics.push({
|
|
239
|
+
code: "MSL-L102",
|
|
240
|
+
severity: "warning",
|
|
241
|
+
message: `Failed to read profile manifest at ${tier.sourcePath}: ${fetched.error}. Recording identity-only hash.`,
|
|
242
|
+
location: undefined,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
out.push({
|
|
246
|
+
upstream: {
|
|
247
|
+
kind: "profile",
|
|
248
|
+
id: tier.id,
|
|
249
|
+
specifier: formatSpecifier(tier.specifier),
|
|
250
|
+
resolved: tier.version,
|
|
251
|
+
hash,
|
|
252
|
+
extends: parentId,
|
|
253
|
+
},
|
|
254
|
+
diagnostics,
|
|
255
|
+
});
|
|
256
|
+
parentId = tier.id;
|
|
257
|
+
}
|
|
258
|
+
return out;
|
|
259
|
+
}
|
|
260
|
+
// ---------------------------------------------------------------------------
|
|
261
|
+
// Registry resolution (Task 16)
|
|
262
|
+
// ---------------------------------------------------------------------------
|
|
263
|
+
/**
|
|
264
|
+
* Resolve federated parent registries (and the fallback, when not already
|
|
265
|
+
* listed). Each URL's `<url>/manifest` is fetched; the body is parsed
|
|
266
|
+
* loosely for `markspec-schema` (defaults to 1 on parse failure).
|
|
267
|
+
*/
|
|
268
|
+
export async function resolveRegistries(config, fetchUrl) {
|
|
269
|
+
const urls = [...config.parents];
|
|
270
|
+
if (config.parentFallback && !urls.includes(config.parentFallback)) {
|
|
271
|
+
urls.push(config.parentFallback);
|
|
272
|
+
}
|
|
273
|
+
const out = [];
|
|
274
|
+
for (const url of urls) {
|
|
275
|
+
const manifestUrl = url.endsWith("/")
|
|
276
|
+
? `${url}manifest`
|
|
277
|
+
: `${url}/manifest`;
|
|
278
|
+
const fetched = await fetchUrl(manifestUrl);
|
|
279
|
+
if (fetched instanceof Uint8Array) {
|
|
280
|
+
const hash = await sha256Bytes(fetched);
|
|
281
|
+
let markspecSchema = 1;
|
|
282
|
+
try {
|
|
283
|
+
const parsed = JSON.parse(new TextDecoder().decode(fetched));
|
|
284
|
+
if (typeof parsed["markspec-schema"] === "number") {
|
|
285
|
+
markspecSchema = parsed["markspec-schema"];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
catch { /* leave default */ }
|
|
289
|
+
out.push({
|
|
290
|
+
upstream: {
|
|
291
|
+
kind: "registry",
|
|
292
|
+
id: `urn:markspec:registry:${url}`,
|
|
293
|
+
api: url,
|
|
294
|
+
resolvedManifestHash: hash,
|
|
295
|
+
markspecSchema,
|
|
296
|
+
},
|
|
297
|
+
diagnostics: [],
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
out.push({
|
|
302
|
+
upstream: {
|
|
303
|
+
kind: "registry",
|
|
304
|
+
id: `urn:markspec:registry:${url}`,
|
|
305
|
+
api: url,
|
|
306
|
+
resolvedManifestHash: "sha256:0",
|
|
307
|
+
markspecSchema: 1,
|
|
308
|
+
},
|
|
309
|
+
diagnostics: [{
|
|
310
|
+
code: "MSL-L101",
|
|
311
|
+
severity: "warning",
|
|
312
|
+
message: `Failed to fetch registry manifest from ${manifestUrl}: ${fetched.error}`,
|
|
313
|
+
location: undefined,
|
|
314
|
+
}],
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return out;
|
|
319
|
+
}
|
|
320
|
+
// ---------------------------------------------------------------------------
|
|
321
|
+
// Bound-entry resolution (Task 17)
|
|
322
|
+
// ---------------------------------------------------------------------------
|
|
323
|
+
/**
|
|
324
|
+
* Resolve every entry carrying `External-id:` attributes into a
|
|
325
|
+
* `ResolvedBoundEntry`. For each External-id, look up the mapping by
|
|
326
|
+
* scheme prefix, compute the locked-attribute set, and snapshot each
|
|
327
|
+
* local value as `sha256:*` of UTF-8 bytes.
|
|
328
|
+
*
|
|
329
|
+
* Unknown scheme → MSL-S021 error, that binding skipped. Entries with
|
|
330
|
+
* zero External-id attributes are silently dropped (no upstream lock
|
|
331
|
+
* needed). Multi-value attributes are joined with `\n` before hashing
|
|
332
|
+
* so a single locked-attribute hash captures the full attribute state.
|
|
333
|
+
*/
|
|
334
|
+
export async function resolveBoundEntries(entries, mappings) {
|
|
335
|
+
const mappingBySystem = new Map();
|
|
336
|
+
for (const m of mappings)
|
|
337
|
+
mappingBySystem.set(m.system, m);
|
|
338
|
+
const out = [];
|
|
339
|
+
for (const entry of entries) {
|
|
340
|
+
const externalIds = [];
|
|
341
|
+
for (const a of entry.rawAttributes) {
|
|
342
|
+
if (a.key === "External-id")
|
|
343
|
+
externalIds.push(a.value);
|
|
344
|
+
}
|
|
345
|
+
if (externalIds.length === 0)
|
|
346
|
+
continue;
|
|
347
|
+
const diagnostics = [];
|
|
348
|
+
const bindings = [];
|
|
349
|
+
for (const eid of externalIds) {
|
|
350
|
+
const colonIdx = eid.indexOf(":");
|
|
351
|
+
const scheme = colonIdx >= 0 ? eid.slice(0, colonIdx) : eid;
|
|
352
|
+
const mapping = mappingBySystem.get(scheme);
|
|
353
|
+
if (!mapping) {
|
|
354
|
+
diagnostics.push({
|
|
355
|
+
code: "MSL-S021",
|
|
356
|
+
severity: "error",
|
|
357
|
+
message: `External-id scheme '${scheme}' on entry '${entry.displayId}' has no matching mapping.yaml.`,
|
|
358
|
+
location: entry.location,
|
|
359
|
+
});
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
const lockedAttrNames = inferLockedAttributes(mapping);
|
|
363
|
+
const lockedAttributes = new Map();
|
|
364
|
+
for (const attrName of lockedAttrNames) {
|
|
365
|
+
const value = entry.rawAttributes
|
|
366
|
+
.filter((a) => a.key === attrName)
|
|
367
|
+
.map((a) => a.value)
|
|
368
|
+
.join("\n");
|
|
369
|
+
const hash = await sha256Bytes(new TextEncoder().encode(value));
|
|
370
|
+
lockedAttributes.set(attrName, hash);
|
|
371
|
+
}
|
|
372
|
+
bindings.push({
|
|
373
|
+
externalId: eid,
|
|
374
|
+
system: scheme,
|
|
375
|
+
direction: mapping.direction,
|
|
376
|
+
lockedAttributes,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
out.push({
|
|
380
|
+
boundEntry: {
|
|
381
|
+
displayId: entry.displayId,
|
|
382
|
+
ulid: entry.id ?? "",
|
|
383
|
+
bindings,
|
|
384
|
+
},
|
|
385
|
+
diagnostics,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
return out;
|
|
389
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/serializer
|
|
3
|
+
*
|
|
4
|
+
* Deterministic TOML emitter for the Lockfile model. Tables and keys in
|
|
5
|
+
* fixed order; arrays sorted by primary key; identical input → byte-
|
|
6
|
+
* identical output. We hand-roll the emitter rather than using
|
|
7
|
+
* @std/toml/stringify because we need (a) generated-file header
|
|
8
|
+
* comment, (b) precise control over nested array-of-tables emission
|
|
9
|
+
* order, (c) guaranteed key sort.
|
|
10
|
+
*/
|
|
11
|
+
import type { Lockfile } from "./model.js";
|
|
12
|
+
/** Emit a deterministic TOML representation of a Lockfile. */
|
|
13
|
+
export declare function serializeLockfile(lf: Lockfile): string;
|
|
14
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/lock/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AAMpB,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,CAwFtD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/serializer
|
|
3
|
+
*
|
|
4
|
+
* Deterministic TOML emitter for the Lockfile model. Tables and keys in
|
|
5
|
+
* fixed order; arrays sorted by primary key; identical input → byte-
|
|
6
|
+
* identical output. We hand-roll the emitter rather than using
|
|
7
|
+
* @std/toml/stringify because we need (a) generated-file header
|
|
8
|
+
* comment, (b) precise control over nested array-of-tables emission
|
|
9
|
+
* order, (c) guaranteed key sort.
|
|
10
|
+
*/
|
|
11
|
+
const HEADER = "# @generated by `markspec lock` — do not hand-edit. Run `markspec lock`.\n" +
|
|
12
|
+
"# See https://markspec.dev/lock for the format.\n";
|
|
13
|
+
/** Emit a deterministic TOML representation of a Lockfile. */
|
|
14
|
+
export function serializeLockfile(lf) {
|
|
15
|
+
const parts = [HEADER];
|
|
16
|
+
parts.push(`schema = ${lf.schema}\n\n`);
|
|
17
|
+
parts.push("[meta]\n");
|
|
18
|
+
parts.push(`markspec-schema = ${lf.meta.markspecSchema}\n`);
|
|
19
|
+
parts.push(`locked-at = ${tomlString(lf.meta.lockedAt)}\n`);
|
|
20
|
+
const refs = lf.upstreams
|
|
21
|
+
.filter((u) => u.kind === "reference")
|
|
22
|
+
.slice()
|
|
23
|
+
.sort((a, b) => a.slug.localeCompare(b.slug));
|
|
24
|
+
for (const r of refs) {
|
|
25
|
+
parts.push("\n[[upstream.reference]]\n");
|
|
26
|
+
parts.push(`slug = ${tomlString(r.slug)}\n`);
|
|
27
|
+
parts.push(`id = ${tomlString(r.id)}\n`);
|
|
28
|
+
if (r.resolved !== undefined) {
|
|
29
|
+
parts.push(`resolved = ${tomlString(r.resolved)}\n`);
|
|
30
|
+
}
|
|
31
|
+
if (r.hash !== undefined)
|
|
32
|
+
parts.push(`hash = ${tomlString(r.hash)}\n`);
|
|
33
|
+
if (r.source !== undefined) {
|
|
34
|
+
parts.push(`source = ${tomlString(r.source)}\n`);
|
|
35
|
+
}
|
|
36
|
+
if (r.componentScheme !== undefined) {
|
|
37
|
+
parts.push(`component-scheme = ${tomlString(r.componentScheme)}\n`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const profs = lf.upstreams
|
|
41
|
+
.filter((u) => u.kind === "profile")
|
|
42
|
+
.slice()
|
|
43
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
44
|
+
for (const p of profs) {
|
|
45
|
+
parts.push("\n[[upstream.profile]]\n");
|
|
46
|
+
parts.push(`id = ${tomlString(p.id)}\n`);
|
|
47
|
+
parts.push(`specifier = ${tomlString(p.specifier)}\n`);
|
|
48
|
+
parts.push(`resolved = ${tomlString(p.resolved)}\n`);
|
|
49
|
+
parts.push(`hash = ${tomlString(p.hash)}\n`);
|
|
50
|
+
if (p.extends !== undefined) {
|
|
51
|
+
parts.push(`extends = ${tomlString(p.extends)}\n`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const regs = lf.upstreams
|
|
55
|
+
.filter((u) => u.kind === "registry")
|
|
56
|
+
.slice()
|
|
57
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
58
|
+
for (const r of regs) {
|
|
59
|
+
parts.push("\n[[upstream.registry]]\n");
|
|
60
|
+
parts.push(`id = ${tomlString(r.id)}\n`);
|
|
61
|
+
parts.push(`api = ${tomlString(r.api)}\n`);
|
|
62
|
+
parts.push(`resolved-manifest-hash = ${tomlString(r.resolvedManifestHash)}\n`);
|
|
63
|
+
parts.push(`markspec-schema = ${r.markspecSchema}\n`);
|
|
64
|
+
}
|
|
65
|
+
const bounds = lf.boundEntries.slice().sort((a, b) => a.displayId.localeCompare(b.displayId));
|
|
66
|
+
for (const be of bounds) {
|
|
67
|
+
parts.push("\n[[bound-entry]]\n");
|
|
68
|
+
parts.push(`display-id = ${tomlString(be.displayId)}\n`);
|
|
69
|
+
parts.push(`ulid = ${tomlString(be.ulid)}\n`);
|
|
70
|
+
const bindings = be.bindings.slice().sort((a, b) => a.system.localeCompare(b.system));
|
|
71
|
+
for (const b of bindings) {
|
|
72
|
+
parts.push("\n[[bound-entry.binding]]\n");
|
|
73
|
+
parts.push(`external-id = ${tomlString(b.externalId)}\n`);
|
|
74
|
+
parts.push(`system = ${tomlString(b.system)}\n`);
|
|
75
|
+
parts.push(`direction = ${tomlString(b.direction)}\n`);
|
|
76
|
+
if (b.lockedAttributes.size > 0) {
|
|
77
|
+
parts.push("\n[bound-entry.binding.locked-attributes]\n");
|
|
78
|
+
const sortedAttrs = [...b.lockedAttributes.entries()]
|
|
79
|
+
.sort(([k1], [k2]) => k1.localeCompare(k2));
|
|
80
|
+
for (const [k, v] of sortedAttrs) {
|
|
81
|
+
parts.push(`${k} = ${tomlString(v)}\n`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
parts.push("\n[generated-cache]\n");
|
|
87
|
+
parts.push(`edges-hash = ${tomlString(lf.generatedCache.edgesHash)}\n`);
|
|
88
|
+
parts.push(`edges-count = ${lf.generatedCache.edgesCount}\n`);
|
|
89
|
+
return parts.join("");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Emit a TOML basic string. Backslash and double-quote escaped; the three
|
|
93
|
+
* common whitespace control characters (`\n`, `\r`, `\t`) are escaped so
|
|
94
|
+
* that opaque external-system inputs (e.g. an `externalId` containing a
|
|
95
|
+
* newline) cannot produce invalid TOML.
|
|
96
|
+
*/
|
|
97
|
+
function tomlString(s) {
|
|
98
|
+
return `"${s
|
|
99
|
+
.replace(/\\/g, "\\\\")
|
|
100
|
+
.replace(/"/g, '\\"')
|
|
101
|
+
.replace(/\n/g, "\\n")
|
|
102
|
+
.replace(/\r/g, "\\r")
|
|
103
|
+
.replace(/\t/g, "\\t")}"`;
|
|
104
|
+
}
|
package/esm/mod.d.ts
CHANGED
|
@@ -8,36 +8,43 @@
|
|
|
8
8
|
* from core/mod.ts, never from internal paths.
|
|
9
9
|
*/
|
|
10
10
|
import "./_dnt.polyfills.js";
|
|
11
|
-
export declare const VERSION = "0.
|
|
11
|
+
export declare const VERSION = "0.6.0";
|
|
12
12
|
export declare const CORE_SCHEMA_VERSION = 1;
|
|
13
|
-
export { ConfigError, DEFAULT_PROJECT_CONFIG, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
14
|
-
export type { Attribute, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, Diagnostic, Directive, DisplayId, EffectiveProfile, EffectiveTypeDef,
|
|
13
|
+
export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, DEFAULT_PROJECT_CONFIG, KNOWN_LINK_KINDS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
14
|
+
export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, Severity, SourceLocation, Ulid, } from "./model/mod.js";
|
|
15
15
|
export { astEquivalent } from "./ast/equivalence.js";
|
|
16
16
|
export { normalizeBodyAst } from "./ast/normalize.js";
|
|
17
17
|
export { render } from "./ast/render.js";
|
|
18
|
-
export type { AdmonitionKind, BlockquoteNode, BodyBlock, CaptionNode, CodeNode, DefinitionListNode, DefinitionPair,
|
|
18
|
+
export type { AdmonitionKind, BlockquoteNode, BodyBlock, CaptionNode, CodeNode, DefinitionListNode, DefinitionPair, FeatureNode, FigureNode, InlineContent, ListItemNode, ListNode, MathNode, NoteNode, ParagraphNode, SourceRange, TableNode, UnknownNode, } from "./ast/nodes.js";
|
|
19
19
|
export { discoverProjectRoot, loadConfig, parseProjectConfig, } from "./config/mod.js";
|
|
20
20
|
export type { LoadConfigResult, ReadFile } from "./config/mod.js";
|
|
21
21
|
export { addProfileSpecifier, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
|
|
22
22
|
export type { MarkspecYaml, ParseMarkspecYamlResult, } from "./config/markspec.js";
|
|
23
23
|
export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit, ensureCacheGitignored, loadChain, loadProfileForCommand, mergeChain, parseManifest, resolveEntryColor, resolveGitSpecifier, resolveLocalSpecifier, } from "./profile/mod.js";
|
|
24
24
|
export type { AppendFile, CacheLocation, GitCacheKeyInput, LoadChainOptions, LoadChainResult, LoadProfileForCommandResult, MergeResult, ParseManifestResult, ResolvedProfileSource, ResolveGitOptions, RunGit, RunGitResult, } from "./profile/mod.js";
|
|
25
|
+
export { buildEffectiveDisciplineRegistry } from "./profile/mod.js";
|
|
26
|
+
export { inferDisciplineMode, resolveDisciplineMode } from "./profile/mod.js";
|
|
25
27
|
export { buildProfileIntrospection } from "./profile/mod.js";
|
|
26
28
|
export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./profile/mod.js";
|
|
27
29
|
export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtension, loadGrammar, parse, parseFile, parseSource, } from "./parser/mod.js";
|
|
28
|
-
export type { DetectCaptionsOptions, DetectDirectivesOptions, DetectInlineRefsOptions, ParseFileResult, ParseOptions, ParseSourceOptions, ParseSourceResult, } from "./parser/mod.js";
|
|
30
|
+
export type { DetectCaptionsOptions, DetectDirectivesOptions, DetectInlineRefsOptions, DocCommentBlockMeta, LanguageDocCommentSpec, LineMap, ParseFileResult, ParseOptions, ParseSourceOptions, ParseSourceResult, SupportedLanguage, } from "./parser/mod.js";
|
|
29
31
|
export { format } from "./formatter/mod.js";
|
|
30
32
|
export type { FormatOptions, FormatResult } from "./formatter/mod.js";
|
|
31
|
-
export { classifyEntriesStage, classifyEntry, compileDisplayIdPattern, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
|
|
33
|
+
export { classifyEntriesStage, classifyEntry, compileDisplayIdPattern, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, suppressDeclaredAttrR010, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
|
|
32
34
|
export type { ClassifyResult, ClassifyStageResult, EffectiveAttrScope, ListingFileContext, ListingKind, PipelineResult, ValidateResult, ValueValidator, } from "./validator/mod.js";
|
|
33
35
|
export { compile, generateInverses, serializeCompileResult, } from "./compiler/mod.js";
|
|
34
|
-
export type { CompileOptions, CompileResult, GenerateInversesResult, SerializedCompileResult, SerializedEntry, } from "./compiler/mod.js";
|
|
36
|
+
export type { CompileOptions, CompileResult, GenerateInversesResult, SerializedCompileResult, SerializedEntry, SerializedTypeRegistry, } from "./compiler/mod.js";
|
|
35
37
|
export { buildManifest } from "./compiler/manifest.js";
|
|
36
38
|
export type { ManifestEdgesBlock, ManifestEntriesBlock, ManifestJson, } from "./compiler/manifest.js";
|
|
37
39
|
export { buildEdgesNdjson, buildEntriesNdjson, indexToJson, } from "./compiler/ndjson_writer.js";
|
|
38
40
|
export type { EntriesNdjsonResult, EntryOffset, } from "./compiler/ndjson_writer.js";
|
|
39
41
|
export { report } from "./reporter/mod.js";
|
|
40
42
|
export type { ReportFormat, ReportKind, ReportOptions, } from "./reporter/mod.js";
|
|
41
|
-
export { isProseScope, runLint } from "./lint/mod.js";
|
|
42
|
-
export type { LintDiagnostic, LintOptions, LintResult } from "./lint/mod.js";
|
|
43
|
+
export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
|
|
44
|
+
export type { EntryScore, LintDiagnostic, LintOptions, LintResult, RuleContribution, ScoreRollup, } from "./lint/mod.js";
|
|
45
|
+
export * as typl from "./typl/mod.js";
|
|
46
|
+
export { canonicalEdgeJson, checkDrift, extractEdgeQuads, hashCanonicalEdges, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
|
|
47
|
+
export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, Lockfile, LockfileMeta, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
|
|
48
|
+
export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
|
|
49
|
+
export type { AttributeMapping, BoundEntryStatus, ConflictPolicy, Direction as SyncDirection, Mapping, ParseMappingResult, RemoteState, SyncLogEntry, } from "./sync/mod.js";
|
|
43
50
|
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"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"}
|
package/esm/mod.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* from core/mod.ts, never from internal paths.
|
|
9
9
|
*/
|
|
10
10
|
import "./_dnt.polyfills.js";
|
|
11
|
-
export const VERSION = "0.
|
|
11
|
+
export const VERSION = "0.6.0";
|
|
12
12
|
export const CORE_SCHEMA_VERSION = 1;
|
|
13
13
|
// Model types
|
|
14
|
-
export { ConfigError, DEFAULT_PROJECT_CONFIG, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
14
|
+
export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, DEFAULT_PROJECT_CONFIG, KNOWN_LINK_KINDS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
15
15
|
// AST (canonical body-AST — spec docs/specs/markspec-core-data-model.md §2)
|
|
16
16
|
// SourceRange is body-relative (no `file`); use SourceLocation for file-absolute positions.
|
|
17
17
|
export { astEquivalent } from "./ast/equivalence.js";
|
|
@@ -22,13 +22,16 @@ export { discoverProjectRoot, loadConfig, parseProjectConfig, } from "./config/m
|
|
|
22
22
|
export { addProfileSpecifier, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
|
|
23
23
|
// Profile system (ADR-008)
|
|
24
24
|
export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit, ensureCacheGitignored, loadChain, loadProfileForCommand, mergeChain, parseManifest, resolveEntryColor, resolveGitSpecifier, resolveLocalSpecifier, } from "./profile/mod.js";
|
|
25
|
+
export { buildEffectiveDisciplineRegistry } from "./profile/mod.js";
|
|
26
|
+
export { inferDisciplineMode, resolveDisciplineMode } from "./profile/mod.js";
|
|
27
|
+
// DisciplineMode type already re-exported via Task 2.
|
|
25
28
|
export { buildProfileIntrospection } from "./profile/mod.js";
|
|
26
29
|
// Parser
|
|
27
30
|
export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtension, loadGrammar, parse, parseFile, parseSource, } from "./parser/mod.js";
|
|
28
31
|
// Formatter
|
|
29
32
|
export { format } from "./formatter/mod.js";
|
|
30
33
|
// Validator
|
|
31
|
-
export { classifyEntriesStage, classifyEntry, compileDisplayIdPattern, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
|
|
34
|
+
export { classifyEntriesStage, classifyEntry, compileDisplayIdPattern, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, suppressDeclaredAttrR010, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
|
|
32
35
|
// Compiler
|
|
33
36
|
export { compile, generateInverses, serializeCompileResult, } from "./compiler/mod.js";
|
|
34
37
|
export { buildManifest } from "./compiler/manifest.js";
|
|
@@ -36,4 +39,9 @@ export { buildEdgesNdjson, buildEntriesNdjson, indexToJson, } from "./compiler/n
|
|
|
36
39
|
// Reporter
|
|
37
40
|
export { report } from "./reporter/mod.js";
|
|
38
41
|
// Lint (prose-analysis)
|
|
39
|
-
export { isProseScope, runLint } from "./lint/mod.js";
|
|
42
|
+
export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
|
|
43
|
+
export * as typl from "./typl/mod.js";
|
|
44
|
+
// ── Lockfile (ADR-022) ───────────────────────────────────────────────────
|
|
45
|
+
export { canonicalEdgeJson, checkDrift, extractEdgeQuads, hashCanonicalEdges, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
|
|
46
|
+
// ── External sync model (ADR-022) ────────────────────────────────────────
|
|
47
|
+
export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
|
|
@@ -42,6 +42,12 @@ export interface AttributeSpec {
|
|
|
42
42
|
export declare const ATTRIBUTE_CATALOG: readonly AttributeSpec[];
|
|
43
43
|
/** Canonical Title-Case attribute keys the core recognizes. */
|
|
44
44
|
export declare const UNIVERSAL_ATTRIBUTE_KEYS: readonly string[];
|
|
45
|
+
/**
|
|
46
|
+
* Attribute value types that accept CSV on input but must be emitted as
|
|
47
|
+
* multi-line per ADR-002 §2.6. `citation` is excluded — locators may contain
|
|
48
|
+
* commas.
|
|
49
|
+
*/
|
|
50
|
+
export declare const CSV_SPLITTABLE_TYPES: ReadonlySet<string>;
|
|
45
51
|
/** Look up an attribute specification by its canonical key. */
|
|
46
52
|
export declare function attributeSpec(key: string): AttributeSpec | undefined;
|
|
47
53
|
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/model/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMhF,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAgBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/model/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMhF,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAgBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,aAAa,EAsPrD,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAC5B,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAInD,CAAC;AAUH,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE"}
|