@asm-agent/tui 0.8.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/README.md +795 -0
- package/dist/autocomplete.d.ts +61 -0
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +601 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/components/box.d.ts +24 -0
- package/dist/components/box.d.ts.map +1 -0
- package/dist/components/box.js +114 -0
- package/dist/components/box.js.map +1 -0
- package/dist/components/cancellable-loader.d.ts +22 -0
- package/dist/components/cancellable-loader.d.ts.map +1 -0
- package/dist/components/cancellable-loader.js +35 -0
- package/dist/components/cancellable-loader.js.map +1 -0
- package/dist/components/editor.d.ts +275 -0
- package/dist/components/editor.d.ts.map +1 -0
- package/dist/components/editor.js +1968 -0
- package/dist/components/editor.js.map +1 -0
- package/dist/components/image.d.ts +34 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/image.js +96 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/input.d.ts +37 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +385 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/loader.d.ts +29 -0
- package/dist/components/loader.d.ts.map +1 -0
- package/dist/components/loader.js +69 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/markdown.d.ts +100 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +773 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/select-list.d.ts +61 -0
- package/dist/components/select-list.d.ts.map +1 -0
- package/dist/components/select-list.js +206 -0
- package/dist/components/select-list.js.map +1 -0
- package/dist/components/settings-list.d.ts +49 -0
- package/dist/components/settings-list.d.ts.map +1 -0
- package/dist/components/settings-list.js +170 -0
- package/dist/components/settings-list.js.map +1 -0
- package/dist/components/spacer.d.ts +12 -0
- package/dist/components/spacer.d.ts.map +1 -0
- package/dist/components/spacer.js +21 -0
- package/dist/components/spacer.js.map +1 -0
- package/dist/components/text.d.ts +19 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/text.js +77 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/truncated-text.d.ts +14 -0
- package/dist/components/truncated-text.d.ts.map +1 -0
- package/dist/components/truncated-text.js +44 -0
- package/dist/components/truncated-text.js.map +1 -0
- package/dist/editor-component.d.ts +51 -0
- package/dist/editor-component.d.ts.map +1 -0
- package/dist/editor-component.js +2 -0
- package/dist/editor-component.js.map +1 -0
- package/dist/fullscreen.d.ts +105 -0
- package/dist/fullscreen.d.ts.map +1 -0
- package/dist/fullscreen.js +597 -0
- package/dist/fullscreen.js.map +1 -0
- package/dist/fuzzy.d.ts +26 -0
- package/dist/fuzzy.d.ts.map +1 -0
- package/dist/fuzzy.js +114 -0
- package/dist/fuzzy.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/keybindings.d.ts +239 -0
- package/dist/keybindings.d.ts.map +1 -0
- package/dist/keybindings.js +222 -0
- package/dist/keybindings.js.map +1 -0
- package/dist/keys.d.ts +184 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +1163 -0
- package/dist/keys.js.map +1 -0
- package/dist/kill-ring.d.ts +26 -0
- package/dist/kill-ring.d.ts.map +1 -0
- package/dist/kill-ring.js +42 -0
- package/dist/kill-ring.js.map +1 -0
- package/dist/latex.d.ts +21 -0
- package/dist/latex.d.ts.map +1 -0
- package/dist/latex.js +797 -0
- package/dist/latex.js.map +1 -0
- package/dist/mouse.d.ts +24 -0
- package/dist/mouse.d.ts.map +1 -0
- package/dist/mouse.js +34 -0
- package/dist/mouse.js.map +1 -0
- package/dist/render-cache.d.ts +9 -0
- package/dist/render-cache.d.ts.map +1 -0
- package/dist/render-cache.js +23 -0
- package/dist/render-cache.js.map +1 -0
- package/dist/selection-metadata.d.ts +22 -0
- package/dist/selection-metadata.d.ts.map +1 -0
- package/dist/selection-metadata.js +141 -0
- package/dist/selection-metadata.js.map +1 -0
- package/dist/slash-command-context.d.ts +12 -0
- package/dist/slash-command-context.d.ts.map +1 -0
- package/dist/slash-command-context.js +32 -0
- package/dist/slash-command-context.js.map +1 -0
- package/dist/stdin-buffer.d.ts +50 -0
- package/dist/stdin-buffer.d.ts.map +1 -0
- package/dist/stdin-buffer.js +313 -0
- package/dist/stdin-buffer.js.map +1 -0
- package/dist/terminal-colors.d.ts +31 -0
- package/dist/terminal-colors.d.ts.map +1 -0
- package/dist/terminal-colors.js +161 -0
- package/dist/terminal-colors.js.map +1 -0
- package/dist/terminal-image.d.ts +85 -0
- package/dist/terminal-image.d.ts.map +1 -0
- package/dist/terminal-image.js +324 -0
- package/dist/terminal-image.js.map +1 -0
- package/dist/terminal.d.ts +113 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/terminal.js +486 -0
- package/dist/terminal.js.map +1 -0
- package/dist/tui.d.ts +310 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +1673 -0
- package/dist/tui.js.map +1 -0
- package/dist/undo-stack.d.ts +16 -0
- package/dist/undo-stack.d.ts.map +1 -0
- package/dist/undo-stack.js +26 -0
- package/dist/undo-stack.js.map +1 -0
- package/dist/utils.d.ts +98 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +1233 -0
- package/dist/utils.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latex.js","sourceRoot":"","sources":["../src/latex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,GAA2B;IACvC,KAAK,EAAE,IAAG;IACV,IAAI,EAAE,IAAG;IACT,KAAK,EAAE,IAAG;IACV,KAAK,EAAE,IAAG;IACV,OAAO,EAAE,IAAG;IACZ,UAAU,EAAE,IAAG;IACf,IAAI,EAAE,IAAG;IACT,GAAG,EAAE,IAAG;IACR,KAAK,EAAE,IAAG;I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ourcesContent":["/**\n * Best-effort LaTeX math to Unicode plain text conversion for terminal display.\n *\n * The goal is readable math in a monospace grid, not faithful typesetting:\n * symbols map to their Unicode equivalents (\\sum → ∑, \\alpha → α), scripts use\n * Unicode sub/superscript characters when every character is available\n * (x_{t-k} → xₜ₋ₖ) and stay in TeX notation otherwise (x_\\theta → x_θ), and\n * structural commands degrade to linear notation (\\frac{a}{b} → a/b).\n * Unknown commands keep their name with the backslash dropped, so output is\n * never worse than the raw source.\n */\n\nconst SYMBOLS: Record<string, string> = {\n\talpha: \"α\",\n\tbeta: \"β\",\n\tgamma: \"γ\",\n\tdelta: \"δ\",\n\tepsilon: \"ε\",\n\tvarepsilon: \"ε\",\n\tzeta: \"ζ\",\n\teta: \"η\",\n\ttheta: \"θ\",\n\tvartheta: \"ϑ\",\n\tiota: \"ι\",\n\tkappa: \"κ\",\n\tlambda: \"λ\",\n\tmu: \"μ\",\n\tnu: \"ν\",\n\txi: \"ξ\",\n\tpi: \"π\",\n\tvarpi: \"ϖ\",\n\trho: \"ρ\",\n\tvarrho: \"ϱ\",\n\tsigma: \"σ\",\n\tvarsigma: \"ς\",\n\ttau: \"τ\",\n\tupsilon: \"υ\",\n\tphi: \"ϕ\",\n\tvarphi: \"φ\",\n\tchi: \"χ\",\n\tpsi: \"ψ\",\n\tomega: \"ω\",\n\tGamma: \"Γ\",\n\tDelta: \"Δ\",\n\tTheta: \"Θ\",\n\tLambda: \"Λ\",\n\tXi: \"Ξ\",\n\tPi: \"Π\",\n\tSigma: \"Σ\",\n\tUpsilon: \"Υ\",\n\tPhi: \"Φ\",\n\tPsi: \"Ψ\",\n\tOmega: \"Ω\",\n\tsum: \"∑\",\n\tprod: \"∏\",\n\tcoprod: \"∐\",\n\tint: \"∫\",\n\tiint: \"∬\",\n\tiiint: \"∭\",\n\toint: \"∮\",\n\tbigcup: \"⋃\",\n\tbigcap: \"⋂\",\n\tbigoplus: \"⨁\",\n\tbigotimes: \"⨂\",\n\tbigodot: \"⨀\",\n\tbigvee: \"⋁\",\n\tbigwedge: \"⋀\",\n\tbigsqcup: \"⨆\",\n\tpm: \"±\",\n\tmp: \"∓\",\n\ttimes: \"×\",\n\tdiv: \"÷\",\n\tcdot: \"·\",\n\tast: \"∗\",\n\tstar: \"⋆\",\n\tcirc: \"∘\",\n\tbullet: \"•\",\n\toplus: \"⊕\",\n\tominus: \"⊖\",\n\totimes: \"⊗\",\n\toslash: \"⊘\",\n\todot: \"⊙\",\n\twedge: \"∧\",\n\tland: \"∧\",\n\tvee: \"∨\",\n\tlor: \"∨\",\n\tcap: \"∩\",\n\tcup: \"∪\",\n\tsetminus: \"∖\",\n\tsqcap: \"⊓\",\n\tsqcup: \"⊔\",\n\tuplus: \"⊎\",\n\tdagger: \"†\",\n\tddagger: \"‡\",\n\tleq: \"≤\",\n\tle: \"≤\",\n\tgeq: \"≥\",\n\tge: \"≥\",\n\tneq: \"≠\",\n\tne: \"≠\",\n\tequiv: \"≡\",\n\tsim: \"∼\",\n\tsimeq: \"≃\",\n\tapprox: \"≈\",\n\tcong: \"≅\",\n\tpropto: \"∝\",\n\tll: \"≪\",\n\tgg: \"≫\",\n\tsubset: \"⊂\",\n\tsupset: \"⊃\",\n\tsubseteq: \"⊆\",\n\tsupseteq: \"⊇\",\n\tsqsubseteq: \"⊑\",\n\tsqsupseteq: \"⊒\",\n\tin: \"∈\",\n\tni: \"∋\",\n\tnotin: \"∉\",\n\tmodels: \"⊨\",\n\tvdash: \"⊢\",\n\tdashv: \"⊣\",\n\tperp: \"⊥\",\n\tparallel: \"∥\",\n\tmid: \"∣\",\n\tasymp: \"≍\",\n\tdoteq: \"≐\",\n\tprec: \"≺\",\n\tsucc: \"≻\",\n\tpreceq: \"⪯\",\n\tsucceq: \"⪰\",\n\ttriangleq: \"≜\",\n\tcoloneqq: \"≔\",\n\tcoloneq: \"≔\",\n\tto: \"→\",\n\trightarrow: \"→\",\n\tleftarrow: \"←\",\n\tgets: \"←\",\n\tleftrightarrow: \"↔\",\n\tRightarrow: \"⇒\",\n\tLeftarrow: \"⇐\",\n\tLeftrightarrow: \"⇔\",\n\tiff: \"⇔\",\n\timplies: \"⇒\",\n\timpliedby: \"⇐\",\n\tmapsto: \"↦\",\n\tlongrightarrow: \"⟶\",\n\tlongleftarrow: \"⟵\",\n\tLongrightarrow: \"⟹\",\n\tLongleftarrow: \"⟸\",\n\tlongmapsto: \"⟼\",\n\tuparrow: \"↑\",\n\tdownarrow: \"↓\",\n\tupdownarrow: \"↕\",\n\tUparrow: \"⇑\",\n\tDownarrow: \"⇓\",\n\thookrightarrow: \"↪\",\n\thookleftarrow: \"↩\",\n\trightharpoonup: \"⇀\",\n\tleftharpoonup: \"↼\",\n\trightrightarrows: \"⇉\",\n\trightleftarrows: \"⇄\",\n\tleadsto: \"⇝\",\n\tnearrow: \"↗\",\n\tsearrow: \"↘\",\n\tnwarrow: \"↖\",\n\tswarrow: \"↙\",\n\tinfty: \"∞\",\n\tpartial: \"∂\",\n\tnabla: \"∇\",\n\tforall: \"∀\",\n\texists: \"∃\",\n\tnexists: \"∄\",\n\temptyset: \"∅\",\n\tvarnothing: \"∅\",\n\tneg: \"¬\",\n\tlnot: \"¬\",\n\tangle: \"∠\",\n\ttriangle: \"△\",\n\tsquare: \"□\",\n\tBox: \"□\",\n\tblacksquare: \"■\",\n\tdiamond: \"⋄\",\n\tDiamond: \"◇\",\n\taleph: \"ℵ\",\n\thbar: \"ℏ\",\n\tell: \"ℓ\",\n\tRe: \"ℜ\",\n\tIm: \"ℑ\",\n\twp: \"℘\",\n\ttop: \"⊤\",\n\tbot: \"⊥\",\n\tflat: \"♭\",\n\tsharp: \"♯\",\n\tnatural: \"♮\",\n\tcheckmark: \"✓\",\n\tdegree: \"°\",\n\tprime: \"′\",\n\ttherefore: \"∴\",\n\tbecause: \"∵\",\n\tdots: \"…\",\n\tldots: \"…\",\n\tdotsc: \"…\",\n\tdotso: \"…\",\n\tcdots: \"⋯\",\n\tdotsb: \"⋯\",\n\tvdots: \"⋮\",\n\tddots: \"⋱\",\n\tlangle: \"⟨\",\n\trangle: \"⟩\",\n\tlceil: \"⌈\",\n\trceil: \"⌉\",\n\tlfloor: \"⌊\",\n\trfloor: \"⌋\",\n\tlvert: \"|\",\n\trvert: \"|\",\n\tvert: \"|\",\n\tlVert: \"‖\",\n\trVert: \"‖\",\n\tVert: \"‖\",\n};\n\n/** Operator names render as plain words (\\log → log). */\nconst OPERATOR_NAMES = new Set([\n\t\"log\",\n\t\"ln\",\n\t\"lg\",\n\t\"exp\",\n\t\"sin\",\n\t\"cos\",\n\t\"tan\",\n\t\"cot\",\n\t\"sec\",\n\t\"csc\",\n\t\"arcsin\",\n\t\"arccos\",\n\t\"arctan\",\n\t\"sinh\",\n\t\"cosh\",\n\t\"tanh\",\n\t\"coth\",\n\t\"min\",\n\t\"max\",\n\t\"argmin\",\n\t\"argmax\",\n\t\"arg\",\n\t\"sup\",\n\t\"inf\",\n\t\"lim\",\n\t\"limsup\",\n\t\"liminf\",\n\t\"det\",\n\t\"dim\",\n\t\"ker\",\n\t\"deg\",\n\t\"gcd\",\n\t\"hom\",\n\t\"Pr\",\n\t\"tr\",\n\t\"Tr\",\n\t\"rank\",\n\t\"diag\",\n\t\"sgn\",\n\t\"softmax\",\n\t\"mod\",\n\t\"bmod\",\n]);\n\n/** Single-character escapes (\\{ → {) and spacing commands. */\nconst ESCAPES: Record<string, string> = {\n\t\"{\": \"{\",\n\t\"}\": \"}\",\n\t\"%\": \"%\",\n\t$: \"$\",\n\t\"&\": \"&\",\n\t\"#\": \"#\",\n\t_: \"_\",\n\t\"|\": \"‖\",\n\t\"\\\\\": \"\\n\",\n\t\" \": \" \",\n\t\",\": \" \",\n\t\";\": \" \",\n\t\":\": \" \",\n\t\"!\": \"\",\n};\n\nconst SPACING_COMMANDS: Record<string, string> = {\n\tquad: \" \",\n\tqquad: \" \",\n\tthinspace: \" \",\n\tenspace: \" \",\n\tmedspace: \" \",\n\tthickspace: \" \",\n};\n\n/** Accent commands → combining character appended to each character. */\nconst ACCENTS: Record<string, string> = {\n\that: \"̂\",\n\twidehat: \"̂\",\n\tbar: \"̄\",\n\toverline: \"̅\",\n\tunderline: \"̲\",\n\tvec: \"⃗\",\n\ttilde: \"̃\",\n\twidetilde: \"̃\",\n\tdot: \"̇\",\n\tddot: \"̈\",\n\tbreve: \"̆\",\n\tcheck: \"̌\",\n\tacute: \"́\",\n\tgrave: \"̀\",\n\tmathring: \"̊\",\n};\n\nconst SUPERSCRIPTS: Record<string, string> = {\n\t\"0\": \"⁰\",\n\t\"1\": \"¹\",\n\t\"2\": \"²\",\n\t\"3\": \"³\",\n\t\"4\": \"⁴\",\n\t\"5\": \"⁵\",\n\t\"6\": \"⁶\",\n\t\"7\": \"⁷\",\n\t\"8\": \"⁸\",\n\t\"9\": \"⁹\",\n\t\"+\": \"⁺\",\n\t\"-\": \"⁻\",\n\t\"−\": \"⁻\",\n\t\"=\": \"⁼\",\n\t\"(\": \"⁽\",\n\t\")\": \"⁾\",\n\t\"*\": \"*\",\n\ta: \"ᵃ\",\n\tb: \"ᵇ\",\n\tc: \"ᶜ\",\n\td: \"ᵈ\",\n\te: \"ᵉ\",\n\tf: \"ᶠ\",\n\tg: \"ᵍ\",\n\th: \"ʰ\",\n\ti: \"ⁱ\",\n\tj: \"ʲ\",\n\tk: \"ᵏ\",\n\tl: \"ˡ\",\n\tm: \"ᵐ\",\n\tn: \"ⁿ\",\n\to: \"ᵒ\",\n\tp: \"ᵖ\",\n\tr: \"ʳ\",\n\ts: \"ˢ\",\n\tt: \"ᵗ\",\n\tu: \"ᵘ\",\n\tv: \"ᵛ\",\n\tw: \"ʷ\",\n\tx: \"ˣ\",\n\ty: \"ʸ\",\n\tz: \"ᶻ\",\n\tA: \"ᴬ\",\n\tB: \"ᴮ\",\n\tD: \"ᴰ\",\n\tE: \"ᴱ\",\n\tG: \"ᴳ\",\n\tH: \"ᴴ\",\n\tI: \"ᴵ\",\n\tJ: \"ᴶ\",\n\tK: \"ᴷ\",\n\tL: \"ᴸ\",\n\tM: \"ᴹ\",\n\tN: \"ᴺ\",\n\tO: \"ᴼ\",\n\tP: \"ᴾ\",\n\tR: \"ᴿ\",\n\tT: \"ᵀ\",\n\tU: \"ᵁ\",\n\tV: \"ⱽ\",\n\tW: \"ᵂ\",\n\tβ: \"ᵝ\",\n\tγ: \"ᵞ\",\n\tδ: \"ᵟ\",\n\tθ: \"ᶿ\",\n\tϕ: \"ᵠ\",\n\tφ: \"ᵠ\",\n\tχ: \"ᵡ\",\n};\n\nconst SUBSCRIPTS: Record<string, string> = {\n\t\"0\": \"₀\",\n\t\"1\": \"₁\",\n\t\"2\": \"₂\",\n\t\"3\": \"₃\",\n\t\"4\": \"₄\",\n\t\"5\": \"₅\",\n\t\"6\": \"₆\",\n\t\"7\": \"₇\",\n\t\"8\": \"₈\",\n\t\"9\": \"₉\",\n\t\"+\": \"₊\",\n\t\"-\": \"₋\",\n\t\"−\": \"₋\",\n\t\"=\": \"₌\",\n\t\"(\": \"₍\",\n\t\")\": \"₎\",\n\ta: \"ₐ\",\n\te: \"ₑ\",\n\th: \"ₕ\",\n\ti: \"ᵢ\",\n\tj: \"ⱼ\",\n\tk: \"ₖ\",\n\tl: \"ₗ\",\n\tm: \"ₘ\",\n\tn: \"ₙ\",\n\to: \"ₒ\",\n\tp: \"ₚ\",\n\tr: \"ᵣ\",\n\ts: \"ₛ\",\n\tt: \"ₜ\",\n\tu: \"ᵤ\",\n\tv: \"ᵥ\",\n\tx: \"ₓ\",\n\tβ: \"ᵦ\",\n\tγ: \"ᵧ\",\n\tρ: \"ᵨ\",\n\tϕ: \"ᵩ\",\n\tφ: \"ᵩ\",\n\tχ: \"ᵪ\",\n};\n\nconst COMMON_FRACTIONS: Record<string, string> = {\n\t\"1/2\": \"½\",\n\t\"1/3\": \"⅓\",\n\t\"2/3\": \"⅔\",\n\t\"1/4\": \"¼\",\n\t\"3/4\": \"¾\",\n\t\"1/5\": \"⅕\",\n\t\"2/5\": \"⅖\",\n\t\"3/5\": \"⅗\",\n\t\"4/5\": \"⅘\",\n\t\"1/6\": \"⅙\",\n\t\"5/6\": \"⅚\",\n\t\"1/8\": \"⅛\",\n};\n\ninterface AlphabetStyle {\n\t/** Code point of the styled \"A\" in the Mathematical Alphanumeric block. */\n\tupper?: number;\n\t/** Code point of the styled \"a\". */\n\tlower?: number;\n\t/** Code point of the styled \"0\". */\n\tdigit?: number;\n\t/** Letters whose styled forms predate the block and live elsewhere in the BMP. */\n\texceptions?: Record<string, string>;\n}\n\nconst ALPHABETS: Record<string, AlphabetStyle> = {\n\tmathbb: {\n\t\tupper: 0x1d538,\n\t\tlower: 0x1d552,\n\t\tdigit: 0x1d7d8,\n\t\texceptions: { C: \"ℂ\", H: \"ℍ\", N: \"ℕ\", P: \"ℙ\", Q: \"ℚ\", R: \"ℝ\", Z: \"ℤ\" },\n\t},\n\tmathbf: { upper: 0x1d400, lower: 0x1d41a, digit: 0x1d7ce },\n\tboldsymbol: { upper: 0x1d400, lower: 0x1d41a, digit: 0x1d7ce },\n\tbm: { upper: 0x1d400, lower: 0x1d41a, digit: 0x1d7ce },\n\ttextbf: { upper: 0x1d400, lower: 0x1d41a, digit: 0x1d7ce },\n\tmathcal: {\n\t\tupper: 0x1d49c,\n\t\tlower: 0x1d4b6,\n\t\texceptions: {\n\t\t\tB: \"ℬ\",\n\t\t\tE: \"ℰ\",\n\t\t\tF: \"ℱ\",\n\t\t\tH: \"ℋ\",\n\t\t\tI: \"ℐ\",\n\t\t\tL: \"ℒ\",\n\t\t\tM: \"ℳ\",\n\t\t\tR: \"ℛ\",\n\t\t\te: \"ℯ\",\n\t\t\tg: \"ℊ\",\n\t\t\to: \"ℴ\",\n\t\t},\n\t},\n\tmathscr: {\n\t\tupper: 0x1d49c,\n\t\tlower: 0x1d4b6,\n\t\texceptions: {\n\t\t\tB: \"ℬ\",\n\t\t\tE: \"ℰ\",\n\t\t\tF: \"ℱ\",\n\t\t\tH: \"ℋ\",\n\t\t\tI: \"ℐ\",\n\t\t\tL: \"ℒ\",\n\t\t\tM: \"ℳ\",\n\t\t\tR: \"ℛ\",\n\t\t\te: \"ℯ\",\n\t\t\tg: \"ℊ\",\n\t\t\to: \"ℴ\",\n\t\t},\n\t},\n\tmathfrak: {\n\t\tupper: 0x1d504,\n\t\tlower: 0x1d51e,\n\t\texceptions: { C: \"ℭ\", H: \"ℌ\", I: \"ℑ\", R: \"ℜ\", Z: \"ℨ\" },\n\t},\n};\n\n/** Text-mode commands: their argument is literal text, so ^ and _ stay as-is. */\nconst TEXT_COMMANDS = new Set([\"text\", \"textrm\", \"textit\", \"textsf\", \"texttt\", \"mbox\", \"hbox\"]);\n\n/** Math-mode font commands rendered unstyled; scripts inside still apply. */\nconst MATH_FONT_COMMANDS = new Set([\"mathrm\", \"mathit\", \"mathsf\", \"mathtt\", \"mathnormal\", \"operatorname\"]);\n\n/** Size/style commands that take no argument and render as nothing. */\nconst IGNORED_COMMANDS = new Set([\n\t\"left\",\n\t\"right\",\n\t\"big\",\n\t\"Big\",\n\t\"bigg\",\n\t\"Bigg\",\n\t\"bigl\",\n\t\"bigr\",\n\t\"bigm\",\n\t\"Bigl\",\n\t\"Bigr\",\n\t\"Bigm\",\n\t\"biggl\",\n\t\"biggr\",\n\t\"Biggl\",\n\t\"Biggr\",\n\t\"displaystyle\",\n\t\"textstyle\",\n\t\"scriptstyle\",\n\t\"limits\",\n\t\"nolimits\",\n\t\"middle\",\n\t\"allowbreak\",\n\t\"nonumber\",\n\t\"notag\",\n]);\n\nfunction styleAlphabet(text: string, style: AlphabetStyle): string {\n\tlet result = \"\";\n\tfor (const ch of text) {\n\t\tconst exception = style.exceptions?.[ch];\n\t\tif (exception) {\n\t\t\tresult += exception;\n\t\t} else if (ch >= \"A\" && ch <= \"Z\" && style.upper !== undefined) {\n\t\t\tresult += String.fromCodePoint(style.upper + ch.charCodeAt(0) - 0x41);\n\t\t} else if (ch >= \"a\" && ch <= \"z\" && style.lower !== undefined) {\n\t\t\tresult += String.fromCodePoint(style.lower + ch.charCodeAt(0) - 0x61);\n\t\t} else if (ch >= \"0\" && ch <= \"9\" && style.digit !== undefined) {\n\t\t\tresult += String.fromCodePoint(style.digit + ch.charCodeAt(0) - 0x30);\n\t\t} else {\n\t\t\tresult += ch;\n\t\t}\n\t}\n\treturn result;\n}\n\n/** Map every character through a sub/superscript table, or return undefined if any character is missing. */\nfunction mapScript(text: string, table: Record<string, string>): string | undefined {\n\tlet result = \"\";\n\tfor (const ch of text) {\n\t\tconst mapped = table[ch];\n\t\tif (mapped === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tresult += mapped;\n\t}\n\treturn result;\n}\n\n/** True when a fraction/sqrt operand reads unambiguously without parentheses. */\nfunction isSimpleOperand(text: string): boolean {\n\treturn [...text].length === 1 || /^[\\p{L}\\p{N}\\p{M}]+$/u.test(text);\n}\n\nfunction parenthesize(text: string): string {\n\treturn isSimpleOperand(text) ? text : `(${text})`;\n}\n\nclass LatexParser {\n\tprivate readonly src: string;\n\tprivate pos = 0;\n\tprivate textMode = false;\n\n\tconstructor(src: string) {\n\t\tthis.src = src;\n\t}\n\n\tparse(): string {\n\t\treturn this.parseSequence();\n\t}\n\n\t/** Render atoms (with attached scripts) until a closing brace or end of input. */\n\tprivate parseSequence(): string {\n\t\tlet result = \"\";\n\t\twhile (this.pos < this.src.length) {\n\t\t\tconst ch = this.src[this.pos];\n\t\t\tif (ch === \"}\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((ch === \"^\" || ch === \"_\") && !this.textMode) {\n\t\t\t\tthis.pos++;\n\t\t\t\tresult += this.parseScript(ch === \"^\" ? SUPERSCRIPTS : SUBSCRIPTS, ch);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (ch === \"&\") {\n\t\t\t\t// Alignment marker: becomes a separating space unless one is there.\n\t\t\t\tthis.pos++;\n\t\t\t\tif (!/\\s$/.test(result)) {\n\t\t\t\t\tresult += \" \";\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult += this.parseAtom() ?? \"\";\n\t\t}\n\t\treturn result;\n\t}\n\n\t/** Render the next atom: a group, a command, or a single character. */\n\tprivate parseAtom(): string | undefined {\n\t\tif (this.pos >= this.src.length) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst ch = this.src[this.pos];\n\t\tif (ch === \"{\") {\n\t\t\treturn this.parseGroup();\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\treturn this.parseCommand();\n\t\t}\n\t\tthis.pos++;\n\t\treturn ch;\n\t}\n\n\t/** Consume \"{...}\" and render its contents. Assumes \"{\" at the current position. */\n\tprivate parseGroup(): string {\n\t\tthis.pos++; // consume \"{\"\n\t\tconst content = this.parseSequence();\n\t\tif (this.src[this.pos] === \"}\") {\n\t\t\tthis.pos++;\n\t\t}\n\t\treturn content;\n\t}\n\n\t/** Consume \"[...]\" and render its contents, or return undefined when absent. */\n\tprivate parseOptionalBracket(): string | undefined {\n\t\tif (this.src[this.pos] !== \"[\") {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst end = this.src.indexOf(\"]\", this.pos + 1);\n\t\tif (end === -1) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst content = new LatexParser(this.src.slice(this.pos + 1, end)).parse();\n\t\tthis.pos = end + 1;\n\t\treturn content;\n\t}\n\n\t/** Render the next required argument: a braced group, or a single atom (TeX allows \\frac12). */\n\tprivate parseArgument(): string {\n\t\twhile (this.pos < this.src.length && /\\s/.test(this.src[this.pos])) {\n\t\t\tthis.pos++;\n\t\t}\n\t\tif (this.src[this.pos] === \"{\") {\n\t\t\treturn this.parseGroup();\n\t\t}\n\t\treturn this.parseAtom() ?? \"\";\n\t}\n\n\t/** Render a ^ or _ script. The operator character itself is already consumed. */\n\tprivate parseScript(table: Record<string, string>, operator: string): string {\n\t\tconst content = this.parseArgument();\n\t\tconst mapped = mapScript(content, table);\n\t\tif (mapped !== undefined) {\n\t\t\treturn mapped;\n\t\t}\n\t\t// No Unicode form for every character: keep lossless TeX notation (x_θ).\n\t\treturn [...content].length === 1 ? `${operator}${content}` : `${operator}{${content}}`;\n\t}\n\n\t/** Render a command. Assumes \"\\\" at the current position. */\n\tprivate parseCommand(): string {\n\t\tthis.pos++; // consume \"\\\"\n\t\tif (this.pos >= this.src.length) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tconst ch = this.src[this.pos];\n\t\tif (!/[a-zA-Z]/.test(ch)) {\n\t\t\tthis.pos++;\n\t\t\treturn ESCAPES[ch] ?? ch;\n\t\t}\n\n\t\tlet name = \"\";\n\t\twhile (this.pos < this.src.length && /[a-zA-Z]/.test(this.src[this.pos])) {\n\t\t\tname += this.src[this.pos];\n\t\t\tthis.pos++;\n\t\t}\n\t\tif (this.src[this.pos] === \"*\") {\n\t\t\tthis.pos++; // operatorname*, section* etc.\n\t\t}\n\n\t\tconst symbol = SYMBOLS[name];\n\t\tif (symbol !== undefined) {\n\t\t\treturn symbol;\n\t\t}\n\t\tif (OPERATOR_NAMES.has(name)) {\n\t\t\treturn name;\n\t\t}\n\t\tconst spacing = SPACING_COMMANDS[name];\n\t\tif (spacing !== undefined) {\n\t\t\treturn spacing;\n\t\t}\n\t\tif (IGNORED_COMMANDS.has(name)) {\n\t\t\tif (name === \"left\" || name === \"right\") {\n\t\t\t\treturn this.parseDelimiter();\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\t\tif (TEXT_COMMANDS.has(name)) {\n\t\t\tconst wasTextMode = this.textMode;\n\t\t\tthis.textMode = true;\n\t\t\tconst content = this.parseArgument();\n\t\t\tthis.textMode = wasTextMode;\n\t\t\treturn content;\n\t\t}\n\t\tif (MATH_FONT_COMMANDS.has(name)) {\n\t\t\treturn this.parseArgument();\n\t\t}\n\t\tconst alphabet = ALPHABETS[name];\n\t\tif (alphabet !== undefined) {\n\t\t\treturn styleAlphabet(this.parseArgument(), alphabet);\n\t\t}\n\t\tconst accent = ACCENTS[name];\n\t\tif (accent !== undefined) {\n\t\t\tconst content = this.parseArgument();\n\t\t\treturn [...content].map((c) => (/\\s/.test(c) ? c : c + accent)).join(\"\");\n\t\t}\n\t\tswitch (name) {\n\t\t\tcase \"frac\":\n\t\t\tcase \"dfrac\":\n\t\t\tcase \"tfrac\":\n\t\t\tcase \"cfrac\": {\n\t\t\t\tconst numerator = this.parseArgument();\n\t\t\t\tconst denominator = this.parseArgument();\n\t\t\t\tconst common = COMMON_FRACTIONS[`${numerator}/${denominator}`];\n\t\t\t\tif (common !== undefined) {\n\t\t\t\t\treturn common;\n\t\t\t\t}\n\t\t\t\treturn `${parenthesize(numerator)}/${parenthesize(denominator)}`;\n\t\t\t}\n\t\t\tcase \"binom\": {\n\t\t\t\tconst top = this.parseArgument();\n\t\t\t\tconst bottom = this.parseArgument();\n\t\t\t\treturn `C(${top},${bottom})`;\n\t\t\t}\n\t\t\tcase \"sqrt\": {\n\t\t\t\tconst index = this.parseOptionalBracket();\n\t\t\t\tconst radicand = this.parseArgument();\n\t\t\t\tconst operand = isSimpleOperand(radicand) ? radicand : `(${radicand})`;\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\treturn `√${operand}`;\n\t\t\t\t}\n\t\t\t\tif (index === \"3\") {\n\t\t\t\t\treturn `∛${operand}`;\n\t\t\t\t}\n\t\t\t\tif (index === \"4\") {\n\t\t\t\t\treturn `∜${operand}`;\n\t\t\t\t}\n\t\t\t\treturn `${mapScript(index, SUPERSCRIPTS) ?? `^${index}`}√${operand}`;\n\t\t\t}\n\t\t\tcase \"not\": {\n\t\t\t\tconst negated = this.parseAtom() ?? \"\";\n\t\t\t\treturn `${negated}̸`;\n\t\t\t}\n\t\t\tcase \"begin\":\n\t\t\tcase \"end\": {\n\t\t\t\tthis.parseArgument(); // environment name\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\tcase \"stackrel\":\n\t\t\tcase \"overset\": {\n\t\t\t\tconst above = this.parseArgument();\n\t\t\t\tconst base = this.parseArgument();\n\t\t\t\tconst mapped = mapScript(above, SUPERSCRIPTS);\n\t\t\t\treturn mapped !== undefined ? base + mapped : `${base}^{${above}}`;\n\t\t\t}\n\t\t\tcase \"underset\": {\n\t\t\t\tconst below = this.parseArgument();\n\t\t\t\tconst base = this.parseArgument();\n\t\t\t\tconst mapped = mapScript(below, SUBSCRIPTS);\n\t\t\t\treturn mapped !== undefined ? base + mapped : `${base}_{${below}}`;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\t// Unknown command: drop the backslash, keep the name.\n\t\t\t\treturn name;\n\t\t}\n\t}\n\n\t/** Render the delimiter following \\left or \\right (\".\" means invisible). */\n\tprivate parseDelimiter(): string {\n\t\twhile (this.pos < this.src.length && /\\s/.test(this.src[this.pos])) {\n\t\t\tthis.pos++;\n\t\t}\n\t\tconst ch = this.src[this.pos];\n\t\tif (ch === undefined) {\n\t\t\treturn \"\";\n\t\t}\n\t\tif (ch === \".\") {\n\t\t\tthis.pos++;\n\t\t\treturn \"\";\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\treturn this.parseCommand();\n\t\t}\n\t\tthis.pos++;\n\t\treturn ch;\n\t}\n}\n\n/**\n * Convert LaTeX math source to Unicode plain text.\n *\n * Newlines in the source are preserved and \"\\\\\" becomes a newline, so\n * multi-line display math (aligned environments) renders on multiple lines.\n * Runs of spaces collapse to one — TeX treats source whitespace as\n * insignificant, and spacing commands otherwise leave double gaps.\n */\nexport function latexToUnicode(tex: string): string {\n\treturn new LatexParser(tex)\n\t\t.parse()\n\t\t.replace(/[^\\S\\n]{2,}/g, \" \")\n\t\t.replace(/\\n\\s*\\n/g, \"\\n\");\n}\n"]}
|
package/dist/mouse.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface MouseEvent {
|
|
2
|
+
/** Base SGR button code with modifier and motion bits removed; wheel up/down are 64/65. */
|
|
3
|
+
button: number;
|
|
4
|
+
/** One-based terminal column. */
|
|
5
|
+
x: number;
|
|
6
|
+
/** One-based terminal row. */
|
|
7
|
+
y: number;
|
|
8
|
+
/** True for SGR `M` reports (press, wheel, or drag), false for release `m`. */
|
|
9
|
+
press: boolean;
|
|
10
|
+
/** Whether the SGR motion bit is set. */
|
|
11
|
+
motion: boolean;
|
|
12
|
+
/** Modifier bits carried by the SGR report. */
|
|
13
|
+
shift: boolean;
|
|
14
|
+
alt: boolean;
|
|
15
|
+
ctrl: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const MOUSE_WHEEL_UP = 64;
|
|
18
|
+
export declare const MOUSE_WHEEL_DOWN = 65;
|
|
19
|
+
export declare const MOUSE_BUTTON_LEFT = 0;
|
|
20
|
+
export declare function isMouseSequence(sequence: string): boolean;
|
|
21
|
+
export declare function parseSgrMouseEvent(sequence: string): MouseEvent | null;
|
|
22
|
+
export declare function isWheelUp(event: MouseEvent): boolean;
|
|
23
|
+
export declare function isWheelDown(event: MouseEvent): boolean;
|
|
24
|
+
//# sourceMappingURL=mouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../src/mouse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAC1B,2FAA2F;IAC3F,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,8BAA8B;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,+EAA+E;IAC/E,KAAK,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACd;AAED,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAQnC,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CActE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEpD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEtD","sourcesContent":["export interface MouseEvent {\n\t/** Base SGR button code with modifier and motion bits removed; wheel up/down are 64/65. */\n\tbutton: number;\n\t/** One-based terminal column. */\n\tx: number;\n\t/** One-based terminal row. */\n\ty: number;\n\t/** True for SGR `M` reports (press, wheel, or drag), false for release `m`. */\n\tpress: boolean;\n\t/** Whether the SGR motion bit is set. */\n\tmotion: boolean;\n\t/** Modifier bits carried by the SGR report. */\n\tshift: boolean;\n\talt: boolean;\n\tctrl: boolean;\n}\n\nexport const MOUSE_WHEEL_UP = 64;\nexport const MOUSE_WHEEL_DOWN = 65;\nexport const MOUSE_BUTTON_LEFT = 0;\n\nconst SGR_MOUSE_PATTERN = /^\\x1b\\[<(\\d+);(\\d+);(\\d+)([Mm])$/;\nconst MODIFIER_SHIFT = 4;\nconst MODIFIER_ALT = 8;\nconst MODIFIER_CTRL = 16;\nconst MOTION_BIT = 32;\n\nexport function isMouseSequence(sequence: string): boolean {\n\treturn sequence.startsWith(\"\\x1b[<\") || sequence.startsWith(\"\\x1b[M\");\n}\n\nexport function parseSgrMouseEvent(sequence: string): MouseEvent | null {\n\tconst match = sequence.match(SGR_MOUSE_PATTERN);\n\tif (!match) return null;\n\tconst raw = Number(match[1]);\n\treturn {\n\t\tbutton: raw & ~(MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_CTRL | MOTION_BIT),\n\t\tx: Number(match[2]),\n\t\ty: Number(match[3]),\n\t\tpress: match[4] === \"M\",\n\t\tmotion: (raw & MOTION_BIT) !== 0,\n\t\tshift: (raw & MODIFIER_SHIFT) !== 0,\n\t\talt: (raw & MODIFIER_ALT) !== 0,\n\t\tctrl: (raw & MODIFIER_CTRL) !== 0,\n\t};\n}\n\nexport function isWheelUp(event: MouseEvent): boolean {\n\treturn event.press && event.button === MOUSE_WHEEL_UP;\n}\n\nexport function isWheelDown(event: MouseEvent): boolean {\n\treturn event.press && event.button === MOUSE_WHEEL_DOWN;\n}\n"]}
|
package/dist/mouse.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const MOUSE_WHEEL_UP = 64;
|
|
2
|
+
export const MOUSE_WHEEL_DOWN = 65;
|
|
3
|
+
export const MOUSE_BUTTON_LEFT = 0;
|
|
4
|
+
const SGR_MOUSE_PATTERN = /^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/;
|
|
5
|
+
const MODIFIER_SHIFT = 4;
|
|
6
|
+
const MODIFIER_ALT = 8;
|
|
7
|
+
const MODIFIER_CTRL = 16;
|
|
8
|
+
const MOTION_BIT = 32;
|
|
9
|
+
export function isMouseSequence(sequence) {
|
|
10
|
+
return sequence.startsWith("\x1b[<") || sequence.startsWith("\x1b[M");
|
|
11
|
+
}
|
|
12
|
+
export function parseSgrMouseEvent(sequence) {
|
|
13
|
+
const match = sequence.match(SGR_MOUSE_PATTERN);
|
|
14
|
+
if (!match)
|
|
15
|
+
return null;
|
|
16
|
+
const raw = Number(match[1]);
|
|
17
|
+
return {
|
|
18
|
+
button: raw & ~(MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_CTRL | MOTION_BIT),
|
|
19
|
+
x: Number(match[2]),
|
|
20
|
+
y: Number(match[3]),
|
|
21
|
+
press: match[4] === "M",
|
|
22
|
+
motion: (raw & MOTION_BIT) !== 0,
|
|
23
|
+
shift: (raw & MODIFIER_SHIFT) !== 0,
|
|
24
|
+
alt: (raw & MODIFIER_ALT) !== 0,
|
|
25
|
+
ctrl: (raw & MODIFIER_CTRL) !== 0,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function isWheelUp(event) {
|
|
29
|
+
return event.press && event.button === MOUSE_WHEEL_UP;
|
|
30
|
+
}
|
|
31
|
+
export function isWheelDown(event) {
|
|
32
|
+
return event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AC,KAAK,CAAC;QAChC,KAAK,EAAE,CAAC,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC;QACnC,GAAG,EAAE,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC;QAC/B,IAAI,EAAE,CAAC,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC;KACjC,CAAC;AAAA,CACF;AAED,MAAM,UAAU,SAAS,CAAC,KAAiB,EAAW;IACrD,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC;AAAA,CACtD;AAED,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAW;IACvD,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,gBAAgB,CAAC;AAAA,CACxD","sourcesContent":["export interface MouseEvent {\n\t/** Base SGR button code with modifier and motion bits removed; wheel up/down are 64/65. */\n\tbutton: number;\n\t/** One-based terminal column. */\n\tx: number;\n\t/** One-based terminal row. */\n\ty: number;\n\t/** True for SGR `M` reports (press, wheel, or drag), false for release `m`. */\n\tpress: boolean;\n\t/** Whether the SGR motion bit is set. */\n\tmotion: boolean;\n\t/** Modifier bits carried by the SGR report. */\n\tshift: boolean;\n\talt: boolean;\n\tctrl: boolean;\n}\n\nexport const MOUSE_WHEEL_UP = 64;\nexport const MOUSE_WHEEL_DOWN = 65;\nexport const MOUSE_BUTTON_LEFT = 0;\n\nconst SGR_MOUSE_PATTERN = /^\\x1b\\[<(\\d+);(\\d+);(\\d+)([Mm])$/;\nconst MODIFIER_SHIFT = 4;\nconst MODIFIER_ALT = 8;\nconst MODIFIER_CTRL = 16;\nconst MOTION_BIT = 32;\n\nexport function isMouseSequence(sequence: string): boolean {\n\treturn sequence.startsWith(\"\\x1b[<\") || sequence.startsWith(\"\\x1b[M\");\n}\n\nexport function parseSgrMouseEvent(sequence: string): MouseEvent | null {\n\tconst match = sequence.match(SGR_MOUSE_PATTERN);\n\tif (!match) return null;\n\tconst raw = Number(match[1]);\n\treturn {\n\t\tbutton: raw & ~(MODIFIER_SHIFT | MODIFIER_ALT | MODIFIER_CTRL | MOTION_BIT),\n\t\tx: Number(match[2]),\n\t\ty: Number(match[3]),\n\t\tpress: match[4] === \"M\",\n\t\tmotion: (raw & MOTION_BIT) !== 0,\n\t\tshift: (raw & MODIFIER_SHIFT) !== 0,\n\t\talt: (raw & MODIFIER_ALT) !== 0,\n\t\tctrl: (raw & MODIFIER_CTRL) !== 0,\n\t};\n}\n\nexport function isWheelUp(event: MouseEvent): boolean {\n\treturn event.press && event.button === MOUSE_WHEEL_UP;\n}\n\nexport function isWheelDown(event: MouseEvent): boolean {\n\treturn event.press && event.button === MOUSE_WHEEL_DOWN;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class VersionedRenderCache {
|
|
2
|
+
private cachedWidth?;
|
|
3
|
+
private cachedVersion?;
|
|
4
|
+
private cachedLines?;
|
|
5
|
+
get(width: number, version: number): string[] | undefined;
|
|
6
|
+
set(width: number, version: number, lines: string[]): string[];
|
|
7
|
+
invalidate(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=render-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-cache.d.ts","sourceRoot":"","sources":["../src/render-cache.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;IAChC,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,WAAW,CAAC,CAAW;IAE/B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAKxD;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAK7D;IAED,UAAU,IAAI,IAAI,CAIjB;CACD","sourcesContent":["export class VersionedRenderCache {\n\tprivate cachedWidth?: number;\n\tprivate cachedVersion?: number;\n\tprivate cachedLines?: string[];\n\n\tget(width: number, version: number): string[] | undefined {\n\t\tif (this.cachedWidth === width && this.cachedVersion === version) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tset(width: number, version: number, lines: string[]): string[] {\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedVersion = version;\n\t\tthis.cachedLines = lines;\n\t\treturn lines;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedVersion = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class VersionedRenderCache {
|
|
2
|
+
cachedWidth;
|
|
3
|
+
cachedVersion;
|
|
4
|
+
cachedLines;
|
|
5
|
+
get(width, version) {
|
|
6
|
+
if (this.cachedWidth === width && this.cachedVersion === version) {
|
|
7
|
+
return this.cachedLines;
|
|
8
|
+
}
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
set(width, version, lines) {
|
|
12
|
+
this.cachedWidth = width;
|
|
13
|
+
this.cachedVersion = version;
|
|
14
|
+
this.cachedLines = lines;
|
|
15
|
+
return lines;
|
|
16
|
+
}
|
|
17
|
+
invalidate() {
|
|
18
|
+
this.cachedWidth = undefined;
|
|
19
|
+
this.cachedVersion = undefined;
|
|
20
|
+
this.cachedLines = undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=render-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-cache.js","sourceRoot":"","sources":["../src/render-cache.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAoB;IACxB,WAAW,CAAU;IACrB,aAAa,CAAU;IACvB,WAAW,CAAY;IAE/B,GAAG,CAAC,KAAa,EAAE,OAAe,EAAwB;QACzD,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,IAAI,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;YAClE,OAAO,IAAI,CAAC,WAAW,CAAC;QACzB,CAAC;QACD,OAAO,SAAS,CAAC;IAAA,CACjB;IAED,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,KAAe,EAAY;QAC9D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,OAAO,KAAK,CAAC;IAAA,CACb;IAED,UAAU,GAAS;QAClB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAAA,CAC7B;CACD","sourcesContent":["export class VersionedRenderCache {\n\tprivate cachedWidth?: number;\n\tprivate cachedVersion?: number;\n\tprivate cachedLines?: string[];\n\n\tget(width: number, version: number): string[] | undefined {\n\t\tif (this.cachedWidth === width && this.cachedVersion === version) {\n\t\t\treturn this.cachedLines;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tset(width: number, version: number, lines: string[]): string[] {\n\t\tthis.cachedWidth = width;\n\t\tthis.cachedVersion = version;\n\t\tthis.cachedLines = lines;\n\t\treturn lines;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.cachedWidth = undefined;\n\t\tthis.cachedVersion = undefined;\n\t\tthis.cachedLines = undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TableCellSelectionRegion {
|
|
2
|
+
line: number;
|
|
3
|
+
col: number;
|
|
4
|
+
width: number;
|
|
5
|
+
table: object;
|
|
6
|
+
tableTop: number;
|
|
7
|
+
tableBottom: number;
|
|
8
|
+
tableLeft: number;
|
|
9
|
+
tableRight: number;
|
|
10
|
+
row: number;
|
|
11
|
+
column: number;
|
|
12
|
+
segment: number;
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function markTableStart(line: string): string;
|
|
16
|
+
export declare function markTableEnd(line: string): string;
|
|
17
|
+
export declare function markTableCell(text: string, row: number, column: number, segment: number, content: string): string;
|
|
18
|
+
export declare function extractTableCellSelectionRegions(lines: string[], getTableIdentity: (index: number) => object): {
|
|
19
|
+
lines: string[];
|
|
20
|
+
regions: TableCellSelectionRegion[];
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=selection-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-metadata.d.ts","sourceRoot":"","sources":["../src/selection-metadata.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAyCD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOjH;AAED,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,MAAM,EAAE,EACf,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACzC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,wBAAwB,EAAE,CAAA;CAAE,CAqG1D","sourcesContent":["import { createAnsiCodeExtractor, visibleWidth } from \"./utils.js\";\n\nconst TABLE_MARKER_PREFIX = \"\\x1b_pi:table:\";\nconst TABLE_START_MARKER = `${TABLE_MARKER_PREFIX}start\\x07`;\nconst TABLE_END_MARKER = `${TABLE_MARKER_PREFIX}end\\x07`;\n\nexport interface TableCellSelectionRegion {\n\tline: number;\n\tcol: number;\n\twidth: number;\n\ttable: object;\n\ttableTop: number;\n\ttableBottom: number;\n\ttableLeft: number;\n\ttableRight: number;\n\trow: number;\n\tcolumn: number;\n\tsegment: number;\n\tcontent: string;\n}\n\ninterface CellMarker {\n\tkind: \"cell-start\" | \"cell-end\";\n\trow: number;\n\tcolumn: number;\n\tsegment: number;\n\tcontent?: string;\n}\n\ninterface TableBounds {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n}\n\nfunction cellMarker(kind: CellMarker[\"kind\"], row: number, column: number, segment: number, content?: string): string {\n\tconst encodedContent = content === undefined ? \"\" : `:${encodeURIComponent(content)}`;\n\treturn `${TABLE_MARKER_PREFIX}${kind}:${row}:${column}:${segment}${encodedContent}\\x07`;\n}\n\nfunction parseCellMarker(code: string): CellMarker | null {\n\tif (!code.startsWith(TABLE_MARKER_PREFIX) || !code.endsWith(\"\\x07\")) return null;\n\tconst [kind, rowText, columnText, segmentText, encodedContent] = code\n\t\t.slice(TABLE_MARKER_PREFIX.length, -1)\n\t\t.split(\":\");\n\tif (kind !== \"cell-start\" && kind !== \"cell-end\") return null;\n\tconst row = Number(rowText);\n\tconst column = Number(columnText);\n\tconst segment = Number(segmentText);\n\tif (![row, column, segment].every(Number.isInteger)) return null;\n\treturn {\n\t\tkind,\n\t\trow,\n\t\tcolumn,\n\t\tsegment,\n\t\tcontent: encodedContent === undefined ? undefined : decodeURIComponent(encodedContent),\n\t};\n}\n\nexport function markTableStart(line: string): string {\n\treturn TABLE_START_MARKER + line;\n}\n\nexport function markTableEnd(line: string): string {\n\treturn line + TABLE_END_MARKER;\n}\n\nexport function markTableCell(text: string, row: number, column: number, segment: number, content: string): string {\n\tconst markerContent = segment === 0 ? content : undefined;\n\treturn (\n\t\tcellMarker(\"cell-start\", row, column, segment, markerContent) +\n\t\ttext +\n\t\tcellMarker(\"cell-end\", row, column, segment)\n\t);\n}\n\nexport function extractTableCellSelectionRegions(\n\tlines: string[],\n\tgetTableIdentity: (index: number) => object,\n): { lines: string[]; regions: TableCellSelectionRegion[] } {\n\tif (!lines.some((line) => line.includes(TABLE_MARKER_PREFIX))) {\n\t\treturn { lines, regions: [] };\n\t}\n\n\tconst cleanLines: string[] = [];\n\tconst regions: TableCellSelectionRegion[] = [];\n\tconst cellContents = new Map<object, Map<string, string>>();\n\tconst tableBounds = new Map<object, TableBounds>();\n\tlet table: object | null = null;\n\tlet tableIndex = 0;\n\n\tfor (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n\t\tconst source = lines[lineIndex];\n\t\tif (!source.includes(TABLE_MARKER_PREFIX)) {\n\t\t\tcleanLines.push(source);\n\t\t\tcontinue;\n\t\t}\n\t\tlet clean = \"\";\n\t\tlet activeCell: (CellMarker & { col: number }) | null = null;\n\t\tlet offset = 0;\n\t\tconst extractAnsi = createAnsiCodeExtractor(source);\n\n\t\twhile (offset < source.length) {\n\t\t\tconst ansi = extractAnsi(offset);\n\t\t\tif (!ansi) {\n\t\t\t\tclean += source[offset];\n\t\t\t\toffset++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (ansi.code === TABLE_START_MARKER) {\n\t\t\t\ttable = getTableIdentity(tableIndex++);\n\t\t\t\tconst col = visibleWidth(clean);\n\t\t\t\ttableBounds.set(table, { top: lineIndex, bottom: lineIndex, left: col, right: col });\n\t\t\t} else if (ansi.code === TABLE_END_MARKER) {\n\t\t\t\tif (table) {\n\t\t\t\t\tconst bounds = tableBounds.get(table);\n\t\t\t\t\tif (bounds) {\n\t\t\t\t\t\tbounds.bottom = lineIndex;\n\t\t\t\t\t\tbounds.right = visibleWidth(clean);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttable = null;\n\t\t\t\tactiveCell = null;\n\t\t\t} else {\n\t\t\t\tconst marker = parseCellMarker(ansi.code);\n\t\t\t\tif (marker?.kind === \"cell-start\") {\n\t\t\t\t\tactiveCell = { ...marker, col: visibleWidth(clean) };\n\t\t\t\t\tif (table && marker.content !== undefined) {\n\t\t\t\t\t\tlet tableContents = cellContents.get(table);\n\t\t\t\t\t\tif (!tableContents) {\n\t\t\t\t\t\t\ttableContents = new Map();\n\t\t\t\t\t\t\tcellContents.set(table, tableContents);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttableContents.set(`${marker.row}:${marker.column}`, marker.content);\n\t\t\t\t\t}\n\t\t\t\t} else if (marker?.kind === \"cell-end\" && table && activeCell) {\n\t\t\t\t\tconst width = visibleWidth(clean) - activeCell.col;\n\t\t\t\t\tif (\n\t\t\t\t\t\twidth > 0 &&\n\t\t\t\t\t\tmarker.row === activeCell.row &&\n\t\t\t\t\t\tmarker.column === activeCell.column &&\n\t\t\t\t\t\tmarker.segment === activeCell.segment\n\t\t\t\t\t) {\n\t\t\t\t\t\tregions.push({\n\t\t\t\t\t\t\tline: lineIndex,\n\t\t\t\t\t\t\tcol: activeCell.col,\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\ttable,\n\t\t\t\t\t\t\ttableTop: 0,\n\t\t\t\t\t\t\ttableBottom: 0,\n\t\t\t\t\t\t\ttableLeft: 0,\n\t\t\t\t\t\t\ttableRight: 0,\n\t\t\t\t\t\t\trow: marker.row,\n\t\t\t\t\t\t\tcolumn: marker.column,\n\t\t\t\t\t\t\tsegment: marker.segment,\n\t\t\t\t\t\t\tcontent: \"\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tactiveCell = null;\n\t\t\t\t} else {\n\t\t\t\t\tclean += ansi.code;\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += ansi.length;\n\t\t}\n\t\tcleanLines.push(clean);\n\t}\n\tfor (const region of regions) {\n\t\tconst bounds = tableBounds.get(region.table);\n\t\tif (bounds) {\n\t\t\tregion.tableTop = bounds.top;\n\t\t\tregion.tableBottom = bounds.bottom;\n\t\t\tregion.tableLeft = bounds.left;\n\t\t\tregion.tableRight = bounds.right;\n\t\t}\n\t\tregion.content = cellContents.get(region.table)?.get(`${region.row}:${region.column}`) ?? \"\";\n\t}\n\n\treturn { lines: cleanLines, regions };\n}\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { createAnsiCodeExtractor, visibleWidth } from "./utils.js";
|
|
2
|
+
const TABLE_MARKER_PREFIX = "\x1b_pi:table:";
|
|
3
|
+
const TABLE_START_MARKER = `${TABLE_MARKER_PREFIX}start\x07`;
|
|
4
|
+
const TABLE_END_MARKER = `${TABLE_MARKER_PREFIX}end\x07`;
|
|
5
|
+
function cellMarker(kind, row, column, segment, content) {
|
|
6
|
+
const encodedContent = content === undefined ? "" : `:${encodeURIComponent(content)}`;
|
|
7
|
+
return `${TABLE_MARKER_PREFIX}${kind}:${row}:${column}:${segment}${encodedContent}\x07`;
|
|
8
|
+
}
|
|
9
|
+
function parseCellMarker(code) {
|
|
10
|
+
if (!code.startsWith(TABLE_MARKER_PREFIX) || !code.endsWith("\x07"))
|
|
11
|
+
return null;
|
|
12
|
+
const [kind, rowText, columnText, segmentText, encodedContent] = code
|
|
13
|
+
.slice(TABLE_MARKER_PREFIX.length, -1)
|
|
14
|
+
.split(":");
|
|
15
|
+
if (kind !== "cell-start" && kind !== "cell-end")
|
|
16
|
+
return null;
|
|
17
|
+
const row = Number(rowText);
|
|
18
|
+
const column = Number(columnText);
|
|
19
|
+
const segment = Number(segmentText);
|
|
20
|
+
if (![row, column, segment].every(Number.isInteger))
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
kind,
|
|
24
|
+
row,
|
|
25
|
+
column,
|
|
26
|
+
segment,
|
|
27
|
+
content: encodedContent === undefined ? undefined : decodeURIComponent(encodedContent),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function markTableStart(line) {
|
|
31
|
+
return TABLE_START_MARKER + line;
|
|
32
|
+
}
|
|
33
|
+
export function markTableEnd(line) {
|
|
34
|
+
return line + TABLE_END_MARKER;
|
|
35
|
+
}
|
|
36
|
+
export function markTableCell(text, row, column, segment, content) {
|
|
37
|
+
const markerContent = segment === 0 ? content : undefined;
|
|
38
|
+
return (cellMarker("cell-start", row, column, segment, markerContent) +
|
|
39
|
+
text +
|
|
40
|
+
cellMarker("cell-end", row, column, segment));
|
|
41
|
+
}
|
|
42
|
+
export function extractTableCellSelectionRegions(lines, getTableIdentity) {
|
|
43
|
+
if (!lines.some((line) => line.includes(TABLE_MARKER_PREFIX))) {
|
|
44
|
+
return { lines, regions: [] };
|
|
45
|
+
}
|
|
46
|
+
const cleanLines = [];
|
|
47
|
+
const regions = [];
|
|
48
|
+
const cellContents = new Map();
|
|
49
|
+
const tableBounds = new Map();
|
|
50
|
+
let table = null;
|
|
51
|
+
let tableIndex = 0;
|
|
52
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
53
|
+
const source = lines[lineIndex];
|
|
54
|
+
if (!source.includes(TABLE_MARKER_PREFIX)) {
|
|
55
|
+
cleanLines.push(source);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
let clean = "";
|
|
59
|
+
let activeCell = null;
|
|
60
|
+
let offset = 0;
|
|
61
|
+
const extractAnsi = createAnsiCodeExtractor(source);
|
|
62
|
+
while (offset < source.length) {
|
|
63
|
+
const ansi = extractAnsi(offset);
|
|
64
|
+
if (!ansi) {
|
|
65
|
+
clean += source[offset];
|
|
66
|
+
offset++;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (ansi.code === TABLE_START_MARKER) {
|
|
70
|
+
table = getTableIdentity(tableIndex++);
|
|
71
|
+
const col = visibleWidth(clean);
|
|
72
|
+
tableBounds.set(table, { top: lineIndex, bottom: lineIndex, left: col, right: col });
|
|
73
|
+
}
|
|
74
|
+
else if (ansi.code === TABLE_END_MARKER) {
|
|
75
|
+
if (table) {
|
|
76
|
+
const bounds = tableBounds.get(table);
|
|
77
|
+
if (bounds) {
|
|
78
|
+
bounds.bottom = lineIndex;
|
|
79
|
+
bounds.right = visibleWidth(clean);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
table = null;
|
|
83
|
+
activeCell = null;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const marker = parseCellMarker(ansi.code);
|
|
87
|
+
if (marker?.kind === "cell-start") {
|
|
88
|
+
activeCell = { ...marker, col: visibleWidth(clean) };
|
|
89
|
+
if (table && marker.content !== undefined) {
|
|
90
|
+
let tableContents = cellContents.get(table);
|
|
91
|
+
if (!tableContents) {
|
|
92
|
+
tableContents = new Map();
|
|
93
|
+
cellContents.set(table, tableContents);
|
|
94
|
+
}
|
|
95
|
+
tableContents.set(`${marker.row}:${marker.column}`, marker.content);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (marker?.kind === "cell-end" && table && activeCell) {
|
|
99
|
+
const width = visibleWidth(clean) - activeCell.col;
|
|
100
|
+
if (width > 0 &&
|
|
101
|
+
marker.row === activeCell.row &&
|
|
102
|
+
marker.column === activeCell.column &&
|
|
103
|
+
marker.segment === activeCell.segment) {
|
|
104
|
+
regions.push({
|
|
105
|
+
line: lineIndex,
|
|
106
|
+
col: activeCell.col,
|
|
107
|
+
width,
|
|
108
|
+
table,
|
|
109
|
+
tableTop: 0,
|
|
110
|
+
tableBottom: 0,
|
|
111
|
+
tableLeft: 0,
|
|
112
|
+
tableRight: 0,
|
|
113
|
+
row: marker.row,
|
|
114
|
+
column: marker.column,
|
|
115
|
+
segment: marker.segment,
|
|
116
|
+
content: "",
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
activeCell = null;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
clean += ansi.code;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
offset += ansi.length;
|
|
126
|
+
}
|
|
127
|
+
cleanLines.push(clean);
|
|
128
|
+
}
|
|
129
|
+
for (const region of regions) {
|
|
130
|
+
const bounds = tableBounds.get(region.table);
|
|
131
|
+
if (bounds) {
|
|
132
|
+
region.tableTop = bounds.top;
|
|
133
|
+
region.tableBottom = bounds.bottom;
|
|
134
|
+
region.tableLeft = bounds.left;
|
|
135
|
+
region.tableRight = bounds.right;
|
|
136
|
+
}
|
|
137
|
+
region.content = cellContents.get(region.table)?.get(`${region.row}:${region.column}`) ?? "";
|
|
138
|
+
}
|
|
139
|
+
return { lines: cleanLines, regions };
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=selection-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-metadata.js","sourceRoot":"","sources":["../src/selection-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAC7C,MAAM,kBAAkB,GAAG,GAAG,mBAAmB,WAAW,CAAC;AAC7D,MAAM,gBAAgB,GAAG,GAAG,mBAAmB,SAAS,CAAC;AAgCzD,SAAS,UAAU,CAAC,IAAwB,EAAE,GAAW,EAAE,MAAc,EAAE,OAAe,EAAE,OAAgB,EAAU;IACrH,MAAM,cAAc,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;IACtF,OAAO,GAAG,mBAAmB,GAAG,IAAI,IAAI,GAAG,IAAI,MAAM,IAAI,OAAO,GAAG,cAAc,MAAM,CAAC;AAAA,CACxF;AAED,SAAS,eAAe,CAAC,IAAY,EAAqB;IACzD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,mBAA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,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC;YAC7B,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;YACnC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC;YAC/B,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;QAClC,CAAC;QACD,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;IAC9F,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAAA,CACtC","sourcesContent":["import { createAnsiCodeExtractor, visibleWidth } from \"./utils.js\";\n\nconst TABLE_MARKER_PREFIX = \"\\x1b_pi:table:\";\nconst TABLE_START_MARKER = `${TABLE_MARKER_PREFIX}start\\x07`;\nconst TABLE_END_MARKER = `${TABLE_MARKER_PREFIX}end\\x07`;\n\nexport interface TableCellSelectionRegion {\n\tline: number;\n\tcol: number;\n\twidth: number;\n\ttable: object;\n\ttableTop: number;\n\ttableBottom: number;\n\ttableLeft: number;\n\ttableRight: number;\n\trow: number;\n\tcolumn: number;\n\tsegment: number;\n\tcontent: string;\n}\n\ninterface CellMarker {\n\tkind: \"cell-start\" | \"cell-end\";\n\trow: number;\n\tcolumn: number;\n\tsegment: number;\n\tcontent?: string;\n}\n\ninterface TableBounds {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n}\n\nfunction cellMarker(kind: CellMarker[\"kind\"], row: number, column: number, segment: number, content?: string): string {\n\tconst encodedContent = content === undefined ? \"\" : `:${encodeURIComponent(content)}`;\n\treturn `${TABLE_MARKER_PREFIX}${kind}:${row}:${column}:${segment}${encodedContent}\\x07`;\n}\n\nfunction parseCellMarker(code: string): CellMarker | null {\n\tif (!code.startsWith(TABLE_MARKER_PREFIX) || !code.endsWith(\"\\x07\")) return null;\n\tconst [kind, rowText, columnText, segmentText, encodedContent] = code\n\t\t.slice(TABLE_MARKER_PREFIX.length, -1)\n\t\t.split(\":\");\n\tif (kind !== \"cell-start\" && kind !== \"cell-end\") return null;\n\tconst row = Number(rowText);\n\tconst column = Number(columnText);\n\tconst segment = Number(segmentText);\n\tif (![row, column, segment].every(Number.isInteger)) return null;\n\treturn {\n\t\tkind,\n\t\trow,\n\t\tcolumn,\n\t\tsegment,\n\t\tcontent: encodedContent === undefined ? undefined : decodeURIComponent(encodedContent),\n\t};\n}\n\nexport function markTableStart(line: string): string {\n\treturn TABLE_START_MARKER + line;\n}\n\nexport function markTableEnd(line: string): string {\n\treturn line + TABLE_END_MARKER;\n}\n\nexport function markTableCell(text: string, row: number, column: number, segment: number, content: string): string {\n\tconst markerContent = segment === 0 ? content : undefined;\n\treturn (\n\t\tcellMarker(\"cell-start\", row, column, segment, markerContent) +\n\t\ttext +\n\t\tcellMarker(\"cell-end\", row, column, segment)\n\t);\n}\n\nexport function extractTableCellSelectionRegions(\n\tlines: string[],\n\tgetTableIdentity: (index: number) => object,\n): { lines: string[]; regions: TableCellSelectionRegion[] } {\n\tif (!lines.some((line) => line.includes(TABLE_MARKER_PREFIX))) {\n\t\treturn { lines, regions: [] };\n\t}\n\n\tconst cleanLines: string[] = [];\n\tconst regions: TableCellSelectionRegion[] = [];\n\tconst cellContents = new Map<object, Map<string, string>>();\n\tconst tableBounds = new Map<object, TableBounds>();\n\tlet table: object | null = null;\n\tlet tableIndex = 0;\n\n\tfor (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n\t\tconst source = lines[lineIndex];\n\t\tif (!source.includes(TABLE_MARKER_PREFIX)) {\n\t\t\tcleanLines.push(source);\n\t\t\tcontinue;\n\t\t}\n\t\tlet clean = \"\";\n\t\tlet activeCell: (CellMarker & { col: number }) | null = null;\n\t\tlet offset = 0;\n\t\tconst extractAnsi = createAnsiCodeExtractor(source);\n\n\t\twhile (offset < source.length) {\n\t\t\tconst ansi = extractAnsi(offset);\n\t\t\tif (!ansi) {\n\t\t\t\tclean += source[offset];\n\t\t\t\toffset++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (ansi.code === TABLE_START_MARKER) {\n\t\t\t\ttable = getTableIdentity(tableIndex++);\n\t\t\t\tconst col = visibleWidth(clean);\n\t\t\t\ttableBounds.set(table, { top: lineIndex, bottom: lineIndex, left: col, right: col });\n\t\t\t} else if (ansi.code === TABLE_END_MARKER) {\n\t\t\t\tif (table) {\n\t\t\t\t\tconst bounds = tableBounds.get(table);\n\t\t\t\t\tif (bounds) {\n\t\t\t\t\t\tbounds.bottom = lineIndex;\n\t\t\t\t\t\tbounds.right = visibleWidth(clean);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttable = null;\n\t\t\t\tactiveCell = null;\n\t\t\t} else {\n\t\t\t\tconst marker = parseCellMarker(ansi.code);\n\t\t\t\tif (marker?.kind === \"cell-start\") {\n\t\t\t\t\tactiveCell = { ...marker, col: visibleWidth(clean) };\n\t\t\t\t\tif (table && marker.content !== undefined) {\n\t\t\t\t\t\tlet tableContents = cellContents.get(table);\n\t\t\t\t\t\tif (!tableContents) {\n\t\t\t\t\t\t\ttableContents = new Map();\n\t\t\t\t\t\t\tcellContents.set(table, tableContents);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttableContents.set(`${marker.row}:${marker.column}`, marker.content);\n\t\t\t\t\t}\n\t\t\t\t} else if (marker?.kind === \"cell-end\" && table && activeCell) {\n\t\t\t\t\tconst width = visibleWidth(clean) - activeCell.col;\n\t\t\t\t\tif (\n\t\t\t\t\t\twidth > 0 &&\n\t\t\t\t\t\tmarker.row === activeCell.row &&\n\t\t\t\t\t\tmarker.column === activeCell.column &&\n\t\t\t\t\t\tmarker.segment === activeCell.segment\n\t\t\t\t\t) {\n\t\t\t\t\t\tregions.push({\n\t\t\t\t\t\t\tline: lineIndex,\n\t\t\t\t\t\t\tcol: activeCell.col,\n\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\ttable,\n\t\t\t\t\t\t\ttableTop: 0,\n\t\t\t\t\t\t\ttableBottom: 0,\n\t\t\t\t\t\t\ttableLeft: 0,\n\t\t\t\t\t\t\ttableRight: 0,\n\t\t\t\t\t\t\trow: marker.row,\n\t\t\t\t\t\t\tcolumn: marker.column,\n\t\t\t\t\t\t\tsegment: marker.segment,\n\t\t\t\t\t\t\tcontent: \"\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tactiveCell = null;\n\t\t\t\t} else {\n\t\t\t\t\tclean += ansi.code;\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += ansi.length;\n\t\t}\n\t\tcleanLines.push(clean);\n\t}\n\tfor (const region of regions) {\n\t\tconst bounds = tableBounds.get(region.table);\n\t\tif (bounds) {\n\t\t\tregion.tableTop = bounds.top;\n\t\t\tregion.tableBottom = bounds.bottom;\n\t\t\tregion.tableLeft = bounds.left;\n\t\t\tregion.tableRight = bounds.right;\n\t\t}\n\t\tregion.content = cellContents.get(region.table)?.get(`${region.row}:${region.column}`) ?? \"\";\n\t}\n\n\treturn { lines: cleanLines, regions };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SlashCommandContext = {
|
|
2
|
+
kind: "name";
|
|
3
|
+
prefix: string;
|
|
4
|
+
isAtPromptStart: boolean;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "argument";
|
|
7
|
+
commandName: string;
|
|
8
|
+
prefix: string;
|
|
9
|
+
isAtPromptStart: true;
|
|
10
|
+
};
|
|
11
|
+
export declare function getSlashCommandContext(lines: string[], cursorLine: number, cursorCol: number): SlashCommandContext | null;
|
|
12
|
+
//# sourceMappingURL=slash-command-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-command-context.d.ts","sourceRoot":"","sources":["../src/slash-command-context.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,IAAI,CAAA;CAAE,CAAC;AAEpF,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GACf,mBAAmB,GAAG,IAAI,CAqC5B","sourcesContent":["export type SlashCommandContext =\n\t| { kind: \"name\"; prefix: string; isAtPromptStart: boolean }\n\t| { kind: \"argument\"; commandName: string; prefix: string; isAtPromptStart: true };\n\nexport function getSlashCommandContext(\n\tlines: string[],\n\tcursorLine: number,\n\tcursorCol: number,\n): SlashCommandContext | null {\n\tconst currentLine = lines[cursorLine] ?? \"\";\n\tconst textBeforeCursor = currentLine.slice(0, cursorCol);\n\tconst trimmedStart = textBeforeCursor.trimStart();\n\n\tif (cursorLine === 0 && trimmedStart.startsWith(\"/\")) {\n\t\tconst separatorIndex = trimmedStart.search(/[ \\t]/);\n\t\tconst commandToken = separatorIndex === -1 ? trimmedStart : trimmedStart.slice(0, separatorIndex);\n\n\t\tif (commandToken.slice(1).includes(\"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (separatorIndex === -1) {\n\t\t\treturn { kind: \"name\", prefix: commandToken, isAtPromptStart: true };\n\t\t}\n\n\t\tconst commandName = commandToken.slice(1);\n\t\tif (!commandName) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tkind: \"argument\",\n\t\t\tcommandName,\n\t\t\tprefix: trimmedStart.slice(separatorIndex + 1),\n\t\t\tisAtPromptStart: true,\n\t\t};\n\t}\n\n\tconst tokenStart = Math.max(textBeforeCursor.lastIndexOf(\" \"), textBeforeCursor.lastIndexOf(\"\\t\")) + 1;\n\tconst prefix = textBeforeCursor.slice(tokenStart);\n\tif (!prefix.startsWith(\"/\") || prefix.slice(1).includes(\"/\")) {\n\t\treturn null;\n\t}\n\n\treturn { kind: \"name\", prefix, isAtPromptStart: false };\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function getSlashCommandContext(lines, cursorLine, cursorCol) {
|
|
2
|
+
const currentLine = lines[cursorLine] ?? "";
|
|
3
|
+
const textBeforeCursor = currentLine.slice(0, cursorCol);
|
|
4
|
+
const trimmedStart = textBeforeCursor.trimStart();
|
|
5
|
+
if (cursorLine === 0 && trimmedStart.startsWith("/")) {
|
|
6
|
+
const separatorIndex = trimmedStart.search(/[ \t]/);
|
|
7
|
+
const commandToken = separatorIndex === -1 ? trimmedStart : trimmedStart.slice(0, separatorIndex);
|
|
8
|
+
if (commandToken.slice(1).includes("/")) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (separatorIndex === -1) {
|
|
12
|
+
return { kind: "name", prefix: commandToken, isAtPromptStart: true };
|
|
13
|
+
}
|
|
14
|
+
const commandName = commandToken.slice(1);
|
|
15
|
+
if (!commandName) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
kind: "argument",
|
|
20
|
+
commandName,
|
|
21
|
+
prefix: trimmedStart.slice(separatorIndex + 1),
|
|
22
|
+
isAtPromptStart: true,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const tokenStart = Math.max(textBeforeCursor.lastIndexOf(" "), textBeforeCursor.lastIndexOf("\t")) + 1;
|
|
26
|
+
const prefix = textBeforeCursor.slice(tokenStart);
|
|
27
|
+
if (!prefix.startsWith("/") || prefix.slice(1).includes("/")) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return { kind: "name", prefix, isAtPromptStart: false };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=slash-command-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-command-context.js","sourceRoot":"","sources":["../src/slash-command-context.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,sBAAsB,CACrC,KAAe,EACf,UAAkB,EAClB,SAAiB,EACY;IAC7B,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAC5C,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;IAElD,IAAI,UAAU,KAAK,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtD,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAElG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAC;QACb,CAAC;QAED,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;YAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;QACtE,CAAC;QAED,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO;YACN,IAAI,EAAE,UAAU;YAChB,WAAW;YACX,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC;YAC9C,eAAe,EAAE,IAAI;SACrB,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvG,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AAAA,CACxD","sourcesContent":["export type SlashCommandContext =\n\t| { kind: \"name\"; prefix: string; isAtPromptStart: boolean }\n\t| { kind: \"argument\"; commandName: string; prefix: string; isAtPromptStart: true };\n\nexport function getSlashCommandContext(\n\tlines: string[],\n\tcursorLine: number,\n\tcursorCol: number,\n): SlashCommandContext | null {\n\tconst currentLine = lines[cursorLine] ?? \"\";\n\tconst textBeforeCursor = currentLine.slice(0, cursorCol);\n\tconst trimmedStart = textBeforeCursor.trimStart();\n\n\tif (cursorLine === 0 && trimmedStart.startsWith(\"/\")) {\n\t\tconst separatorIndex = trimmedStart.search(/[ \\t]/);\n\t\tconst commandToken = separatorIndex === -1 ? trimmedStart : trimmedStart.slice(0, separatorIndex);\n\n\t\tif (commandToken.slice(1).includes(\"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (separatorIndex === -1) {\n\t\t\treturn { kind: \"name\", prefix: commandToken, isAtPromptStart: true };\n\t\t}\n\n\t\tconst commandName = commandToken.slice(1);\n\t\tif (!commandName) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\tkind: \"argument\",\n\t\t\tcommandName,\n\t\t\tprefix: trimmedStart.slice(separatorIndex + 1),\n\t\t\tisAtPromptStart: true,\n\t\t};\n\t}\n\n\tconst tokenStart = Math.max(textBeforeCursor.lastIndexOf(\" \"), textBeforeCursor.lastIndexOf(\"\\t\")) + 1;\n\tconst prefix = textBeforeCursor.slice(tokenStart);\n\tif (!prefix.startsWith(\"/\") || prefix.slice(1).includes(\"/\")) {\n\t\treturn null;\n\t}\n\n\treturn { kind: \"name\", prefix, isAtPromptStart: false };\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StdinBuffer buffers input and emits complete sequences.
|
|
3
|
+
*
|
|
4
|
+
* This is necessary because stdin data events can arrive in partial chunks,
|
|
5
|
+
* especially for escape sequences like mouse events. Without buffering,
|
|
6
|
+
* partial sequences can be misinterpreted as regular keypresses.
|
|
7
|
+
*
|
|
8
|
+
* For example, the mouse SGR sequence `\x1b[<35;20;5m` might arrive as:
|
|
9
|
+
* - Event 1: `\x1b`
|
|
10
|
+
* - Event 2: `[<35`
|
|
11
|
+
* - Event 3: `;20;5m`
|
|
12
|
+
*
|
|
13
|
+
* The buffer accumulates these until a complete sequence is detected.
|
|
14
|
+
* Call the `process()` method to feed input data.
|
|
15
|
+
*
|
|
16
|
+
* Based on code from OpenTUI (https://github.com/anomalyco/opentui)
|
|
17
|
+
* MIT License - Copyright (c) 2025 opentui
|
|
18
|
+
*/
|
|
19
|
+
import { EventEmitter } from "events";
|
|
20
|
+
export type StdinBufferOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* Maximum time to wait for sequence completion (default: 10ms)
|
|
23
|
+
* After this time, the buffer is flushed even if incomplete
|
|
24
|
+
*/
|
|
25
|
+
timeout?: number;
|
|
26
|
+
};
|
|
27
|
+
export type StdinBufferEventMap = {
|
|
28
|
+
data: [string];
|
|
29
|
+
paste: [string];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Buffers stdin input and emits complete sequences via the 'data' event.
|
|
33
|
+
* Handles partial escape sequences that arrive across multiple chunks.
|
|
34
|
+
*/
|
|
35
|
+
export declare class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
36
|
+
private buffer;
|
|
37
|
+
private timeout;
|
|
38
|
+
private readonly timeoutMs;
|
|
39
|
+
private pasteMode;
|
|
40
|
+
private pasteBuffer;
|
|
41
|
+
private pendingKittyPrintableCodepoint;
|
|
42
|
+
constructor(options?: StdinBufferOptions);
|
|
43
|
+
process(data: string | Buffer): void;
|
|
44
|
+
private emitDataSequence;
|
|
45
|
+
flush(): string[];
|
|
46
|
+
clear(): void;
|
|
47
|
+
getBuffer(): string;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=stdin-buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin-buffer.d.ts","sourceRoot":"","sources":["../src/stdin-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AA6LtC,MAAM,MAAM,kBAAkB,GAAG;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACf,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IACjE,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,8BAA8B,CAAqB;IAE3D,YAAY,OAAO,GAAE,kBAAuB,EAG3C;IAEM,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmG1C;IAED,OAAO,CAAC,gBAAgB;IAWxB,KAAK,IAAI,MAAM,EAAE,CAchB;IAED,KAAK,IAAI,IAAI,CASZ;IAED,SAAS,IAAI,MAAM,CAElB;IAED,OAAO,IAAI,IAAI,CAEd;CACD","sourcesContent":["/**\n * StdinBuffer buffers input and emits complete sequences.\n *\n * This is necessary because stdin data events can arrive in partial chunks,\n * especially for escape sequences like mouse events. Without buffering,\n * partial sequences can be misinterpreted as regular keypresses.\n *\n * For example, the mouse SGR sequence `\\x1b[<35;20;5m` might arrive as:\n * - Event 1: `\\x1b`\n * - Event 2: `[<35`\n * - Event 3: `;20;5m`\n *\n * The buffer accumulates these until a complete sequence is detected.\n * Call the `process()` method to feed input data.\n *\n * Based on code from OpenTUI (https://github.com/anomalyco/opentui)\n * MIT License - Copyright (c) 2025 opentui\n */\n\nimport { EventEmitter } from \"events\";\n\nconst ESC = \"\\x1b\";\nconst BRACKETED_PASTE_START = \"\\x1b[200~\";\nconst BRACKETED_PASTE_END = \"\\x1b[201~\";\n\n/**\n * Check if a string is a complete escape sequence or needs more data\n */\nfunction isCompleteSequence(data: string): \"complete\" | \"incomplete\" | \"not-escape\" {\n\tif (!data.startsWith(ESC)) {\n\t\treturn \"not-escape\";\n\t}\n\n\tif (data.length === 1) {\n\t\treturn \"incomplete\";\n\t}\n\n\tconst afterEsc = data.slice(1);\n\n\tif (afterEsc.startsWith(\"[\")) {\n\t\tif (afterEsc.startsWith(\"[M\")) {\n\t\t\treturn data.length >= 6 ? \"complete\" : \"incomplete\";\n\t\t}\n\t\treturn isCompleteCsiSequence(data);\n\t}\n\n\tif (afterEsc.startsWith(\"]\")) {\n\t\treturn isCompleteOscSequence(data);\n\t}\n\n\tif (afterEsc.startsWith(\"P\")) {\n\t\treturn isCompleteDcsSequence(data);\n\t}\n\n\tif (afterEsc.startsWith(\"_\")) {\n\t\treturn isCompleteApcSequence(data);\n\t}\n\n\tif (afterEsc.startsWith(\"O\")) {\n\t\treturn afterEsc.length >= 2 ? \"complete\" : \"incomplete\";\n\t}\n\n\tif (afterEsc.length === 1) {\n\t\treturn \"complete\";\n\t}\n\n\treturn \"complete\";\n}\n\n/**\n * Check if CSI sequence is complete\n * CSI sequences: ESC [ ... followed by a final byte (0x40-0x7E)\n */\nfunction isCompleteCsiSequence(data: string): \"complete\" | \"incomplete\" {\n\tif (!data.startsWith(`${ESC}[`)) {\n\t\treturn \"complete\";\n\t}\n\n\tif (data.length < 3) {\n\t\treturn \"incomplete\";\n\t}\n\n\tconst payload = data.slice(2);\n\n\tconst lastChar = payload[payload.length - 1];\n\tconst lastCharCode = lastChar.charCodeAt(0);\n\n\tif (lastCharCode >= 0x40 && lastCharCode <= 0x7e) {\n\t\tif (payload.startsWith(\"<\")) {\n\t\t\tconst mouseMatch = /^<\\d+;\\d+;\\d+[Mm]$/.test(payload);\n\t\t\tif (mouseMatch) {\n\t\t\t\treturn \"complete\";\n\t\t\t}\n\t\t\tif (lastChar === \"M\" || lastChar === \"m\") {\n\t\t\t\tconst parts = payload.slice(1, -1).split(\";\");\n\t\t\t\tif (parts.length === 3 && parts.every((p) => /^\\d+$/.test(p))) {\n\t\t\t\t\treturn \"complete\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn \"incomplete\";\n\t\t}\n\n\t\treturn \"complete\";\n\t}\n\n\treturn \"incomplete\";\n}\n\n/**\n * Check if OSC sequence is complete\n * OSC sequences: ESC ] ... ST (where ST is ESC \\ or BEL)\n */\nfunction isCompleteOscSequence(data: string): \"complete\" | \"incomplete\" {\n\tif (!data.startsWith(`${ESC}]`)) {\n\t\treturn \"complete\";\n\t}\n\n\tif (data.endsWith(`${ESC}\\\\`) || data.endsWith(\"\\x07\")) {\n\t\treturn \"complete\";\n\t}\n\n\treturn \"incomplete\";\n}\n\n/**\n * Check if DCS (Device Control String) sequence is complete\n * DCS sequences: ESC P ... ST (where ST is ESC \\)\n * Used for XTVersion responses like ESC P >| ... ESC \\\n */\nfunction isCompleteDcsSequence(data: string): \"complete\" | \"incomplete\" {\n\tif (!data.startsWith(`${ESC}P`)) {\n\t\treturn \"complete\";\n\t}\n\n\tif (data.endsWith(`${ESC}\\\\`)) {\n\t\treturn \"complete\";\n\t}\n\n\treturn \"incomplete\";\n}\n\n/**\n * Check if APC (Application Program Command) sequence is complete\n * APC sequences: ESC _ ... ST (where ST is ESC \\)\n * Used for Kitty graphics responses like ESC _ G ... ESC \\\n */\nfunction isCompleteApcSequence(data: string): \"complete\" | \"incomplete\" {\n\tif (!data.startsWith(`${ESC}_`)) {\n\t\treturn \"complete\";\n\t}\n\n\tif (data.endsWith(`${ESC}\\\\`)) {\n\t\treturn \"complete\";\n\t}\n\n\treturn \"incomplete\";\n}\n\n/**\n * Split accumulated buffer into complete sequences\n */\nfunction parseUnmodifiedKittyPrintableCodepoint(sequence: string): number | undefined {\n\tconst match = sequence.match(/^\\x1b\\[(\\d+)(?::\\d*)?(?::\\d+)?u$/);\n\tif (!match) return undefined;\n\n\tconst codepoint = parseInt(match[1]!, 10);\n\treturn codepoint >= 32 ? codepoint : undefined;\n}\n\nfunction extractCompleteSequences(buffer: string): { sequences: string[]; remainder: string } {\n\tconst sequences: string[] = [];\n\tlet pos = 0;\n\n\twhile (pos < buffer.length) {\n\t\tconst remaining = buffer.slice(pos);\n\n\t\tif (remaining.startsWith(ESC)) {\n\t\t\tlet seqEnd = 1;\n\t\t\twhile (seqEnd <= remaining.length) {\n\t\t\t\tconst candidate = remaining.slice(0, seqEnd);\n\t\t\t\tconst status = isCompleteSequence(candidate);\n\n\t\t\t\tif (status === \"complete\") {\n\t\t\t\t\tsequences.push(candidate);\n\t\t\t\t\tpos += seqEnd;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (status === \"incomplete\") {\n\t\t\t\t\tseqEnd++;\n\t\t\t\t} else {\n\t\t\t\t\tsequences.push(candidate);\n\t\t\t\t\tpos += seqEnd;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (seqEnd > remaining.length) {\n\t\t\t\treturn { sequences, remainder: remaining };\n\t\t\t}\n\t\t} else {\n\t\t\tsequences.push(remaining[0]!);\n\t\t\tpos++;\n\t\t}\n\t}\n\n\treturn { sequences, remainder: \"\" };\n}\n\nexport type StdinBufferOptions = {\n\t/**\n\t * Maximum time to wait for sequence completion (default: 10ms)\n\t * After this time, the buffer is flushed even if incomplete\n\t */\n\ttimeout?: number;\n};\n\nexport type StdinBufferEventMap = {\n\tdata: [string];\n\tpaste: [string];\n};\n\n/**\n * Buffers stdin input and emits complete sequences via the 'data' event.\n * Handles partial escape sequences that arrive across multiple chunks.\n */\nexport class StdinBuffer extends EventEmitter<StdinBufferEventMap> {\n\tprivate buffer: string = \"\";\n\tprivate timeout: ReturnType<typeof setTimeout> | null = null;\n\tprivate readonly timeoutMs: number;\n\tprivate pasteMode: boolean = false;\n\tprivate pasteBuffer: string = \"\";\n\tprivate pendingKittyPrintableCodepoint: number | undefined;\n\n\tconstructor(options: StdinBufferOptions = {}) {\n\t\tsuper();\n\t\tthis.timeoutMs = options.timeout ?? 10;\n\t}\n\n\tpublic process(data: string | Buffer): void {\n\t\tif (this.timeout) {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = null;\n\t\t}\n\n\t\t// Handle high-byte conversion (for compatibility with parseKeypress)\n\t\t// If buffer has single byte > 127, convert to ESC + (byte - 128)\n\t\tlet str: string;\n\t\tif (Buffer.isBuffer(data)) {\n\t\t\tif (data.length === 1 && data[0]! > 127) {\n\t\t\t\tconst byte = data[0]! - 128;\n\t\t\t\tstr = `\\x1b${String.fromCharCode(byte)}`;\n\t\t\t} else {\n\t\t\t\tstr = data.toString();\n\t\t\t}\n\t\t} else {\n\t\t\tstr = data;\n\t\t}\n\n\t\tif (str.length === 0 && this.buffer.length === 0) {\n\t\t\tthis.emitDataSequence(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis.buffer += str;\n\n\t\tif (this.pasteMode) {\n\t\t\tthis.pasteBuffer += this.buffer;\n\t\t\tthis.buffer = \"\";\n\n\t\t\tconst endIndex = this.pasteBuffer.indexOf(BRACKETED_PASTE_END);\n\t\t\tif (endIndex !== -1) {\n\t\t\t\tconst pastedContent = this.pasteBuffer.slice(0, endIndex);\n\t\t\t\tconst remaining = this.pasteBuffer.slice(endIndex + BRACKETED_PASTE_END.length);\n\n\t\t\t\tthis.pasteMode = false;\n\t\t\t\tthis.pasteBuffer = \"\";\n\t\t\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\n\t\t\t\tthis.emit(\"paste\", pastedContent);\n\n\t\t\t\tif (remaining.length > 0) {\n\t\t\t\t\tthis.process(remaining);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = this.buffer.indexOf(BRACKETED_PASTE_START);\n\t\tif (startIndex !== -1) {\n\t\t\tif (startIndex > 0) {\n\t\t\t\tconst beforePaste = this.buffer.slice(0, startIndex);\n\t\t\t\tconst result = extractCompleteSequences(beforePaste);\n\t\t\t\tfor (const sequence of result.sequences) {\n\t\t\t\t\tthis.emitDataSequence(sequence);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\t\t\tthis.buffer = this.buffer.slice(startIndex + BRACKETED_PASTE_START.length);\n\t\t\tthis.pasteMode = true;\n\t\t\tthis.pasteBuffer = this.buffer;\n\t\t\tthis.buffer = \"\";\n\n\t\t\tconst endIndex = this.pasteBuffer.indexOf(BRACKETED_PASTE_END);\n\t\t\tif (endIndex !== -1) {\n\t\t\t\tconst pastedContent = this.pasteBuffer.slice(0, endIndex);\n\t\t\t\tconst remaining = this.pasteBuffer.slice(endIndex + BRACKETED_PASTE_END.length);\n\n\t\t\t\tthis.pasteMode = false;\n\t\t\t\tthis.pasteBuffer = \"\";\n\t\t\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\n\t\t\t\tthis.emit(\"paste\", pastedContent);\n\n\t\t\t\tif (remaining.length > 0) {\n\t\t\t\t\tthis.process(remaining);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst result = extractCompleteSequences(this.buffer);\n\t\tthis.buffer = result.remainder;\n\n\t\tfor (const sequence of result.sequences) {\n\t\t\tthis.emitDataSequence(sequence);\n\t\t}\n\n\t\tif (this.buffer.length > 0) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tconst flushed = this.flush();\n\n\t\t\t\tfor (const sequence of flushed) {\n\t\t\t\t\tthis.emitDataSequence(sequence);\n\t\t\t\t}\n\t\t\t}, this.timeoutMs);\n\t\t}\n\t}\n\n\tprivate emitDataSequence(sequence: string): void {\n\t\tconst rawCodepoint = sequence.length === 1 ? sequence.codePointAt(0) : undefined;\n\t\tif (rawCodepoint !== undefined && rawCodepoint === this.pendingKittyPrintableCodepoint) {\n\t\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pendingKittyPrintableCodepoint = parseUnmodifiedKittyPrintableCodepoint(sequence);\n\t\tthis.emit(\"data\", sequence);\n\t}\n\n\tflush(): string[] {\n\t\tif (this.timeout) {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = null;\n\t\t}\n\n\t\tif (this.buffer.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst sequences = [this.buffer];\n\t\tthis.buffer = \"\";\n\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\t\treturn sequences;\n\t}\n\n\tclear(): void {\n\t\tif (this.timeout) {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = null;\n\t\t}\n\t\tthis.buffer = \"\";\n\t\tthis.pasteMode = false;\n\t\tthis.pasteBuffer = \"\";\n\t\tthis.pendingKittyPrintableCodepoint = undefined;\n\t}\n\n\tgetBuffer(): string {\n\t\treturn this.buffer;\n\t}\n\n\tdestroy(): void {\n\t\tthis.clear();\n\t}\n}\n"]}
|