@driftsys/markspec 0.5.0 → 0.6.1
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 +18 -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 +97 -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 +21 -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 +95 -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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/sync/log
|
|
3
|
+
*
|
|
4
|
+
* Append-only NDJSON sync log. Pure encode/decode here; the actual
|
|
5
|
+
* file I/O happens in the CLI command (with `O_APPEND` for atomic
|
|
6
|
+
* append) so this module stays runtime-agnostic.
|
|
7
|
+
*/
|
|
8
|
+
/** One entry in `.markspec/sync/<system>/log.ndjson`. */
|
|
9
|
+
export interface SyncLogEntry {
|
|
10
|
+
/** RFC 3339 UTC. */
|
|
11
|
+
readonly ts: string;
|
|
12
|
+
readonly op: "push" | "pull" | "conflict" | "resolve";
|
|
13
|
+
readonly entryId: string;
|
|
14
|
+
readonly displayId: string;
|
|
15
|
+
readonly externalId: string;
|
|
16
|
+
readonly direction: "outbound" | "inbound" | "bidirectional";
|
|
17
|
+
readonly attrsChanged: readonly string[];
|
|
18
|
+
readonly remoteStateBefore: string;
|
|
19
|
+
readonly remoteStateAfter: string;
|
|
20
|
+
readonly hashBefore?: string;
|
|
21
|
+
readonly hashAfter?: string;
|
|
22
|
+
readonly actor: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Encode an entry as one NDJSON line (single JSON object + trailing
|
|
26
|
+
* newline). Rejects entries whose string fields contain embedded
|
|
27
|
+
* newlines — NDJSON's framing relies on `\n` being a record separator,
|
|
28
|
+
* so an embedded newline would silently split one record across two
|
|
29
|
+
* lines and break every downstream reader.
|
|
30
|
+
*/
|
|
31
|
+
export declare function encodeLogLine(e: SyncLogEntry): string;
|
|
32
|
+
/** Parse one NDJSON line (without trailing newline) → SyncLogEntry. */
|
|
33
|
+
export declare function parseLogLine(line: string): SyncLogEntry;
|
|
34
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/sync/log.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;IAC7D,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAOrD;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAEvD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/sync/log
|
|
4
|
+
*
|
|
5
|
+
* Append-only NDJSON sync log. Pure encode/decode here; the actual
|
|
6
|
+
* file I/O happens in the CLI command (with `O_APPEND` for atomic
|
|
7
|
+
* append) so this module stays runtime-agnostic.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.encodeLogLine = encodeLogLine;
|
|
11
|
+
exports.parseLogLine = parseLogLine;
|
|
12
|
+
/**
|
|
13
|
+
* Encode an entry as one NDJSON line (single JSON object + trailing
|
|
14
|
+
* newline). Rejects entries whose string fields contain embedded
|
|
15
|
+
* newlines — NDJSON's framing relies on `\n` being a record separator,
|
|
16
|
+
* so an embedded newline would silently split one record across two
|
|
17
|
+
* lines and break every downstream reader.
|
|
18
|
+
*/
|
|
19
|
+
function encodeLogLine(e) {
|
|
20
|
+
for (const v of stringValues(e)) {
|
|
21
|
+
if (v.includes("\n")) {
|
|
22
|
+
throw new Error(`Sync log: field contains embedded newline: ${v}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return JSON.stringify(e) + "\n";
|
|
26
|
+
}
|
|
27
|
+
/** Parse one NDJSON line (without trailing newline) → SyncLogEntry. */
|
|
28
|
+
function parseLogLine(line) {
|
|
29
|
+
return JSON.parse(line);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Yield every string field that appears in the encoded JSON, so the
|
|
33
|
+
* embedded-newline guard can scrub the full payload (not just a
|
|
34
|
+
* hand-maintained subset that drifts as `SyncLogEntry` grows).
|
|
35
|
+
*/
|
|
36
|
+
function* stringValues(e) {
|
|
37
|
+
yield e.ts;
|
|
38
|
+
yield e.op;
|
|
39
|
+
yield e.entryId;
|
|
40
|
+
yield e.displayId;
|
|
41
|
+
yield e.externalId;
|
|
42
|
+
yield e.direction;
|
|
43
|
+
yield e.remoteStateBefore;
|
|
44
|
+
yield e.remoteStateAfter;
|
|
45
|
+
yield e.actor;
|
|
46
|
+
if (e.hashBefore !== undefined)
|
|
47
|
+
yield e.hashBefore;
|
|
48
|
+
if (e.hashAfter !== undefined)
|
|
49
|
+
yield e.hashAfter;
|
|
50
|
+
for (const a of e.attrsChanged)
|
|
51
|
+
yield a;
|
|
52
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/sync/mapping
|
|
3
|
+
*
|
|
4
|
+
* mapping.yaml schema + parser + cross-system validation. Defines how an
|
|
5
|
+
* external system (Jira, DOORS, Polarion, …) binds onto MarkSpec entries:
|
|
6
|
+
* which attributes flow which direction, conflict-resolution policy,
|
|
7
|
+
* cache TTL.
|
|
8
|
+
*
|
|
9
|
+
* Diagnostic family is `MSL-S###`:
|
|
10
|
+
* - MSL-S001 — malformed YAML / unsupported schema
|
|
11
|
+
* - MSL-S002 — locked + outbound contradiction
|
|
12
|
+
* - MSL-S003 — unknown conflict policy (newest-wins removed pre-1.0)
|
|
13
|
+
* - MSL-S004 — system ≠ identity.external-id-scheme
|
|
14
|
+
* - MSL-S005 — unparseable cache.ttl
|
|
15
|
+
* - MSL-S020 — multi-system local-write conflict on same attribute
|
|
16
|
+
*/
|
|
17
|
+
import type { Diagnostic } from "../model/mod.js";
|
|
18
|
+
/** Sync flow direction. */
|
|
19
|
+
export type Direction = "outbound" | "inbound" | "bidirectional";
|
|
20
|
+
/** Conflict-resolution policy. `newest-wins` is intentionally absent. */
|
|
21
|
+
export type ConflictPolicy = "manual" | "local-wins" | "remote-wins";
|
|
22
|
+
/** One mapping row: MarkSpec attribute ↔ external attribute. */
|
|
23
|
+
export interface AttributeMapping {
|
|
24
|
+
readonly markspec: string;
|
|
25
|
+
readonly external: string;
|
|
26
|
+
readonly direction: Direction;
|
|
27
|
+
/** When true, the local MarkSpec attribute is read-only — external owns it. */
|
|
28
|
+
readonly locked: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** A fully validated mapping.yaml. */
|
|
31
|
+
export interface Mapping {
|
|
32
|
+
readonly schema: number;
|
|
33
|
+
readonly system: string;
|
|
34
|
+
readonly direction: Direction;
|
|
35
|
+
readonly identity: {
|
|
36
|
+
readonly externalIdScheme: string;
|
|
37
|
+
};
|
|
38
|
+
readonly attributes: readonly AttributeMapping[];
|
|
39
|
+
readonly conflict: {
|
|
40
|
+
readonly default: ConflictPolicy;
|
|
41
|
+
};
|
|
42
|
+
readonly cache: {
|
|
43
|
+
readonly ttlMs: number;
|
|
44
|
+
};
|
|
45
|
+
/** Filesystem path the mapping was loaded from, for diagnostic locations. */
|
|
46
|
+
readonly sourcePath: string;
|
|
47
|
+
}
|
|
48
|
+
/** Outcome of {@linkcode parseMapping}. */
|
|
49
|
+
export interface ParseMappingResult {
|
|
50
|
+
readonly mapping?: Mapping;
|
|
51
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parse and validate one mapping.yaml. Returns the model when valid, or
|
|
55
|
+
* an MSL-S### diagnostic when not. Single-shot — stops at the first
|
|
56
|
+
* integrity failure to keep the repair signal clear.
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseMapping(yaml: string, sourcePath: string): ParseMappingResult;
|
|
59
|
+
/**
|
|
60
|
+
* Cross-system validation: at most one system writes locally per attribute.
|
|
61
|
+
* "Writes locally" = direction is `inbound` or `bidirectional`. Multiple
|
|
62
|
+
* outbound writers on the same attribute are allowed (all push the same
|
|
63
|
+
* local value).
|
|
64
|
+
*/
|
|
65
|
+
export declare function validateMappings(mappings: readonly Mapping[]): Diagnostic[];
|
|
66
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/sync/mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,2BAA2B;AAC3B,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AAEjE,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,CAAC;AAErE,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,sCAAsC;AACtC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;KAAE,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AASD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,kBAAkB,CA4HpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,UAAU,EAAE,CA2B3E"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/sync/mapping
|
|
4
|
+
*
|
|
5
|
+
* mapping.yaml schema + parser + cross-system validation. Defines how an
|
|
6
|
+
* external system (Jira, DOORS, Polarion, …) binds onto MarkSpec entries:
|
|
7
|
+
* which attributes flow which direction, conflict-resolution policy,
|
|
8
|
+
* cache TTL.
|
|
9
|
+
*
|
|
10
|
+
* Diagnostic family is `MSL-S###`:
|
|
11
|
+
* - MSL-S001 — malformed YAML / unsupported schema
|
|
12
|
+
* - MSL-S002 — locked + outbound contradiction
|
|
13
|
+
* - MSL-S003 — unknown conflict policy (newest-wins removed pre-1.0)
|
|
14
|
+
* - MSL-S004 — system ≠ identity.external-id-scheme
|
|
15
|
+
* - MSL-S005 — unparseable cache.ttl
|
|
16
|
+
* - MSL-S020 — multi-system local-write conflict on same attribute
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.parseMapping = parseMapping;
|
|
20
|
+
exports.validateMappings = validateMappings;
|
|
21
|
+
const yaml_1 = require("@std/yaml");
|
|
22
|
+
const SUPPORTED_SCHEMA = 1;
|
|
23
|
+
const ALLOWED_POLICIES = new Set([
|
|
24
|
+
"manual",
|
|
25
|
+
"local-wins",
|
|
26
|
+
"remote-wins",
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Parse and validate one mapping.yaml. Returns the model when valid, or
|
|
30
|
+
* an MSL-S### diagnostic when not. Single-shot — stops at the first
|
|
31
|
+
* integrity failure to keep the repair signal clear.
|
|
32
|
+
*/
|
|
33
|
+
function parseMapping(yaml, sourcePath) {
|
|
34
|
+
let raw;
|
|
35
|
+
try {
|
|
36
|
+
raw = (0, yaml_1.parse)(yaml);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
return fail("MSL-S001", `Malformed mapping.yaml: ${e.message}`, sourcePath);
|
|
40
|
+
}
|
|
41
|
+
const schema = raw.schema;
|
|
42
|
+
if (schema !== SUPPORTED_SCHEMA) {
|
|
43
|
+
return fail("MSL-S001", `Unsupported mapping schema: ${schema} (expected ${SUPPORTED_SCHEMA})`, sourcePath);
|
|
44
|
+
}
|
|
45
|
+
const system = typeof raw.system === "string" ? raw.system : undefined;
|
|
46
|
+
if (system === undefined) {
|
|
47
|
+
return fail("MSL-S001", "Missing or non-string `system` field", sourcePath);
|
|
48
|
+
}
|
|
49
|
+
const direction = raw.direction;
|
|
50
|
+
if (direction !== "outbound" && direction !== "inbound" &&
|
|
51
|
+
direction !== "bidirectional") {
|
|
52
|
+
return fail("MSL-S001", `Invalid top-level direction '${direction}' (expected outbound/inbound/bidirectional)`, sourcePath);
|
|
53
|
+
}
|
|
54
|
+
const identity = raw.identity;
|
|
55
|
+
const scheme = identity?.["external-id-scheme"];
|
|
56
|
+
if (typeof scheme !== "string") {
|
|
57
|
+
return fail("MSL-S001", "Missing identity.external-id-scheme", sourcePath);
|
|
58
|
+
}
|
|
59
|
+
if (scheme !== system) {
|
|
60
|
+
return fail("MSL-S004", `system '${system}' does not match identity.external-id-scheme '${scheme}'`, sourcePath);
|
|
61
|
+
}
|
|
62
|
+
const conflict = raw.conflict;
|
|
63
|
+
const policy = conflict?.default;
|
|
64
|
+
if (policy !== undefined && !ALLOWED_POLICIES.has(policy)) {
|
|
65
|
+
return fail("MSL-S003", `Unknown conflict policy '${policy}' (allowed: manual, local-wins, remote-wins; newest-wins removed pre-1.0)`, sourcePath);
|
|
66
|
+
}
|
|
67
|
+
const cacheRaw = raw.cache;
|
|
68
|
+
const ttlStr = cacheRaw?.ttl ?? "15m";
|
|
69
|
+
const ttlMs = parseDurationMs(ttlStr);
|
|
70
|
+
if (ttlMs === null) {
|
|
71
|
+
return fail("MSL-S005", `Unparseable cache.ttl '${ttlStr}' (expected: 15m, 1h, 7d etc.)`, sourcePath);
|
|
72
|
+
}
|
|
73
|
+
const attrsRaw = raw.attributes ?? [];
|
|
74
|
+
const attributes = [];
|
|
75
|
+
for (const a of attrsRaw) {
|
|
76
|
+
const attrDir = (a.direction === "outbound" || a.direction === "inbound" ||
|
|
77
|
+
a.direction === "bidirectional")
|
|
78
|
+
? a.direction
|
|
79
|
+
: direction;
|
|
80
|
+
const locked = a.locked === true;
|
|
81
|
+
if (locked && attrDir === "outbound") {
|
|
82
|
+
return fail("MSL-S002", `Attribute '${a.markspec}': locked: true contradicts direction: outbound`, sourcePath);
|
|
83
|
+
}
|
|
84
|
+
if (typeof a.markspec !== "string" || typeof a.external !== "string") {
|
|
85
|
+
return fail("MSL-S001", "Each attribute mapping requires string 'markspec' and 'external' fields", sourcePath);
|
|
86
|
+
}
|
|
87
|
+
attributes.push({
|
|
88
|
+
markspec: a.markspec,
|
|
89
|
+
external: a.external,
|
|
90
|
+
direction: attrDir,
|
|
91
|
+
locked,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const mapping = {
|
|
95
|
+
schema,
|
|
96
|
+
system,
|
|
97
|
+
direction,
|
|
98
|
+
identity: { externalIdScheme: scheme },
|
|
99
|
+
attributes,
|
|
100
|
+
conflict: { default: policy ?? "manual" },
|
|
101
|
+
cache: { ttlMs },
|
|
102
|
+
sourcePath,
|
|
103
|
+
};
|
|
104
|
+
return { mapping, diagnostics: [] };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Cross-system validation: at most one system writes locally per attribute.
|
|
108
|
+
* "Writes locally" = direction is `inbound` or `bidirectional`. Multiple
|
|
109
|
+
* outbound writers on the same attribute are allowed (all push the same
|
|
110
|
+
* local value).
|
|
111
|
+
*/
|
|
112
|
+
function validateMappings(mappings) {
|
|
113
|
+
const diagnostics = [];
|
|
114
|
+
const writersByAttr = new Map();
|
|
115
|
+
for (const m of mappings) {
|
|
116
|
+
for (const a of m.attributes) {
|
|
117
|
+
const writesLocally = a.direction === "inbound" ||
|
|
118
|
+
a.direction === "bidirectional";
|
|
119
|
+
if (!writesLocally)
|
|
120
|
+
continue;
|
|
121
|
+
const list = writersByAttr.get(a.markspec) ?? [];
|
|
122
|
+
list.push(m.system);
|
|
123
|
+
writersByAttr.set(a.markspec, list);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
for (const [attr, systems] of writersByAttr) {
|
|
127
|
+
if (systems.length > 1) {
|
|
128
|
+
diagnostics.push({
|
|
129
|
+
code: "MSL-S020",
|
|
130
|
+
severity: "error",
|
|
131
|
+
message: `Multi-system local-write conflict on attribute '${attr}': systems ${systems.join(", ")} all write locally. At most one system may write any attribute locally.`,
|
|
132
|
+
location: undefined,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return diagnostics;
|
|
137
|
+
}
|
|
138
|
+
/** Build a single-diagnostic failure result with file-level location. */
|
|
139
|
+
function fail(code, message, sourcePath) {
|
|
140
|
+
return {
|
|
141
|
+
diagnostics: [{
|
|
142
|
+
code,
|
|
143
|
+
severity: "error",
|
|
144
|
+
message,
|
|
145
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
146
|
+
}],
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Parse a duration suffix string (15m, 1h, 7d, 500ms) → milliseconds. */
|
|
150
|
+
function parseDurationMs(s) {
|
|
151
|
+
const m = s.match(/^(\d+)(ms|s|m|h|d)$/);
|
|
152
|
+
if (!m)
|
|
153
|
+
return null;
|
|
154
|
+
const n = parseInt(m[1], 10);
|
|
155
|
+
switch (m[2]) {
|
|
156
|
+
case "ms":
|
|
157
|
+
return n;
|
|
158
|
+
case "s":
|
|
159
|
+
return n * 1000;
|
|
160
|
+
case "m":
|
|
161
|
+
return n * 60 * 1000;
|
|
162
|
+
case "h":
|
|
163
|
+
return n * 60 * 60 * 1000;
|
|
164
|
+
case "d":
|
|
165
|
+
return n * 24 * 60 * 60 * 1000;
|
|
166
|
+
default:
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/sync
|
|
3
|
+
*
|
|
4
|
+
* External-system sync model: mapping schema, locked-attribute
|
|
5
|
+
* inference, NDJSON log encode/decode, status aggregation. Per-tool
|
|
6
|
+
* connectors (Jira, DOORS, etc.) are out of scope here — see ADR-006
|
|
7
|
+
* §Out-of-scope.
|
|
8
|
+
*/
|
|
9
|
+
export { parseMapping, validateMappings } from "./mapping.js";
|
|
10
|
+
export type { AttributeMapping, ConflictPolicy, Direction, Mapping, ParseMappingResult, } from "./mapping.js";
|
|
11
|
+
export { inferLockedAttributes } from "./locked_attributes.js";
|
|
12
|
+
export { encodeLogLine, parseLogLine } from "./log.js";
|
|
13
|
+
export type { SyncLogEntry } from "./log.js";
|
|
14
|
+
export { aggregateStatusByState } from "./status.js";
|
|
15
|
+
export type { BoundEntryStatus, RemoteState } from "./status.js";
|
|
16
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/sync/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,OAAO,EACP,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/sync
|
|
4
|
+
*
|
|
5
|
+
* External-system sync model: mapping schema, locked-attribute
|
|
6
|
+
* inference, NDJSON log encode/decode, status aggregation. Per-tool
|
|
7
|
+
* connectors (Jira, DOORS, etc.) are out of scope here — see ADR-006
|
|
8
|
+
* §Out-of-scope.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.aggregateStatusByState = exports.parseLogLine = exports.encodeLogLine = exports.inferLockedAttributes = exports.validateMappings = exports.parseMapping = void 0;
|
|
12
|
+
var mapping_js_1 = require("./mapping.js");
|
|
13
|
+
Object.defineProperty(exports, "parseMapping", { enumerable: true, get: function () { return mapping_js_1.parseMapping; } });
|
|
14
|
+
Object.defineProperty(exports, "validateMappings", { enumerable: true, get: function () { return mapping_js_1.validateMappings; } });
|
|
15
|
+
var locked_attributes_js_1 = require("./locked_attributes.js");
|
|
16
|
+
Object.defineProperty(exports, "inferLockedAttributes", { enumerable: true, get: function () { return locked_attributes_js_1.inferLockedAttributes; } });
|
|
17
|
+
var log_js_1 = require("./log.js");
|
|
18
|
+
Object.defineProperty(exports, "encodeLogLine", { enumerable: true, get: function () { return log_js_1.encodeLogLine; } });
|
|
19
|
+
Object.defineProperty(exports, "parseLogLine", { enumerable: true, get: function () { return log_js_1.parseLogLine; } });
|
|
20
|
+
var status_js_1 = require("./status.js");
|
|
21
|
+
Object.defineProperty(exports, "aggregateStatusByState", { enumerable: true, get: function () { return status_js_1.aggregateStatusByState; } });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/sync/status
|
|
3
|
+
*
|
|
4
|
+
* Aggregate per-binding status into the groupings sync-status CLI needs.
|
|
5
|
+
*/
|
|
6
|
+
/** All possible `remote_state` values observed on a bound entry. */
|
|
7
|
+
export type RemoteState = "ok" | "ahead" | "behind" | "conflict" | "deleted-upstream" | "unreachable" | "unbound";
|
|
8
|
+
/** Per-binding status snapshot. */
|
|
9
|
+
export interface BoundEntryStatus {
|
|
10
|
+
readonly displayId: string;
|
|
11
|
+
readonly system: string;
|
|
12
|
+
readonly externalId: string;
|
|
13
|
+
readonly remoteState: RemoteState;
|
|
14
|
+
readonly lastSyncedAt?: string;
|
|
15
|
+
readonly lastConflictAt?: string;
|
|
16
|
+
readonly lockedAttributes?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Group by `remoteState`; entries within each group sorted by
|
|
20
|
+
* `displayId` for stable CLI output.
|
|
21
|
+
*/
|
|
22
|
+
export declare function aggregateStatusByState(entries: readonly BoundEntryStatus[]): Map<RemoteState, BoundEntryStatus[]>;
|
|
23
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/sync/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oEAAoE;AACpE,MAAM,MAAM,WAAW,GACnB,IAAI,GACJ,OAAO,GACP,QAAQ,GACR,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,SAAS,CAAC;AAEd,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GACnC,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAWtC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/sync/status
|
|
4
|
+
*
|
|
5
|
+
* Aggregate per-binding status into the groupings sync-status CLI needs.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.aggregateStatusByState = aggregateStatusByState;
|
|
9
|
+
/**
|
|
10
|
+
* Group by `remoteState`; entries within each group sorted by
|
|
11
|
+
* `displayId` for stable CLI output.
|
|
12
|
+
*/
|
|
13
|
+
function aggregateStatusByState(entries) {
|
|
14
|
+
const out = new Map();
|
|
15
|
+
for (const e of entries) {
|
|
16
|
+
const list = out.get(e.remoteState) ?? [];
|
|
17
|
+
list.push(e);
|
|
18
|
+
out.set(e.remoteState, list);
|
|
19
|
+
}
|
|
20
|
+
for (const list of out.values()) {
|
|
21
|
+
list.sort((a, b) => a.displayId.localeCompare(b.displayId));
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module typl/ast
|
|
3
|
+
*
|
|
4
|
+
* AST node types for the typl DSL. These types form the foundation
|
|
5
|
+
* for the lexer, parser, validator, and evaluator.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Closed kind vocabulary. `value` is the default kind when an author omits
|
|
9
|
+
* it from a binding.
|
|
10
|
+
*/
|
|
11
|
+
export declare const KINDS: readonly ["value", "event", "signal", "command", "state", "const", "config", "document", "stream"];
|
|
12
|
+
export type Kind = typeof KINDS[number];
|
|
13
|
+
/** Schema AST — one discriminated union covering all shape variants. */
|
|
14
|
+
export type Shape = {
|
|
15
|
+
kind: "primitive";
|
|
16
|
+
type: "int" | "float" | "bool" | "string" | "bytes";
|
|
17
|
+
} | {
|
|
18
|
+
kind: "range";
|
|
19
|
+
type: "int" | "float";
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
exact?: number;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "length";
|
|
25
|
+
type: "string" | "bytes";
|
|
26
|
+
min?: number;
|
|
27
|
+
max?: number;
|
|
28
|
+
exact?: number;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "pattern";
|
|
31
|
+
regex: string;
|
|
32
|
+
flags?: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "array";
|
|
35
|
+
element: Shape;
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
exact?: number;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "enum";
|
|
41
|
+
values: readonly (string | number | boolean)[];
|
|
42
|
+
} | {
|
|
43
|
+
kind: "record";
|
|
44
|
+
fields: Readonly<Record<string, Shape>>;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "literal";
|
|
47
|
+
value: string | number | boolean;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "ref";
|
|
50
|
+
name: string;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "optional";
|
|
53
|
+
inner: Shape;
|
|
54
|
+
};
|
|
55
|
+
/** Source position carried through every statement for diagnostics. */
|
|
56
|
+
export interface Position {
|
|
57
|
+
/** 1-based line within the typl source. */
|
|
58
|
+
readonly line: number;
|
|
59
|
+
/** 1-based column. */
|
|
60
|
+
readonly column: number;
|
|
61
|
+
}
|
|
62
|
+
/** A `$X : [kind] shape` declaration. */
|
|
63
|
+
export interface Binding {
|
|
64
|
+
readonly statementKind: "binding";
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly kind: Kind;
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Absent when the binding declares only a role with no payload
|
|
69
|
+
* (e.g. `$Idle : state`, or `$Click : event` with no carried data).
|
|
70
|
+
*/
|
|
71
|
+
readonly shape?: Shape;
|
|
72
|
+
readonly position: Position;
|
|
73
|
+
}
|
|
74
|
+
/** A `type X = shape` declaration. */
|
|
75
|
+
export interface Typedef {
|
|
76
|
+
readonly statementKind: "typedef";
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly shape: Shape;
|
|
79
|
+
readonly position: Position;
|
|
80
|
+
}
|
|
81
|
+
export type Statement = Binding | Typedef;
|
|
82
|
+
/** A parsed typl source unit. */
|
|
83
|
+
export interface TyplBlock {
|
|
84
|
+
readonly bindings: readonly Binding[];
|
|
85
|
+
readonly typedefs: readonly Typedef[];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=ast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/typl/ast.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,KAAK,oGAUR,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;AAExC,wEAAwE;AACxE,MAAM,MAAM,KAAK,GACb;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CAAE,GAC1E;IACA,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACC;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAEvC,uEAAuE;AACvE,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,yCAAyC;AACzC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,sCAAsC;AACtC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,iCAAiC;AACjC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CACvC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module typl/ast
|
|
4
|
+
*
|
|
5
|
+
* AST node types for the typl DSL. These types form the foundation
|
|
6
|
+
* for the lexer, parser, validator, and evaluator.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.KINDS = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Closed kind vocabulary. `value` is the default kind when an author omits
|
|
12
|
+
* it from a binding.
|
|
13
|
+
*/
|
|
14
|
+
exports.KINDS = [
|
|
15
|
+
"value",
|
|
16
|
+
"event",
|
|
17
|
+
"signal",
|
|
18
|
+
"command",
|
|
19
|
+
"state",
|
|
20
|
+
"const",
|
|
21
|
+
"config",
|
|
22
|
+
"document",
|
|
23
|
+
"stream",
|
|
24
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module typl/bridge
|
|
3
|
+
*
|
|
4
|
+
* Bridges between fence-relative {@linkcode TyplDiagnostic}s emitted by
|
|
5
|
+
* the typl parser and file-relative core {@linkcode Diagnostic}s
|
|
6
|
+
* consumed by the validator and CLI.
|
|
7
|
+
*
|
|
8
|
+
* The typl parser operates on raw typl source strings without knowing
|
|
9
|
+
* the host file. Surface adapters (fence, bullet, inline) attach the
|
|
10
|
+
* file path and a position offset when bridging.
|
|
11
|
+
*
|
|
12
|
+
* See ADR-019.
|
|
13
|
+
*/
|
|
14
|
+
import type { Diagnostic } from "../model/mod.js";
|
|
15
|
+
import type { TyplDiagnostic } from "./diagnostics.js";
|
|
16
|
+
/**
|
|
17
|
+
* Convert a fence-relative typl diagnostic into a file-relative core
|
|
18
|
+
* diagnostic.
|
|
19
|
+
*
|
|
20
|
+
* The fence's opening ` ``` ` line is at `fenceStartLine` (1-based).
|
|
21
|
+
* The typl content begins on the line _after_ the opening fence, so a
|
|
22
|
+
* typl diagnostic at line N corresponds to file line `fenceStartLine + N`.
|
|
23
|
+
* Column is passed through unchanged (the spec acknowledges a minor
|
|
24
|
+
* indent-translation wart for fences inside indented list items —
|
|
25
|
+
* tracked separately, not in scope here).
|
|
26
|
+
*
|
|
27
|
+
* @param diag the fence-relative diagnostic emitted by parseTyplBlock
|
|
28
|
+
* @param file the host file path
|
|
29
|
+
* @param fenceStartLine 1-based line of the opening ``` in the host file
|
|
30
|
+
*/
|
|
31
|
+
export declare function bridgeTyplDiagnostic(diag: TyplDiagnostic, file: string, fenceStartLine: number): Diagnostic;
|
|
32
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/typl/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,UAAU,CAWZ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bridgeTyplDiagnostic = bridgeTyplDiagnostic;
|
|
4
|
+
/**
|
|
5
|
+
* Convert a fence-relative typl diagnostic into a file-relative core
|
|
6
|
+
* diagnostic.
|
|
7
|
+
*
|
|
8
|
+
* The fence's opening ` ``` ` line is at `fenceStartLine` (1-based).
|
|
9
|
+
* The typl content begins on the line _after_ the opening fence, so a
|
|
10
|
+
* typl diagnostic at line N corresponds to file line `fenceStartLine + N`.
|
|
11
|
+
* Column is passed through unchanged (the spec acknowledges a minor
|
|
12
|
+
* indent-translation wart for fences inside indented list items —
|
|
13
|
+
* tracked separately, not in scope here).
|
|
14
|
+
*
|
|
15
|
+
* @param diag the fence-relative diagnostic emitted by parseTyplBlock
|
|
16
|
+
* @param file the host file path
|
|
17
|
+
* @param fenceStartLine 1-based line of the opening ``` in the host file
|
|
18
|
+
*/
|
|
19
|
+
function bridgeTyplDiagnostic(diag, file, fenceStartLine) {
|
|
20
|
+
return {
|
|
21
|
+
code: diag.code,
|
|
22
|
+
severity: diag.severity,
|
|
23
|
+
message: diag.message,
|
|
24
|
+
location: {
|
|
25
|
+
file,
|
|
26
|
+
line: fenceStartLine + diag.position.line,
|
|
27
|
+
column: diag.position.column,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module typl/bullet
|
|
3
|
+
*
|
|
4
|
+
* Bullet-glossary surface adapter — recognises CommonMark bullet list
|
|
5
|
+
* items whose first paragraph matches typl syntax (`$X : ...` binding
|
|
6
|
+
* or `type X = ...` typedef). Mixed lists are supported: items that
|
|
7
|
+
* match are treated as typl declarations; non-matching bullets are
|
|
8
|
+
* left alone.
|
|
9
|
+
*
|
|
10
|
+
* Each matching item produces one TyplBulletExtraction; the parser
|
|
11
|
+
* integration calls parseTyplBlock on each `source` independently.
|
|
12
|
+
* Per-item position-bridging uses the item's range and formula
|
|
13
|
+
* documented in bridgeTyplDiagnostic.
|
|
14
|
+
*
|
|
15
|
+
* See ADR-019.
|
|
16
|
+
*/
|
|
17
|
+
import type { BodyBlock, SourceRange } from "../ast/nodes.js";
|
|
18
|
+
/** A single typl bullet item found inside a body. */
|
|
19
|
+
export interface TyplBulletExtraction {
|
|
20
|
+
/** The typl source from one matching bullet item (paragraph text). */
|
|
21
|
+
readonly source: string;
|
|
22
|
+
/** Source range of the bullet's first paragraph. */
|
|
23
|
+
readonly range: SourceRange;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Walk a body AST and return every bullet-list item whose first
|
|
27
|
+
* paragraph matches typl syntax. Recurses through ListNode →
|
|
28
|
+
* ListItemNode.blocks for nested lists (typl bullets inside a nested
|
|
29
|
+
* list are picked up).
|
|
30
|
+
*
|
|
31
|
+
* Returns matches in source order (depth-first).
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractTyplBullets(blocks: readonly BodyBlock[]): readonly TyplBulletExtraction[];
|
|
34
|
+
//# sourceMappingURL=bullet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bullet.d.ts","sourceRoot":"","sources":["../../src/typl/bullet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,SAAS,EAAiB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAYD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,oBAAoB,EAAE,CA0BjC"}
|