@tiangong-lca/pcr 0.3.1 → 0.4.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 +8 -4
- package/node_modules/@types/debug/LICENSE +21 -0
- package/node_modules/@types/debug/README.md +69 -0
- package/node_modules/@types/debug/index.d.ts +50 -0
- package/node_modules/@types/debug/package.json +58 -0
- package/node_modules/@types/mdast/LICENSE +21 -0
- package/node_modules/@types/mdast/README.md +15 -0
- package/node_modules/@types/mdast/index.d.ts +1123 -0
- package/node_modules/@types/mdast/package.json +47 -0
- package/node_modules/@types/ms/LICENSE +21 -0
- package/node_modules/@types/ms/README.md +82 -0
- package/node_modules/@types/ms/index.d.ts +63 -0
- package/node_modules/@types/ms/package.json +26 -0
- package/node_modules/@types/unist/LICENSE +21 -0
- package/node_modules/@types/unist/README.md +15 -0
- package/node_modules/@types/unist/index.d.ts +119 -0
- package/node_modules/@types/unist/package.json +60 -0
- package/node_modules/bail/index.d.ts +10 -0
- package/node_modules/bail/index.js +12 -0
- package/node_modules/bail/license +22 -0
- package/node_modules/bail/package.json +73 -0
- package/node_modules/bail/readme.md +147 -0
- package/node_modules/ccount/index.d.ts +11 -0
- package/node_modules/ccount/index.js +27 -0
- package/node_modules/ccount/license +22 -0
- package/node_modules/ccount/package.json +71 -0
- package/node_modules/ccount/readme.md +149 -0
- package/node_modules/character-entities/index.d.ts +6 -0
- package/node_modules/character-entities/index.js +2132 -0
- package/node_modules/character-entities/license +22 -0
- package/node_modules/character-entities/package.json +78 -0
- package/node_modules/character-entities/readme.md +152 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/decode-named-character-reference/index.d.ts +13 -0
- package/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.js +32 -0
- package/node_modules/decode-named-character-reference/index.js +19 -0
- package/node_modules/decode-named-character-reference/license +22 -0
- package/node_modules/decode-named-character-reference/package.json +90 -0
- package/node_modules/decode-named-character-reference/readme.md +136 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/index.d.ts +1 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.d.ts +1 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +57 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/devlop/lib/default.js +9 -0
- package/node_modules/devlop/lib/development.d.ts +84 -0
- package/node_modules/devlop/lib/development.js +238 -0
- package/node_modules/devlop/license +22 -0
- package/node_modules/devlop/package.json +80 -0
- package/node_modules/devlop/readme.md +360 -0
- package/node_modules/escape-string-regexp/index.d.ts +16 -0
- package/node_modules/escape-string-regexp/index.js +11 -0
- package/node_modules/escape-string-regexp/license +9 -0
- package/node_modules/escape-string-regexp/package.json +40 -0
- package/node_modules/escape-string-regexp/readme.md +34 -0
- package/node_modules/extend/.editorconfig +20 -0
- package/node_modules/extend/.eslintrc +17 -0
- package/node_modules/extend/.jscs.json +175 -0
- package/node_modules/extend/.travis.yml +230 -0
- package/node_modules/extend/CHANGELOG.md +83 -0
- package/node_modules/extend/LICENSE +23 -0
- package/node_modules/extend/README.md +81 -0
- package/node_modules/extend/component.json +32 -0
- package/node_modules/extend/index.js +117 -0
- package/node_modules/extend/package.json +42 -0
- package/node_modules/is-plain-obj/index.d.ts +35 -0
- package/node_modules/is-plain-obj/index.js +8 -0
- package/node_modules/is-plain-obj/license +9 -0
- package/node_modules/is-plain-obj/package.json +41 -0
- package/node_modules/is-plain-obj/readme.md +58 -0
- package/node_modules/longest-streak/index.d.ts +11 -0
- package/node_modules/longest-streak/index.js +36 -0
- package/node_modules/longest-streak/license +22 -0
- package/node_modules/longest-streak/package.json +73 -0
- package/node_modules/longest-streak/readme.md +150 -0
- package/node_modules/markdown-table/index.d.ts +171 -0
- package/node_modules/markdown-table/index.d.ts.map +1 -0
- package/node_modules/markdown-table/index.js +393 -0
- package/node_modules/markdown-table/license +22 -0
- package/node_modules/markdown-table/package.json +77 -0
- package/node_modules/markdown-table/readme.md +344 -0
- package/node_modules/mdast-util-find-and-replace/index.d.ts +9 -0
- package/node_modules/mdast-util-find-and-replace/index.d.ts.map +1 -0
- package/node_modules/mdast-util-find-and-replace/index.js +11 -0
- package/node_modules/mdast-util-find-and-replace/lib/index.d.ts +79 -0
- package/node_modules/mdast-util-find-and-replace/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-find-and-replace/lib/index.js +261 -0
- package/node_modules/mdast-util-find-and-replace/license +22 -0
- package/node_modules/mdast-util-find-and-replace/package.json +85 -0
- package/node_modules/mdast-util-find-and-replace/readme.md +368 -0
- package/node_modules/mdast-util-from-markdown/dev/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/dev/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.js +1348 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-from-markdown/lib/index.js +1177 -0
- package/node_modules/mdast-util-from-markdown/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/license +22 -0
- package/node_modules/mdast-util-from-markdown/package.json +99 -0
- package/node_modules/mdast-util-from-markdown/readme.md +535 -0
- package/node_modules/mdast-util-gfm/index.d.ts +12 -0
- package/node_modules/mdast-util-gfm/index.js +2 -0
- package/node_modules/mdast-util-gfm/lib/index.d.ts +24 -0
- package/node_modules/mdast-util-gfm/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-gfm/lib/index.js +63 -0
- package/node_modules/mdast-util-gfm/license +22 -0
- package/node_modules/mdast-util-gfm/package.json +125 -0
- package/node_modules/mdast-util-gfm/readme.md +497 -0
- package/node_modules/mdast-util-gfm-autolink-literal/index.d.ts +1 -0
- package/node_modules/mdast-util-gfm-autolink-literal/index.js +4 -0
- package/node_modules/mdast-util-gfm-autolink-literal/lib/index.d.ts +18 -0
- package/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +280 -0
- package/node_modules/mdast-util-gfm-autolink-literal/license +22 -0
- package/node_modules/mdast-util-gfm-autolink-literal/package.json +106 -0
- package/node_modules/mdast-util-gfm-autolink-literal/readme.md +334 -0
- package/node_modules/mdast-util-gfm-footnote/index.d.ts +34 -0
- package/node_modules/mdast-util-gfm-footnote/index.js +2 -0
- package/node_modules/mdast-util-gfm-footnote/lib/index.d.ts +22 -0
- package/node_modules/mdast-util-gfm-footnote/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-gfm-footnote/lib/index.js +212 -0
- package/node_modules/mdast-util-gfm-footnote/license +22 -0
- package/node_modules/mdast-util-gfm-footnote/package.json +111 -0
- package/node_modules/mdast-util-gfm-footnote/readme.md +494 -0
- package/node_modules/mdast-util-gfm-strikethrough/index.d.ts +19 -0
- package/node_modules/mdast-util-gfm-strikethrough/index.js +5 -0
- package/node_modules/mdast-util-gfm-strikethrough/lib/index.d.ts +19 -0
- package/node_modules/mdast-util-gfm-strikethrough/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-gfm-strikethrough/lib/index.js +133 -0
- package/node_modules/mdast-util-gfm-strikethrough/license +22 -0
- package/node_modules/mdast-util-gfm-strikethrough/package.json +84 -0
- package/node_modules/mdast-util-gfm-strikethrough/readme.md +350 -0
- package/node_modules/mdast-util-gfm-table/index.d.ts +54 -0
- package/node_modules/mdast-util-gfm-table/index.js +2 -0
- package/node_modules/mdast-util-gfm-table/lib/index.d.ts +51 -0
- package/node_modules/mdast-util-gfm-table/lib/index.js +300 -0
- package/node_modules/mdast-util-gfm-table/license +22 -0
- package/node_modules/mdast-util-gfm-table/package.json +101 -0
- package/node_modules/mdast-util-gfm-table/readme.md +605 -0
- package/node_modules/mdast-util-gfm-task-list-item/index.d.ts +4 -0
- package/node_modules/mdast-util-gfm-task-list-item/index.js +4 -0
- package/node_modules/mdast-util-gfm-task-list-item/lib/index.d.ts +23 -0
- package/node_modules/mdast-util-gfm-task-list-item/lib/index.js +141 -0
- package/node_modules/mdast-util-gfm-task-list-item/license +22 -0
- package/node_modules/mdast-util-gfm-task-list-item/package.json +90 -0
- package/node_modules/mdast-util-gfm-task-list-item/readme.md +366 -0
- package/node_modules/mdast-util-phrasing/index.d.ts +1 -0
- package/node_modules/mdast-util-phrasing/index.js +1 -0
- package/node_modules/mdast-util-phrasing/lib/index.d.ts +3 -0
- package/node_modules/mdast-util-phrasing/lib/index.js +45 -0
- package/node_modules/mdast-util-phrasing/license +23 -0
- package/node_modules/mdast-util-phrasing/package.json +78 -0
- package/node_modules/mdast-util-phrasing/readme.md +200 -0
- package/node_modules/mdast-util-to-markdown/index.d.ts +18 -0
- package/node_modules/mdast-util-to-markdown/index.js +3 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +14 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.js +98 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +40 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.js +41 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.js +86 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +83 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +52 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +67 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +84 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +22 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.js +27 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +78 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.js +92 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts +42 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.js +45 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +28 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +86 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +78 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +37 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.js +129 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +73 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.js +107 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +27 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.js +34 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +52 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +67 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.js +22 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +17 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +27 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts +14 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/index.js +213 -0
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/join.js +56 -0
- package/node_modules/mdast-util-to-markdown/lib/types.d.ts +985 -0
- package/node_modules/mdast-util-to-markdown/lib/types.js +2 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.js +160 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.js +33 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts +23 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.js +32 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +12 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +42 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +25 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +26 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +93 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +110 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +704 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +33 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +82 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +18 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +27 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +14 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +39 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +14 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +39 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.js +63 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +40 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +17 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +52 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +29 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.js +238 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.js +55 -0
- package/node_modules/mdast-util-to-markdown/license +22 -0
- package/node_modules/mdast-util-to-markdown/package.json +88 -0
- package/node_modules/mdast-util-to-markdown/readme.md +805 -0
- package/node_modules/mdast-util-to-string/index.d.ts +2 -0
- package/node_modules/mdast-util-to-string/index.js +5 -0
- package/node_modules/mdast-util-to-string/lib/index.d.ts +31 -0
- package/node_modules/mdast-util-to-string/lib/index.js +108 -0
- package/node_modules/mdast-util-to-string/license +22 -0
- package/node_modules/mdast-util-to-string/package.json +78 -0
- package/node_modules/mdast-util-to-string/readme.md +218 -0
- package/node_modules/micromark/dev/index.d.ts +82 -0
- package/node_modules/micromark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark/dev/index.js +68 -0
- package/node_modules/micromark/dev/lib/compile.d.ts +16 -0
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/compile.js +1162 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/constructs.js +101 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.js +718 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/content.js +99 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/document.js +449 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/text.js +248 -0
- package/node_modules/micromark/dev/lib/parse.d.ts +10 -0
- package/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/parse.js +58 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/postprocess.js +19 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/preprocess.js +139 -0
- package/node_modules/micromark/dev/stream.d.ts +35 -0
- package/node_modules/micromark/dev/stream.d.ts.map +1 -0
- package/node_modules/micromark/dev/stream.js +270 -0
- package/node_modules/micromark/index.d.ts +82 -0
- package/node_modules/micromark/index.d.ts.map +1 -0
- package/node_modules/micromark/index.js +60 -0
- package/node_modules/micromark/lib/compile.d.ts +16 -0
- package/node_modules/micromark/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/lib/compile.js +1068 -0
- package/node_modules/micromark/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/lib/constructs.js +85 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/lib/create-tokenizer.js +613 -0
- package/node_modules/micromark/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/content.js +79 -0
- package/node_modules/micromark/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/document.js +370 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/flow.js +58 -0
- package/node_modules/micromark/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/text.js +216 -0
- package/node_modules/micromark/lib/parse.d.ts +10 -0
- package/node_modules/micromark/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/lib/parse.js +56 -0
- package/node_modules/micromark/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/postprocess.js +18 -0
- package/node_modules/micromark/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/preprocess.js +112 -0
- package/node_modules/micromark/license +22 -0
- package/node_modules/micromark/package.json +87 -0
- package/node_modules/micromark/readme.md +488 -0
- package/node_modules/micromark/stream.d.ts +35 -0
- package/node_modules/micromark/stream.d.ts.map +1 -0
- package/node_modules/micromark/stream.js +256 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/index.js +22 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +294 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +472 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +178 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +229 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +938 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +658 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +119 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +71 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +213 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
- package/node_modules/micromark-core-commonmark/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/index.js +22 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/attention.js +231 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +422 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +159 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/content.js +163 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +191 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +827 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.js +561 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +110 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +63 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/list.js +213 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +187 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/node_modules/micromark-core-commonmark/license +22 -0
- package/node_modules/micromark-core-commonmark/package.json +62 -0
- package/node_modules/micromark-core-commonmark/readme.md +171 -0
- package/node_modules/micromark-extension-gfm/index.d.ts +28 -0
- package/node_modules/micromark-extension-gfm/index.js +69 -0
- package/node_modules/micromark-extension-gfm/license +22 -0
- package/node_modules/micromark-extension-gfm/package.json +107 -0
- package/node_modules/micromark-extension-gfm/readme.md +433 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/index.d.ts +24 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/index.js +2 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/html.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/html.js +56 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js +983 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/index.d.ts +24 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/index.js +2 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/lib/html.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/lib/html.js +60 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +854 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/license +22 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/package.json +116 -0
- package/node_modules/micromark-extension-gfm-autolink-literal/readme.md +422 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/index.d.ts +164 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/index.js +3 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/lib/html.d.ts +25 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/lib/html.js +226 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/lib/syntax.d.ts +9 -0
- package/node_modules/micromark-extension-gfm-footnote/dev/lib/syntax.js +558 -0
- package/node_modules/micromark-extension-gfm-footnote/index.d.ts +164 -0
- package/node_modules/micromark-extension-gfm-footnote/index.js +3 -0
- package/node_modules/micromark-extension-gfm-footnote/lib/html.d.ts +25 -0
- package/node_modules/micromark-extension-gfm-footnote/lib/html.js +154 -0
- package/node_modules/micromark-extension-gfm-footnote/lib/syntax.d.ts +9 -0
- package/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +485 -0
- package/node_modules/micromark-extension-gfm-footnote/license +22 -0
- package/node_modules/micromark-extension-gfm-footnote/package.json +132 -0
- package/node_modules/micromark-extension-gfm-footnote/readme.md +656 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/index.d.ts +30 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/index.js +3 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js +26 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.d.ts +12 -0
- package/node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.js +183 -0
- package/node_modules/micromark-extension-gfm-strikethrough/index.d.ts +24 -0
- package/node_modules/micromark-extension-gfm-strikethrough/index.js +3 -0
- package/node_modules/micromark-extension-gfm-strikethrough/lib/html.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-strikethrough/lib/html.js +26 -0
- package/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.d.ts +12 -0
- package/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +142 -0
- package/node_modules/micromark-extension-gfm-strikethrough/license +22 -0
- package/node_modules/micromark-extension-gfm-strikethrough/package.json +129 -0
- package/node_modules/micromark-extension-gfm-strikethrough/readme.md +304 -0
- package/node_modules/micromark-extension-gfm-table/dev/index.d.ts +55 -0
- package/node_modules/micromark-extension-gfm-table/dev/index.js +2 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +51 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +231 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts +11 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.js +153 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts +14 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.js +64 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts +18 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +964 -0
- package/node_modules/micromark-extension-gfm-table/index.d.ts +55 -0
- package/node_modules/micromark-extension-gfm-table/index.js +2 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +51 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.js +222 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.d.ts +11 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.js +135 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts +14 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.js +52 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts +18 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.js +846 -0
- package/node_modules/micromark-extension-gfm-table/license +22 -0
- package/node_modules/micromark-extension-gfm-table/package.json +86 -0
- package/node_modules/micromark-extension-gfm-table/readme.md +515 -0
- package/node_modules/micromark-extension-gfm-tagfilter/index.d.ts +1 -0
- package/node_modules/micromark-extension-gfm-tagfilter/index.js +1 -0
- package/node_modules/micromark-extension-gfm-tagfilter/lib/index.d.ts +12 -0
- package/node_modules/micromark-extension-gfm-tagfilter/lib/index.js +51 -0
- package/node_modules/micromark-extension-gfm-tagfilter/license +22 -0
- package/node_modules/micromark-extension-gfm-tagfilter/package.json +82 -0
- package/node_modules/micromark-extension-gfm-tagfilter/readme.md +237 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/index.d.ts +17 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/index.js +2 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/lib/html.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/lib/html.js +29 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/lib/syntax.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-task-list-item/dev/lib/syntax.js +166 -0
- package/node_modules/micromark-extension-gfm-task-list-item/index.d.ts +17 -0
- package/node_modules/micromark-extension-gfm-task-list-item/index.js +2 -0
- package/node_modules/micromark-extension-gfm-task-list-item/lib/html.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-task-list-item/lib/html.js +29 -0
- package/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.d.ts +10 -0
- package/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +158 -0
- package/node_modules/micromark-extension-gfm-task-list-item/license +22 -0
- package/node_modules/micromark-extension-gfm-task-list-item/package.json +131 -0
- package/node_modules/micromark-extension-gfm-task-list-item/readme.md +305 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/dev/index.js +255 -0
- package/node_modules/micromark-factory-destination/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/index.js +206 -0
- package/node_modules/micromark-factory-destination/license +22 -0
- package/node_modules/micromark-factory-destination/package.json +57 -0
- package/node_modules/micromark-factory-destination/readme.md +234 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/dev/index.js +172 -0
- package/node_modules/micromark-factory-label/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/index.js +148 -0
- package/node_modules/micromark-factory-label/license +22 -0
- package/node_modules/micromark-factory-label/package.json +60 -0
- package/node_modules/micromark-factory-label/readme.md +224 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts +60 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/dev/index.js +122 -0
- package/node_modules/micromark-factory-space/index.d.ts +60 -0
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/index.js +116 -0
- package/node_modules/micromark-factory-space/license +22 -0
- package/node_modules/micromark-factory-space/package.json +46 -0
- package/node_modules/micromark-factory-space/readme.md +225 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/dev/index.js +169 -0
- package/node_modules/micromark-factory-title/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/index.js +158 -0
- package/node_modules/micromark-factory-title/license +22 -0
- package/node_modules/micromark-factory-title/package.json +58 -0
- package/node_modules/micromark-factory-title/readme.md +229 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/index.js +44 -0
- package/node_modules/micromark-factory-whitespace/license +22 -0
- package/node_modules/micromark-factory-whitespace/package.json +57 -0
- package/node_modules/micromark-factory-whitespace/readme.md +205 -0
- package/node_modules/micromark-util-character/dev/index.d.ts +195 -0
- package/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/dev/index.js +252 -0
- package/node_modules/micromark-util-character/index.d.ts +195 -0
- package/node_modules/micromark-util-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/index.js +246 -0
- package/node_modules/micromark-util-character/license +22 -0
- package/node_modules/micromark-util-character/package.json +57 -0
- package/node_modules/micromark-util-character/readme.md +446 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/dev/index.js +89 -0
- package/node_modules/micromark-util-chunked/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/index.js +81 -0
- package/node_modules/micromark-util-chunked/license +22 -0
- package/node_modules/micromark-util-chunked/package.json +57 -0
- package/node_modules/micromark-util-chunked/readme.md +219 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/dev/index.js +38 -0
- package/node_modules/micromark-util-classify-character/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/index.js +27 -0
- package/node_modules/micromark-util-classify-character/license +22 -0
- package/node_modules/micromark-util-classify-character/package.json +59 -0
- package/node_modules/micromark-util-classify-character/readme.md +205 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
- package/node_modules/micromark-util-combine-extensions/index.js +143 -0
- package/node_modules/micromark-util-combine-extensions/license +22 -0
- package/node_modules/micromark-util-combine-extensions/package.json +52 -0
- package/node_modules/micromark-util-combine-extensions/readme.md +201 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/dev/index.js +53 -0
- package/node_modules/micromark-util-decode-string/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/index.js +45 -0
- package/node_modules/micromark-util-decode-string/license +22 -0
- package/node_modules/micromark-util-decode-string/package.json +63 -0
- package/node_modules/micromark-util-decode-string/readme.md +179 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-encode/index.d.ts +14 -0
- package/node_modules/micromark-util-encode/index.d.ts.map +1 -0
- package/node_modules/micromark-util-encode/index.js +33 -0
- package/node_modules/micromark-util-encode/license +22 -0
- package/node_modules/micromark-util-encode/package.json +47 -0
- package/node_modules/micromark-util-encode/readme.md +176 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
- package/node_modules/micromark-util-html-tag-name/index.js +93 -0
- package/node_modules/micromark-util-html-tag-name/license +22 -0
- package/node_modules/micromark-util-html-tag-name/package.json +47 -0
- package/node_modules/micromark-util-html-tag-name/readme.md +193 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/index.js +33 -0
- package/node_modules/micromark-util-normalize-identifier/license +22 -0
- package/node_modules/micromark-util-normalize-identifier/package.json +58 -0
- package/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
- package/node_modules/micromark-util-resolve-all/index.js +32 -0
- package/node_modules/micromark-util-resolve-all/license +22 -0
- package/node_modules/micromark-util-resolve-all/package.json +48 -0
- package/node_modules/micromark-util-resolve-all/readme.md +238 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
- package/node_modules/micromark-util-sanitize-uri/license +22 -0
- package/node_modules/micromark-util-sanitize-uri/package.json +59 -0
- package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/index.js +228 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/node_modules/micromark-util-subtokenize/license +22 -0
- package/node_modules/micromark-util-subtokenize/package.json +60 -0
- package/node_modules/micromark-util-subtokenize/readme.md +181 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/default.js +4 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/types.js +453 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/values.js +109 -0
- package/node_modules/micromark-util-symbol/license +22 -0
- package/node_modules/micromark-util-symbol/package.json +43 -0
- package/node_modules/micromark-util-symbol/readme.md +168 -0
- package/node_modules/micromark-util-types/index.d.ts +1315 -0
- package/node_modules/micromark-util-types/index.js +2 -0
- package/node_modules/micromark-util-types/license +22 -0
- package/node_modules/micromark-util-types/package.json +37 -0
- package/node_modules/micromark-util-types/readme.md +151 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/remark-gfm/index.d.ts +13 -0
- package/node_modules/remark-gfm/index.js +2 -0
- package/node_modules/remark-gfm/lib/index.d.ts +12 -0
- package/node_modules/remark-gfm/lib/index.d.ts.map +1 -0
- package/node_modules/remark-gfm/lib/index.js +41 -0
- package/node_modules/remark-gfm/license +22 -0
- package/node_modules/remark-gfm/package.json +125 -0
- package/node_modules/remark-gfm/readme.md +518 -0
- package/node_modules/remark-parse/index.d.ts +55 -0
- package/node_modules/remark-parse/index.js +2 -0
- package/node_modules/remark-parse/lib/index.d.ts +26 -0
- package/node_modules/remark-parse/lib/index.js +43 -0
- package/node_modules/remark-parse/license +21 -0
- package/node_modules/remark-parse/package.json +72 -0
- package/node_modules/remark-parse/readme.md +428 -0
- package/node_modules/remark-stringify/index.d.ts +41 -0
- package/node_modules/remark-stringify/index.js +2 -0
- package/node_modules/remark-stringify/lib/index.d.ts +26 -0
- package/node_modules/remark-stringify/lib/index.js +42 -0
- package/node_modules/remark-stringify/license +21 -0
- package/node_modules/remark-stringify/package.json +71 -0
- package/node_modules/remark-stringify/readme.md +407 -0
- package/node_modules/trough/index.d.ts +7 -0
- package/node_modules/trough/index.d.ts.map +1 -0
- package/node_modules/trough/index.js +9 -0
- package/node_modules/trough/lib/index.d.ts +105 -0
- package/node_modules/trough/lib/index.d.ts.map +1 -0
- package/node_modules/trough/lib/index.js +206 -0
- package/node_modules/trough/license +21 -0
- package/node_modules/trough/package.json +77 -0
- package/node_modules/trough/readme.md +494 -0
- package/node_modules/unified/index.d.ts +106 -0
- package/node_modules/unified/index.js +2 -0
- package/node_modules/unified/lib/callable-instance.d.ts +2 -0
- package/node_modules/unified/lib/callable-instance.d.ts.map +1 -0
- package/node_modules/unified/lib/callable-instance.js +44 -0
- package/node_modules/unified/lib/index.d.ts +1024 -0
- package/node_modules/unified/lib/index.d.ts.map +1 -0
- package/node_modules/unified/lib/index.js +1323 -0
- package/node_modules/unified/license +21 -0
- package/node_modules/unified/package.json +120 -0
- package/node_modules/unified/readme.md +1835 -0
- package/node_modules/unist-util-is/index.d.ts +5 -0
- package/node_modules/unist-util-is/index.d.ts.map +1 -0
- package/node_modules/unist-util-is/index.js +7 -0
- package/node_modules/unist-util-is/lib/index.d.ts +111 -0
- package/node_modules/unist-util-is/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-is/lib/index.js +296 -0
- package/node_modules/unist-util-is/license +22 -0
- package/node_modules/unist-util-is/package.json +103 -0
- package/node_modules/unist-util-is/readme.md +351 -0
- package/node_modules/unist-util-stringify-position/index.d.ts +1 -0
- package/node_modules/unist-util-stringify-position/index.js +1 -0
- package/node_modules/unist-util-stringify-position/lib/index.d.ts +61 -0
- package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
- package/node_modules/unist-util-stringify-position/license +22 -0
- package/node_modules/unist-util-stringify-position/package.json +80 -0
- package/node_modules/unist-util-stringify-position/readme.md +206 -0
- package/node_modules/unist-util-visit/index.d.ts +9 -0
- package/node_modules/unist-util-visit/index.js +2 -0
- package/node_modules/unist-util-visit/lib/index.d.ts +195 -0
- package/node_modules/unist-util-visit/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-visit/lib/index.js +312 -0
- package/node_modules/unist-util-visit/license +22 -0
- package/node_modules/unist-util-visit/package.json +108 -0
- package/node_modules/unist-util-visit/readme.md +313 -0
- package/node_modules/unist-util-visit-parents/index.d.ts +14 -0
- package/node_modules/unist-util-visit-parents/index.js +2 -0
- package/node_modules/unist-util-visit-parents/lib/color.d.ts +6 -0
- package/node_modules/unist-util-visit-parents/lib/color.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/color.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.d.ts +6 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/index.d.ts +219 -0
- package/node_modules/unist-util-visit-parents/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/index.js +399 -0
- package/node_modules/unist-util-visit-parents/license +22 -0
- package/node_modules/unist-util-visit-parents/package.json +106 -0
- package/node_modules/unist-util-visit-parents/readme.md +388 -0
- package/node_modules/vfile/index.d.ts +153 -0
- package/node_modules/vfile/index.js +2 -0
- package/node_modules/vfile/lib/index.d.ts +1465 -0
- package/node_modules/vfile/lib/index.d.ts.map +1 -0
- package/node_modules/vfile/lib/index.js +643 -0
- package/node_modules/vfile/lib/minpath.browser.d.ts +47 -0
- package/node_modules/vfile/lib/minpath.browser.d.ts.map +1 -0
- package/node_modules/vfile/lib/minpath.browser.js +426 -0
- package/node_modules/vfile/lib/minpath.d.ts +2 -0
- package/node_modules/vfile/lib/minpath.d.ts.map +1 -0
- package/node_modules/vfile/lib/minpath.js +1 -0
- package/node_modules/vfile/lib/minproc.browser.d.ts +6 -0
- package/node_modules/vfile/lib/minproc.browser.d.ts.map +1 -0
- package/node_modules/vfile/lib/minproc.browser.js +8 -0
- package/node_modules/vfile/lib/minproc.d.ts +2 -0
- package/node_modules/vfile/lib/minproc.d.ts.map +1 -0
- package/node_modules/vfile/lib/minproc.js +1 -0
- package/node_modules/vfile/lib/minurl.browser.d.ts +9 -0
- package/node_modules/vfile/lib/minurl.browser.d.ts.map +1 -0
- package/node_modules/vfile/lib/minurl.browser.js +76 -0
- package/node_modules/vfile/lib/minurl.d.ts +3 -0
- package/node_modules/vfile/lib/minurl.d.ts.map +1 -0
- package/node_modules/vfile/lib/minurl.js +2 -0
- package/node_modules/vfile/lib/minurl.shared.d.ts +20 -0
- package/node_modules/vfile/lib/minurl.shared.d.ts.map +1 -0
- package/node_modules/vfile/lib/minurl.shared.js +31 -0
- package/node_modules/vfile/license +21 -0
- package/node_modules/vfile/package.json +134 -0
- package/node_modules/vfile/readme.md +785 -0
- package/node_modules/vfile-message/index.d.ts +2 -0
- package/node_modules/vfile-message/index.js +5 -0
- package/node_modules/vfile-message/lib/index.d.ts +508 -0
- package/node_modules/vfile-message/lib/index.js +314 -0
- package/node_modules/vfile-message/license +22 -0
- package/node_modules/vfile-message/package.json +80 -0
- package/node_modules/vfile-message/readme.md +252 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +226 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +228 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +120 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/node_modules/zwitch/index.d.ts +67 -0
- package/node_modules/zwitch/index.js +118 -0
- package/node_modules/zwitch/license +22 -0
- package/node_modules/zwitch/package.json +72 -0
- package/node_modules/zwitch/readme.md +226 -0
- package/package.json +13 -5
- package/packages/pcr-core/schemas/guidance-batch-request.schema.json +12 -0
- package/packages/pcr-core/schemas/guidance-output.schema.json +236 -28
- package/packages/pcr-core/schemas/structured-projection.schema.json +576 -80
- package/packages/pcr-core/src/classification-coverage.js +664 -0
- package/packages/pcr-core/src/classification-coverage.js.map +1 -0
- package/packages/pcr-core/src/compiler/guidance-context.js +135 -0
- package/packages/pcr-core/src/compiler/guidance-context.js.map +1 -0
- package/packages/pcr-core/src/compiler/guidance-envelope.js +78 -0
- package/packages/pcr-core/src/compiler/guidance-envelope.js.map +1 -0
- package/packages/pcr-core/src/compiler/normative-integrity.js +67 -0
- package/packages/pcr-core/src/compiler/normative-integrity.js.map +1 -0
- package/packages/pcr-core/src/compiler/normative-projection.js +276 -0
- package/packages/pcr-core/src/compiler/normative-projection.js.map +1 -0
- package/packages/pcr-core/src/compiler/source-context.js +231 -0
- package/packages/pcr-core/src/compiler/source-context.js.map +1 -0
- package/packages/pcr-core/src/consumption-calculation.js +61 -0
- package/packages/pcr-core/src/consumption-calculation.js.map +1 -0
- package/packages/pcr-core/src/consumption-data.js +99 -0
- package/packages/pcr-core/src/consumption-data.js.map +1 -0
- package/packages/pcr-core/src/consumption-guidance.js +107 -0
- package/packages/pcr-core/src/consumption-guidance.js.map +1 -0
- package/packages/pcr-core/src/consumption-review.js +103 -0
- package/packages/pcr-core/src/consumption-review.js.map +1 -0
- package/packages/pcr-core/src/contracts.js +163 -0
- package/packages/pcr-core/src/contracts.js.map +1 -0
- package/packages/pcr-core/src/generated/controlled-vocabulary.js +39 -0
- package/packages/pcr-core/src/generated/controlled-vocabulary.js.map +1 -0
- package/packages/pcr-core/src/index.js +1824 -0
- package/packages/pcr-core/src/index.js.map +1 -0
- package/packages/pcr-core/src/languages.js +85 -0
- package/packages/pcr-core/src/languages.js.map +1 -0
- package/packages/pcr-core/src/offline-library.js +302 -0
- package/packages/pcr-core/src/offline-library.js.map +1 -0
- package/packages/pcr-core/src/output-semantics.js +122 -0
- package/packages/pcr-core/src/output-semantics.js.map +1 -0
- package/packages/pcr-core/src/pcr-id-aliases.js +898 -0
- package/packages/pcr-core/src/pcr-id-aliases.js.map +1 -0
- package/packages/pcr-core/src/projection-completeness.js +172 -0
- package/packages/pcr-core/src/projection-completeness.js.map +1 -0
- package/packages/pcr-core/src/projection-integrity.js +177 -0
- package/packages/pcr-core/src/projection-integrity.js.map +1 -0
- package/packages/pcr-core/src/read-context.js +421 -0
- package/packages/pcr-core/src/read-context.js.map +1 -0
- package/packages/pcr-core/src/read-session.js +150 -0
- package/packages/pcr-core/src/read-session.js.map +1 -0
- package/packages/pcr-core/src/schema-validation.js +136 -0
- package/packages/pcr-core/src/schema-validation.js.map +1 -0
- package/packages/pcr-core/src/source-context.js +18 -0
- package/packages/pcr-core/src/source-context.js.map +1 -0
- package/packages/pcr-core/src/tidas-inspection.js +201 -0
- package/packages/pcr-core/src/tidas-inspection.js.map +1 -0
- package/packages/pcr-core/src/types.js +12 -0
- package/packages/pcr-core/src/types.js.map +1 -0
- package/packages/pcr-core/src/vocabulary.js +47 -0
- package/packages/pcr-core/src/vocabulary.js.map +1 -0
- package/packages/pcr-core/src/yaml-lite.js +267 -0
- package/packages/pcr-core/src/yaml-lite.js.map +1 -0
- package/packages/tiangong-pcr-cli/bin/tiangong-pcr.js +11 -0
- package/packages/tiangong-pcr-cli/bin/tiangong-pcr.js.map +1 -0
- package/packages/tiangong-pcr-cli/src/commands.js +1662 -0
- package/packages/tiangong-pcr-cli/src/commands.js.map +1 -0
- package/product-release.json +4 -4
- package/skills/tiangong-pcr/SKILL.md +9 -2
- package/packages/pcr-core/src/classification-coverage.mjs +0 -732
- package/packages/pcr-core/src/consumption-calculation.mjs +0 -53
- package/packages/pcr-core/src/consumption-data.mjs +0 -88
- package/packages/pcr-core/src/consumption-guidance.mjs +0 -62
- package/packages/pcr-core/src/consumption-review.mjs +0 -83
- package/packages/pcr-core/src/contracts.mjs +0 -195
- package/packages/pcr-core/src/generated/controlled-vocabulary.mjs +0 -41
- package/packages/pcr-core/src/index.mjs +0 -2101
- package/packages/pcr-core/src/languages.mjs +0 -86
- package/packages/pcr-core/src/offline-library.mjs +0 -121
- package/packages/pcr-core/src/output-semantics.mjs +0 -228
- package/packages/pcr-core/src/pcr-id-aliases.mjs +0 -949
- package/packages/pcr-core/src/projection-completeness.mjs +0 -284
- package/packages/pcr-core/src/projection-integrity.mjs +0 -208
- package/packages/pcr-core/src/read-context.mjs +0 -505
- package/packages/pcr-core/src/schema-validation.mjs +0 -142
- package/packages/pcr-core/src/source-context.mjs +0 -13
- package/packages/pcr-core/src/tidas-inspection.mjs +0 -177
- package/packages/pcr-core/src/yaml-lite.mjs +0 -261
- package/packages/tiangong-pcr-cli/bin/tiangong-pcr.mjs +0 -12
- package/packages/tiangong-pcr-cli/src/commands.mjs +0 -1691
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ConsumptionError, object, strictNumber } from "./consumption-data.js";
|
|
2
|
+
function text(value, name) {
|
|
3
|
+
if (typeof value !== "string" || !value.trim())
|
|
4
|
+
throw new ConsumptionError("PCR_CALCULATION_INPUT", `${name} must state the unit, basis or evidence explicitly.`, { field: name });
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
// Arithmetic only: the Agent owns physical equivalence, applicability and evidence.
|
|
8
|
+
export function calculate(request) {
|
|
9
|
+
if (!object(request))
|
|
10
|
+
throw new ConsumptionError("PCR_CALCULATION_INPUT", "Use a JSON object with operation normalize, convert or balance. See calculate --help.");
|
|
11
|
+
const evidence = text(request.evidence, "evidence");
|
|
12
|
+
const basis = text(request.basis, "basis");
|
|
13
|
+
let result;
|
|
14
|
+
let formula;
|
|
15
|
+
if (request.operation === "normalize") {
|
|
16
|
+
const amount = strictNumber(request.amount, "amount");
|
|
17
|
+
const sourceReference = strictNumber(request.source_reference, "source_reference", { positive: true });
|
|
18
|
+
const targetReference = strictNumber(request.target_reference, "target_reference", { positive: true });
|
|
19
|
+
const unit = text(request.unit, "unit");
|
|
20
|
+
text(request.reference_unit, "reference_unit");
|
|
21
|
+
result = { amount: amount * targetReference / sourceReference, unit, factor: targetReference / sourceReference };
|
|
22
|
+
formula = "amount * target_reference / source_reference; both reference quantities share reference_unit and the stated physical basis";
|
|
23
|
+
}
|
|
24
|
+
else if (request.operation === "convert") {
|
|
25
|
+
const amount = strictNumber(request.amount, "amount");
|
|
26
|
+
const factor = strictNumber(request.factor, "factor", { positive: true });
|
|
27
|
+
text(request.from_unit, "from_unit");
|
|
28
|
+
const unit = text(request.to_unit, "to_unit");
|
|
29
|
+
result = { amount: amount * factor, unit, factor };
|
|
30
|
+
formula = "amount * factor; factor is explicitly supplied in to_unit / from_unit";
|
|
31
|
+
}
|
|
32
|
+
else if (request.operation === "balance") {
|
|
33
|
+
const unit = text(request.unit, "unit");
|
|
34
|
+
const sums = { inputs: 0, outputs: 0 };
|
|
35
|
+
for (const name of ["inputs", "outputs"]) {
|
|
36
|
+
const items = request[name];
|
|
37
|
+
if (!Array.isArray(items) || !items.length)
|
|
38
|
+
throw new ConsumptionError("PCR_CALCULATION_INPUT", `${name} must be a non-empty array of {amount, label} in the declared common unit and basis.`);
|
|
39
|
+
sums[name] = items.reduce((sum, item, index) => {
|
|
40
|
+
if (!object(item))
|
|
41
|
+
throw new ConsumptionError("PCR_CALCULATION_INPUT", `${name}[${index}] must be an amount/label object.`);
|
|
42
|
+
text(item.label, `${name}[${index}].label`);
|
|
43
|
+
return sum + strictNumber(item.amount, `${name}[${index}].amount`);
|
|
44
|
+
}, 0);
|
|
45
|
+
}
|
|
46
|
+
const accumulation = strictNumber(request.accumulation, "accumulation");
|
|
47
|
+
result = { input_total: sums.inputs, output_total: sums.outputs, accumulation, residual: sums.inputs - sums.outputs - accumulation, unit };
|
|
48
|
+
formula = "sum(inputs) - sum(outputs) - accumulation; positive residual is unaccounted net input";
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
throw new ConsumptionError("PCR_CALCULATION_OPERATION", "Use operation normalize, convert or balance. No formulas, factors or units are inferred.");
|
|
52
|
+
}
|
|
53
|
+
if (Object.values(result).some((value) => typeof value === "number" && !Number.isFinite(value)))
|
|
54
|
+
throw new ConsumptionError("PCR_CALCULATION_OVERFLOW", "Calculation produced a non-finite number; rescale or correct the input quantities.");
|
|
55
|
+
return {
|
|
56
|
+
schema_version: 1, calculation_kind: "tiangong-pcr-arithmetic", operation: request.operation,
|
|
57
|
+
request, formula, result, basis, evidence,
|
|
58
|
+
interpretation: "Arithmetic only, using supplied values and JavaScript floating-point precision. Physical applicability, evidence quality, tolerance and anomaly judgment are not evaluated.",
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=consumption-calculation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumption-calculation.js","sourceRoot":"pcr://source/","sources":["packages/pcr-core/src/consumption-calculation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EA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cAAc,EAAE,6KAA6K;KAC9L,CAAC;AACJ,CAAC","sourcesContent":["import { ConsumptionError, object, strictNumber } from \"./consumption-data.ts\";\n\nfunction text(value: unknown, name: string): string {\n if (typeof value !== \"string\" || !value.trim()) throw new ConsumptionError(\"PCR_CALCULATION_INPUT\", `${name} must state the unit, basis or evidence explicitly.`, { field: name });\n return value;\n}\n\n// Arithmetic only: the Agent owns physical equivalence, applicability and evidence.\nexport function calculate(request: unknown) {\n if (!object(request)) throw new ConsumptionError(\"PCR_CALCULATION_INPUT\", \"Use a JSON object with operation normalize, convert or balance. See calculate --help.\");\n const evidence = text(request.evidence, \"evidence\");\n const basis = text(request.basis, \"basis\");\n let result: { amount: number; unit: string; factor: number } | { input_total: number; output_total: number; accumulation: number; residual: number; unit: string };\n let formula;\n if (request.operation === \"normalize\") {\n const amount = strictNumber(request.amount, \"amount\");\n const sourceReference = strictNumber(request.source_reference, \"source_reference\", { positive: true });\n const targetReference = strictNumber(request.target_reference, \"target_reference\", { positive: true });\n const unit = text(request.unit, \"unit\");\n text(request.reference_unit, \"reference_unit\");\n result = { amount: amount * targetReference / sourceReference, unit, factor: targetReference / sourceReference };\n formula = \"amount * target_reference / source_reference; both reference quantities share reference_unit and the stated physical basis\";\n } else if (request.operation === \"convert\") {\n const amount = strictNumber(request.amount, \"amount\");\n const factor = strictNumber(request.factor, \"factor\", { positive: true });\n text(request.from_unit, \"from_unit\");\n const unit = text(request.to_unit, \"to_unit\");\n result = { amount: amount * factor, unit, factor };\n formula = \"amount * factor; factor is explicitly supplied in to_unit / from_unit\";\n } else if (request.operation === \"balance\") {\n const unit = text(request.unit, \"unit\");\n const sums = { inputs: 0, outputs: 0 };\n for (const name of [\"inputs\", \"outputs\"] as const) {\n const items = request[name];\n if (!Array.isArray(items) || !items.length) throw new ConsumptionError(\"PCR_CALCULATION_INPUT\", `${name} must be a non-empty array of {amount, label} in the declared common unit and basis.`);\n sums[name] = items.reduce((sum: number, item: unknown, index: number) => {\n if (!object(item)) throw new ConsumptionError(\"PCR_CALCULATION_INPUT\", `${name}[${index}] must be an amount/label object.`);\n text(item.label, `${name}[${index}].label`);\n return sum + strictNumber(item.amount, `${name}[${index}].amount`);\n }, 0);\n }\n const accumulation = strictNumber(request.accumulation, \"accumulation\");\n result = { input_total: sums.inputs, output_total: sums.outputs, accumulation, residual: sums.inputs - sums.outputs - accumulation, unit };\n formula = \"sum(inputs) - sum(outputs) - accumulation; positive residual is unaccounted net input\";\n } else {\n throw new ConsumptionError(\"PCR_CALCULATION_OPERATION\", \"Use operation normalize, convert or balance. No formulas, factors or units are inferred.\");\n }\n if (Object.values(result).some((value) => typeof value === \"number\" && !Number.isFinite(value))) throw new ConsumptionError(\"PCR_CALCULATION_OVERFLOW\", \"Calculation produced a non-finite number; rescale or correct the input quantities.\");\n return {\n schema_version: 1, calculation_kind: \"tiangong-pcr-arithmetic\", operation: request.operation,\n request, formula, result, basis, evidence,\n interpretation: \"Arithmetic only, using supplied values and JavaScript floating-point precision. Physical applicability, evidence quality, tolerance and anomaly judgment are not evaluated.\",\n };\n}\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export class ConsumptionError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
details;
|
|
7
|
+
constructor(code, message, details = {}) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'ConsumptionError';
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.details = details;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const sha256 = (bytes) => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
|
|
15
|
+
export const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
16
|
+
export const pointerToken = (value) => String(value).replaceAll('~', '~0').replaceAll('/', '~1');
|
|
17
|
+
export function atPointer(value, pointer) {
|
|
18
|
+
if (typeof pointer !== 'string' || (pointer !== '' && !pointer.startsWith('/')) || /~(?:[^01]|$)/u.test(pointer)) {
|
|
19
|
+
throw new ConsumptionError('PCR_POINTER_INVALID', 'Use an RFC 6901 JSON Pointer, such as /processDataSet/exchanges/exchange/0.');
|
|
20
|
+
}
|
|
21
|
+
if (pointer === '')
|
|
22
|
+
return value;
|
|
23
|
+
let current = value;
|
|
24
|
+
for (const encoded of pointer.slice(1).split('/')) {
|
|
25
|
+
const key = encoded.replaceAll('~1', '/').replaceAll('~0', '~');
|
|
26
|
+
if (current === null || typeof current !== 'object' || !Object.hasOwn(current, key)
|
|
27
|
+
|| (Array.isArray(current) && !/^(0|[1-9]\d*)$/u.test(key))) {
|
|
28
|
+
throw new ConsumptionError('PCR_POINTER_NOT_FOUND', `No value exists at ${pointer}. Inspect the summary or a paged section first.`, { pointer });
|
|
29
|
+
}
|
|
30
|
+
// Index by the exact decoded token: numeric coercion could round a large
|
|
31
|
+
// token to a different property. The own-property check excludes prototypes.
|
|
32
|
+
current = current[key];
|
|
33
|
+
}
|
|
34
|
+
return current;
|
|
35
|
+
}
|
|
36
|
+
function message(error) { return error instanceof Error ? error.message : String(error); }
|
|
37
|
+
export function readJsonDocument(filename, maxBytes = 16 * 1024 * 1024) {
|
|
38
|
+
const file = path.resolve(filename);
|
|
39
|
+
let bytes;
|
|
40
|
+
try {
|
|
41
|
+
const stat = statSync(file);
|
|
42
|
+
if (!stat.isFile() || stat.size > maxBytes) {
|
|
43
|
+
throw new ConsumptionError('PCR_INPUT_SIZE', `Expected a JSON file no larger than ${maxBytes} bytes: ${file}`);
|
|
44
|
+
}
|
|
45
|
+
bytes = readFileSync(file);
|
|
46
|
+
if (bytes.length > maxBytes)
|
|
47
|
+
throw new ConsumptionError('PCR_INPUT_SIZE', `Input grew beyond ${maxBytes} bytes: ${file}`);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof ConsumptionError)
|
|
51
|
+
throw error;
|
|
52
|
+
throw new ConsumptionError('PCR_INPUT_READ', `Cannot read local JSON file ${file}: ${message(error)}`, { file });
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
// Fatal decoding prevents malformed bytes from silently becoming U+FFFD.
|
|
56
|
+
// Keep BOM in decoding and remove exactly one, preserving the legacy rule.
|
|
57
|
+
const text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes).replace(/^\uFEFF/u, '');
|
|
58
|
+
const value = JSON.parse(text);
|
|
59
|
+
return { file, sha256: sha256(bytes), bytes: bytes.length, value };
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
throw new ConsumptionError('PCR_INPUT_JSON', `Malformed JSON in ${file}: ${message(error)}`, { file });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function entriesAt(value, pointer) {
|
|
66
|
+
if (value === undefined || value === null)
|
|
67
|
+
return [];
|
|
68
|
+
const items = Array.isArray(value) ? value : null;
|
|
69
|
+
return items ? items.map((item, index) => ({ pointer: `${pointer}/${index}`, value: item })) : [{ pointer, value }];
|
|
70
|
+
}
|
|
71
|
+
export function paginate(items, page = 1, pageSize = 10) {
|
|
72
|
+
if (typeof page !== 'number' || typeof pageSize !== 'number' || !Number.isSafeInteger(page) || page < 1
|
|
73
|
+
|| !Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 100) {
|
|
74
|
+
throw new ConsumptionError('PCR_PAGE_INVALID', 'Use --page >= 1 and --page-size from 1 to 100.');
|
|
75
|
+
}
|
|
76
|
+
const pages = Math.max(1, Math.ceil(items.length / pageSize));
|
|
77
|
+
if (page > pages)
|
|
78
|
+
throw new ConsumptionError('PCR_PAGE_RANGE', `Page ${page} exceeds ${pages}; use --page ${pages}.`);
|
|
79
|
+
return { items: items.slice((page - 1) * pageSize, page * pageSize),
|
|
80
|
+
pagination: { page, page_size: pageSize, total: items.length, total_pages: pages, has_more: page < pages } };
|
|
81
|
+
}
|
|
82
|
+
/** Legacy bounded inspection utility. Semantic selected guidance must retain its
|
|
83
|
+
* complete value and source context instead of passing through this helper. */
|
|
84
|
+
export function preview(value, maxChars = 2400) {
|
|
85
|
+
const json = JSON.stringify(value);
|
|
86
|
+
if (json === undefined)
|
|
87
|
+
throw new TypeError('Value has no JSON representation.');
|
|
88
|
+
return json.length <= maxChars ? { value, truncated: false }
|
|
89
|
+
: { excerpt: json.slice(0, maxChars), truncated: true, total_characters: json.length };
|
|
90
|
+
}
|
|
91
|
+
export function strictNumber(value, name, { positive = false } = {}) {
|
|
92
|
+
if ((typeof value !== 'number' && typeof value !== 'string')
|
|
93
|
+
|| (typeof value === 'string' && !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u.test(value))
|
|
94
|
+
|| !Number.isFinite(Number(value)) || (positive && Number(value) <= 0)) {
|
|
95
|
+
throw new ConsumptionError('PCR_NUMBER_INVALID', `${name} must be a finite${positive ? ' positive' : ''} decimal number. Missing values are not zero.`, { field: name });
|
|
96
|
+
}
|
|
97
|
+
return Number(value);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=consumption-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumption-data.js","sourceRoot":"pcr://source/","sources":["packages/pcr-core/src/consumption-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,IAAI,CAAS;IACb,OAAO,CAAoC;IACpD,YAAY,IAAY,EAAE,OAAe,EAAE,OAAO,GAAsC,EAAE;QACxF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,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I;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;QAC1D,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,IAAY,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,GAA2B,EAAE;IAC1G,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;WACvD,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,kDAAkD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;WAC9F,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,GAAG,IAAI,oBAAoB,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,+CAA+C,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3K,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { createHash, type BinaryLike } from 'node:crypto';\nimport { readFileSync, statSync } from 'node:fs';\nimport path from 'node:path';\n\nexport class ConsumptionError extends Error {\n readonly code: string;\n readonly details: Readonly<Record<string, unknown>>;\n constructor(code: string, message: string, details: Readonly<Record<string, unknown>> = {}) {\n super(message);\n this.name = 'ConsumptionError';\n this.code = code;\n this.details = details;\n }\n}\n\nexport const sha256 = (bytes: BinaryLike): string => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;\nexport const object = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\nexport const pointerToken = (value: unknown): string => String(value).replaceAll('~', '~0').replaceAll('/', '~1');\n\nexport function atPointer(value: unknown, pointer: unknown): unknown {\n if (typeof pointer !== 'string' || (pointer !== '' && !pointer.startsWith('/')) || /~(?:[^01]|$)/u.test(pointer)) {\n throw new ConsumptionError('PCR_POINTER_INVALID', 'Use an RFC 6901 JSON Pointer, such as /processDataSet/exchanges/exchange/0.');\n }\n if (pointer === '') return value;\n let current: unknown = value;\n for (const encoded of pointer.slice(1).split('/')) {\n const key = encoded.replaceAll('~1', '/').replaceAll('~0', '~');\n if (current === null || typeof current !== 'object' || !Object.hasOwn(current, key)\n || (Array.isArray(current) && !/^(0|[1-9]\\d*)$/u.test(key))) {\n throw new ConsumptionError('PCR_POINTER_NOT_FOUND', `No value exists at ${pointer}. Inspect the summary or a paged section first.`, { pointer });\n }\n // Index by the exact decoded token: numeric coercion could round a large\n // token to a different property. The own-property check excludes prototypes.\n current = (current as Record<string, unknown>)[key];\n }\n return current;\n}\n\nexport interface JsonDocument {\n readonly file: string;\n readonly sha256: string;\n readonly bytes: number;\n readonly value: unknown;\n}\nfunction message(error: unknown): string { return error instanceof Error ? error.message : String(error); }\n\nexport function readJsonDocument(filename: string, maxBytes = 16 * 1024 * 1024): JsonDocument {\n const file = path.resolve(filename);\n let bytes: Buffer;\n try {\n const stat = statSync(file);\n if (!stat.isFile() || stat.size > maxBytes) {\n throw new ConsumptionError('PCR_INPUT_SIZE', `Expected a JSON file no larger than ${maxBytes} bytes: ${file}`);\n }\n bytes = readFileSync(file);\n if (bytes.length > maxBytes) throw new ConsumptionError('PCR_INPUT_SIZE', `Input grew beyond ${maxBytes} bytes: ${file}`);\n } catch (error: unknown) {\n if (error instanceof ConsumptionError) throw error;\n throw new ConsumptionError('PCR_INPUT_READ', `Cannot read local JSON file ${file}: ${message(error)}`, { file });\n }\n try {\n // Fatal decoding prevents malformed bytes from silently becoming U+FFFD.\n // Keep BOM in decoding and remove exactly one, preserving the legacy rule.\n const text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes).replace(/^\\uFEFF/u, '');\n const value: unknown = JSON.parse(text);\n return { file, sha256: sha256(bytes), bytes: bytes.length, value };\n } catch (error: unknown) {\n throw new ConsumptionError('PCR_INPUT_JSON', `Malformed JSON in ${file}: ${message(error)}`, { file });\n }\n}\n\nexport interface PointerEntry { readonly pointer: string; readonly value: unknown }\nexport function entriesAt(value: unknown, pointer: string): PointerEntry[] {\n if (value === undefined || value === null) return [];\n const items: readonly unknown[] | null = Array.isArray(value) ? value : null;\n return items ? items.map((item, index) => ({ pointer: `${pointer}/${index}`, value: item })) : [{ pointer, value }];\n}\n\nexport interface Pagination {\n readonly page: number;\n readonly page_size: number;\n readonly total: number;\n readonly total_pages: number;\n readonly has_more: boolean;\n}\nexport function paginate<T>(items: readonly T[], page: unknown = 1, pageSize: unknown = 10): { items: T[]; pagination: Pagination } {\n if (typeof page !== 'number' || typeof pageSize !== 'number' || !Number.isSafeInteger(page) || page < 1\n || !Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 100) {\n throw new ConsumptionError('PCR_PAGE_INVALID', 'Use --page >= 1 and --page-size from 1 to 100.');\n }\n const pages = Math.max(1, Math.ceil(items.length / pageSize));\n if (page > pages) throw new ConsumptionError('PCR_PAGE_RANGE', `Page ${page} exceeds ${pages}; use --page ${pages}.`);\n return { items: items.slice((page - 1) * pageSize, page * pageSize),\n pagination: { page, page_size: pageSize, total: items.length, total_pages: pages, has_more: page < pages } };\n}\n\nexport type Preview<T> = { readonly value: T; readonly truncated: false }\n | { readonly excerpt: string; readonly truncated: true; readonly total_characters: number };\n/** Legacy bounded inspection utility. Semantic selected guidance must retain its\n * complete value and source context instead of passing through this helper. */\nexport function preview<T>(value: T, maxChars = 2400): Preview<T> {\n const json = JSON.stringify(value);\n if (json === undefined) throw new TypeError('Value has no JSON representation.');\n return json.length <= maxChars ? { value, truncated: false }\n : { excerpt: json.slice(0, maxChars), truncated: true, total_characters: json.length };\n}\n\nexport function strictNumber(value: unknown, name: string, { positive = false }: { positive?: boolean } = {}): number {\n if ((typeof value !== 'number' && typeof value !== 'string')\n || (typeof value === 'string' && !/^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/u.test(value))\n || !Number.isFinite(Number(value)) || (positive && Number(value) <= 0)) {\n throw new ConsumptionError('PCR_NUMBER_INVALID', `${name} must be a finite${positive ? ' positive' : ''} decimal number. Missing values are not zero.`, { field: name });\n }\n return Number(value);\n}\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ConsumptionError, atPointer, entriesAt, object, paginate } from './consumption-data.js';
|
|
2
|
+
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
3
|
+
import structuredSchema from '../schemas/structured-projection.schema.json' with { type: 'json' };
|
|
4
|
+
import vocabularySchema from '../schemas/controlled-vocabulary.schema.json' with { type: 'json' };
|
|
5
|
+
import { assertGuidanceContextConsistency } from './compiler/guidance-context.js';
|
|
6
|
+
import { getVerifiedPcrProjection } from "./index.js";
|
|
7
|
+
const TOPICS = {
|
|
8
|
+
overview: ['product_category_identity', 'functional_unit', 'boundary_abstraction'],
|
|
9
|
+
'reference-flow': ['functional_unit', 'reference_flow_definition'],
|
|
10
|
+
boundary: ['system_boundary/rules', 'boundary_abstraction'], measurement: ['measurement_rules'],
|
|
11
|
+
inventory: ['process_map', 'process_inventory'], collection: ['dataset_production/collection_protocols'],
|
|
12
|
+
calculation: ['dataset_production/calculation_rules'], allocation: ['allocation_rules'],
|
|
13
|
+
quality: ['data_quality_rules', 'dataset_production/data_quality_requirements', 'published_dataset_profile'],
|
|
14
|
+
validation: ['validation_rules'], sources: ['data_sources'],
|
|
15
|
+
};
|
|
16
|
+
export const GUIDANCE_TOPICS = Object.keys(TOPICS);
|
|
17
|
+
const contextValidator = new Ajv2020({ strict: true, schemas: [structuredSchema, vocabularySchema] }).compile({ $ref: `${structuredSchema.$id}#/$defs/normativeContext` });
|
|
18
|
+
function provenance(value) {
|
|
19
|
+
return object(value) && (value.kind === 'stored_projection' || value.kind === 'derived_legacy_source')
|
|
20
|
+
&& value.compiler_contract_version === '2' && (value.stored_projection_schema_version === 1 || value.stored_projection_schema_version === 2)
|
|
21
|
+
&& ['stored_projection_sha256', 'source_sha256', 'context_sha256'].every(key => typeof value[key] === 'string' && /^sha256:[0-9a-f]{64}$/u.test(value[key]));
|
|
22
|
+
}
|
|
23
|
+
function verified(value) {
|
|
24
|
+
if (!object(value) || !object(value.pcr) || !object(value.readiness) || !object(value.structured)
|
|
25
|
+
|| typeof value.source_structured !== 'string' || !contextValidator(value.normative_context)
|
|
26
|
+
|| !provenance(value.normative_context_provenance)) {
|
|
27
|
+
throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Verified projection lacks complete normative source context.');
|
|
28
|
+
}
|
|
29
|
+
const snapshot = { pcr: value.pcr, readiness: value.readiness, structured: value.structured,
|
|
30
|
+
source_structured: value.source_structured, normative_context: value.normative_context,
|
|
31
|
+
normative_context_provenance: value.normative_context_provenance };
|
|
32
|
+
assertGuidanceContextConsistency(snapshot.structured, snapshot);
|
|
33
|
+
return snapshot;
|
|
34
|
+
}
|
|
35
|
+
export function projectionBinding(value) {
|
|
36
|
+
if (!object(value) || !object(value.pcr) || !object(value.readiness) || !object(value.structured)) {
|
|
37
|
+
throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Invalid verified projection binding.');
|
|
38
|
+
}
|
|
39
|
+
const metadata = value.structured.projection_metadata;
|
|
40
|
+
if (!object(metadata) || !object(metadata.canonical_markdown)
|
|
41
|
+
|| typeof value.pcr.id !== 'string' || !value.pcr.id || (value.pcr.version !== null && (typeof value.pcr.version !== 'string' || !value.pcr.version))
|
|
42
|
+
|| typeof value.readiness.methodology_status !== 'string' || !value.readiness.methodology_status
|
|
43
|
+
|| typeof metadata.generated_content_sha256 !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(metadata.generated_content_sha256)
|
|
44
|
+
|| typeof metadata.canonical_markdown.sha256 !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(metadata.canonical_markdown.sha256)) {
|
|
45
|
+
throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Projection identity and fingerprint fields are invalid.');
|
|
46
|
+
}
|
|
47
|
+
return { pcr_id: value.pcr.id, version: value.pcr.version,
|
|
48
|
+
projection_sha256: metadata.generated_content_sha256, markdown_sha256: metadata.canonical_markdown.sha256,
|
|
49
|
+
methodology_status: value.readiness.methodology_status };
|
|
50
|
+
}
|
|
51
|
+
export function pcrEvidence(snapshot, pointer) { return { ...projectionBinding(snapshot), pointer }; }
|
|
52
|
+
function contextSelection(snapshot, pointers, requested = pointers) {
|
|
53
|
+
const context = snapshot.normative_context;
|
|
54
|
+
const bindings = context.bindings.filter(binding => pointers.some(pointer => pointer === '' || pointer === binding.pointer || pointer.startsWith(`${binding.pointer}/`) || binding.pointer.startsWith(`${pointer}/`)));
|
|
55
|
+
const ids = new Set(bindings.map(binding => binding.unit_id));
|
|
56
|
+
const boundUnits = new Set(context.bindings.map(binding => binding.unit_id));
|
|
57
|
+
for (const unit of context.units) {
|
|
58
|
+
const familyPointer = unit.family === 'system_boundary' ? '/system_boundary/rules' : unit.family === 'allocation' ? '/allocation_rules' : '/validation_rules';
|
|
59
|
+
if (!boundUnits.has(unit.unit_id) && requested.some(pointer => pointer === '' || familyPointer.startsWith(pointer) || pointer.startsWith(familyPointer)))
|
|
60
|
+
ids.add(unit.unit_id);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
normalization: context.normalization, source_sha256: context.source_sha256,
|
|
64
|
+
parent_context_sha256: snapshot.normative_context_provenance.context_sha256,
|
|
65
|
+
complete_for_selected_values: true,
|
|
66
|
+
units: context.units.filter(unit => ids.has(unit.unit_id)), bindings,
|
|
67
|
+
diagnostics: context.diagnostics.filter(diagnostic => ids.has(diagnostic.unit_id)),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Pure selection over a core-verified envelope. Values are complete; pagination
|
|
71
|
+
* limits item count rather than cutting an individual requirement into characters. */
|
|
72
|
+
export function selectGuidanceFromSnapshot(value, { topic = 'overview', pointer, page = 1, pageSize = 10 } = {}) {
|
|
73
|
+
const snapshot = verified(value);
|
|
74
|
+
const base = {
|
|
75
|
+
schema_version: 2, guidance_kind: 'tiangong-pcr-guidance-selection',
|
|
76
|
+
pcr: projectionBinding(snapshot), readiness: snapshot.readiness, source_structured: snapshot.source_structured,
|
|
77
|
+
source_markdown: snapshot.source_structured.replace(/structured\.yaml$/u, 'pcr.en-US.md'), topics: GUIDANCE_TOPICS,
|
|
78
|
+
normative_context_provenance: snapshot.normative_context_provenance,
|
|
79
|
+
citation_note: 'Pointers and stored hashes address the verified stored projection. Complete selected values include their source units and ancestor context. Legacy enrichment has separate context provenance. Applicability remains an Agent judgment; fallback identities and pointers are snapshot-bound.',
|
|
80
|
+
};
|
|
81
|
+
if (pointer !== undefined)
|
|
82
|
+
return { ...base, source: pcrEvidence(snapshot, pointer), value: atPointer(snapshot.structured, pointer), normative_context_selection: contextSelection(snapshot, [pointer]) };
|
|
83
|
+
const names = Object.hasOwn(TOPICS, topic) ? TOPICS[topic] : undefined;
|
|
84
|
+
if (!names)
|
|
85
|
+
throw new ConsumptionError('PCR_GUIDANCE_TOPIC', `Use --topic ${GUIDANCE_TOPICS.join('|')}.`);
|
|
86
|
+
const entries = [];
|
|
87
|
+
for (const name of names) {
|
|
88
|
+
const sourcePointer = `/${name}`;
|
|
89
|
+
let selected;
|
|
90
|
+
try {
|
|
91
|
+
selected = atPointer(snapshot.structured, sourcePointer);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (!(error instanceof ConsumptionError) || error.code !== 'PCR_POINTER_NOT_FOUND')
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
for (const entry of entriesAt(selected, sourcePointer)) {
|
|
98
|
+
entries.push({ source: pcrEvidence(snapshot, entry.pointer),
|
|
99
|
+
rule_id: object(entry.value) ? entry.value.rule_id ?? entry.value.protocol_id ?? entry.value.row_id ?? entry.value.id ?? null : null,
|
|
100
|
+
value: entry.value, truncated: false });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const selected = paginate(entries, page, pageSize);
|
|
104
|
+
return { ...base, topic, ...selected, normative_context_selection: contextSelection(snapshot, selected.items.map(item => item.source.pointer), names.map(name => `/${name}`)) };
|
|
105
|
+
}
|
|
106
|
+
export function selectGuidance(options) { return selectGuidanceFromSnapshot(getVerifiedPcrProjection(options), options); }
|
|
107
|
+
//# sourceMappingURL=consumption-guidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumption-guidance.js","sourceRoot":"pcr://source/","sources":["packages/pcr-core/src/consumption-guidance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,gBAAgB,MAAM,8CAA8C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClG,OAAO,gBAAgB,MAAM,8CAA8C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElG,OAAO,EAAE,gCAAgC,EAAkC,MAAM,gCAAgC,CAAC;AAGlH,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,MAAM,MAAM,GAAgD;IAC1D,QAAQ,EAAE,CAAC,2BAA2B,EAAE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IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI;gBACpI,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,2BAA2B,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AAClL,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,OAAwB,IAAI,OAAO,0BAA0B,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { ConsumptionError, atPointer, entriesAt, object, paginate } from './consumption-data.ts';\nimport { Ajv2020 } from 'ajv/dist/2020.js';\nimport structuredSchema from '../schemas/structured-projection.schema.json' with { type: 'json' };\nimport vocabularySchema from '../schemas/controlled-vocabulary.schema.json' with { type: 'json' };\nimport type { NormativeProjectionContext } from './compiler/normative-projection.ts';\nimport { assertGuidanceContextConsistency, type GuidanceContextProvenance } from './compiler/guidance-context.ts';\nimport type { GuidanceContextEnvelope } from './compiler/guidance-context.ts';\n\nimport { getVerifiedPcrProjection } from \"./index.ts\";\nconst TOPICS: Readonly<Record<string, readonly string[]>> = {\n overview: ['product_category_identity', 'functional_unit', 'boundary_abstraction'],\n 'reference-flow': ['functional_unit', 'reference_flow_definition'],\n boundary: ['system_boundary/rules', 'boundary_abstraction'], measurement: ['measurement_rules'],\n inventory: ['process_map', 'process_inventory'], collection: ['dataset_production/collection_protocols'],\n calculation: ['dataset_production/calculation_rules'], allocation: ['allocation_rules'],\n quality: ['data_quality_rules', 'dataset_production/data_quality_requirements', 'published_dataset_profile'],\n validation: ['validation_rules'], sources: ['data_sources'],\n};\nexport const GUIDANCE_TOPICS = Object.keys(TOPICS);\nexport interface GuidanceOptions {\n root?: string; pcrId: string; topic?: string; pointer?: string; page?: number; pageSize?: number;\n}\ninterface VerifiedSnapshot extends GuidanceContextEnvelope {\n pcr: Record<string, unknown>; readiness: Record<string, unknown>;\n source_structured: string; structured: Record<string, unknown>;\n}\nconst contextValidator = new Ajv2020({ strict: true, schemas: [structuredSchema, vocabularySchema] }).compile<NormativeProjectionContext>({ $ref: `${structuredSchema.$id}#/$defs/normativeContext` });\nfunction provenance(value: unknown): value is GuidanceContextProvenance {\n return object(value) && (value.kind === 'stored_projection' || value.kind === 'derived_legacy_source')\n && value.compiler_contract_version === '2' && (value.stored_projection_schema_version === 1 || value.stored_projection_schema_version === 2)\n && ['stored_projection_sha256', 'source_sha256', 'context_sha256'].every(key => typeof value[key] === 'string' && /^sha256:[0-9a-f]{64}$/u.test(value[key]));\n}\nfunction verified(value: unknown): VerifiedSnapshot {\n if (!object(value) || !object(value.pcr) || !object(value.readiness) || !object(value.structured)\n || typeof value.source_structured !== 'string' || !contextValidator(value.normative_context)\n || !provenance(value.normative_context_provenance)) {\n throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Verified projection lacks complete normative source context.');\n }\n const snapshot = { pcr: value.pcr, readiness: value.readiness, structured: value.structured,\n source_structured: value.source_structured, normative_context: value.normative_context,\n normative_context_provenance: value.normative_context_provenance };\n assertGuidanceContextConsistency(snapshot.structured, snapshot);\n return snapshot;\n}\nexport function projectionBinding(value: unknown) {\n if (!object(value) || !object(value.pcr) || !object(value.readiness) || !object(value.structured)) {\n throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Invalid verified projection binding.');\n }\n const metadata = value.structured.projection_metadata;\n if (!object(metadata) || !object(metadata.canonical_markdown)\n || typeof value.pcr.id !== 'string' || !value.pcr.id || (value.pcr.version !== null && (typeof value.pcr.version !== 'string' || !value.pcr.version))\n || typeof value.readiness.methodology_status !== 'string' || !value.readiness.methodology_status\n || typeof metadata.generated_content_sha256 !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(metadata.generated_content_sha256)\n || typeof metadata.canonical_markdown.sha256 !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(metadata.canonical_markdown.sha256)) {\n throw new ConsumptionError('PCR_INTERNAL_CONTRACT_INVALID', 'Projection identity and fingerprint fields are invalid.');\n }\n return { pcr_id: value.pcr.id, version: value.pcr.version,\n projection_sha256: metadata.generated_content_sha256, markdown_sha256: metadata.canonical_markdown.sha256,\n methodology_status: value.readiness.methodology_status };\n}\nexport function pcrEvidence(snapshot: unknown, pointer: string) { return { ...projectionBinding(snapshot), pointer }; }\nfunction contextSelection(snapshot: VerifiedSnapshot, pointers: readonly string[], requested: readonly string[] = pointers) {\n const context = snapshot.normative_context;\n const bindings = context.bindings.filter(binding => pointers.some(pointer =>\n pointer === '' || pointer === binding.pointer || pointer.startsWith(`${binding.pointer}/`) || binding.pointer.startsWith(`${pointer}/`)));\n const ids = new Set(bindings.map(binding => binding.unit_id));\n const boundUnits = new Set(context.bindings.map(binding => binding.unit_id));\n for (const unit of context.units) {\n const familyPointer = unit.family === 'system_boundary' ? '/system_boundary/rules' : unit.family === 'allocation' ? '/allocation_rules' : '/validation_rules';\n if (!boundUnits.has(unit.unit_id) && requested.some(pointer => pointer === '' || familyPointer.startsWith(pointer) || pointer.startsWith(familyPointer))) ids.add(unit.unit_id);\n }\n return {\n normalization: context.normalization, source_sha256: context.source_sha256,\n parent_context_sha256: snapshot.normative_context_provenance.context_sha256,\n complete_for_selected_values: true,\n units: context.units.filter(unit => ids.has(unit.unit_id)), bindings,\n diagnostics: context.diagnostics.filter(diagnostic => ids.has(diagnostic.unit_id)),\n };\n}\n/** Pure selection over a core-verified envelope. Values are complete; pagination\n * limits item count rather than cutting an individual requirement into characters. */\nexport function selectGuidanceFromSnapshot(value: unknown, { topic = 'overview', pointer, page = 1, pageSize = 10 }: Omit<GuidanceOptions, 'root' | 'pcrId'> = {}) {\n const snapshot = verified(value);\n const base = {\n schema_version: 2, guidance_kind: 'tiangong-pcr-guidance-selection',\n pcr: projectionBinding(snapshot), readiness: snapshot.readiness, source_structured: snapshot.source_structured,\n source_markdown: snapshot.source_structured.replace(/structured\\.yaml$/u, 'pcr.en-US.md'), topics: GUIDANCE_TOPICS,\n normative_context_provenance: snapshot.normative_context_provenance,\n citation_note: 'Pointers and stored hashes address the verified stored projection. Complete selected values include their source units and ancestor context. Legacy enrichment has separate context provenance. Applicability remains an Agent judgment; fallback identities and pointers are snapshot-bound.',\n };\n if (pointer !== undefined) return { ...base, source: pcrEvidence(snapshot, pointer), value: atPointer(snapshot.structured, pointer), normative_context_selection: contextSelection(snapshot, [pointer]) };\n const names = Object.hasOwn(TOPICS, topic) ? TOPICS[topic] : undefined;\n if (!names) throw new ConsumptionError('PCR_GUIDANCE_TOPIC', `Use --topic ${GUIDANCE_TOPICS.join('|')}.`);\n const entries = [];\n for (const name of names) {\n const sourcePointer = `/${name}`;\n let selected: unknown;\n try { selected = atPointer(snapshot.structured, sourcePointer); }\n catch (error: unknown) { if (!(error instanceof ConsumptionError) || error.code !== 'PCR_POINTER_NOT_FOUND') throw error; }\n for (const entry of entriesAt(selected, sourcePointer)) {\n entries.push({ source: pcrEvidence(snapshot, entry.pointer),\n rule_id: object(entry.value) ? entry.value.rule_id ?? entry.value.protocol_id ?? entry.value.row_id ?? entry.value.id ?? null : null,\n value: entry.value, truncated: false });\n }\n }\n const selected = paginate(entries, page, pageSize);\n return { ...base, topic, ...selected, normative_context_selection: contextSelection(snapshot, selected.items.map(item => item.source.pointer), names.map(name => `/${name}`)) };\n}\nexport function selectGuidance(options: GuidanceOptions) { return selectGuidanceFromSnapshot(getVerifiedPcrProjection(options), options); }\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { atPointer } from "./consumption-data.js";
|
|
2
|
+
import { getVerifiedPcrProjection } from "./index.js";
|
|
3
|
+
import { projectionBinding } from "./consumption-guidance.js";
|
|
4
|
+
import { documentIdentity, extractReferences, loadTidasContext } from "./tidas-inspection.js";
|
|
5
|
+
import { validateCoreContract } from "./contracts.js";
|
|
6
|
+
import { isUnknownRecord, unknownField, errorMessage } from "./types.js";
|
|
7
|
+
const TOPICS = ["scope_and_applicability", "reference_basis", "inventory_and_boundary", "allocation", "data_quality"];
|
|
8
|
+
export function prepareReview({ root, pcrId, input, related }) {
|
|
9
|
+
const snapshot = getVerifiedPcrProjection({ root, pcrId });
|
|
10
|
+
const context = loadTidasContext({ input, related: related ?? null });
|
|
11
|
+
const unresolved = extractReferences(context).filter((reference) => reference.status !== "resolved");
|
|
12
|
+
return {
|
|
13
|
+
schema_version: 1, report_kind: "tiangong-pcr-agent-review", status: "draft",
|
|
14
|
+
pcr: projectionBinding(snapshot), inputs: context.documents.map(documentIdentity),
|
|
15
|
+
scope: {
|
|
16
|
+
description: `Review of supplied ${context.primary.kind}; the Agent must establish its declared scope and reference basis.`,
|
|
17
|
+
applicability: "Not assessed. Explain product, technology, gate and PCR applicability before drawing conclusions.",
|
|
18
|
+
limitations: [
|
|
19
|
+
"No semantic review or TIDAS schema validation has been performed by this command.",
|
|
20
|
+
`${unresolved.length} reference(s) could not be uniquely resolved in the supplied local inputs; inspect references before claiming omissions.`,
|
|
21
|
+
`${context.ignoredFiles.length} JSON file(s) with no native TIDAS dataset root were ignored by input inspection.`,
|
|
22
|
+
`PCR methodology status: ${snapshot.readiness.methodology_status}; library availability does not promote candidate methodology.`,
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
coverage: TOPICS.map((topic) => ({ topic, status: "not_reviewed", rationale: "Awaiting Agent investigation of applicability and evidence." })),
|
|
26
|
+
findings: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function checkReview({ root, pcrId, input, related, report: rawReport }) {
|
|
30
|
+
const shape = validateCoreContract("agent-review.schema.json", rawReport);
|
|
31
|
+
const issues = [];
|
|
32
|
+
const add = (code, location, message) => { issues.push({ code, location, message }); };
|
|
33
|
+
let report = null;
|
|
34
|
+
if (!shape.valid) {
|
|
35
|
+
for (const error of shape.issues ?? shape.errors)
|
|
36
|
+
add("report_shape", error.instance_path ?? "", error.message);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (!isUnknownRecord(rawReport))
|
|
40
|
+
throw new TypeError("Validated review report must be an object.");
|
|
41
|
+
// Existing strict JSON Schema validation proves the complete envelope shape.
|
|
42
|
+
// This cast occurs only after success; scientific reasoning remains unchecked.
|
|
43
|
+
report = rawReport;
|
|
44
|
+
const snapshot = getVerifiedPcrProjection({ root, pcrId });
|
|
45
|
+
const binding = projectionBinding(snapshot);
|
|
46
|
+
const context = loadTidasContext({ input, related: related ?? null });
|
|
47
|
+
const actual = context.documents.map(documentIdentity);
|
|
48
|
+
const files = new Map(context.documents.map((doc) => [doc.file, doc]));
|
|
49
|
+
const sameBinding = (candidate) => Object.entries(binding).every(([key, value]) => unknownField(candidate, key) === value);
|
|
50
|
+
if (!sameBinding(report.pcr))
|
|
51
|
+
add("pcr_changed", "/pcr", "PCR identity, content hashes or methodology status differ from the selected verified projection.");
|
|
52
|
+
if (report.inputs.length !== actual.length || report.inputs.some((item, index) => Object.entries(actual[index] ?? {}).some(([key, value]) => unknownField(item, key) !== value))) {
|
|
53
|
+
add("inputs_changed", "/inputs", "Input files, identities, order or exact-byte hashes differ. Regenerate the draft bindings and review the changed evidence.");
|
|
54
|
+
}
|
|
55
|
+
if (report.status === "reviewed" && !report.coverage.some((item) => item.status === "reviewed"))
|
|
56
|
+
add("review_empty", "/coverage", "A reviewed report must name at least one actually reviewed topic; otherwise retain draft status.");
|
|
57
|
+
const ids = new Set();
|
|
58
|
+
for (const [index, finding] of report.findings.entries()) {
|
|
59
|
+
const prefix = `/findings/${index}`;
|
|
60
|
+
if (ids.has(finding.id))
|
|
61
|
+
add("duplicate_finding", `${prefix}/id`, "Finding IDs must be unique within this report.");
|
|
62
|
+
ids.add(finding.id);
|
|
63
|
+
for (const [refIndex, reference] of finding.input_refs.entries()) {
|
|
64
|
+
const location = `${prefix}/input_refs/${refIndex}`;
|
|
65
|
+
const doc = files.get(reference.file);
|
|
66
|
+
if (!doc || reference.sha256 !== doc.sha256)
|
|
67
|
+
add("input_reference_changed", location, "Reference must identify an explicitly supplied input and its current exact-byte hash.");
|
|
68
|
+
else {
|
|
69
|
+
try {
|
|
70
|
+
atPointer(doc.value, reference.pointer);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
add("input_pointer", location, errorMessage(error));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const [refIndex, reference] of finding.pcr_refs.entries()) {
|
|
78
|
+
const location = `${prefix}/pcr_refs/${refIndex}`;
|
|
79
|
+
if (!sameBinding(reference))
|
|
80
|
+
add("pcr_reference_changed", location, "PCR reference does not match the selected verified projection.");
|
|
81
|
+
else {
|
|
82
|
+
try {
|
|
83
|
+
atPointer(snapshot.structured, reference.pointer);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
add("pcr_pointer", location, errorMessage(error));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
schema_version: 1, check_kind: "tiangong-pcr-review-envelope-check",
|
|
94
|
+
envelope_valid: issues.length === 0, methodology_approval: false,
|
|
95
|
+
report_status: report?.status ?? null,
|
|
96
|
+
checked: ["report_shape", ...(shape.valid ? ["input_and_pcr_bindings", "finding_reference_locations", "review_status_consistency"] : [])],
|
|
97
|
+
not_checked: ["PCR applicability", "truth of observations or conclusions", "sufficiency of evidence", "coverage completeness", "TIDAS schema validity"],
|
|
98
|
+
issues,
|
|
99
|
+
next_step: issues.length ? "Correct the report or re-review changed evidence, then run review check again."
|
|
100
|
+
: "Have the Agent/user assess the reasoning and remaining scope. Envelope validity does not approve the dataset.",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=consumption-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumption-review.js","sourceRoot":"pcr://source/","sources":["packages/pcr-core/src/consumption-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsBzE,MAAM,MAAM,GAAG,CAAC,yBAAyB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;AAEtH,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAiB;IAC1E,MAAM,QAAQ,GAAG,wBAAwB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;IACrG,OAA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BAAwB,EAAE,6BAA6B,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzI,WAAW,EAAE,CAAC,mBAAmB,EAAE,sCAAsC,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,uBAAuB,CAAC;QACvJ,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,gFAAgF;YACzG,CAAC,CAAC,+GAA+G;KACpH,CAAC;AACJ,CAAC","sourcesContent":["import { atPointer } from \"./consumption-data.ts\";\nimport { getVerifiedPcrProjection } from \"./index.ts\";\nimport { projectionBinding } from \"./consumption-guidance.ts\";\nimport { documentIdentity, extractReferences, loadTidasContext } from \"./tidas-inspection.ts\";\nimport { validateCoreContract } from \"./contracts.ts\";\n\nimport { isUnknownRecord, unknownField, errorMessage } from \"./types.ts\";\n\nexport interface ReviewOptions { root: string; pcrId: string; input: string; related?: string | null }\ntype PcrBinding = ReturnType<typeof projectionBinding>;\ntype InputIdentity = ReturnType<typeof documentIdentity>;\ninterface InputReference { file: string; sha256: string; pointer: string }\ninterface PcrReference extends PcrBinding { pointer: string }\nexport interface AgentReviewFinding {\n id: string; kind: \"confirmed_issue\" | \"suspected_anomaly\" | \"evidence_gap\";\n severity: \"error\" | \"warning\" | \"info\"; observation: string; rationale: string;\n input_refs: InputReference[]; pcr_refs: PcrReference[]; suggested_action: string; questions: string[];\n alternative_explanations?: string[];\n}\nexport interface AgentReviewReport extends Record<string, unknown> {\n schema_version: 1; report_kind: \"tiangong-pcr-agent-review\"; status: \"draft\" | \"reviewed\";\n pcr: PcrBinding; inputs: InputIdentity[];\n scope: { description: string; applicability: string; limitations: string[] };\n coverage: { topic: string; status: \"reviewed\" | \"not_applicable\" | \"not_reviewed\"; rationale: string }[];\n findings: AgentReviewFinding[];\n}\nexport interface ReviewIssue { code: string; location: string; message: string }\n\nconst TOPICS = [\"scope_and_applicability\", \"reference_basis\", \"inventory_and_boundary\", \"allocation\", \"data_quality\"];\n\nexport function prepareReview({ root, pcrId, input, related }: ReviewOptions): AgentReviewReport {\n const snapshot = getVerifiedPcrProjection({ root, pcrId });\n const context = loadTidasContext({ input, related: related ?? null });\n const unresolved = extractReferences(context).filter((reference) => reference.status !== \"resolved\");\n return {\n schema_version: 1, report_kind: \"tiangong-pcr-agent-review\", status: \"draft\",\n pcr: projectionBinding(snapshot), inputs: context.documents.map(documentIdentity),\n scope: {\n description: `Review of supplied ${context.primary.kind}; the Agent must establish its declared scope and reference basis.`,\n applicability: \"Not assessed. Explain product, technology, gate and PCR applicability before drawing conclusions.\",\n limitations: [\n \"No semantic review or TIDAS schema validation has been performed by this command.\",\n `${unresolved.length} reference(s) could not be uniquely resolved in the supplied local inputs; inspect references before claiming omissions.`,\n `${context.ignoredFiles.length} JSON file(s) with no native TIDAS dataset root were ignored by input inspection.`,\n `PCR methodology status: ${snapshot.readiness.methodology_status}; library availability does not promote candidate methodology.`,\n ],\n },\n coverage: TOPICS.map((topic) => ({ topic, status: \"not_reviewed\", rationale: \"Awaiting Agent investigation of applicability and evidence.\" })),\n findings: [],\n };\n}\n\nexport function checkReview({ root, pcrId, input, related, report: rawReport }: ReviewOptions & { report: unknown }) {\n const shape = validateCoreContract(\"agent-review.schema.json\", rawReport);\n const issues: ReviewIssue[] = [];\n const add = (code: string, location: string, message: string): void => { issues.push({ code, location, message }); };\n let report: AgentReviewReport | null = null;\n if (!shape.valid) {\n for (const error of shape.issues ?? shape.errors) add(\"report_shape\", error.instance_path ?? \"\", error.message);\n } else {\n if (!isUnknownRecord(rawReport)) throw new TypeError(\"Validated review report must be an object.\");\n // Existing strict JSON Schema validation proves the complete envelope shape.\n // This cast occurs only after success; scientific reasoning remains unchecked.\n report = rawReport as AgentReviewReport;\n const snapshot = getVerifiedPcrProjection({ root, pcrId });\n const binding = projectionBinding(snapshot);\n const context = loadTidasContext({ input, related: related ?? null });\n const actual = context.documents.map(documentIdentity);\n const files = new Map(context.documents.map((doc) => [doc.file, doc]));\n const sameBinding = (candidate: unknown): boolean => Object.entries(binding).every(([key, value]) => unknownField(candidate, key) === value);\n if (!sameBinding(report.pcr)) add(\"pcr_changed\", \"/pcr\", \"PCR identity, content hashes or methodology status differ from the selected verified projection.\");\n if (report.inputs.length !== actual.length || report.inputs.some((item, index) => Object.entries(actual[index] ?? {}).some(([key, value]) => unknownField(item, key) !== value))) {\n add(\"inputs_changed\", \"/inputs\", \"Input files, identities, order or exact-byte hashes differ. Regenerate the draft bindings and review the changed evidence.\");\n }\n if (report.status === \"reviewed\" && !report.coverage.some((item) => item.status === \"reviewed\")) add(\"review_empty\", \"/coverage\", \"A reviewed report must name at least one actually reviewed topic; otherwise retain draft status.\");\n const ids = new Set();\n for (const [index, finding] of report.findings.entries()) {\n const prefix = `/findings/${index}`;\n if (ids.has(finding.id)) add(\"duplicate_finding\", `${prefix}/id`, \"Finding IDs must be unique within this report.\");\n ids.add(finding.id);\n for (const [refIndex, reference] of finding.input_refs.entries()) {\n const location = `${prefix}/input_refs/${refIndex}`;\n const doc = files.get(reference.file);\n if (!doc || reference.sha256 !== doc.sha256) add(\"input_reference_changed\", location, \"Reference must identify an explicitly supplied input and its current exact-byte hash.\");\n else {\n try { atPointer(doc.value, reference.pointer); }\n catch (error) { add(\"input_pointer\", location, errorMessage(error)); }\n }\n }\n for (const [refIndex, reference] of finding.pcr_refs.entries()) {\n const location = `${prefix}/pcr_refs/${refIndex}`;\n if (!sameBinding(reference)) add(\"pcr_reference_changed\", location, \"PCR reference does not match the selected verified projection.\");\n else {\n try { atPointer(snapshot.structured, reference.pointer); }\n catch (error) { add(\"pcr_pointer\", location, errorMessage(error)); }\n }\n }\n }\n }\n return {\n schema_version: 1, check_kind: \"tiangong-pcr-review-envelope-check\",\n envelope_valid: issues.length === 0, methodology_approval: false,\n report_status: report?.status ?? null,\n checked: [\"report_shape\", ...(shape.valid ? [\"input_and_pcr_bindings\", \"finding_reference_locations\", \"review_status_consistency\"] : [])],\n not_checked: [\"PCR applicability\", \"truth of observations or conclusions\", \"sufficiency of evidence\", \"coverage completeness\", \"TIDAS schema validity\"],\n issues,\n next_step: issues.length ? \"Correct the report or re-review changed evidence, then run review check again.\"\n : \"Have the Agent/user assess the reasoning and remaining scope. Envelope validity does not approve the dataset.\",\n };\n}\n"]}
|