@openclaw/feishu 2026.10.2 → 2026.10.5-beta.2
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/dist/.setup/{app-registration-BB6TubaW.mjs → app-registration-DQOq5urV.mjs} +13 -32
- package/dist/.setup/{channel-DZakdZ3r.mjs → channel-CjGGyrdx.mjs} +87 -174
- package/dist/.setup/{channel.runtime-rXFuQXLL.mjs → channel.runtime-SaC_uTPM.mjs} +57 -74
- package/dist/.setup/{chat-mTBvMMvx.mjs → chat-fC3dvxFs.mjs} +16 -28
- package/dist/.setup/{client-CcxmEkoy.mjs → client-wwr8PGPH.mjs} +24 -30
- package/dist/.setup/{conversation-id-C1ofUfU8.mjs → conversation-id-D00i9uy5.mjs} +5 -10
- package/dist/.setup/{doctor-contract-DyOo8NvC.mjs → doctor-contract-oIpUWtNO.mjs} +8 -15
- package/dist/.setup/{monitor-CXaFHMmi.mjs → monitor-Yt__BUki.mjs} +33 -54
- package/dist/.setup/{monitor.account-cJ8gavqv.mjs → monitor.account-CVz16781.mjs} +359 -658
- package/dist/.setup/{probe-BjSykXB8.mjs → probe-DXnFxq5j.mjs} +14 -17
- package/dist/.setup/{reply-delivery-result-laBNOmBu.mjs → reply-delivery-result-iCCrdxE1.mjs} +153 -181
- package/dist/.setup/{session-conversation-C53IEUWt.mjs → session-conversation-BSBNK5Mq.mjs} +1 -1
- package/dist/.setup/{setup-api-fZcYXGxe.mjs → setup-api-B_LFQQ-Q.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-C8Z_x3KJ.mjs → subagent-hooks-9Pc1-k37.mjs} +7 -17
- package/dist/.setup/{thread-bindings-jW2x5VuN.mjs → thread-bindings-DdNLxoL3.mjs} +21 -44
- package/dist/api.js +218 -326
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
- package/node_modules/@openclaw/fs-safe/README.md +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
- package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
- package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
- package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
- package/node_modules/@openclaw/fs-safe/package.json +15 -15
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/mdast-util-to-markdown/index.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/configure.js +19 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.js +16 -5
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/code.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +11 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/html.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image.js +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +14 -4
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link.js +24 -9
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/root.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/text.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +6 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +6 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/index.js +34 -8
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/join.js +18 -1
- package/node_modules/mdast-util-to-markdown/lib/types.d.ts +50 -30
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/unsafe.js +15 -1
- 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 +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +3 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +9 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +95 -4
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +636 -57
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +12 -7
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +7 -2
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +20 -15
- 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.js +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/safe.js +71 -7
- package/node_modules/mdast-util-to-markdown/package.json +13 -57
- package/node_modules/mdast-util-to-markdown/readme.md +139 -84
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/compile.js +14 -4
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
- package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/preprocess.js +19 -21
- package/node_modules/micromark/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/lib/compile.js +37 -29
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/lib/create-tokenizer.js +37 -35
- package/node_modules/micromark/lib/initialize/document.js +21 -13
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/lib/initialize/text.js +7 -3
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/lib/preprocess.js +16 -19
- package/node_modules/micromark/package.json +2 -15
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
- 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.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
- package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
- package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
- 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.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
- package/node_modules/micromark-core-commonmark/package.json +4 -16
- package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/dev/index.js +58 -3
- package/node_modules/micromark-factory-space/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/index.js +55 -3
- package/node_modules/micromark-factory-space/package.json +1 -10
- package/node_modules/micromark-factory-space/readme.md +25 -25
- 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-types/index.d.ts +6 -3
- package/node_modules/micromark-util-types/package.json +2 -36
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +5 -5
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts +0 -7
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map +0 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import {ok as assert} from 'devlop'
|
|
11
|
-
import {
|
|
11
|
+
import {factorySpaceMinMax} from 'micromark-factory-space'
|
|
12
12
|
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
|
|
13
13
|
import {codes, constants, types} from 'micromark-util-symbol'
|
|
14
14
|
|
|
@@ -27,7 +27,6 @@ const furtherStart = {partial: true, tokenize: tokenizeFurtherStart}
|
|
|
27
27
|
* @type {Tokenizer}
|
|
28
28
|
*/
|
|
29
29
|
function tokenizeCodeIndented(effects, ok, nok) {
|
|
30
|
-
const self = this
|
|
31
30
|
return start
|
|
32
31
|
|
|
33
32
|
/**
|
|
@@ -48,35 +47,16 @@ function tokenizeCodeIndented(effects, ok, nok) {
|
|
|
48
47
|
// To do: manually check if interrupting like `markdown-rs`.
|
|
49
48
|
assert(markdownSpace(code))
|
|
50
49
|
effects.enter(types.codeIndented)
|
|
51
|
-
|
|
52
|
-
// so that we can drop the next state.
|
|
53
|
-
return factorySpace(
|
|
50
|
+
return factorySpaceMinMax(
|
|
54
51
|
effects,
|
|
55
|
-
|
|
52
|
+
atBreak,
|
|
53
|
+
nok,
|
|
56
54
|
types.linePrefix,
|
|
57
|
-
constants.tabSize
|
|
55
|
+
constants.tabSize,
|
|
56
|
+
constants.tabSize
|
|
58
57
|
)(code)
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
/**
|
|
62
|
-
* At start, after 1 or 4 spaces.
|
|
63
|
-
*
|
|
64
|
-
* ```markdown
|
|
65
|
-
* > | aaa
|
|
66
|
-
* ^
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* @type {State}
|
|
70
|
-
*/
|
|
71
|
-
function afterPrefix(code) {
|
|
72
|
-
const tail = self.events[self.events.length - 1]
|
|
73
|
-
return tail &&
|
|
74
|
-
tail[1].type === types.linePrefix &&
|
|
75
|
-
tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
|
|
76
|
-
? atBreak(code)
|
|
77
|
-
: nok(code)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
60
|
/**
|
|
81
61
|
* At a break.
|
|
82
62
|
*
|
|
@@ -168,35 +148,31 @@ function tokenizeFurtherStart(effects, ok, nok) {
|
|
|
168
148
|
// To do: the code here in `micromark-js` is a bit different from
|
|
169
149
|
// `markdown-rs` because there it can attempt spaces.
|
|
170
150
|
// We can’t yet.
|
|
171
|
-
|
|
172
|
-
// To do: use an improved `space_or_tab` function like `markdown-rs`,
|
|
173
|
-
// so that we can drop the next state.
|
|
174
|
-
return factorySpace(
|
|
151
|
+
return factorySpaceMinMax(
|
|
175
152
|
effects,
|
|
176
|
-
|
|
153
|
+
ok,
|
|
154
|
+
onNotEnoughPrefix,
|
|
177
155
|
types.linePrefix,
|
|
178
|
-
constants.tabSize
|
|
156
|
+
constants.tabSize,
|
|
157
|
+
constants.tabSize
|
|
179
158
|
)(code)
|
|
180
159
|
}
|
|
181
160
|
|
|
182
161
|
/**
|
|
183
|
-
*
|
|
162
|
+
* After not enough of a prefix.
|
|
163
|
+
*
|
|
164
|
+
* A following line ending is another (potentially blank) line to try,
|
|
165
|
+
* anything else means this isn’t a continuation.
|
|
184
166
|
*
|
|
185
167
|
* ```markdown
|
|
186
168
|
* > | aaa
|
|
187
|
-
*
|
|
169
|
+
*
|
|
170
|
+
* | bbb
|
|
188
171
|
* ```
|
|
189
172
|
*
|
|
190
173
|
* @type {State}
|
|
191
174
|
*/
|
|
192
|
-
function
|
|
193
|
-
|
|
194
|
-
return tail &&
|
|
195
|
-
tail[1].type === types.linePrefix &&
|
|
196
|
-
tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
|
|
197
|
-
? ok(code)
|
|
198
|
-
: markdownLineEnding(code)
|
|
199
|
-
? furtherStart(code)
|
|
200
|
-
: nok(code)
|
|
175
|
+
function onNotEnoughPrefix(code) {
|
|
176
|
+
return markdownLineEnding(code) ? furtherStart(code) : nok(code)
|
|
201
177
|
}
|
|
202
178
|
}
|
|
@@ -30,10 +30,6 @@ export const headingAtx = {
|
|
|
30
30
|
function resolveHeadingAtx(events, context) {
|
|
31
31
|
let contentEnd = events.length - 2
|
|
32
32
|
let contentStart = 3
|
|
33
|
-
/** @type {Token} */
|
|
34
|
-
let content
|
|
35
|
-
/** @type {Token} */
|
|
36
|
-
let text
|
|
37
33
|
|
|
38
34
|
// Prefix whitespace, part of the opening.
|
|
39
35
|
if (events[contentStart][1].type === types.whitespace) {
|
|
@@ -58,12 +54,12 @@ function resolveHeadingAtx(events, context) {
|
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
if (contentEnd > contentStart) {
|
|
61
|
-
content = {
|
|
57
|
+
const content = {
|
|
62
58
|
type: types.atxHeadingText,
|
|
63
59
|
start: events[contentStart][1].start,
|
|
64
60
|
end: events[contentEnd][1].end
|
|
65
61
|
}
|
|
66
|
-
text = {
|
|
62
|
+
const text = {
|
|
67
63
|
type: types.chunkText,
|
|
68
64
|
start: events[contentStart][1].start,
|
|
69
65
|
end: events[contentEnd][1].end,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-flow.d.ts","sourceRoot":"","sources":["html-flow.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html-flow.d.ts","sourceRoot":"","sources":["html-flow.js"],"names":[],"mappings":"AAwBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BAtBS,sBAAsB"}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import {htmlBlockNames, htmlRawNames} from 'micromark-util-html-tag-name'
|
|
21
21
|
import {codes, constants, types} from 'micromark-util-symbol'
|
|
22
22
|
import {blankLine} from './blank-line.js'
|
|
23
|
+
import {nonLazyContinuation} from './partial-non-lazy-continuation.js'
|
|
23
24
|
|
|
24
25
|
/** @type {Construct} */
|
|
25
26
|
export const htmlFlow = {
|
|
@@ -31,10 +32,6 @@ export const htmlFlow = {
|
|
|
31
32
|
|
|
32
33
|
/** @type {Construct} */
|
|
33
34
|
const blankLineBefore = {partial: true, tokenize: tokenizeBlankLineBefore}
|
|
34
|
-
const nonLazyContinuationStart = {
|
|
35
|
-
partial: true,
|
|
36
|
-
tokenize: tokenizeNonLazyContinuationStart
|
|
37
|
-
}
|
|
38
35
|
|
|
39
36
|
/** @type {Resolver} */
|
|
40
37
|
function resolveToHtmlFlow(events) {
|
|
@@ -704,7 +701,7 @@ function tokenizeHtmlFlow(effects, ok, nok) {
|
|
|
704
701
|
*/
|
|
705
702
|
function continuationStart(code) {
|
|
706
703
|
return effects.check(
|
|
707
|
-
|
|
704
|
+
nonLazyContinuation,
|
|
708
705
|
continuationStartNonLazy,
|
|
709
706
|
continuationAfter
|
|
710
707
|
)(code)
|
|
@@ -912,54 +909,6 @@ function tokenizeHtmlFlow(effects, ok, nok) {
|
|
|
912
909
|
}
|
|
913
910
|
}
|
|
914
911
|
|
|
915
|
-
/**
|
|
916
|
-
* @this {TokenizeContext}
|
|
917
|
-
* Context.
|
|
918
|
-
* @type {Tokenizer}
|
|
919
|
-
*/
|
|
920
|
-
function tokenizeNonLazyContinuationStart(effects, ok, nok) {
|
|
921
|
-
const self = this
|
|
922
|
-
|
|
923
|
-
return start
|
|
924
|
-
|
|
925
|
-
/**
|
|
926
|
-
* At eol, before continuation.
|
|
927
|
-
*
|
|
928
|
-
* ```markdown
|
|
929
|
-
* > | * ```js
|
|
930
|
-
* ^
|
|
931
|
-
* | b
|
|
932
|
-
* ```
|
|
933
|
-
*
|
|
934
|
-
* @type {State}
|
|
935
|
-
*/
|
|
936
|
-
function start(code) {
|
|
937
|
-
if (markdownLineEnding(code)) {
|
|
938
|
-
effects.enter(types.lineEnding)
|
|
939
|
-
effects.consume(code)
|
|
940
|
-
effects.exit(types.lineEnding)
|
|
941
|
-
return after
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
return nok(code)
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* A continuation.
|
|
949
|
-
*
|
|
950
|
-
* ```markdown
|
|
951
|
-
* | * ```js
|
|
952
|
-
* > | b
|
|
953
|
-
* ^
|
|
954
|
-
* ```
|
|
955
|
-
*
|
|
956
|
-
* @type {State}
|
|
957
|
-
*/
|
|
958
|
-
function after(code) {
|
|
959
|
-
return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
912
|
/**
|
|
964
913
|
* @this {TokenizeContext}
|
|
965
914
|
* Context.
|
|
@@ -69,8 +69,6 @@ function resolveAllLabelEnd(events) {
|
|
|
69
69
|
function resolveToLabelEnd(events, context) {
|
|
70
70
|
let index = events.length
|
|
71
71
|
let offset = 0
|
|
72
|
-
/** @type {Token} */
|
|
73
|
-
let token
|
|
74
72
|
/** @type {number | undefined} */
|
|
75
73
|
let open
|
|
76
74
|
/** @type {number | undefined} */
|
|
@@ -80,7 +78,7 @@ function resolveToLabelEnd(events, context) {
|
|
|
80
78
|
|
|
81
79
|
// Find an opening.
|
|
82
80
|
while (index--) {
|
|
83
|
-
token = events[index][1]
|
|
81
|
+
const token = events[index][1]
|
|
84
82
|
|
|
85
83
|
if (open) {
|
|
86
84
|
// If we see another link, or inactive link label, we’ve been here before.
|
|
@@ -187,22 +185,23 @@ function resolveToLabelEnd(events, context) {
|
|
|
187
185
|
*/
|
|
188
186
|
function tokenizeLabelEnd(effects, ok, nok) {
|
|
189
187
|
const self = this
|
|
190
|
-
|
|
188
|
+
const labelStarts = self._labelStarts
|
|
191
189
|
/** @type {Token} */
|
|
192
190
|
let labelStart
|
|
193
191
|
/** @type {boolean} */
|
|
194
192
|
let defined
|
|
195
193
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
194
|
+
if (labelStarts) {
|
|
195
|
+
// Discard ones that failed to close,
|
|
196
|
+
// they’re not needed anymore.
|
|
197
|
+
while (
|
|
198
|
+
labelStarts.length > 0 &&
|
|
199
|
+
labelStarts[labelStarts.length - 1]._balanced
|
|
202
200
|
) {
|
|
203
|
-
|
|
204
|
-
break
|
|
201
|
+
labelStarts.pop()
|
|
205
202
|
}
|
|
203
|
+
|
|
204
|
+
labelStart = labelStarts[labelStarts.length - 1]
|
|
206
205
|
}
|
|
207
206
|
|
|
208
207
|
return start
|
|
@@ -338,6 +337,9 @@ function tokenizeLabelEnd(effects, ok, nok) {
|
|
|
338
337
|
*/
|
|
339
338
|
function labelEndOk(code) {
|
|
340
339
|
// Note: `markdown-rs` does a bunch of stuff here.
|
|
340
|
+
// This label start is now used up: discard it so it’s never found again.
|
|
341
|
+
assert(labelStarts, 'expected `labelStarts` to be populated')
|
|
342
|
+
labelStarts.pop()
|
|
341
343
|
return ok(code)
|
|
342
344
|
}
|
|
343
345
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-start-image.d.ts","sourceRoot":"","sources":["label-start-image.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label-start-image.d.ts","sourceRoot":"","sources":["label-start-image.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @import {
|
|
3
3
|
* Construct,
|
|
4
4
|
* State,
|
|
5
|
+
* Token,
|
|
5
6
|
* TokenizeContext,
|
|
6
7
|
* Tokenizer
|
|
7
8
|
* } from 'micromark-util-types'
|
|
@@ -25,6 +26,8 @@ export const labelStartImage = {
|
|
|
25
26
|
*/
|
|
26
27
|
function tokenizeLabelStartImage(effects, ok, nok) {
|
|
27
28
|
const self = this
|
|
29
|
+
/** @type {Token} */
|
|
30
|
+
let labelImage
|
|
28
31
|
|
|
29
32
|
return start
|
|
30
33
|
|
|
@@ -62,7 +65,7 @@ function tokenizeLabelStartImage(effects, ok, nok) {
|
|
|
62
65
|
effects.enter(types.labelMarker)
|
|
63
66
|
effects.consume(code)
|
|
64
67
|
effects.exit(types.labelMarker)
|
|
65
|
-
effects.exit(types.labelImage)
|
|
68
|
+
labelImage = effects.exit(types.labelImage)
|
|
66
69
|
return after
|
|
67
70
|
}
|
|
68
71
|
|
|
@@ -101,10 +104,16 @@ function tokenizeLabelStartImage(effects, ok, nok) {
|
|
|
101
104
|
// `micromark-extension-gfm-footnote`, but the `label-start-link`
|
|
102
105
|
// behavior isn’t.
|
|
103
106
|
// Hidden footnotes hook.
|
|
104
|
-
/* c8 ignore next
|
|
105
|
-
|
|
107
|
+
/* c8 ignore next 6 */
|
|
108
|
+
if (
|
|
109
|
+
code === codes.caret &&
|
|
106
110
|
'_hiddenFootnoteSupport' in self.parser.constructs
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
) {
|
|
112
|
+
return nok(code)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
self._labelStarts = self._labelStarts || []
|
|
116
|
+
self._labelStarts.push(labelImage)
|
|
117
|
+
return ok(code)
|
|
109
118
|
}
|
|
110
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-start-link.d.ts","sourceRoot":"","sources":["label-start-link.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label-start-link.d.ts","sourceRoot":"","sources":["label-start-link.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,6BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @import {
|
|
3
3
|
* Construct,
|
|
4
4
|
* State,
|
|
5
|
+
* Token,
|
|
5
6
|
* TokenizeContext,
|
|
6
7
|
* Tokenizer
|
|
7
8
|
* } from 'micromark-util-types'
|
|
@@ -25,6 +26,8 @@ export const labelStartLink = {
|
|
|
25
26
|
*/
|
|
26
27
|
function tokenizeLabelStartLink(effects, ok, nok) {
|
|
27
28
|
const self = this
|
|
29
|
+
/** @type {Token} */
|
|
30
|
+
let labelLink
|
|
28
31
|
|
|
29
32
|
return start
|
|
30
33
|
|
|
@@ -44,7 +47,7 @@ function tokenizeLabelStartLink(effects, ok, nok) {
|
|
|
44
47
|
effects.enter(types.labelMarker)
|
|
45
48
|
effects.consume(code)
|
|
46
49
|
effects.exit(types.labelMarker)
|
|
47
|
-
effects.exit(types.labelLink)
|
|
50
|
+
labelLink = effects.exit(types.labelLink)
|
|
48
51
|
return after
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -53,10 +56,16 @@ function tokenizeLabelStartLink(effects, ok, nok) {
|
|
|
53
56
|
// To do: this isn’t needed in `micromark-extension-gfm-footnote`,
|
|
54
57
|
// remove.
|
|
55
58
|
// Hidden footnotes hook.
|
|
56
|
-
/* c8 ignore next
|
|
57
|
-
|
|
59
|
+
/* c8 ignore next 6 */
|
|
60
|
+
if (
|
|
61
|
+
code === codes.caret &&
|
|
58
62
|
'_hiddenFootnoteSupport' in self.parser.constructs
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
) {
|
|
64
|
+
return nok(code)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
self._labelStarts = self._labelStarts || []
|
|
68
|
+
self._labelStarts.push(labelLink)
|
|
69
|
+
return ok(code)
|
|
61
70
|
}
|
|
62
71
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partial-non-lazy-continuation.d.ts","sourceRoot":"","sources":["partial-non-lazy-continuation.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,kCADW,SAAS,CAInB;+BAXS,sBAAsB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {
|
|
3
|
+
* Construct,
|
|
4
|
+
* State,
|
|
5
|
+
* TokenizeContext,
|
|
6
|
+
* Tokenizer
|
|
7
|
+
* } from 'micromark-util-types'
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {ok as assert} from 'devlop'
|
|
11
|
+
import {markdownLineEnding} from 'micromark-util-character'
|
|
12
|
+
import {codes, types} from 'micromark-util-symbol'
|
|
13
|
+
|
|
14
|
+
/** @type {Construct} */
|
|
15
|
+
export const nonLazyContinuation = {
|
|
16
|
+
partial: true,
|
|
17
|
+
tokenize: tokenizeNonLazyContinuation
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @this {TokenizeContext}
|
|
22
|
+
* Context.
|
|
23
|
+
* @type {Tokenizer}
|
|
24
|
+
*/
|
|
25
|
+
function tokenizeNonLazyContinuation(effects, ok, nok) {
|
|
26
|
+
const self = this
|
|
27
|
+
|
|
28
|
+
return start
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* At eol, before continuation.
|
|
32
|
+
*
|
|
33
|
+
* ```markdown
|
|
34
|
+
* > | * ```js
|
|
35
|
+
* ^
|
|
36
|
+
* | b
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @type {State}
|
|
40
|
+
*/
|
|
41
|
+
function start(code) {
|
|
42
|
+
if (code === codes.eof) {
|
|
43
|
+
return nok(code)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
assert(markdownLineEnding(code), 'expected eol')
|
|
47
|
+
effects.enter(types.lineEnding)
|
|
48
|
+
effects.consume(code)
|
|
49
|
+
effects.exit(types.lineEnding)
|
|
50
|
+
return after
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* A continuation.
|
|
55
|
+
*
|
|
56
|
+
* ```markdown
|
|
57
|
+
* | * ```js
|
|
58
|
+
* > | b
|
|
59
|
+
* ^
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @type {State}
|
|
63
|
+
*/
|
|
64
|
+
function after(code) {
|
|
65
|
+
return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setext-underline.d.ts","sourceRoot":"","sources":["setext-underline.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setext-underline.d.ts","sourceRoot":"","sources":["setext-underline.js"],"names":[],"mappings":"AAiBA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAdS,sBAAsB"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import {ok as assert} from 'devlop'
|
|
13
13
|
import {factorySpace} from 'micromark-factory-space'
|
|
14
14
|
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
|
|
15
|
+
import {EditMap} from 'micromark-util-edit-map'
|
|
15
16
|
import {codes, types} from 'micromark-util-symbol'
|
|
16
17
|
|
|
17
18
|
/** @type {Construct} */
|
|
@@ -23,7 +24,7 @@ export const setextUnderline = {
|
|
|
23
24
|
|
|
24
25
|
/** @type {Resolver} */
|
|
25
26
|
function resolveToSetextUnderline(events, context) {
|
|
26
|
-
|
|
27
|
+
const editMap = new EditMap()
|
|
27
28
|
let index = events.length
|
|
28
29
|
/** @type {number | undefined} */
|
|
29
30
|
let content
|
|
@@ -49,7 +50,7 @@ function resolveToSetextUnderline(events, context) {
|
|
|
49
50
|
else {
|
|
50
51
|
if (events[index][1].type === types.content) {
|
|
51
52
|
// Remove the content end (if needed we’ll add it later)
|
|
52
|
-
|
|
53
|
+
editMap.add(index, 1, [])
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
if (!definition && events[index][1].type === types.definition) {
|
|
@@ -77,15 +78,17 @@ function resolveToSetextUnderline(events, context) {
|
|
|
77
78
|
// If we have definitions in the content, we’ll keep on having content,
|
|
78
79
|
// but we need move it.
|
|
79
80
|
if (definition) {
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
editMap.add(text, 0, [['enter', heading, context]])
|
|
82
|
+
editMap.add(definition + 1, 0, [['exit', events[content][1], context]])
|
|
82
83
|
events[content][1].end = {...events[definition][1].end}
|
|
83
84
|
} else {
|
|
84
85
|
events[content][1] = heading
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
// Add the heading exit at the end.
|
|
88
|
-
events.
|
|
89
|
+
editMap.add(events.length, 0, [['exit', heading, context]])
|
|
90
|
+
|
|
91
|
+
editMap.consume(events)
|
|
89
92
|
|
|
90
93
|
return events
|
|
91
94
|
}
|
|
@@ -30,22 +30,8 @@ export const attention = {
|
|
|
30
30
|
// eslint-disable-next-line complexity
|
|
31
31
|
function resolveAllAttention(events, context) {
|
|
32
32
|
let index = -1;
|
|
33
|
-
/** @type {number} */
|
|
34
|
-
let open;
|
|
35
|
-
/** @type {Token} */
|
|
36
|
-
let group;
|
|
37
|
-
/** @type {Token} */
|
|
38
|
-
let text;
|
|
39
|
-
/** @type {Token} */
|
|
40
|
-
let openingSequence;
|
|
41
|
-
/** @type {Token} */
|
|
42
|
-
let closingSequence;
|
|
43
|
-
/** @type {number} */
|
|
44
|
-
let use;
|
|
45
33
|
/** @type {Array<Event>} */
|
|
46
34
|
let nextEvents;
|
|
47
|
-
/** @type {number} */
|
|
48
|
-
let offset;
|
|
49
35
|
|
|
50
36
|
// Walk through all events.
|
|
51
37
|
//
|
|
@@ -54,7 +40,7 @@ function resolveAllAttention(events, context) {
|
|
|
54
40
|
while (++index < events.length) {
|
|
55
41
|
// Find a token that can close.
|
|
56
42
|
if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {
|
|
57
|
-
open = index;
|
|
43
|
+
let open = index;
|
|
58
44
|
|
|
59
45
|
// Now walk back to find an opener.
|
|
60
46
|
while (open--) {
|
|
@@ -71,7 +57,7 @@ function resolveAllAttention(events, context) {
|
|
|
71
57
|
}
|
|
72
58
|
|
|
73
59
|
// Number of markers to use from the sequence.
|
|
74
|
-
use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;
|
|
60
|
+
const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;
|
|
75
61
|
const start = {
|
|
76
62
|
...events[open][1].end
|
|
77
63
|
};
|
|
@@ -80,21 +66,21 @@ function resolveAllAttention(events, context) {
|
|
|
80
66
|
};
|
|
81
67
|
movePoint(start, -use);
|
|
82
68
|
movePoint(end, use);
|
|
83
|
-
openingSequence = {
|
|
69
|
+
const openingSequence = {
|
|
84
70
|
type: use > 1 ? "strongSequence" : "emphasisSequence",
|
|
85
71
|
start,
|
|
86
72
|
end: {
|
|
87
73
|
...events[open][1].end
|
|
88
74
|
}
|
|
89
75
|
};
|
|
90
|
-
closingSequence = {
|
|
76
|
+
const closingSequence = {
|
|
91
77
|
type: use > 1 ? "strongSequence" : "emphasisSequence",
|
|
92
78
|
start: {
|
|
93
79
|
...events[index][1].start
|
|
94
80
|
},
|
|
95
81
|
end
|
|
96
82
|
};
|
|
97
|
-
text = {
|
|
83
|
+
const text = {
|
|
98
84
|
type: use > 1 ? "strongText" : "emphasisText",
|
|
99
85
|
start: {
|
|
100
86
|
...events[open][1].end
|
|
@@ -103,7 +89,7 @@ function resolveAllAttention(events, context) {
|
|
|
103
89
|
...events[index][1].start
|
|
104
90
|
}
|
|
105
91
|
};
|
|
106
|
-
group = {
|
|
92
|
+
const group = {
|
|
107
93
|
type: use > 1 ? "strong" : "emphasis",
|
|
108
94
|
start: {
|
|
109
95
|
...openingSequence.start
|
|
@@ -136,12 +122,13 @@ function resolveAllAttention(events, context) {
|
|
|
136
122
|
// Closing.
|
|
137
123
|
nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);
|
|
138
124
|
|
|
125
|
+
/** @type {number} */
|
|
126
|
+
let offset = 0;
|
|
127
|
+
|
|
139
128
|
// If there are more markers in the closing, add them after.
|
|
140
129
|
if (events[index][1].end.offset - events[index][1].start.offset) {
|
|
141
130
|
offset = 2;
|
|
142
131
|
nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);
|
|
143
|
-
} else {
|
|
144
|
-
offset = 0;
|
|
145
132
|
}
|
|
146
133
|
splice(events, open - 1, index - open + 3, nextEvents);
|
|
147
134
|
index = open + nextEvents.length - offset - 2;
|
|
@@ -213,8 +200,11 @@ function tokenizeAttention(effects, ok) {
|
|
|
213
200
|
|
|
214
201
|
// Always populated by defaults.
|
|
215
202
|
|
|
216
|
-
|
|
217
|
-
|
|
203
|
+
// Note: `*` and `_` are in `attentionMarkers` through core.
|
|
204
|
+
// They are excluded here as the loosening is meant for markers registered
|
|
205
|
+
// by *other* constructs (such as GFM strikethrough’s `~`).
|
|
206
|
+
const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;
|
|
207
|
+
const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;
|
|
218
208
|
token._open = Boolean(marker === 42 ? open : open && (before || !close));
|
|
219
209
|
token._close = Boolean(marker === 42 ? close : close && (after || !open));
|
|
220
210
|
return ok(code);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-fenced.d.ts","sourceRoot":"","sources":["code-fenced.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-fenced.d.ts","sourceRoot":"","sources":["code-fenced.js"],"names":[],"mappings":"AAgBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAdS,sBAAsB"}
|
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { factorySpace } from 'micromark-factory-space';
|
|
12
12
|
import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
|
|
13
|
-
|
|
14
|
-
const nonLazyContinuation = {
|
|
15
|
-
partial: true,
|
|
16
|
-
tokenize: tokenizeNonLazyContinuation
|
|
17
|
-
};
|
|
13
|
+
import { nonLazyContinuation } from './partial-non-lazy-continuation.js';
|
|
18
14
|
|
|
19
15
|
/** @type {Construct} */
|
|
20
16
|
export const codeFenced = {
|
|
@@ -423,38 +419,4 @@ function tokenizeCodeFenced(effects, ok, nok) {
|
|
|
423
419
|
return nok(code);
|
|
424
420
|
}
|
|
425
421
|
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* @this {TokenizeContext}
|
|
430
|
-
* Context.
|
|
431
|
-
* @type {Tokenizer}
|
|
432
|
-
*/
|
|
433
|
-
function tokenizeNonLazyContinuation(effects, ok, nok) {
|
|
434
|
-
const self = this;
|
|
435
|
-
return start;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* @type {State}
|
|
441
|
-
*/
|
|
442
|
-
function start(code) {
|
|
443
|
-
if (code === null) {
|
|
444
|
-
return nok(code);
|
|
445
|
-
}
|
|
446
|
-
effects.enter("lineEnding");
|
|
447
|
-
effects.consume(code);
|
|
448
|
-
effects.exit("lineEnding");
|
|
449
|
-
return lineStart;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
* @type {State}
|
|
456
|
-
*/
|
|
457
|
-
function lineStart(code) {
|
|
458
|
-
return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
|
|
459
|
-
}
|
|
460
422
|
}
|