@openclaw/ai 2026.9.1-beta.1 → 2026.9.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/{anthropic-DI4PZKKB.mjs → anthropic-BDdqdVLK.mjs} +222 -216
- package/dist/{anthropic-compaction-replay-nhKaCXu6.mjs → anthropic-compaction-replay-DB2FGLQc.mjs} +160 -68
- package/dist/{anthropic-payload-policy-B_0n0enE.d.mts → anthropic-payload-policy-d46X2pR0.d.mts} +28 -4
- package/dist/{api-registry-CTd8NzcD.d.mts → api-registry-DWtPjzyn.d.mts} +2 -2
- package/dist/{azure-openai-responses-D8dI0ekg.mjs → azure-openai-responses-C5bZRfAP.mjs} +12 -9
- package/dist/{number-coercion-H9qHik3g.mjs → base64-CEFBpSkN.mjs} +73 -1
- package/dist/{diagnostics-COpOtRwq.mjs → diagnostics-CPeq9F7y.mjs} +5 -1
- package/dist/diagnostics-DfFyKeX_.mjs +136 -0
- package/dist/{diagnostics-BaTA9eVl.d.mts → diagnostics-DnPnOui6.d.mts} +5 -1
- package/dist/diagnostics.d.mts +8 -3
- package/dist/diagnostics.mjs +4 -3
- package/dist/{env-api-keys-DrgeBuva.mjs → env-api-keys-bktO00EJ.mjs} +2 -15
- package/dist/{event-stream-uSMZJ3FA.mjs → event-stream-BgDvQeum.mjs} +3 -9
- package/dist/{event-stream-LiXePESD.d.mts → event-stream-BhT5T1Ay.d.mts} +1 -1
- package/dist/event-stream-zctLx0yr.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{google-Od-LLdVK.mjs → google-4qeuE8iX.mjs} +9 -7
- package/dist/{google-shared-Bgr9lFPw.mjs → google-shared-CWeG8RIl.mjs} +27 -23
- package/dist/{google-vertex-aerRSXc4.mjs → google-vertex-O9BcnB6X.mjs} +8 -6
- package/dist/{host-D51fmkH6.mjs → host-CEvLw30U.mjs} +54 -9
- package/dist/{host-DsbPMFU6.d.mts → host-DjzGmdZ2.d.mts} +3 -3
- package/dist/index-FnHM2FcI.d.mts +117 -0
- package/dist/index.d.mts +10 -11
- package/dist/index.mjs +6 -6
- package/dist/internal/anthropic.d.mts +59 -55
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +3 -3
- package/dist/internal/openai-responses-payload-policy.mjs +2 -3
- package/dist/internal/openai.d.mts +66 -64
- package/dist/internal/openai.mjs +10 -10
- package/dist/internal/retry-after.d.mts +2 -3
- package/dist/internal/runtime.d.mts +43 -43
- package/dist/internal/runtime.mjs +10 -8
- package/dist/internal/shared.d.mts +25 -25
- package/dist/internal/shared.mjs +95 -4
- package/dist/{mistral-EiHdymeb.mjs → mistral-Tb6oalqH.mjs} +30 -23
- package/dist/{openai-chatgpt-responses-DHpF9o1e.mjs → openai-chatgpt-responses-yUXjPNfu.mjs} +76 -137
- package/dist/{openai-completions-EFPiUGfS.mjs → openai-completions-BIUV3RDT.mjs} +26 -22
- package/dist/{openai-completions-compat-BefmHT26.d.mts → openai-completions-compat-CpjYUArk.d.mts} +5 -5
- package/dist/{openai-completions-stream-DUlGwRMz.mjs → openai-completions-stream-BsrBe3Gg.mjs} +103 -96
- package/dist/openai-prompt-cache-CGnVB74a.mjs +21 -0
- package/dist/openai-prompt-cache-CNoIfHYC.d.mts +16 -0
- package/dist/{openai-responses-BogP8OjX.mjs → openai-responses-CCL41ALM.mjs} +15 -14
- package/dist/openai-responses-compaction-window-BMVHFOtq.mjs +697 -0
- package/dist/{openai-responses-contracts-Dvj_UtPy.d.mts → openai-responses-contracts-rF5DDRNS.d.mts} +23 -6
- package/dist/{openai-responses-payload-policy-CNGFT9zr.d.mts → openai-responses-payload-policy-rLRPsSmB.d.mts} +1 -0
- package/dist/{openai-responses-prompt-observer-internal-Cd4hJG-S.mjs → openai-responses-prompt-observer-internal-D0bhBfgL.mjs} +4 -18
- package/dist/{openai-responses-shared-DJThc6jW.mjs → openai-responses-shared-Bmma_3Qc.mjs} +438 -309
- package/dist/{openai-tool-schema-ho-hIkQf.mjs → openai-tool-schema-_pTAJqKF.mjs} +30 -40
- package/dist/{provider-error-DDOs_Bz0.mjs → provider-error-9TraxGvt.mjs} +20 -92
- package/dist/{provider-options-MdMBLzlU.d.mts → provider-options-Bcc_p-TU.d.mts} +26 -6
- package/dist/provider-replay-context-BuSUaAk5.mjs +21 -0
- package/dist/{provider-transcript-transform-C01bQ5a3.mjs → provider-transcript-transform-BaMbI1hr.mjs} +1 -1
- package/dist/provider-types.d.mts +19 -20
- package/dist/providers.d.mts +6 -6
- package/dist/providers.mjs +11 -11
- package/dist/{reasoning-tag-text-partitioner-5ygO2rZc.mjs → reasoning-tag-text-partitioner-DLCNXki6.mjs} +158 -94
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{sanitize-unicode-DCkltN94.mjs → sanitize-unicode-D6xUvZaS.mjs} +2 -8
- package/dist/{simple-options-CFj7x3J4.mjs → simple-options-BjHCCh4v.mjs} +42 -6
- package/dist/{src-Bu3FiFAG.mjs → src-2qBGKg8O.mjs} +83 -2
- package/dist/{stream-first-event-timeout-MK28puvq.mjs → stream-first-event-timeout-DcNjoFQE.mjs} +1 -1
- package/dist/{tool-schema-json-projection-qvTEs5Am.mjs → tool-schema-json-projection-mJhXDcyz.mjs} +21 -31
- package/dist/{transport-stream-shared-ljShVIZB.mjs → transport-stream-shared-CZqMhfIw.mjs} +19 -6
- package/dist/{transport-stream-shared-rvaCyFYt.d.mts → transport-stream-shared-xnaqxmbP.d.mts} +5 -5
- package/dist/{transport-utils-LJ1_rbi-.mjs → transport-utils-7il795_9.mjs} +5 -8
- package/dist/transports.d.mts +121 -85
- package/dist/transports.mjs +747 -464
- package/dist/types-3Lnm-QSJ.d.mts +1 -0
- package/dist/{types-DhLoJbFm.d.mts → types-CJ1-Ht7A.d.mts} +55 -19
- package/dist/types.d.mts +7 -7
- package/dist/types.mjs +5 -5
- package/dist/{validation-Dk7q7NMN.d.mts → validation-AKZBDGQd.d.mts} +1 -1
- package/dist/{validation-B61OhAio.mjs → validation-CJZtym2g.mjs} +7 -5
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +5 -5
- package/dist/anthropic-BECQCNdF.d.mts +0 -98
- package/dist/event-stream-BKp4fOt_.d.mts +0 -1
- package/dist/index-Qbej8io0.d.mts +0 -3
- package/dist/openai-prompt-cache-2uo_1OR1.d.mts +0 -7
- package/dist/openai-prompt-cache-mZTCdRPo.mjs +0 -12
- package/dist/openai-responses-contracts-QUY12X0B.mjs +0 -233
- package/dist/openai-responses-payload-policy-D8EdimYe.mjs +0 -204
- package/dist/provider-options-AvldWZt8.mjs +0 -21
- package/dist/tls-certificate-errors-DXSpluKI.mjs +0 -93
- package/dist/types-GiAjXatj.d.mts +0 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
+
import "./provider-error-9TraxGvt.mjs";
|
|
3
|
+
//#region packages/normalization-core/src/expect.ts
|
|
4
|
+
/** Returns the value or throws with the named context; use for genuine invariants only. */
|
|
5
|
+
function expectDefined(value, context) {
|
|
6
|
+
if (value === null || value === void 0) throw new Error("expected " + context + " to be defined");
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
3
11
|
/**
|
|
4
12
|
* @typedef {import('mdast').Nodes} Nodes
|
|
5
13
|
*
|
|
@@ -81,7 +89,7 @@ function node(value) {
|
|
|
81
89
|
return Boolean(value && typeof value === "object");
|
|
82
90
|
}
|
|
83
91
|
//#endregion
|
|
84
|
-
//#region node_modules/character-entities/index.js
|
|
92
|
+
//#region node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
|
|
85
93
|
/**
|
|
86
94
|
* Map of named character references.
|
|
87
95
|
*
|
|
@@ -2215,7 +2223,7 @@ const characterEntities = {
|
|
|
2215
2223
|
zwnj: ""
|
|
2216
2224
|
};
|
|
2217
2225
|
//#endregion
|
|
2218
|
-
//#region node_modules/decode-named-character-reference/index.js
|
|
2226
|
+
//#region node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.js
|
|
2219
2227
|
const own$1 = {}.hasOwnProperty;
|
|
2220
2228
|
/**
|
|
2221
2229
|
* Decode a single character reference (without the `&` or `;`).
|
|
@@ -2232,7 +2240,7 @@ function decodeNamedCharacterReference(value) {
|
|
|
2232
2240
|
return own$1.call(characterEntities, value) ? characterEntities[value] : false;
|
|
2233
2241
|
}
|
|
2234
2242
|
//#endregion
|
|
2235
|
-
//#region node_modules/micromark-util-chunked/index.js
|
|
2243
|
+
//#region node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.js
|
|
2236
2244
|
/**
|
|
2237
2245
|
* Like `Array#splice`, but smarter for giant arrays.
|
|
2238
2246
|
*
|
|
@@ -2302,7 +2310,7 @@ function push(list, items) {
|
|
|
2302
2310
|
return items;
|
|
2303
2311
|
}
|
|
2304
2312
|
//#endregion
|
|
2305
|
-
//#region node_modules/micromark-util-combine-extensions/index.js
|
|
2313
|
+
//#region node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.js
|
|
2306
2314
|
/**
|
|
2307
2315
|
* @import {
|
|
2308
2316
|
* Extension,
|
|
@@ -2373,7 +2381,7 @@ function constructs(existing, list) {
|
|
|
2373
2381
|
splice(existing, 0, 0, before);
|
|
2374
2382
|
}
|
|
2375
2383
|
//#endregion
|
|
2376
|
-
//#region node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
2384
|
+
//#region node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
2377
2385
|
/**
|
|
2378
2386
|
* Turn the number (in string form as either hexa- or plain decimal) coming from
|
|
2379
2387
|
* a numeric character reference into a character.
|
|
@@ -2394,7 +2402,7 @@ function decodeNumericCharacterReference(value, base) {
|
|
|
2394
2402
|
return String.fromCodePoint(code);
|
|
2395
2403
|
}
|
|
2396
2404
|
//#endregion
|
|
2397
|
-
//#region node_modules/micromark-util-normalize-identifier/index.js
|
|
2405
|
+
//#region node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.js
|
|
2398
2406
|
/**
|
|
2399
2407
|
* Normalize an identifier (as found in references, definitions).
|
|
2400
2408
|
*
|
|
@@ -2418,7 +2426,7 @@ function normalizeIdentifier(value) {
|
|
|
2418
2426
|
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
2419
2427
|
}
|
|
2420
2428
|
//#endregion
|
|
2421
|
-
//#region node_modules/micromark-util-character/index.js
|
|
2429
|
+
//#region node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.js
|
|
2422
2430
|
/**
|
|
2423
2431
|
* @import {Code} from 'micromark-util-types'
|
|
2424
2432
|
*/
|
|
@@ -2646,7 +2654,7 @@ function regexCheck(regex) {
|
|
|
2646
2654
|
}
|
|
2647
2655
|
}
|
|
2648
2656
|
//#endregion
|
|
2649
|
-
//#region node_modules/micromark-factory-space/index.js
|
|
2657
|
+
//#region node_modules/.pnpm/micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.js
|
|
2650
2658
|
/**
|
|
2651
2659
|
* @import {Effects, State, TokenType} from 'micromark-util-types'
|
|
2652
2660
|
*/
|
|
@@ -2705,7 +2713,7 @@ function factorySpace(effects, ok, type, max) {
|
|
|
2705
2713
|
}
|
|
2706
2714
|
}
|
|
2707
2715
|
//#endregion
|
|
2708
|
-
//#region node_modules/micromark/lib/initialize/content.js
|
|
2716
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/initialize/content.js
|
|
2709
2717
|
/**
|
|
2710
2718
|
* @import {
|
|
2711
2719
|
* InitialConstruct,
|
|
@@ -2772,7 +2780,7 @@ function initializeContent(effects) {
|
|
|
2772
2780
|
}
|
|
2773
2781
|
}
|
|
2774
2782
|
//#endregion
|
|
2775
|
-
//#region node_modules/micromark/lib/initialize/document.js
|
|
2783
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/initialize/document.js
|
|
2776
2784
|
/**
|
|
2777
2785
|
* @import {
|
|
2778
2786
|
* Construct,
|
|
@@ -2988,7 +2996,7 @@ function tokenizeContainer(effects, ok, nok) {
|
|
|
2988
2996
|
return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
2989
2997
|
}
|
|
2990
2998
|
//#endregion
|
|
2991
|
-
//#region node_modules/micromark-util-classify-character/index.js
|
|
2999
|
+
//#region node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
|
|
2992
3000
|
/**
|
|
2993
3001
|
* @import {Code} from 'micromark-util-types'
|
|
2994
3002
|
*/
|
|
@@ -3011,7 +3019,7 @@ function classifyCharacter(code) {
|
|
|
3011
3019
|
if (unicodePunctuation(code)) return 2;
|
|
3012
3020
|
}
|
|
3013
3021
|
//#endregion
|
|
3014
|
-
//#region node_modules/micromark-util-resolve-all/index.js
|
|
3022
|
+
//#region node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.js
|
|
3015
3023
|
/**
|
|
3016
3024
|
* @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'
|
|
3017
3025
|
*/
|
|
@@ -3041,7 +3049,7 @@ function resolveAll(constructs, events, context) {
|
|
|
3041
3049
|
return events;
|
|
3042
3050
|
}
|
|
3043
3051
|
//#endregion
|
|
3044
|
-
//#region node_modules/micromark-core-commonmark/lib/attention.js
|
|
3052
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/attention.js
|
|
3045
3053
|
/**
|
|
3046
3054
|
* @import {
|
|
3047
3055
|
* Code,
|
|
@@ -3261,7 +3269,7 @@ function movePoint(point, offset) {
|
|
|
3261
3269
|
point._bufferIndex += offset;
|
|
3262
3270
|
}
|
|
3263
3271
|
//#endregion
|
|
3264
|
-
//#region node_modules/micromark-core-commonmark/lib/autolink.js
|
|
3272
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/autolink.js
|
|
3265
3273
|
/**
|
|
3266
3274
|
* @import {
|
|
3267
3275
|
* Construct,
|
|
@@ -3472,7 +3480,7 @@ function tokenizeAutolink(effects, ok, nok) {
|
|
|
3472
3480
|
}
|
|
3473
3481
|
}
|
|
3474
3482
|
//#endregion
|
|
3475
|
-
//#region node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
3483
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
3476
3484
|
/**
|
|
3477
3485
|
* @import {
|
|
3478
3486
|
* Construct,
|
|
@@ -3529,7 +3537,7 @@ function tokenizeBlankLine(effects, ok, nok) {
|
|
|
3529
3537
|
}
|
|
3530
3538
|
}
|
|
3531
3539
|
//#endregion
|
|
3532
|
-
//#region node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
3540
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
3533
3541
|
/**
|
|
3534
3542
|
* @import {
|
|
3535
3543
|
* Construct,
|
|
@@ -3656,7 +3664,7 @@ function exit$1(effects) {
|
|
|
3656
3664
|
effects.exit("blockQuote");
|
|
3657
3665
|
}
|
|
3658
3666
|
//#endregion
|
|
3659
|
-
//#region node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
3667
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
3660
3668
|
/**
|
|
3661
3669
|
* @import {
|
|
3662
3670
|
* Construct,
|
|
@@ -3716,7 +3724,7 @@ function tokenizeCharacterEscape(effects, ok, nok) {
|
|
|
3716
3724
|
}
|
|
3717
3725
|
}
|
|
3718
3726
|
//#endregion
|
|
3719
|
-
//#region node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
3727
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
3720
3728
|
/**
|
|
3721
3729
|
* @import {
|
|
3722
3730
|
* Code,
|
|
@@ -3854,7 +3862,7 @@ function tokenizeCharacterReference(effects, ok, nok) {
|
|
|
3854
3862
|
}
|
|
3855
3863
|
}
|
|
3856
3864
|
//#endregion
|
|
3857
|
-
//#region node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
3865
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
3858
3866
|
/**
|
|
3859
3867
|
* @import {
|
|
3860
3868
|
* Code,
|
|
@@ -4269,7 +4277,7 @@ function tokenizeNonLazyContinuation(effects, ok, nok) {
|
|
|
4269
4277
|
}
|
|
4270
4278
|
}
|
|
4271
4279
|
//#endregion
|
|
4272
|
-
//#region node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
4280
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
4273
4281
|
/**
|
|
4274
4282
|
* @import {
|
|
4275
4283
|
* Construct,
|
|
@@ -4413,7 +4421,7 @@ function tokenizeFurtherStart(effects, ok, nok) {
|
|
|
4413
4421
|
}
|
|
4414
4422
|
}
|
|
4415
4423
|
//#endregion
|
|
4416
|
-
//#region node_modules/micromark-core-commonmark/lib/code-text.js
|
|
4424
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-text.js
|
|
4417
4425
|
/**
|
|
4418
4426
|
* @import {
|
|
4419
4427
|
* Construct,
|
|
@@ -4598,7 +4606,7 @@ function tokenizeCodeText(effects, ok, nok) {
|
|
|
4598
4606
|
}
|
|
4599
4607
|
}
|
|
4600
4608
|
//#endregion
|
|
4601
|
-
//#region node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
4609
|
+
//#region node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
4602
4610
|
/**
|
|
4603
4611
|
* Some of the internal operations of micromark do lots of editing
|
|
4604
4612
|
* operations on very large arrays. This runs into problems with two
|
|
@@ -4828,7 +4836,7 @@ function chunkedPush(list, right) {
|
|
|
4828
4836
|
}
|
|
4829
4837
|
}
|
|
4830
4838
|
//#endregion
|
|
4831
|
-
//#region node_modules/micromark-util-subtokenize/index.js
|
|
4839
|
+
//#region node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.js
|
|
4832
4840
|
/**
|
|
4833
4841
|
* @import {Chunk, Event, Token} from 'micromark-util-types'
|
|
4834
4842
|
*/
|
|
@@ -4983,7 +4991,7 @@ function subcontent(events, eventIndex) {
|
|
|
4983
4991
|
return gaps;
|
|
4984
4992
|
}
|
|
4985
4993
|
//#endregion
|
|
4986
|
-
//#region node_modules/micromark-core-commonmark/lib/content.js
|
|
4994
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/content.js
|
|
4987
4995
|
/**
|
|
4988
4996
|
* @import {
|
|
4989
4997
|
* Construct,
|
|
@@ -5116,7 +5124,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
5116
5124
|
}
|
|
5117
5125
|
}
|
|
5118
5126
|
//#endregion
|
|
5119
|
-
//#region node_modules/micromark-factory-destination/index.js
|
|
5127
|
+
//#region node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.js
|
|
5120
5128
|
/**
|
|
5121
5129
|
* @import {Effects, State, TokenType} from 'micromark-util-types'
|
|
5122
5130
|
*/
|
|
@@ -5300,7 +5308,7 @@ function factoryDestination(effects, ok, nok, type, literalType, literalMarkerTy
|
|
|
5300
5308
|
}
|
|
5301
5309
|
}
|
|
5302
5310
|
//#endregion
|
|
5303
|
-
//#region node_modules/micromark-factory-label/index.js
|
|
5311
|
+
//#region node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.js
|
|
5304
5312
|
/**
|
|
5305
5313
|
* @import {
|
|
5306
5314
|
* Effects,
|
|
@@ -5375,7 +5383,9 @@ function factoryLabel(effects, ok, nok, type, markerType, stringType) {
|
|
|
5375
5383
|
* @type {State}
|
|
5376
5384
|
*/
|
|
5377
5385
|
function atBreak(code) {
|
|
5378
|
-
if (size > 999 || code === null || code === 91 || code === 93 && !seen ||
|
|
5386
|
+
if (size > 999 || code === null || code === 91 || code === 93 && !seen ||
|
|
5387
|
+
/* c8 ignore next 3 */
|
|
5388
|
+
code === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code);
|
|
5379
5389
|
if (code === 93) {
|
|
5380
5390
|
effects.exit(stringType);
|
|
5381
5391
|
effects.enter(markerType);
|
|
@@ -5432,7 +5442,7 @@ function factoryLabel(effects, ok, nok, type, markerType, stringType) {
|
|
|
5432
5442
|
}
|
|
5433
5443
|
}
|
|
5434
5444
|
//#endregion
|
|
5435
|
-
//#region node_modules/micromark-factory-title/index.js
|
|
5445
|
+
//#region node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.js
|
|
5436
5446
|
/**
|
|
5437
5447
|
* @import {
|
|
5438
5448
|
* Code,
|
|
@@ -5577,7 +5587,7 @@ function factoryTitle(effects, ok, nok, type, markerType, stringType) {
|
|
|
5577
5587
|
}
|
|
5578
5588
|
}
|
|
5579
5589
|
//#endregion
|
|
5580
|
-
//#region node_modules/micromark-factory-whitespace/index.js
|
|
5590
|
+
//#region node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.js
|
|
5581
5591
|
/**
|
|
5582
5592
|
* @import {Effects, State} from 'micromark-util-types'
|
|
5583
5593
|
*/
|
|
@@ -5617,7 +5627,7 @@ function factoryWhitespace(effects, ok) {
|
|
|
5617
5627
|
}
|
|
5618
5628
|
}
|
|
5619
5629
|
//#endregion
|
|
5620
|
-
//#region node_modules/micromark-core-commonmark/lib/definition.js
|
|
5630
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/definition.js
|
|
5621
5631
|
/**
|
|
5622
5632
|
* @import {
|
|
5623
5633
|
* Construct,
|
|
@@ -5832,7 +5842,7 @@ function tokenizeTitleBefore(effects, ok, nok) {
|
|
|
5832
5842
|
}
|
|
5833
5843
|
}
|
|
5834
5844
|
//#endregion
|
|
5835
|
-
//#region node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
5845
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
5836
5846
|
/**
|
|
5837
5847
|
* @import {
|
|
5838
5848
|
* Construct,
|
|
@@ -5889,7 +5899,7 @@ function tokenizeHardBreakEscape(effects, ok, nok) {
|
|
|
5889
5899
|
}
|
|
5890
5900
|
}
|
|
5891
5901
|
//#endregion
|
|
5892
|
-
//#region node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
5902
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
5893
5903
|
/**
|
|
5894
5904
|
* @import {
|
|
5895
5905
|
* Construct,
|
|
@@ -6074,7 +6084,7 @@ function tokenizeHeadingAtx(effects, ok, nok) {
|
|
|
6074
6084
|
}
|
|
6075
6085
|
}
|
|
6076
6086
|
//#endregion
|
|
6077
|
-
//#region node_modules/micromark-util-html-tag-name/index.js
|
|
6087
|
+
//#region node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
|
|
6078
6088
|
/**
|
|
6079
6089
|
* List of lowercase HTML “block” tag names.
|
|
6080
6090
|
*
|
|
@@ -6173,7 +6183,7 @@ const htmlRawNames = [
|
|
|
6173
6183
|
"textarea"
|
|
6174
6184
|
];
|
|
6175
6185
|
//#endregion
|
|
6176
|
-
//#region node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
6186
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
6177
6187
|
/**
|
|
6178
6188
|
* @import {
|
|
6179
6189
|
* Code,
|
|
@@ -6946,7 +6956,7 @@ function tokenizeBlankLineBefore(effects, ok, nok) {
|
|
|
6946
6956
|
}
|
|
6947
6957
|
}
|
|
6948
6958
|
//#endregion
|
|
6949
|
-
//#region node_modules/micromark-core-commonmark/lib/html-text.js
|
|
6959
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-text.js
|
|
6950
6960
|
/**
|
|
6951
6961
|
* @import {
|
|
6952
6962
|
* Code,
|
|
@@ -7560,7 +7570,7 @@ function tokenizeHtmlText(effects, ok, nok) {
|
|
|
7560
7570
|
}
|
|
7561
7571
|
}
|
|
7562
7572
|
//#endregion
|
|
7563
|
-
//#region node_modules/micromark-core-commonmark/lib/label-end.js
|
|
7573
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-end.js
|
|
7564
7574
|
/**
|
|
7565
7575
|
* @import {
|
|
7566
7576
|
* Construct,
|
|
@@ -8030,7 +8040,7 @@ function tokenizeReferenceCollapsed(effects, ok, nok) {
|
|
|
8030
8040
|
}
|
|
8031
8041
|
}
|
|
8032
8042
|
//#endregion
|
|
8033
|
-
//#region node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
8043
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
8034
8044
|
/**
|
|
8035
8045
|
* @import {
|
|
8036
8046
|
* Construct,
|
|
@@ -8123,7 +8133,7 @@ function tokenizeLabelStartImage(effects, ok, nok) {
|
|
|
8123
8133
|
}
|
|
8124
8134
|
}
|
|
8125
8135
|
//#endregion
|
|
8126
|
-
//#region node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
8136
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
8127
8137
|
/**
|
|
8128
8138
|
* @import {
|
|
8129
8139
|
* Construct,
|
|
@@ -8171,7 +8181,7 @@ function tokenizeLabelStartLink(effects, ok, nok) {
|
|
|
8171
8181
|
}
|
|
8172
8182
|
}
|
|
8173
8183
|
//#endregion
|
|
8174
|
-
//#region node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
8184
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
8175
8185
|
/**
|
|
8176
8186
|
* @import {
|
|
8177
8187
|
* Construct,
|
|
@@ -8201,7 +8211,7 @@ function tokenizeLineEnding(effects, ok) {
|
|
|
8201
8211
|
}
|
|
8202
8212
|
}
|
|
8203
8213
|
//#endregion
|
|
8204
|
-
//#region node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
8214
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
8205
8215
|
/**
|
|
8206
8216
|
* @import {
|
|
8207
8217
|
* Code,
|
|
@@ -8296,7 +8306,7 @@ function tokenizeThematicBreak(effects, ok, nok) {
|
|
|
8296
8306
|
}
|
|
8297
8307
|
}
|
|
8298
8308
|
//#endregion
|
|
8299
|
-
//#region node_modules/micromark-core-commonmark/lib/list.js
|
|
8309
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/list.js
|
|
8300
8310
|
/**
|
|
8301
8311
|
* @import {
|
|
8302
8312
|
* Code,
|
|
@@ -8468,7 +8478,7 @@ function tokenizeListItemPrefixWhitespace(effects, ok, nok) {
|
|
|
8468
8478
|
}
|
|
8469
8479
|
}
|
|
8470
8480
|
//#endregion
|
|
8471
|
-
//#region node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
8481
|
+
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
8472
8482
|
/**
|
|
8473
8483
|
* @import {
|
|
8474
8484
|
* Code,
|
|
@@ -8620,7 +8630,7 @@ function tokenizeSetextUnderline(effects, ok, nok) {
|
|
|
8620
8630
|
}
|
|
8621
8631
|
}
|
|
8622
8632
|
//#endregion
|
|
8623
|
-
//#region node_modules/micromark/lib/initialize/flow.js
|
|
8633
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/initialize/flow.js
|
|
8624
8634
|
/**
|
|
8625
8635
|
* @import {
|
|
8626
8636
|
* InitialConstruct,
|
|
@@ -8667,7 +8677,7 @@ function initializeFlow(effects) {
|
|
|
8667
8677
|
}
|
|
8668
8678
|
}
|
|
8669
8679
|
//#endregion
|
|
8670
|
-
//#region node_modules/micromark/lib/initialize/text.js
|
|
8680
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/initialize/text.js
|
|
8671
8681
|
/**
|
|
8672
8682
|
* @import {
|
|
8673
8683
|
* Code,
|
|
@@ -8844,7 +8854,7 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
8844
8854
|
return events;
|
|
8845
8855
|
}
|
|
8846
8856
|
//#endregion
|
|
8847
|
-
//#region node_modules/micromark/lib/constructs.js
|
|
8857
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/constructs.js
|
|
8848
8858
|
/**
|
|
8849
8859
|
* @import {Extension} from 'micromark-util-types'
|
|
8850
8860
|
*/
|
|
@@ -8922,7 +8932,7 @@ const attentionMarkers = { null: [42, 95] };
|
|
|
8922
8932
|
/** @satisfies {Extension['disable']} */
|
|
8923
8933
|
const disable = { null: [] };
|
|
8924
8934
|
//#endregion
|
|
8925
|
-
//#region node_modules/micromark/lib/create-tokenizer.js
|
|
8935
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/create-tokenizer.js
|
|
8926
8936
|
/**
|
|
8927
8937
|
* @import {
|
|
8928
8938
|
* Chunk,
|
|
@@ -9391,7 +9401,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
9391
9401
|
return result.join("");
|
|
9392
9402
|
}
|
|
9393
9403
|
//#endregion
|
|
9394
|
-
//#region node_modules/micromark/lib/parse.js
|
|
9404
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/parse.js
|
|
9395
9405
|
/**
|
|
9396
9406
|
* @import {
|
|
9397
9407
|
* Create,
|
|
@@ -9435,7 +9445,7 @@ function parse(options) {
|
|
|
9435
9445
|
}
|
|
9436
9446
|
}
|
|
9437
9447
|
//#endregion
|
|
9438
|
-
//#region node_modules/micromark/lib/postprocess.js
|
|
9448
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/postprocess.js
|
|
9439
9449
|
/**
|
|
9440
9450
|
* @import {Event} from 'micromark-util-types'
|
|
9441
9451
|
*/
|
|
@@ -9450,7 +9460,7 @@ function postprocess(events) {
|
|
|
9450
9460
|
return events;
|
|
9451
9461
|
}
|
|
9452
9462
|
//#endregion
|
|
9453
|
-
//#region node_modules/micromark/lib/preprocess.js
|
|
9463
|
+
//#region node_modules/.pnpm/micromark@4.0.2_supports-color@10.2.2/node_modules/micromark/lib/preprocess.js
|
|
9454
9464
|
/**
|
|
9455
9465
|
* @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'
|
|
9456
9466
|
*/
|
|
@@ -9551,7 +9561,7 @@ function preprocess() {
|
|
|
9551
9561
|
}
|
|
9552
9562
|
}
|
|
9553
9563
|
//#endregion
|
|
9554
|
-
//#region node_modules/micromark-util-decode-string/index.js
|
|
9564
|
+
//#region node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js
|
|
9555
9565
|
const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
9556
9566
|
/**
|
|
9557
9567
|
* Decode markdown strings (which occur in places such as fenced code info
|
|
@@ -9588,7 +9598,7 @@ function decode($0, $1, $2) {
|
|
|
9588
9598
|
return decodeNamedCharacterReference($2) || $0;
|
|
9589
9599
|
}
|
|
9590
9600
|
//#endregion
|
|
9591
|
-
//#region node_modules/unist-util-stringify-position/lib/index.js
|
|
9601
|
+
//#region node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.js
|
|
9592
9602
|
/**
|
|
9593
9603
|
* @typedef {import('unist').Node} Node
|
|
9594
9604
|
* @typedef {import('unist').Point} Point
|
|
@@ -9652,7 +9662,7 @@ function index(value) {
|
|
|
9652
9662
|
return value && typeof value === "number" ? value : 1;
|
|
9653
9663
|
}
|
|
9654
9664
|
//#endregion
|
|
9655
|
-
//#region node_modules/mdast-util-from-markdown/lib/index.js
|
|
9665
|
+
//#region node_modules/.pnpm/mdast-util-from-markdown@2.0.3_supports-color@10.2.2/node_modules/mdast-util-from-markdown/lib/index.js
|
|
9656
9666
|
/**
|
|
9657
9667
|
* @import {
|
|
9658
9668
|
* Break,
|
|
@@ -9867,8 +9877,10 @@ function compiler(options) {
|
|
|
9867
9877
|
/** @type {Array<number>} */
|
|
9868
9878
|
const listStack = [];
|
|
9869
9879
|
let index = -1;
|
|
9870
|
-
while (++index < events.length) if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered")
|
|
9871
|
-
|
|
9880
|
+
while (++index < events.length) if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered") {
|
|
9881
|
+
if (events[index][0] === "enter") listStack.push(index);
|
|
9882
|
+
else index = prepareList(events, listStack.pop(), index);
|
|
9883
|
+
}
|
|
9872
9884
|
index = -1;
|
|
9873
9885
|
while (++index < events.length) {
|
|
9874
9886
|
const handler = config[events[index][0]];
|
|
@@ -10058,8 +10070,10 @@ function compiler(options) {
|
|
|
10058
10070
|
start: token.start,
|
|
10059
10071
|
end: token.end
|
|
10060
10072
|
}) + "): it’s not open");
|
|
10061
|
-
else if (open[0].type !== token.type)
|
|
10062
|
-
|
|
10073
|
+
else if (open[0].type !== token.type) {
|
|
10074
|
+
if (onExitError) onExitError.call(this, token, open[0]);
|
|
10075
|
+
else (open[1] || defaultOnError).call(this, token, open[0]);
|
|
10076
|
+
}
|
|
10063
10077
|
node.position.end = point(token.end);
|
|
10064
10078
|
}
|
|
10065
10079
|
/**
|
|
@@ -10618,7 +10632,7 @@ function defaultOnError(left, right) {
|
|
|
10618
10632
|
}) + ") is still open");
|
|
10619
10633
|
}
|
|
10620
10634
|
//#endregion
|
|
10621
|
-
//#region node_modules/mdast-util-gfm-table/lib/index.js
|
|
10635
|
+
//#region node_modules/.pnpm/mdast-util-gfm-table@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-table/lib/index.js
|
|
10622
10636
|
/**
|
|
10623
10637
|
* @typedef {import('mdast').InlineCode} InlineCode
|
|
10624
10638
|
* @typedef {import('mdast').Table} Table
|
|
@@ -10743,7 +10757,7 @@ function replace($0, $1) {
|
|
|
10743
10757
|
return $1 === "|" ? $1 : $0;
|
|
10744
10758
|
}
|
|
10745
10759
|
//#endregion
|
|
10746
|
-
//#region node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
10760
|
+
//#region node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
10747
10761
|
/**
|
|
10748
10762
|
* @import {Event} from 'micromark-util-types'
|
|
10749
10763
|
*/
|
|
@@ -10835,7 +10849,7 @@ function addImplementation(editMap, at, remove, add) {
|
|
|
10835
10849
|
]);
|
|
10836
10850
|
}
|
|
10837
10851
|
//#endregion
|
|
10838
|
-
//#region node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
10852
|
+
//#region node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
10839
10853
|
/**
|
|
10840
10854
|
* @import {Event} from 'micromark-util-types'
|
|
10841
10855
|
*/
|
|
@@ -10873,7 +10887,7 @@ function gfmTableAlign(events, index) {
|
|
|
10873
10887
|
return align;
|
|
10874
10888
|
}
|
|
10875
10889
|
//#endregion
|
|
10876
|
-
//#region node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
10890
|
+
//#region node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
10877
10891
|
/**
|
|
10878
10892
|
* @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
10879
10893
|
*/
|
|
@@ -11416,19 +11430,21 @@ function resolveTable(events, context) {
|
|
|
11416
11430
|
}
|
|
11417
11431
|
cell[2] = index;
|
|
11418
11432
|
}
|
|
11419
|
-
} else if (token.type === "tableCellDivider")
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11433
|
+
} else if (token.type === "tableCellDivider") {
|
|
11434
|
+
if (inFirstCellAwaitingPipe) inFirstCellAwaitingPipe = false;
|
|
11435
|
+
else {
|
|
11436
|
+
if (lastCell[1] !== 0) {
|
|
11437
|
+
cell[0] = cell[1];
|
|
11438
|
+
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
11439
|
+
}
|
|
11440
|
+
lastCell = cell;
|
|
11441
|
+
cell = [
|
|
11442
|
+
lastCell[1],
|
|
11443
|
+
index,
|
|
11444
|
+
0,
|
|
11445
|
+
0
|
|
11446
|
+
];
|
|
11424
11447
|
}
|
|
11425
|
-
lastCell = cell;
|
|
11426
|
-
cell = [
|
|
11427
|
-
lastCell[1],
|
|
11428
|
-
index,
|
|
11429
|
-
0,
|
|
11430
|
-
0
|
|
11431
|
-
];
|
|
11432
11448
|
}
|
|
11433
11449
|
} else if (token.type === "tableHead") {
|
|
11434
11450
|
afterHeadAwaitingFirstBodyRow = true;
|
|
@@ -11679,35 +11695,81 @@ function findNextLineEnding(text, start) {
|
|
|
11679
11695
|
if (carriageReturn === -1) return lineFeed;
|
|
11680
11696
|
return lineFeed === -1 ? carriageReturn : Math.min(carriageReturn, lineFeed);
|
|
11681
11697
|
}
|
|
11682
|
-
function
|
|
11698
|
+
function captureInlineSources(text, sources) {
|
|
11699
|
+
const observe = function(token) {
|
|
11700
|
+
const start = this.stack.findLast((entry) => entry.type === "inlineCode")?.position?.start.offset;
|
|
11701
|
+
if (start === void 0) return;
|
|
11702
|
+
let source = sources.get(start);
|
|
11703
|
+
if (!source) {
|
|
11704
|
+
const inlineBlock = this.stack.findLast((entry) => entry.type === "paragraph" || entry.type === "heading");
|
|
11705
|
+
const begin = inlineBlock?.children[0]?.position?.start.offset;
|
|
11706
|
+
const containers = this.stack.filter((entry) => entry.type === "listItem" || entry.type === "blockquote");
|
|
11707
|
+
const prefixEnd = begin !== void 0 && containers.length ? begin : start;
|
|
11708
|
+
const prefixStart = containers.length ? Math.max(text.lastIndexOf("\n", prefixEnd - 1), text.lastIndexOf("\r", prefixEnd - 1)) + 1 : start;
|
|
11709
|
+
const prefix = containers.map((entry) => text.slice(entry.position?.start.offset, entry.children[0]?.position?.start.offset)).join("");
|
|
11710
|
+
source = {
|
|
11711
|
+
prefix: {
|
|
11712
|
+
start: prefixStart,
|
|
11713
|
+
end: prefixEnd,
|
|
11714
|
+
ownerStart: containers[0]?.position?.start.offset ?? start,
|
|
11715
|
+
text: prefix + (containers.length && inlineBlock?.type === "heading" ? text.slice(inlineBlock.position?.start.offset, begin) : "")
|
|
11716
|
+
},
|
|
11717
|
+
value: "",
|
|
11718
|
+
offsets: []
|
|
11719
|
+
};
|
|
11720
|
+
sources.set(start, source);
|
|
11721
|
+
}
|
|
11722
|
+
const value = this.sliceSerialize(token);
|
|
11723
|
+
const extra = value.length - (token.end.offset - token.start.offset);
|
|
11724
|
+
for (let cursor = start + source.offsets.length; cursor < token.end.offset; cursor += 1) {
|
|
11725
|
+
const consumed = cursor - token.start.offset;
|
|
11726
|
+
source.offsets.push(source.value.length + (consumed > 0 ? consumed + extra : 0));
|
|
11727
|
+
}
|
|
11728
|
+
source.value += value;
|
|
11729
|
+
};
|
|
11730
|
+
return { enter: {
|
|
11731
|
+
codeTextData(token) {
|
|
11732
|
+
observe.call(this, token);
|
|
11733
|
+
expectDefined(this.config.enter.data, "Markdown data handler").call(this, token);
|
|
11734
|
+
},
|
|
11735
|
+
lineEnding: observe
|
|
11736
|
+
} };
|
|
11737
|
+
}
|
|
11738
|
+
function parseMarkdownOwnership(text, options) {
|
|
11683
11739
|
if (!text) return {
|
|
11740
|
+
regions: [],
|
|
11684
11741
|
codeSpans: [],
|
|
11685
11742
|
retainStart: 0
|
|
11686
11743
|
};
|
|
11744
|
+
const sources = /* @__PURE__ */ new Map();
|
|
11745
|
+
const tables = options?.syntax !== "commonmark";
|
|
11687
11746
|
const tree = fromMarkdown(text, {
|
|
11688
|
-
extensions: [DISABLE_HTML_MARKDOWN, gfmTable()],
|
|
11689
|
-
mdastExtensions: [gfmTableFromMarkdown()]
|
|
11747
|
+
extensions: [DISABLE_HTML_MARKDOWN, ...tables ? [gfmTable()] : []],
|
|
11748
|
+
mdastExtensions: [...tables ? [gfmTableFromMarkdown()] : [], ...options?.includeSource ? [captureInlineSources(text, sources)] : []]
|
|
11690
11749
|
});
|
|
11691
|
-
const
|
|
11750
|
+
const regions = [];
|
|
11692
11751
|
const pending = [tree];
|
|
11693
11752
|
while (pending.length > 0) {
|
|
11694
|
-
const node = pending.pop();
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
const
|
|
11699
|
-
if (
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11753
|
+
const node = expectDefined(pending.pop(), "Markdown ownership node");
|
|
11754
|
+
const start = node.position?.start?.offset;
|
|
11755
|
+
const end = node.position?.end?.offset;
|
|
11756
|
+
if ((node.type === "code" || node.type === "inlineCode") && start !== void 0 && end !== void 0) {
|
|
11757
|
+
const source = sources.get(start);
|
|
11758
|
+
if (source) while (source.offsets.length <= end - start) source.offsets.push(source.value.length);
|
|
11759
|
+
regions.push({
|
|
11760
|
+
start,
|
|
11761
|
+
end,
|
|
11762
|
+
block: node.type === "code",
|
|
11763
|
+
...source ? { source } : {}
|
|
11764
|
+
});
|
|
11705
11765
|
}
|
|
11766
|
+
for (const child of node.children?.toReversed() ?? []) pending.push(child);
|
|
11706
11767
|
}
|
|
11707
|
-
|
|
11768
|
+
regions.sort((left, right) => left.start - right.start);
|
|
11708
11769
|
return {
|
|
11709
|
-
|
|
11710
|
-
|
|
11770
|
+
regions,
|
|
11771
|
+
codeSpans: regions.map(({ start, end }) => [start, end]),
|
|
11772
|
+
retainStart: tree.children?.at(-1)?.position?.start?.offset ?? text.length
|
|
11711
11773
|
};
|
|
11712
11774
|
}
|
|
11713
11775
|
function isInsideCode(index, spans) {
|
|
@@ -11821,8 +11883,10 @@ function reduceReasoningText(text, codeSpans, state, options) {
|
|
|
11821
11883
|
append(text.slice(cursor));
|
|
11822
11884
|
if (options.final && state.depth > 0 && state.pending) {
|
|
11823
11885
|
const pending = state.pending;
|
|
11824
|
-
if (!pending.containsPrivate)
|
|
11825
|
-
|
|
11886
|
+
if (!pending.containsPrivate) {
|
|
11887
|
+
if (options.mode === "static-preserve" || options.mode === "static-strict" && !pending.visibleBefore && !pending.protectedClose || options.mode === "visible" && !pending.protectedClose) emit("text", options.mode === "visible" && pending.visibleBefore ? pending.openTag + pending.content : pending.content);
|
|
11888
|
+
else emit("thinking", pending.content);
|
|
11889
|
+
}
|
|
11826
11890
|
state.depth = 0;
|
|
11827
11891
|
state.pending = void 0;
|
|
11828
11892
|
}
|