dispach 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -18
- package/dist/App-5a35bjkt.js +11 -0
- package/dist/{App-dxqm39zx.js.map → App-5a35bjkt.js.map} +1 -1
- package/dist/{ConfigEditor-7v5nebvy.js → ConfigEditor-7nnc2ke6.js} +4 -4
- package/dist/{ConfigEditor-7v5nebvy.js.map → ConfigEditor-7nnc2ke6.js.map} +1 -1
- package/dist/{KeyProbe-vjhmdpx6.js → KeyProbe-kbz0j6sm.js} +3 -3
- package/dist/{KeyProbe-vjhmdpx6.js.map → KeyProbe-kbz0j6sm.js.map} +1 -1
- package/dist/{Picker-jxaesaxy.js → Picker-2zjjt17a.js} +3 -3
- package/dist/{Picker-jxaesaxy.js.map → Picker-2zjjt17a.js.map} +1 -1
- package/dist/{SessionPicker-z2t0p4b5.js → SessionPicker-fyyvxy40.js} +3 -3
- package/dist/{SessionPicker-z2t0p4b5.js.map → SessionPicker-fyyvxy40.js.map} +1 -1
- package/dist/{SkillBrowser-yyf2gy0q.js → SkillBrowser-x7r51zy0.js} +3 -3
- package/dist/{SkillBrowser-yyf2gy0q.js.map → SkillBrowser-x7r51zy0.js.map} +1 -1
- package/dist/WizardApp-v0dghsyw.js +5 -0
- package/dist/{WizardApp-12ndxgqv.js.map → WizardApp-v0dghsyw.js.map} +1 -1
- package/dist/client.js +8 -8
- package/dist/client.js.map +3 -3
- package/dist/{config-yz0nz51b.js → config-9cv76yrk.js} +13 -13
- package/dist/{config-yz0nz51b.js.map → config-9cv76yrk.js.map} +1 -1
- package/dist/{credential-wgt4gvcz.js → credential-yxqj8x1f.js} +5 -5
- package/dist/{credential-wgt4gvcz.js.map → credential-yxqj8x1f.js.map} +1 -1
- package/dist/{index-7da4fqcr.js → index-000rxxy3.js} +5 -5
- package/dist/{index-7da4fqcr.js.map → index-000rxxy3.js.map} +1 -1
- package/dist/{index-9f9pp2ef.js → index-0b1hdwnm.js} +4 -4
- package/dist/{index-9f9pp2ef.js.map → index-0b1hdwnm.js.map} +1 -1
- package/dist/{index-9nsfs0vy.js → index-17an0jqq.js} +4 -4
- package/dist/{index-9nsfs0vy.js.map → index-17an0jqq.js.map} +1 -1
- package/dist/index-2wmsmcbr.js +6 -0
- package/dist/{index-my5cjx00.js.map → index-2wmsmcbr.js.map} +1 -1
- package/dist/{index-9d011p3q.js → index-3g3ny01d.js} +4 -4
- package/dist/{index-9d011p3q.js.map → index-3g3ny01d.js.map} +1 -1
- package/dist/{index-8bmhd2hj.js → index-4cf6v9nb.js} +4 -4
- package/dist/{index-8bmhd2hj.js.map → index-4cf6v9nb.js.map} +1 -1
- package/dist/{index-bwckzbf8.js → index-4z7axw4r.js} +4 -4
- package/dist/{index-bwckzbf8.js.map → index-4z7axw4r.js.map} +1 -1
- package/dist/{index-b5wwtxzk.js → index-5t6wahx8.js} +28 -28
- package/dist/{index-b5wwtxzk.js.map → index-5t6wahx8.js.map} +5 -5
- package/dist/{index-6b7qvh1x.js → index-5x4dn0gg.js} +4 -4
- package/dist/{index-6b7qvh1x.js.map → index-5x4dn0gg.js.map} +1 -1
- package/dist/index-73jfw4jp.js +6 -0
- package/dist/{index-jym27m75.js.map → index-73jfw4jp.js.map} +1 -1
- package/dist/{index-2cvtz0fy.js → index-7z4sw2dm.js} +228 -228
- package/dist/{index-2cvtz0fy.js.map → index-7z4sw2dm.js.map} +4 -4
- package/dist/{index-gbnc99j8.js → index-83bqtze0.js} +9 -9
- package/dist/{index-gbnc99j8.js.map → index-83bqtze0.js.map} +1 -1
- package/dist/index-9bkd0fdj.js +427 -0
- package/dist/{index-bry9bzt3.js.map → index-9bkd0fdj.js.map} +2 -2
- package/dist/{index-cx3vz7sf.js → index-9r0wyj6w.js} +4 -4
- package/dist/{index-cx3vz7sf.js.map → index-9r0wyj6w.js.map} +1 -1
- package/dist/index-a4xqgdrm.js +6 -0
- package/dist/{index-rqbtm761.js.map → index-a4xqgdrm.js.map} +1 -1
- package/dist/{index-j97vttdt.js → index-ammv5st7.js} +6 -6
- package/dist/{index-j97vttdt.js.map → index-ammv5st7.js.map} +1 -1
- package/dist/{index-qc2vrq9z.js → index-cqqb6gaq.js} +5 -5
- package/dist/{index-qc2vrq9z.js.map → index-cqqb6gaq.js.map} +1 -1
- package/dist/{index-jk0def33.js → index-d4x6yvqh.js} +4 -4
- package/dist/{index-jk0def33.js.map → index-d4x6yvqh.js.map} +1 -1
- package/dist/{index-fvhg0xyd.js → index-d69d6pkm.js} +79 -79
- package/dist/{index-fvhg0xyd.js.map → index-d69d6pkm.js.map} +1 -1
- package/dist/{index-rqzg861g.js → index-dwyr2kdm.js} +4 -4
- package/dist/{index-rqzg861g.js.map → index-dwyr2kdm.js.map} +1 -1
- package/dist/{index-6z0yr17z.js → index-e0j1jafd.js} +7 -7
- package/dist/{index-6z0yr17z.js.map → index-e0j1jafd.js.map} +1 -1
- package/dist/{index-xqyms08r.js → index-ez2mb28y.js} +4 -4
- package/dist/{index-xqyms08r.js.map → index-ez2mb28y.js.map} +1 -1
- package/dist/{index-e8n70sgj.js → index-fex44816.js} +4 -4
- package/dist/{index-e8n70sgj.js.map → index-fex44816.js.map} +1 -1
- package/dist/{index-t1xvacym.js → index-gme2egyq.js} +4 -4
- package/dist/{index-t1xvacym.js.map → index-gme2egyq.js.map} +1 -1
- package/dist/{index-mrtb5y08.js → index-gz9x25tz.js} +4 -4
- package/dist/{index-mrtb5y08.js.map → index-gz9x25tz.js.map} +1 -1
- package/dist/{index-mgdgx22q.js → index-j7gyr5nx.js} +6 -6
- package/dist/{index-mgdgx22q.js.map → index-j7gyr5nx.js.map} +1 -1
- package/dist/{index-xgqzk5cq.js → index-nvm5hwe4.js} +6 -6
- package/dist/{index-xgqzk5cq.js.map → index-nvm5hwe4.js.map} +1 -1
- package/dist/index-r3wwvqzb.js +77 -0
- package/dist/index-r3wwvqzb.js.map +12 -0
- package/dist/index-v8e92nfw.js +6 -0
- package/dist/{index-b8zwg8a3.js.map → index-v8e92nfw.js.map} +1 -1
- package/dist/{index-yr25dnf5.js → index-xf178c4m.js} +4 -4
- package/dist/{index-yr25dnf5.js.map → index-xf178c4m.js.map} +1 -1
- package/dist/index-zked16y4.js +7 -0
- package/dist/{index-h2yds678.js.map → index-zked16y4.js.map} +1 -1
- package/dist/{index-3nwfz9jq.js → index-zxh0ntgf.js} +10 -10
- package/dist/{index-3nwfz9jq.js.map → index-zxh0ntgf.js.map} +1 -1
- package/dist/index.js +202 -198
- package/dist/index.js.map +6 -6
- package/dist/lib/bootstrap.d.ts +13 -0
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-w7r68df1.js → web-x77y8w3v.js} +5 -5
- package/dist/{web-w7r68df1.js.map → web-x77y8w3v.js.map} +1 -1
- package/package.json +2 -2
- package/dist/App-dxqm39zx.js +0 -11
- package/dist/WizardApp-12ndxgqv.js +0 -5
- package/dist/index-9pj1ws0p.js +0 -77
- package/dist/index-9pj1ws0p.js.map +0 -12
- package/dist/index-b8zwg8a3.js +0 -6
- package/dist/index-bry9bzt3.js +0 -427
- package/dist/index-h2yds678.js +0 -7
- package/dist/index-jym27m75.js +0 -6
- package/dist/index-my5cjx00.js +0 -6
- package/dist/index-rqbtm761.js +0 -6
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * Breaking text into the rows a fixed-width window will draw.\n *\n * ## One wrapping, ours\n *\n * This module used to count rows the way a terminal does — divide the character count by the width — and\n * hand the text to Ink to wrap. Those are two different answers to one question, and the difference is not\n * academic: Ink breaks at spaces, so 240 characters at 80 columns is **four** rows to Ink and three to a\n * division. Every cap built on the division was therefore one row short of what appeared on screen, which\n * on the alternate buffer is a frame taller than the terminal.\n *\n * So the rule is that whoever owns a bounded window wraps the text itself and renders each row with\n * `wrap=\"truncate\"`. The count is then the count, by construction, and a frame test asserts it against a\n * real render rather than trusting the arithmetic.\n *\n * Tabs are expanded to spaces on the way through. A tab's width is the terminal's business and not ours,\n * so a row containing one cannot be measured — expanding it is the only way the number we counted is the\n * number drawn. It changes bytes, never meaning, which is the line decision 4.27 draws.\n */\n\nconst TAB_WIDTH = 8\nconst TAB = \" \".repeat(TAB_WIDTH)\n\nimport { cellWidths } from \"#lib/width\"\n\n/**\n * One drawn row, and which source characters it drew.\n *\n * The offsets exist because a row's text is **not** a slice of its line. Breaking at a space consumes\n * the space, a word longer than the window is cut, and a hanging indent is re-applied to rows that never\n * contained it — so \"which row is source offset 41 on, and at what column\" cannot be recovered from the\n * strings afterwards. Anything that draws a caret over wrapped text needs exactly that, and computing it\n * a second time from the finished rows is how a cursor ends up a column out on the lines that wrapped.\n */\nexport interface WrappedRow {\n /** Exactly what is painted, the re-applied indent included. */\n readonly text: string\n /** Columns of `text` that are indent. A caret never lands to the left of this. */\n readonly lead: number\n /** Source code-point offset of this row's first drawn character. */\n readonly from: number\n /** One past this row's last drawn character. A break at a space leaves a gap before the next `from`. */\n readonly to: number\n}\n\n/**\n * One logical line, broken at spaces to fit `columns`, with the source offsets kept.\n *\n * A word longer than the whole width is cut rather than allowed to overflow — a URL or a base64 blob is\n * the normal case for that, and there is nowhere better to break it. Returns one row for an empty line,\n * because a blank line in a reply is a blank row on screen and dropping it would close up paragraphs the\n * model deliberately separated.\n */\nexport function wrapRows(line: string, columns: number): readonly WrappedRow[] {\n // Tabs are expanded before anything is measured, so offsets are into the *expanded* line. A caller\n // placing a caret has to expand its own column the same way, which `expandColumn` is for.\n const flat = line.replaceAll(\"\\t\", TAB)\n const all = [...flat]\n // Widths per cell, computed once. Every measurement below is a sum over this rather than a count of\n // code points: an emoji is one code point and two columns, so counting made `\"👍\".repeat(10)` measure\n // ten and draw twenty. Offsets stay in code points, because that is what a caller slices with.\n const w = cellWidths(all)\n const span = (from: number, to: number): number => {\n let total = 0\n for (let at = from; at < to; at += 1) total += w[at] ?? 0\n return total\n }\n if (columns <= 0 || span(0, all.length) <= columns) {\n return [{ text: flat, lead: 0, from: 0, to: all.length }]\n }\n\n // Leading whitespace is structure, and splitting on spaces destroys it.\n //\n // Found live: `/help`'s output indents each entry by two spaces, and every line short enough to fit kept\n // them while every line that wrapped lost them — so one list came out at two different indents depending\n // on how long each summary happened to be. Held aside here and re-applied to every row, which also gives\n // a wrapped indented block a hanging indent rather than a ragged left edge.\n let indent = 0\n while (indent < all.length && (all[indent] === \" \" || all[indent] === \"\\u00a0\")) indent += 1\n if (indent > 0) {\n const body = all.slice(indent).join(\"\")\n // An indent as wide as the window is dropped rather than honoured: keeping it would leave no room\n // for the text, and shrinking the width to fit it recurses forever. The recursion terminates either\n // way, because `body` cannot begin with a space.\n if (indent >= columns) {\n return wrapRows(body, columns).map((row) => ({\n ...row,\n from: row.from + indent,\n to: row.to + indent,\n }))\n }\n const pad = \" \".repeat(indent)\n return wrapRows(body, columns - indent).map((row) => ({\n text: `${pad}${row.text}`,\n lead: row.lead + indent,\n from: row.from + indent,\n to: row.to + indent,\n }))\n }\n\n const rows: WrappedRow[] = []\n // `at` is where the pending row starts in the source; `width` is how much of it is drawn so far.\n let at = 0\n let width = 0\n const push = (to: number) => {\n rows.push({ text: all.slice(at, to).join(\"\"), lead: 0, from: at, to })\n }\n let cursor = 0\n while (cursor <= all.length) {\n // The next word, and the single space that introduced it. A run of spaces is not collapsed —\n // only the one space a break consumes is, which is what keeps the offsets honest.\n let end = cursor\n while (end < all.length && all[end] !== \" \") end += 1\n const word = span(cursor, end)\n\n if (word > columns) {\n // Longer than any row can hold. Flush what is pending, then cut it into full rows.\n if (width > 0) {\n push(cursor === at ? cursor : cursor - 1)\n at = cursor\n width = 0\n }\n let take = cursor\n while (span(take, end) > columns) {\n // Advance by *columns*, not by cells. A cut that would land inside a double-width\n // character stops before it, which is why the row can come out one column short: half an\n // emoji is not a thing a terminal can draw, and drawing it anyway is how a row overflows.\n let stop = take\n let filled = 0\n while (stop < end && filled + (w[stop] ?? 0) <= columns) {\n filled += w[stop] ?? 0\n stop += 1\n }\n // A single character wider than the whole window would otherwise loop forever taking\n // nothing. Emit it alone and overflow by one column, which is the only option left.\n if (stop === take) stop = take + 1\n at = take\n push(stop)\n take = stop\n at = take\n }\n at = take\n width = span(take, end)\n } else if (width > 0 && width + 1 + word > columns) {\n // Does not fit beside what is already on this row. The space before it is the break and is\n // drawn by neither row, which is why `to` and the next `from` are not the same number.\n push(cursor - 1)\n at = cursor\n width = word\n } else {\n width = width === 0 ? word : width + 1 + word\n }\n\n if (end >= all.length) break\n cursor = end + 1\n }\n push(all.length)\n return rows\n}\n\nfunction wrapLine(line: string, columns: number): readonly string[] {\n return wrapRows(line, columns).map((row) => row.text)\n}\n\n/** A code-point column in `line` translated into the tab-expanded coordinates `wrapRows` reports. */\nexport function expandColumn(line: string, column: number): number {\n let out = 0\n for (const [at, ch] of [...line].entries()) {\n if (at >= column) break\n out += ch === \"\\t\" ? TAB_WIDTH : 1\n }\n return out\n}\n\n/** Every row `text` occupies at `columns`, newlines respected and long lines broken. */\nexport function wrapText(text: string, columns: number): readonly string[] {\n return text.split(\"\\n\").flatMap((line) => wrapLine(line, columns))\n}\n\n/**\n * The live pane: the rows to draw, how tall that makes it, and how much was dropped.\n *\n * Height-capped on purpose. Ink erases and redraws its whole dynamic tree per frame, so an uncapped pane\n * means redrawing the entire reply on every token — a cost that grows with the length of the answer,\n * precisely when the terminal is busiest. The newest rows are the ones kept, because they are what the\n * reader is looking at, and nothing is lost: the finished reply joins the transcript at `turn.end`.\n *\n * All three numbers from one wrap, because they were computed separately and disagreed. The component\n * needs the rows and the dropped count; the chat frame needs the height to subtract from the terminal\n * *before* the pane renders. Deriving them apart meant the notice's own row was counted by one caller and\n * not the other, which is a layout one row taller than the screen.\n */\nexport interface LivePane {\n /** What to draw, newest last. Already wrapped, so each is one row. */\n readonly lines: readonly string[]\n /** Rows the pane occupies, the \"… n hidden\" notice included. Zero when there is nothing to show. */\n readonly rows: number\n /** Rows dropped off the top. Non-zero is exactly the condition for drawing the notice. */\n readonly hidden: number\n}\n\nexport function livePane(text: string, columns: number, maxRows: number): LivePane {\n if (text === \"\" || maxRows <= 0) return { lines: [], rows: 0, hidden: 0 }\n const all = wrapText(text, columns)\n if (all.length <= maxRows) return { lines: all, rows: all.length, hidden: 0 }\n // The extra row is the notice itself.\n return {\n lines: all.slice(all.length - maxRows),\n rows: maxRows + 1,\n hidden: all.length - maxRows,\n }\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";AA4BA,IAAM,EAA+C,CACjD,CAAC,KAAQ,IAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,CACrB,EAGM,EAA+C,CACjD,CAAC,IAAQ,GAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,C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CAAC,IAAQ,EAAI,IAAI,EAIjD,SAAS,EAAY,CAAC,EAAc,EAAwB,CAC/D,IAAI,EAAM,EACV,QAAY,EAAI,IAAO,CAAC,GAAG,CAAI,EAAE,QAAQ,EAAG,CACxC,GAAI,GAAM,EAAQ,MAClB,GAAO,IAAO,KArJJ,EAqJuB,EAErC,OAAO,EAIJ,SAAS,EAAQ,CAAC,EAAc,EAAoC,CACvE,OAAO,EAAK,MAAM;AAAA,CAAI,EAAE,QAAQ,CAAC,IAAS,EAAS,EAAM,CAAO,CAAC,EAyB9D,SAAS,EAAQ,CAAC,EAAc,EAAiB,EAA2B,CAC/E,GAAI,IAAS,IAAM,GAAW,EAAG,MAAO,CAAE,MAAO,CAAC,EAAG,KAAM,EAAG,OAAQ,CAAE,EACxE,IAAM,EAAM,GAAS,EAAM,CAAO,EAClC,GAAI,EAAI,QAAU,EAAS,MAAO,CAAE,MAAO,EAAK,KAAM,EAAI,OAAQ,OAAQ,CAAE,EAE5E,MAAO,CACH,MAAO,EAAI,MAAM,EAAI,OAAS,CAAO,EACrC,KAAM,EAAU,EAChB,OAAQ,EAAI,OAAS,CACzB",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "1C4BBE684410C70264756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var o={accent:"magenta",muted:"gray",success:"green",warning:"yellow",error:"red",info:"blue",emphasis:"cyan",selection:"blue",border:"gray",borderActive:"magenta",brand:"magenta"},
|
|
3
|
-
export{
|
|
2
|
+
var o={accent:"magenta",muted:"gray",success:"green",warning:"yellow",error:"red",info:"blue",emphasis:"cyan",selection:"blue",border:"gray",borderActive:"magenta",brand:"magenta"},qo={idle:o.success,thinking:o.warning,streaming:o.accent,working:o.info,cancelling:o.emphasis},Go={user:o.accent,assistant:void 0,reasoning:o.muted,note:o.muted,error:o.error,tool:o.info,banner:void 0},Zo={user:"› ",assistant:"",reasoning:" ",note:"· ",error:"✖ ",tool:" · ",banner:""},u={prompt:"› ",pointer:"❯ ",bullet:"· ",error:"✖ ",dot:"● ",check:"✓ ",ellipsis:"…",create:"+ ",checked:"◉ ",unchecked:"◯ "},Nr=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Vo=80,oe="round";function d(n){if(n<1000)return String(n);let e=n/1000;return e<10?`${e.toFixed(1)}k`:`${Math.round(e)}k`}function Yo(n,e,r){if(r)return"installed";let t=d(n);return e===0?t:`${t} · ${e} script${e===1?"":"s"}`}function S(n,e){if(e<=0)return"";let r=n.replace(/\s+/g," ").trim();if(r.length<=e)return r;if(e===1)return"…";return`${r.slice(0,e-1)}…`}function xn(n,e,r={}){let t=Math.max(18,Math.min(r.nameMax??34,e)),s=18,i=6;if(i+t+s>n)s=Math.max(6,n-i-t);if(i+t+s>n)t=Math.max(6,n-i-s);let a=n-(i+t+s+2);if(n<60||a<24)return{name:t,meta:s,description:0};return{name:t,meta:s,description:a}}function En(n,e){return{name:S(n.name,e.name).padEnd(e.name),meta:S(n.meta,e.meta).padEnd(e.meta),description:e.description===0?"":S(n.description,e.description)}}function Tn(n,e){let r=S(n,Math.max(0,e-8)),t=r.length+3;return`${r} ${"─".repeat(Math.max(0,Math.min(e,80)-t))}`}function I(n,e,r){if(n<=r)return{from:0,to:n};let t=Math.floor(r/2),s=Math.min(Math.max(0,e-t),n-r);return{from:s,to:s+r}}var Ko="\x1B[?1000h\x1B[?1002h\x1B[?1006h",Ho="\x1B[?1006l\x1B[?1002l\x1B[?1000l";var l=/(?:^|\u001B)\[<(\d+);(\d+);(\d+)([Mm])/g,m=/(?:^|\u001B)\[M[\s\S]{3}/g;function Wo(n){if(!n.includes("[<")&&!n.includes("[M"))return;let e=0,r=!1,t,s,i=!1;for(let a of n.matchAll(l)){r=!0;let c=Number(a[1]);if(c===64){e-=3;continue}if(c===65){e+=3;continue}t={column:Math.max(0,Number(a[2])-1),row:Math.max(0,Number(a[3])-1)},s=a[4]==="m"?"release":(c&32)!==0?"drag":"press",i=(c&4)!==0}for(let a of n.matchAll(m)){r=!0;let c=(a[0].codePointAt(a[0].length-3)??32)-32;if(c===64)e-=3;else if(c===65)e+=3}if(!r)return;return{rows:e,...t===void 0?{}:{at:t},...s===void 0?{}:{kind:s},...i?{shift:i}:{}}}
|
|
3
|
+
export{Ko,Ho,Wo,o,qo,Go,Zo,u,Nr,Vo,oe,Yo,S,xn,En,Tn,I};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=3279F5173B2AE91564756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-d4x6yvqh.js.map
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"/**\n * Wheel scrolling on the alternate screen. Pure, so a mouse report is arithmetic rather than a guess.\n *\n * ## Why this needs a guard rather than only a parser\n *\n * Ink does not know about mouse reports. Measured against a real pty with tracking on: a wheel notch\n * arrived as the literal text `ESC[<64;10;5M`, fell through the keymap to the insert branch, and was typed\n * into the message — twice, because two notches are two reports. So recognising a report is not an\n * optimisation here; every report a terminal can send has to be claimed, wheel and click alike, or the\n * feature's cost is garbage in somebody's message.\n *\n * A chunk can carry several reports. A fast scroll sends one per notch and the runtime coalesces them, so\n * the count matters: honouring one report per chunk makes a flick of the wheel move a single row and reads\n * as the wheel not working.\n *\n * ## The trade this makes, stated\n *\n * Tracking is what stops the terminal handling the mouse itself, so **drag-selecting text with the mouse\n * stops working while a session is mounted**. Every terminal worth naming lets you hold shift to bypass\n * tracking and select natively, which is why the key list says so rather than leaving it to be discovered.\n *\n * Two encodings are recognised. SGR (`ESC [ < b ; x ; y M`) is what we ask for and what any terminal from\n * the last decade replies with; X10 (`ESC [ M` and three raw bytes) is the fallback a terminal that ignored\n * the SGR request will use, and its bytes are frequently above 127 — so leaving it unclaimed would put\n * unprintable characters into a message on exactly the terminals least able to say why.\n */\n\n/**\n * Button tracking, drag tracking, and SGR encoding.\n *\n * 1000 reports press and release and is the least that reports the wheel at all. **1002 adds motion while a\n * button is held**, and without it a drag is not reported — which is why selecting text was not merely\n * disabled but unreachable: the events never arrived. 1003 (motion with no button) is deliberately absent,\n * because it makes the terminal send a report for every pixel of idle pointer movement and nothing here\n * wants hover.\n *\n * Set low-to-high and reset high-to-low, so a terminal that only understands some of them is left in a\n * state we asked for rather than a partial one.\n */\nexport const ENABLE_MOUSE = \"\\u001B[?1000h\\u001B[?1002h\\u001B[?1006h\"\n/** Reversed on the way out, so a terminal is left handling its own mouse again. */\nexport const DISABLE_MOUSE = \"\\u001B[?1006l\\u001B[?1002l\\u001B[?1000l\"\n\n/**\n * Rows one notch of the wheel moves.\n *\n * Three, which is the line-scroll every desktop uses. One row per notch is technically a scroll and feels\n * like the wheel is broken; a whole page per notch overshoots what somebody is looking for.\n */\nexport const WHEEL_ROWS = 3\n\n/** Wheel-up and wheel-down in SGR's button numbering. 64 is the wheel bit plus button 0. */\nconst WHEEL_UP = 64\nconst WHEEL_DOWN = 65\n\n/** Motion bit — set on every report mode 1002 sends while a button is held. */\nconst MOTION = 32\n/** Shift bit, so shift-clicking can extend a selection rather than starting a new one. */\nconst SHIFT = 4\n\n/**\n * The escape prefix is **optional**, and that is not laxness.\n *\n * Ink strips one leading `ESC` from the chunk before a handler sees it (`use-input.js:97`), so the first\n * report in a chunk arrives bare and every one after it keeps its escape. Requiring the prefix therefore\n * matched none of them, which is exactly how the first version of this let a wheel notch through: measured\n * against a real pty, the composer read `abc[<64;10;5M[<64;10;5M`.\n *\n * Anchored rather than left floating: a bare report is only recognised at the very start of the chunk,\n * which is the one position Ink's stripping can produce. A message that happens to contain the same text\n * in the middle of a sentence is still a message.\n */\n// biome-ignore lint/suspicious/noControlCharactersInRegex: the escape byte is the thing being matched\nconst SGR = /(?:^|\\u001B)\\[<(\\d+);(\\d+);(\\d+)([Mm])/g\n// biome-ignore lint/suspicious/noControlCharactersInRegex: the escape byte is the thing being matched\nconst X10 = /(?:^|\\u001B)\\[M[\\s\\S]{3}/g\n\n/** Which gesture a report describes. */\nexport type MouseKind = \"wheel\" | \"press\" | \"drag\" | \"release\"\n\n/** Where a report happened, in **zero-based** screen cells. */\nexport interface MousePoint {\n readonly column: number\n readonly row: number\n}\n\nexport interface MouseInput {\n /**\n * Rows to move: negative up, positive down, zero for a report that is not the wheel.\n *\n * Zero is *not* \"no report\" — a click is a report with no scroll in it, and it still has to be\n * swallowed. The `undefined` return is what means \"no report\".\n */\n readonly rows: number\n /**\n * The last gesture in the chunk, and where it happened. `undefined` when nothing positional was in it.\n *\n * The *last* rather than every one, because a drag arrives as a stream of motion reports and only the\n * newest position matters — a selection follows the pointer, it does not retrace it. The wheel is the\n * exception and is summed instead, which is why `rows` is separate: a flick coalesces several notches\n * into one chunk and honouring only the last would move a single row.\n */\n readonly at?: MousePoint\n readonly kind?: MouseKind\n /** Held modifiers, from SGR's button bits. Shift is what extends a selection from a click. */\n readonly shift?: boolean\n}\n\n/**\n * What a chunk of input means to the mouse, or `undefined` if it holds no mouse report at all.\n *\n * Returning `undefined` rather than a zero is what keeps a keystroke a keystroke: every other branch of\n * the keymap runs only when this says nothing.\n */\nexport function mouseInput(input: string): MouseInput | undefined {\n // Cheap prefilter. Every report contains one of these two, and almost no keystroke does.\n if (!input.includes(\"[<\") && !input.includes(\"[M\")) return undefined\n let rows = 0\n let seen = false\n let at: MousePoint | undefined\n let kind: MouseKind | undefined\n let shift = false\n for (const match of input.matchAll(SGR)) {\n seen = true\n const button = Number(match[1])\n if (button === WHEEL_UP) {\n rows -= WHEEL_ROWS\n continue\n }\n if (button === WHEEL_DOWN) {\n rows += WHEEL_ROWS\n continue\n }\n // SGR reports 1-based cells; everything downstream indexes from zero, so the conversion happens\n // once, here, rather than at each of the callers that would each have to remember it.\n at = { column: Math.max(0, Number(match[2]) - 1), row: Math.max(0, Number(match[3]) - 1) }\n // `m` is a release whatever the button bits say. Motion is bit 5 (32); the low two bits are the\n // button, and only the left one starts a selection.\n kind = match[4] === \"m\" ? \"release\" : (button & MOTION) !== 0 ? \"drag\" : \"press\"\n shift = (button & SHIFT) !== 0\n }\n for (const match of input.matchAll(X10)) {\n seen = true\n // X10 offsets every field by 32, so the wheel's 64 and 65 arrive as 96 and 97.\n // Three fields follow `[M`, and the escape before it is optional — so the button is found\n // from the end of the match rather than at a fixed offset.\n const button = (match[0].codePointAt(match[0].length - 3) ?? 32) - 32\n if (button === WHEEL_UP) rows -= WHEEL_ROWS\n else if (button === WHEEL_DOWN) rows += WHEEL_ROWS\n }\n if (!seen) return undefined\n return {\n rows,\n ...(at === undefined ? {} : { at }),\n ...(kind === undefined ? {} : { kind }),\n ...(shift ? { shift } : {}),\n }\n}\n"
|
|
8
8
|
],
|
|
9
9
|
"mappings": ";AA2DO,IAAM,EAAe,CACxB,OAAQ,UACR,MAAO,OACP,QAAS,QACT,QAAS,SACT,MAAO,MACP,KAAM,OACN,SAAU,OAGV,UAAW,OACX,OAAQ,OACR,aAAc,UACd,MAAO,SACX,EAGa,GAA2C,CACpD,KAAM,EAAM,QACZ,SAAU,EAAM,QAChB,UAAW,EAAM,OACjB,QAAS,EAAM,KACf,WAAY,EAAM,QACtB,EAGa,GAAyD,CAClE,KAAM,EAAM,OACZ,UAAW,OACX,UAAW,EAAM,MACjB,KAAM,EAAM,MACZ,MAAO,EAAM,MACb,KAAM,EAAM,KACZ,OAAQ,MACZ,EAUa,GAA8C,CACvD,KAAM,KACN,UAAW,GACX,UAAW,KACX,KAAM,KACN,MAAO,KACP,KAAM,OACN,OAAQ,EACZ,EAGa,EAAQ,CACjB,OAAQ,KACR,QAAS,KACT,OAAQ,KACR,MAAO,KACP,IAAK,KACL,MAAO,KACP,SAAU,IACV,OAAQ,KAER,QAAS,KACT,UAAW,IACf,EAGa,GAAiB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EAClE,GAAsB,GAGtB,GAAe,QCzGrB,SAAS,CAAa,CAA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