sandbox 2.4.0 → 2.5.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/dist/{ansi-styles-B57ln_zO.mjs → ansi-styles-DEyvEjde.mjs} +1 -1
- package/dist/{ansi-styles-B57ln_zO.mjs.map → ansi-styles-DEyvEjde.mjs.map} +1 -1
- package/dist/{app-uOMbKaBL.mjs → app-DCn8EUEY.mjs} +71 -80
- package/dist/app-DCn8EUEY.mjs.map +1 -0
- package/dist/{cli-truncate-DMIDACmY.mjs → cli-truncate-BM8ZM2fH.mjs} +2 -2
- package/dist/{cli-truncate-DMIDACmY.mjs.map → cli-truncate-BM8ZM2fH.mjs.map} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{log-update-txb7Or7B.mjs → log-update-i5LRJCHc.mjs} +3 -3
- package/dist/{log-update-txb7Or7B.mjs.map → log-update-i5LRJCHc.mjs.map} +1 -1
- package/dist/pty-server-linux-x86_64 +0 -0
- package/dist/sandbox.mjs +2 -2
- package/dist/{token-Bwtve9Y6.mjs → token-CFLlmxRf.mjs} +19 -11
- package/dist/token-CFLlmxRf.mjs.map +1 -0
- package/dist/token-util-B2dwBZRL.mjs +5 -0
- package/dist/{token-util-BpWskZEO.mjs → token-util-DACSFqcB.mjs} +107 -23
- package/dist/token-util-DACSFqcB.mjs.map +1 -0
- package/dist/wrap-ansi-BEIieZPu.mjs +5 -0
- package/dist/{wrap-ansi-DoQ74EEn.mjs → wrap-ansi-zdFz5AsC.mjs} +2 -2
- package/dist/{wrap-ansi-DoQ74EEn.mjs.map → wrap-ansi-zdFz5AsC.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/app-uOMbKaBL.mjs.map +0 -1
- package/dist/token-Bwtve9Y6.mjs.map +0 -1
- package/dist/token-error-C0CafU2G.mjs +0 -43
- package/dist/token-error-C0CafU2G.mjs.map +0 -1
- package/dist/token-util-BpWskZEO.mjs.map +0 -1
- package/dist/token-util-CRAtcwBI.mjs +0 -6
- package/dist/wrap-ansi-CEi7ZT5i.mjs +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stringWidth } from "./string-width-D78SVDLD.mjs";
|
|
2
|
-
import { t as ansi_styles_default } from "./ansi-styles-
|
|
2
|
+
import { t as ansi_styles_default } from "./ansi-styles-DEyvEjde.mjs";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
5
5
|
function isFullwidthCodePoint(codePoint) {
|
|
@@ -121,4 +121,4 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
121
121
|
|
|
122
122
|
//#endregion
|
|
123
123
|
export { cliTruncate as default };
|
|
124
|
-
//# sourceMappingURL=cli-truncate-
|
|
124
|
+
//# sourceMappingURL=cli-truncate-BM8ZM2fH.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-truncate-DMIDACmY.mjs","names":["ansiStyles"],"sources":["../../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js","../../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js","../../../node_modules/.pnpm/cli-truncate@4.0.0/node_modules/cli-truncate/index.js"],"sourcesContent":["/* eslint-disable yoda */\n\nexport default function isFullwidthCodePoint(codePoint) {\n\tif (!Number.isInteger(codePoint)) {\n\t\treturn false;\n\t}\n\n\t// Code points are derived from:\n\t// https://unicode.org/Public/UNIDATA/EastAsianWidth.txt\n\treturn codePoint >= 0x1100 && (\n\t\tcodePoint <= 0x115F || // Hangul Jamo\n\t\tcodePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET\n\t\tcodePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET\n\t\t// CJK Radicals Supplement .. Enclosed CJK Letters and Months\n\t\t(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||\n\t\t// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A\n\t\t(0x3250 <= codePoint && codePoint <= 0x4DBF) ||\n\t\t// CJK Unified Ideographs .. Yi Radicals\n\t\t(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||\n\t\t// Hangul Jamo Extended-A\n\t\t(0xA960 <= codePoint && codePoint <= 0xA97C) ||\n\t\t// Hangul Syllables\n\t\t(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n\t\t// CJK Compatibility Ideographs\n\t\t(0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n\t\t// Vertical Forms\n\t\t(0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n\t\t// CJK Compatibility Forms .. Small Form Variants\n\t\t(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||\n\t\t// Halfwidth and Fullwidth Forms\n\t\t(0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n\t\t(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||\n\t\t// Kana Supplement\n\t\t(0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n\t\t// Enclosed Ideographic Supplement\n\t\t(0x1F200 <= codePoint && codePoint <= 0x1F251) ||\n\t\t// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane\n\t\t(0x20000 <= codePoint && codePoint <= 0x3FFFD)\n\t);\n}\n","import isFullwidthCodePoint from 'is-fullwidth-code-point';\nimport ansiStyles from 'ansi-styles';\n\nconst astralRegex = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/;\n\nconst ESCAPES = [\n\t'\\u001B',\n\t'\\u009B'\n];\n\nconst wrapAnsi = code => `${ESCAPES[0]}[${code}m`;\n\nconst checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {\n\tlet output = [];\n\tansiCodes = [...ansiCodes];\n\n\tfor (let ansiCode of ansiCodes) {\n\t\tconst ansiCodeOrigin = ansiCode;\n\t\tif (ansiCode.includes(';')) {\n\t\t\tansiCode = ansiCode.split(';')[0][0] + '0';\n\t\t}\n\n\t\tconst item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10));\n\t\tif (item) {\n\t\t\tconst indexEscape = ansiCodes.indexOf(item.toString());\n\t\t\tif (indexEscape === -1) {\n\t\t\t\toutput.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));\n\t\t\t} else {\n\t\t\t\tansiCodes.splice(indexEscape, 1);\n\t\t\t}\n\t\t} else if (isEscapes) {\n\t\t\toutput.push(wrapAnsi(0));\n\t\t\tbreak;\n\t\t} else {\n\t\t\toutput.push(wrapAnsi(ansiCodeOrigin));\n\t\t}\n\t}\n\n\tif (isEscapes) {\n\t\toutput = output.filter((element, index) => output.indexOf(element) === index);\n\n\t\tif (endAnsiCode !== undefined) {\n\t\t\tconst fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10)));\n\t\t\t// TODO: Remove the use of `.reduce` here.\n\t\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t\toutput = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);\n\t\t}\n\t}\n\n\treturn output.join('');\n};\n\nexport default function sliceAnsi(string, begin, end) {\n\tconst characters = [...string];\n\tconst ansiCodes = [];\n\n\tlet stringEnd = typeof end === 'number' ? end : characters.length;\n\tlet isInsideEscape = false;\n\tlet ansiCode;\n\tlet visible = 0;\n\tlet output = '';\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tlet leftEscape = false;\n\n\t\tif (ESCAPES.includes(character)) {\n\t\t\tconst code = /\\d[^m]*/.exec(string.slice(index, index + 18));\n\t\t\tansiCode = code && code.length > 0 ? code[0] : undefined;\n\n\t\t\tif (visible < stringEnd) {\n\t\t\t\tisInsideEscape = true;\n\n\t\t\t\tif (ansiCode !== undefined) {\n\t\t\t\t\tansiCodes.push(ansiCode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isInsideEscape && character === 'm') {\n\t\t\tisInsideEscape = false;\n\t\t\tleftEscape = true;\n\t\t}\n\n\t\tif (!isInsideEscape && !leftEscape) {\n\t\t\tvisible++;\n\t\t}\n\n\t\tif (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {\n\t\t\tvisible++;\n\n\t\t\tif (typeof end !== 'number') {\n\t\t\t\tstringEnd++;\n\t\t\t}\n\t\t}\n\n\t\tif (visible > begin && visible <= stringEnd) {\n\t\t\toutput += character;\n\t\t} else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {\n\t\t\toutput = checkAnsi(ansiCodes);\n\t\t} else if (visible >= stringEnd) {\n\t\t\toutput += checkAnsi(ansiCodes, true, ansiCode);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn output;\n}\n","import sliceAnsi from 'slice-ansi';\nimport stringWidth from 'string-width';\n\nfunction getIndexOfNearestSpace(string, wantedIndex, shouldSearchRight) {\n\tif (string.charAt(wantedIndex) === ' ') {\n\t\treturn wantedIndex;\n\t}\n\n\tconst direction = shouldSearchRight ? 1 : -1;\n\n\tfor (let index = 0; index <= 3; index++) {\n\t\tconst finalIndex = wantedIndex + (index * direction);\n\t\tif (string.charAt(finalIndex) === ' ') {\n\t\t\treturn finalIndex;\n\t\t}\n\t}\n\n\treturn wantedIndex;\n}\n\nexport default function cliTruncate(text, columns, options = {}) {\n\tconst {\n\t\tposition = 'end',\n\t\tspace = false,\n\t\tpreferTruncationOnSpace = false,\n\t} = options;\n\n\tlet {truncationCharacter = '…'} = options;\n\n\tif (typeof text !== 'string') {\n\t\tthrow new TypeError(`Expected \\`input\\` to be a string, got ${typeof text}`);\n\t}\n\n\tif (typeof columns !== 'number') {\n\t\tthrow new TypeError(`Expected \\`columns\\` to be a number, got ${typeof columns}`);\n\t}\n\n\tif (columns < 1) {\n\t\treturn '';\n\t}\n\n\tif (columns === 1) {\n\t\treturn truncationCharacter;\n\t}\n\n\tconst length = stringWidth(text);\n\n\tif (length <= columns) {\n\t\treturn text;\n\t}\n\n\tif (position === 'start') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, true);\n\t\t\treturn truncationCharacter + sliceAnsi(text, nearestSpace, length).trim();\n\t\t}\n\n\t\tif (space === true) {\n\t\t\ttruncationCharacter += ' ';\n\t\t}\n\n\t\treturn truncationCharacter + sliceAnsi(text, length - columns + stringWidth(truncationCharacter), length);\n\t}\n\n\tif (position === 'middle') {\n\t\tif (space === true) {\n\t\t\ttruncationCharacter = ` ${truncationCharacter} `;\n\t\t}\n\n\t\tconst half = Math.floor(columns / 2);\n\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);\n\t\t\tconst spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);\n\t\t\treturn sliceAnsi(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();\n\t\t}\n\n\t\treturn (\n\t\t\tsliceAnsi(text, 0, half)\n\t\t\t\t+ truncationCharacter\n\t\t\t\t+ sliceAnsi(text, length - (columns - half) + stringWidth(truncationCharacter), length)\n\t\t);\n\t}\n\n\tif (position === 'end') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, columns - 1);\n\t\t\treturn sliceAnsi(text, 0, nearestSpace) + truncationCharacter;\n\t\t}\n\n\t\tif (space === true) {\n\t\t\ttruncationCharacter = ` ${truncationCharacter}`;\n\t\t}\n\n\t\treturn sliceAnsi(text, 0, columns - stringWidth(truncationCharacter)) + truncationCharacter;\n\t}\n\n\tthrow new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${position}`);\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;AAEA,SAAwB,qBAAqB,WAAW;AACvD,KAAI,CAAC,OAAO,UAAU,UAAU,CAC/B,QAAO;AAKR,QAAO,aAAa,SACnB,aAAa,QACb,cAAc,QACd,cAAc,QAEb,SAAU,aAAa,aAAa,SAAU,c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ADF,uBAAuB,MAAM,UAAU,EAAE,CACvB,GAAG;AAG3C,MAAI,UAAU,KACb,uBAAsB,IAAI;AAG3B,SAAO,UAAU,MAAM,GAAG,UAAU,YAAY,oBAAoB,CAAC,GAAG;;AAGzE,OAAM,IAAI,MAAM,oFAAoF,WAAW"}
|
|
1
|
+
{"version":3,"file":"cli-truncate-BM8ZM2fH.mjs","names":["ansiStyles"],"sources":["../../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js","../../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js","../../../node_modules/.pnpm/cli-truncate@4.0.0/node_modules/cli-truncate/index.js"],"sourcesContent":["/* eslint-disable yoda */\n\nexport default function isFullwidthCodePoint(codePoint) {\n\tif (!Number.isInteger(codePoint)) {\n\t\treturn false;\n\t}\n\n\t// Code points are derived from:\n\t// https://unicode.org/Public/UNIDATA/EastAsianWidth.txt\n\treturn codePoint >= 0x1100 && (\n\t\tcodePoint <= 0x115F || // Hangul Jamo\n\t\tcodePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET\n\t\tcodePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET\n\t\t// CJK Radicals Supplement .. Enclosed CJK Letters and Months\n\t\t(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||\n\t\t// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A\n\t\t(0x3250 <= codePoint && codePoint <= 0x4DBF) ||\n\t\t// CJK Unified Ideographs .. Yi Radicals\n\t\t(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||\n\t\t// Hangul Jamo Extended-A\n\t\t(0xA960 <= codePoint && codePoint <= 0xA97C) ||\n\t\t// Hangul Syllables\n\t\t(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n\t\t// CJK Compatibility Ideographs\n\t\t(0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n\t\t// Vertical Forms\n\t\t(0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n\t\t// CJK Compatibility Forms .. Small Form Variants\n\t\t(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||\n\t\t// Halfwidth and Fullwidth Forms\n\t\t(0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n\t\t(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||\n\t\t// Kana Supplement\n\t\t(0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n\t\t// Enclosed Ideographic Supplement\n\t\t(0x1F200 <= codePoint && codePoint <= 0x1F251) ||\n\t\t// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane\n\t\t(0x20000 <= codePoint && codePoint <= 0x3FFFD)\n\t);\n}\n","import isFullwidthCodePoint from 'is-fullwidth-code-point';\nimport ansiStyles from 'ansi-styles';\n\nconst astralRegex = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/;\n\nconst ESCAPES = [\n\t'\\u001B',\n\t'\\u009B'\n];\n\nconst wrapAnsi = code => `${ESCAPES[0]}[${code}m`;\n\nconst checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {\n\tlet output = [];\n\tansiCodes = [...ansiCodes];\n\n\tfor (let ansiCode of ansiCodes) {\n\t\tconst ansiCodeOrigin = ansiCode;\n\t\tif (ansiCode.includes(';')) {\n\t\t\tansiCode = ansiCode.split(';')[0][0] + '0';\n\t\t}\n\n\t\tconst item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10));\n\t\tif (item) {\n\t\t\tconst indexEscape = ansiCodes.indexOf(item.toString());\n\t\t\tif (indexEscape === -1) {\n\t\t\t\toutput.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));\n\t\t\t} else {\n\t\t\t\tansiCodes.splice(indexEscape, 1);\n\t\t\t}\n\t\t} else if (isEscapes) {\n\t\t\toutput.push(wrapAnsi(0));\n\t\t\tbreak;\n\t\t} else {\n\t\t\toutput.push(wrapAnsi(ansiCodeOrigin));\n\t\t}\n\t}\n\n\tif (isEscapes) {\n\t\toutput = output.filter((element, index) => output.indexOf(element) === index);\n\n\t\tif (endAnsiCode !== undefined) {\n\t\t\tconst fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10)));\n\t\t\t// TODO: Remove the use of `.reduce` here.\n\t\t\t// eslint-disable-next-line unicorn/no-array-reduce\n\t\t\toutput = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);\n\t\t}\n\t}\n\n\treturn output.join('');\n};\n\nexport default function sliceAnsi(string, begin, end) {\n\tconst characters = [...string];\n\tconst ansiCodes = [];\n\n\tlet stringEnd = typeof end === 'number' ? end : characters.length;\n\tlet isInsideEscape = false;\n\tlet ansiCode;\n\tlet visible = 0;\n\tlet output = '';\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tlet leftEscape = false;\n\n\t\tif (ESCAPES.includes(character)) {\n\t\t\tconst code = /\\d[^m]*/.exec(string.slice(index, index + 18));\n\t\t\tansiCode = code && code.length > 0 ? code[0] : undefined;\n\n\t\t\tif (visible < stringEnd) {\n\t\t\t\tisInsideEscape = true;\n\n\t\t\t\tif (ansiCode !== undefined) {\n\t\t\t\t\tansiCodes.push(ansiCode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isInsideEscape && character === 'm') {\n\t\t\tisInsideEscape = false;\n\t\t\tleftEscape = true;\n\t\t}\n\n\t\tif (!isInsideEscape && !leftEscape) {\n\t\t\tvisible++;\n\t\t}\n\n\t\tif (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {\n\t\t\tvisible++;\n\n\t\t\tif (typeof end !== 'number') {\n\t\t\t\tstringEnd++;\n\t\t\t}\n\t\t}\n\n\t\tif (visible > begin && visible <= stringEnd) {\n\t\t\toutput += character;\n\t\t} else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {\n\t\t\toutput = checkAnsi(ansiCodes);\n\t\t} else if (visible >= stringEnd) {\n\t\t\toutput += checkAnsi(ansiCodes, true, ansiCode);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn output;\n}\n","import sliceAnsi from 'slice-ansi';\nimport stringWidth from 'string-width';\n\nfunction getIndexOfNearestSpace(string, wantedIndex, shouldSearchRight) {\n\tif (string.charAt(wantedIndex) === ' ') {\n\t\treturn wantedIndex;\n\t}\n\n\tconst direction = shouldSearchRight ? 1 : -1;\n\n\tfor (let index = 0; index <= 3; index++) {\n\t\tconst finalIndex = wantedIndex + (index * direction);\n\t\tif (string.charAt(finalIndex) === ' ') {\n\t\t\treturn finalIndex;\n\t\t}\n\t}\n\n\treturn wantedIndex;\n}\n\nexport default function cliTruncate(text, columns, options = {}) {\n\tconst {\n\t\tposition = 'end',\n\t\tspace = false,\n\t\tpreferTruncationOnSpace = false,\n\t} = options;\n\n\tlet {truncationCharacter = '…'} = options;\n\n\tif (typeof text !== 'string') {\n\t\tthrow new TypeError(`Expected \\`input\\` to be a string, got ${typeof text}`);\n\t}\n\n\tif (typeof columns !== 'number') {\n\t\tthrow new TypeError(`Expected \\`columns\\` to be a number, got ${typeof columns}`);\n\t}\n\n\tif (columns < 1) {\n\t\treturn '';\n\t}\n\n\tif (columns === 1) {\n\t\treturn truncationCharacter;\n\t}\n\n\tconst length = stringWidth(text);\n\n\tif (length <= columns) {\n\t\treturn text;\n\t}\n\n\tif (position === 'start') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, true);\n\t\t\treturn truncationCharacter + sliceAnsi(text, nearestSpace, length).trim();\n\t\t}\n\n\t\tif (space === true) {\n\t\t\ttruncationCharacter += ' ';\n\t\t}\n\n\t\treturn truncationCharacter + sliceAnsi(text, length - columns + stringWidth(truncationCharacter), length);\n\t}\n\n\tif (position === 'middle') {\n\t\tif (space === true) {\n\t\t\ttruncationCharacter = ` ${truncationCharacter} `;\n\t\t}\n\n\t\tconst half = Math.floor(columns / 2);\n\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);\n\t\t\tconst spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);\n\t\t\treturn sliceAnsi(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();\n\t\t}\n\n\t\treturn (\n\t\t\tsliceAnsi(text, 0, half)\n\t\t\t\t+ truncationCharacter\n\t\t\t\t+ sliceAnsi(text, length - (columns - half) + stringWidth(truncationCharacter), length)\n\t\t);\n\t}\n\n\tif (position === 'end') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, columns - 1);\n\t\t\treturn sliceAnsi(text, 0, nearestSpace) + truncationCharacter;\n\t\t}\n\n\t\tif (space === true) {\n\t\t\ttruncationCharacter = ` ${truncationCharacter}`;\n\t\t}\n\n\t\treturn sliceAnsi(text, 0, columns - stringWidth(truncationCharacter)) + truncationCharacter;\n\t}\n\n\tthrow new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${position}`);\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;AAEA,SAAwB,qBAAqB,WAAW;AACvD,KAAI,CAAC,OAAO,UAAU,UAAU,CAC/B,QAAO;AAKR,QAAO,aAAa,SACnB,aAAa,QACb,cAAc,QACd,cAAc,QAEb,SAAU,aAAa,aAAa,SAAU,cAAc,SAE5D,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SAEpC,SAAU,aAAa,aAAa,SACpC,SAAU,aAAa,aAAa,SAEpC,UAAW,aAAa,aAAa,UAErC,UAAW,aAAa,aAAa,UAErC,UAAW,aAAa,aAAa;;;;;AClCxC,MAAM,cAAc;AAEpB,MAAM,UAAU,CACf,QACA,IACA;AAED,MAAM,YA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AI,YAAY,EACf,QAAO;CAGR,MAAM,SAAS,YAAY,KAAK;AAEhC,KAAI,UAAU,QACb,QAAO;AAGR,KAAI,aAAa,SAAS;AACzB,MAAI,yBAAyB;GAC5B,MAAM,eAAe,uBAAuB,MAAM,SAAS,UAAU,GAAG,KAAK;AAC7E,UAAO,sBAAsB,UAAU,MAAM,cAAc,OAAO,CAAC,MAAM;;AAG1E,MAAI,UAAU,KACb,wBAAuB;AAGxB,SAAO,sBAAsB,UAAU,MAAM,SAAS,UAAU,YAAY,oBAAoB,EAAE,OAAO;;AAG1G,KAAI,aAAa,UAAU;AAC1B,MAAI,UAAU,KACb,uBAAsB,IAAI,oBAAoB;EAG/C,MAAM,OAAO,KAAK,MAAM,UAAU,EAAE;AAEpC,MAAI,yBAAyB;GAC5B,MAAM,2BAA2B,uBAAuB,MAAM,KAAK;GACnE,MAAM,4BAA4B,uBAAuB,MAAM,UAAU,UAAU,QAAQ,GAAG,KAAK;AACnG,UAAO,UAAU,MAAM,GAAG,yBAAyB,GAAG,sBAAsB,UAAU,MAAM,2BAA2B,OAAO,CAAC,MAAM;;AAGtI,SACC,UAAU,MAAM,GAAG,KAAK,GACrB,sBACA,UAAU,MAAM,UAAU,UAAU,QAAQ,YAAY,oBAAoB,EAAE,OAAO;;AAI1F,KAAI,aAAa,OAAO;AACvB,MAAI,wBAEH,QAAO,UAAU,MAAM,GADF,uBAAuB,MAAM,UAAU,EAAE,CACvB,GAAG;AAG3C,MAAI,UAAU,KACb,uBAAsB,IAAI;AAG3B,SAAO,UAAU,MAAM,GAAG,UAAU,YAAY,oBAAoB,CAAC,GAAG;;AAGzE,OAAM,IAAI,MAAM,oFAAoF,WAAW"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as require_cjs, t as app } from "./app-
|
|
1
|
+
import { r as require_cjs, t as app } from "./app-DCn8EUEY.mjs";
|
|
2
2
|
import "./string-width-D78SVDLD.mjs";
|
|
3
3
|
import "./cli-cursor-Dab4mDU2.mjs";
|
|
4
|
-
import "./token-
|
|
4
|
+
import "./token-util-DACSFqcB.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
var import_cjs = require_cjs();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as stripAnsi, i as init_strip_ansi, n as isFullWidth, r as isWide } from "./string-width-D78SVDLD.mjs";
|
|
2
2
|
import { t as cli_cursor_default } from "./cli-cursor-Dab4mDU2.mjs";
|
|
3
|
-
import { t as ansi_styles_default } from "./ansi-styles-
|
|
4
|
-
import { t as wrapAnsi } from "./wrap-ansi-
|
|
3
|
+
import { t as ansi_styles_default } from "./ansi-styles-DEyvEjde.mjs";
|
|
4
|
+
import { t as wrapAnsi } from "./wrap-ansi-zdFz5AsC.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
|
|
7
7
|
//#region ../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js
|
|
@@ -220,4 +220,4 @@ const logUpdateStderr = createLogUpdate(process.stderr);
|
|
|
220
220
|
|
|
221
221
|
//#endregion
|
|
222
222
|
export { createLogUpdate };
|
|
223
|
-
//# sourceMappingURL=log-update-
|
|
223
|
+
//# sourceMappingURL=log-update-i5LRJCHc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-update-txb7Or7B.mjs","names":["isWindows","ansiStyles","isFullWidth","ansiEscapes.eraseLines"],"sources":["../../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js","../../../node_modules/.pnpm/ansi-escapes@7.1.0/node_modules/ansi-escapes/base.js","../../../node_modules/.pnpm/is-fullwidth-code-point@5.1.0/node_modules/is-fullwidth-code-point/index.js","../../../node_modules/.pnpm/slice-ansi@7.1.0/node_modules/slice-ansi/index.js","../../../node_modules/.pnpm/log-update@6.1.0/node_modules/log-update/index.js"],"sourcesContent":["/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */\n\nexport const isBrowser = globalThis.window?.document !== undefined;\n\nexport const isNode = globalThis.process?.versions?.node !== undefined;\n\nexport const isBun = globalThis.process?.versions?.bun !== undefined;\n\nexport const isDeno = globalThis.Deno?.version?.deno !== undefined;\n\nexport const isElectron = globalThis.process?.versions?.electron !== undefined;\n\nexport const isJsDom = globalThis.navigator?.userAgent?.includes('jsdom') === true;\n\nexport const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;\n\nexport const isDedicatedWorker = typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;\n\nexport const isSharedWorker = typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;\n\nexport const isServiceWorker = typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;\n\n// Note: I'm intentionally not DRYing up the other variables to keep them \"lazy\".\nconst platform = globalThis.navigator?.userAgentData?.platform;\n\nexport const isMacOs = platform === 'macOS'\n\t|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.\n\t|| globalThis.navigator?.userAgent?.includes(' Mac ') === true\n\t|| globalThis.process?.platform === 'darwin';\n\nexport const isWindows = platform === 'Windows'\n\t|| globalThis.navigator?.platform === 'Win32'\n\t|| globalThis.process?.platform === 'win32';\n\nexport const isLinux = platform === 'Linux'\n\t|| globalThis.navigator?.platform?.startsWith('Linux') === true\n\t|| globalThis.navigator?.userAgent?.includes(' Linux ') === true\n\t|| globalThis.process?.platform === 'linux';\n\nexport const isIos = platform === 'iOS'\n\t|| (globalThis.navigator?.platform === 'MacIntel' && globalThis.navigator?.maxTouchPoints > 1)\n\t|| /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);\n\nexport const isAndroid = platform === 'Android'\n\t|| globalThis.navigator?.platform === 'Android'\n\t|| globalThis.navigator?.userAgent?.includes(' Android ') === true\n\t|| globalThis.process?.platform === 'android';\n","import process from 'node:process';\nimport {isBrowser} from 'environment';\n\nconst ESC = '\\u001B[';\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\nconst isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === 'Apple_Terminal';\nconst isWindows = !isBrowser && process.platform === 'win32';\n\nconst cwdFunction = isBrowser ? () => {\n\tthrow new Error('`process.cwd()` only works in Node.js, not the browser.');\n} : process.cwd;\n\nexport const cursorTo = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tif (typeof y !== 'number') {\n\t\treturn ESC + (x + 1) + 'G';\n\t}\n\n\treturn ESC + (y + 1) + SEP + (x + 1) + 'H';\n};\n\nexport const cursorMove = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tlet returnValue = '';\n\n\tif (x < 0) {\n\t\treturnValue += ESC + (-x) + 'D';\n\t} else if (x > 0) {\n\t\treturnValue += ESC + x + 'C';\n\t}\n\n\tif (y < 0) {\n\t\treturnValue += ESC + (-y) + 'A';\n\t} else if (y > 0) {\n\t\treturnValue += ESC + y + 'B';\n\t}\n\n\treturn returnValue;\n};\n\nexport const cursorUp = (count = 1) => ESC + count + 'A';\nexport const cursorDown = (count = 1) => ESC + count + 'B';\nexport const cursorForward = (count = 1) => ESC + count + 'C';\nexport const cursorBackward = (count = 1) => ESC + count + 'D';\n\nexport const cursorLeft = ESC + 'G';\nexport const cursorSavePosition = isTerminalApp ? '\\u001B7' : ESC + 's';\nexport const cursorRestorePosition = isTerminalApp ? '\\u001B8' : ESC + 'u';\nexport const cursorGetPosition = ESC + '6n';\nexport const cursorNextLine = ESC + 'E';\nexport const cursorPrevLine = ESC + 'F';\nexport const cursorHide = ESC + '?25l';\nexport const cursorShow = ESC + '?25h';\n\nexport const eraseLines = count => {\n\tlet clear = '';\n\n\tfor (let i = 0; i < count; i++) {\n\t\tclear += eraseLine + (i < count - 1 ? cursorUp() : '');\n\t}\n\n\tif (count) {\n\t\tclear += cursorLeft;\n\t}\n\n\treturn clear;\n};\n\nexport const eraseEndLine = ESC + 'K';\nexport const eraseStartLine = ESC + '1K';\nexport const eraseLine = ESC + '2K';\nexport const eraseDown = ESC + 'J';\nexport const eraseUp = ESC + '1J';\nexport const eraseScreen = ESC + '2J';\nexport const scrollUp = ESC + 'S';\nexport const scrollDown = ESC + 'T';\n\nexport const clearScreen = '\\u001Bc';\n\nexport const clearViewport = `${eraseScreen}${ESC}H`;\n\nexport const clearTerminal = isWindows\n\t? `${eraseScreen}${ESC}0f`\n\t// 1. Erases the screen (Only done in case `2` is not supported)\n\t// 2. Erases the whole screen including scrollback buffer\n\t// 3. Moves cursor to the top-left position\n\t// More info: https://www.real-world-systems.com/docs/ANSIcode.html\n\t:\t`${eraseScreen}${ESC}3J${ESC}H`;\n\nexport const enterAlternativeScreen = ESC + '?1049h';\nexport const exitAlternativeScreen = ESC + '?1049l';\n\nexport const beep = BEL;\n\nexport const link = (text, url) => [\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\turl,\n\tBEL,\n\ttext,\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\tBEL,\n].join('');\n\nexport const image = (data, options = {}) => {\n\tlet returnValue = `${OSC}1337;File=inline=1`;\n\n\tif (options.width) {\n\t\treturnValue += `;width=${options.width}`;\n\t}\n\n\tif (options.height) {\n\t\treturnValue += `;height=${options.height}`;\n\t}\n\n\tif (options.preserveAspectRatio === false) {\n\t\treturnValue += ';preserveAspectRatio=0';\n\t}\n\n\treturn returnValue + ':' + Buffer.from(data).toString('base64') + BEL;\n};\n\nexport const iTerm = {\n\tsetCwd: (cwd = cwdFunction()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,\n\n\tannotation(message, options = {}) {\n\t\tlet returnValue = `${OSC}1337;`;\n\n\t\tconst hasX = options.x !== undefined;\n\t\tconst hasY = options.y !== undefined;\n\t\tif ((hasX || hasY) && !(hasX && hasY && options.length !== undefined)) {\n\t\t\tthrow new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');\n\t\t}\n\n\t\tmessage = message.replaceAll('|', '');\n\n\t\treturnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';\n\n\t\tif (options.length > 0) {\n\t\t\treturnValue += (\n\t\t\t\thasX\n\t\t\t\t\t? [message, options.length, options.x, options.y]\n\t\t\t\t\t: [options.length, message]\n\t\t\t).join('|');\n\t\t} else {\n\t\t\treturnValue += message;\n\t\t}\n\n\t\treturn returnValue + BEL;\n\t},\n};\n\nexport const ConEmu = {\n\tsetCwd: (cwd = cwdFunction()) => `${OSC}9;9;${cwd}${BEL}`,\n};\n\nexport const setCwd = (cwd = cwdFunction()) => iTerm.setCwd(cwd) + ConEmu.setCwd(cwd);\n","import {\n\t_isFullWidth as isFullWidth,\n\t_isWide as isWide,\n} from 'get-east-asian-width';\n\nexport default function isFullwidthCodePoint(codePoint) {\n\tif (!Number.isInteger(codePoint)) {\n\t\treturn false;\n\t}\n\n\treturn isFullWidth(codePoint) || isWide(codePoint);\n}\n","import ansiStyles from 'ansi-styles';\nimport isFullwidthCodePoint from 'is-fullwidth-code-point';\n\n// \\x1b and \\x9b\nconst ESCAPES = new Set([27, 155]);\n\nconst CODE_POINT_0 = '0'.codePointAt(0);\nconst CODE_POINT_9 = '9'.codePointAt(0);\n\nconst endCodesSet = new Set();\nconst endCodesMap = new Map();\nfor (const [start, end] of ansiStyles.codes) {\n\tendCodesSet.add(ansiStyles.color.ansi(end));\n\tendCodesMap.set(ansiStyles.color.ansi(start), ansiStyles.color.ansi(end));\n}\n\nfunction getEndCode(code) {\n\tif (endCodesSet.has(code)) {\n\t\treturn code;\n\t}\n\n\tif (endCodesMap.has(code)) {\n\t\treturn endCodesMap.get(code);\n\t}\n\n\tcode = code.slice(2);\n\tif (code.includes(';')) {\n\t\tcode = code[0] + '0';\n\t}\n\n\tconst returnValue = ansiStyles.codes.get(Number.parseInt(code, 10));\n\tif (returnValue) {\n\t\treturn ansiStyles.color.ansi(returnValue);\n\t}\n\n\treturn ansiStyles.reset.open;\n}\n\nfunction findNumberIndex(string) {\n\tfor (let index = 0; index < string.length; index++) {\n\t\tconst codePoint = string.codePointAt(index);\n\t\tif (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) {\n\t\t\treturn index;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nfunction parseAnsiCode(string, offset) {\n\tstring = string.slice(offset, offset + 19);\n\tconst startIndex = findNumberIndex(string);\n\tif (startIndex !== -1) {\n\t\tlet endIndex = string.indexOf('m', startIndex);\n\t\tif (endIndex === -1) {\n\t\t\tendIndex = string.length;\n\t\t}\n\n\t\treturn string.slice(0, endIndex + 1);\n\t}\n}\n\nfunction tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {\n\tconst returnValue = [];\n\n\tlet index = 0;\n\tlet visibleCount = 0;\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\treturnValue.push({\n\t\t\t\t\ttype: 'ansi',\n\t\t\t\t\tcode,\n\t\t\t\t\tendCode: getEndCode(code),\n\t\t\t\t});\n\t\t\t\tindex += code.length;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst isFullWidth = isFullwidthCodePoint(codePoint);\n\t\tconst character = String.fromCodePoint(codePoint);\n\n\t\treturnValue.push({\n\t\t\ttype: 'character',\n\t\t\tvalue: character,\n\t\t\tisFullWidth,\n\t\t});\n\n\t\tindex += character.length;\n\t\tvisibleCount += isFullWidth ? 2 : character.length;\n\n\t\tif (visibleCount >= endCharacter) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn returnValue;\n}\n\nfunction reduceAnsiCodes(codes) {\n\tlet returnValue = [];\n\n\tfor (const code of codes) {\n\t\tif (code.code === ansiStyles.reset.open) {\n\t\t\t// Reset code, disable all codes\n\t\t\treturnValue = [];\n\t\t} else if (endCodesSet.has(code.code)) {\n\t\t\t// This is an end code, disable all matching start codes\n\t\t\treturnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.code);\n\t\t} else {\n\t\t\t// This is a start code. Disable all styles this \"overrides\", then enable it\n\t\t\treturnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.endCode);\n\t\t\treturnValue.push(code);\n\t\t}\n\t}\n\n\treturn returnValue;\n}\n\nfunction undoAnsiCodes(codes) {\n\tconst reduced = reduceAnsiCodes(codes);\n\tconst endCodes = reduced.map(({endCode}) => endCode);\n\treturn endCodes.reverse().join('');\n}\n\nexport default function sliceAnsi(string, start, end) {\n\tconst tokens = tokenize(string, end);\n\tlet activeCodes = [];\n\tlet position = 0;\n\tlet returnValue = '';\n\tlet include = false;\n\n\tfor (const token of tokens) {\n\t\tif (end !== undefined && position >= end) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type === 'ansi') {\n\t\t\tactiveCodes.push(token);\n\t\t\tif (include) {\n\t\t\t\treturnValue += token.code;\n\t\t\t}\n\t\t} else {\n\t\t\t// Character\n\t\t\tif (!include && position >= start) {\n\t\t\t\tinclude = true;\n\t\t\t\t// Simplify active codes\n\t\t\t\tactiveCodes = reduceAnsiCodes(activeCodes);\n\t\t\t\treturnValue = activeCodes.map(({code}) => code).join('');\n\t\t\t}\n\n\t\t\tif (include) {\n\t\t\t\treturnValue += token.value;\n\t\t\t}\n\n\t\t\tposition += token.isFullWidth ? 2 : token.value.length;\n\t\t}\n\t}\n\n\t// Disable active codes at the end\n\treturnValue += undoAnsiCodes(activeCodes);\n\treturn returnValue;\n}\n","import process from 'node:process';\nimport ansiEscapes from 'ansi-escapes';\nimport cliCursor from 'cli-cursor';\nimport wrapAnsi from 'wrap-ansi';\nimport sliceAnsi from 'slice-ansi';\nimport stripAnsi from 'strip-ansi';\n\nconst defaultTerminalHeight = 24;\n\nconst getWidth = ({columns = 80}) => columns;\n\nconst fitToTerminalHeight = (stream, text) => {\n\tconst terminalHeight = stream.rows ?? defaultTerminalHeight;\n\tconst lines = text.split('\\n');\n\tconst toRemove = Math.max(0, lines.length - terminalHeight);\n\treturn toRemove ? sliceAnsi(text, stripAnsi(lines.slice(0, toRemove).join('\\n')).length + 1) : text;\n};\n\nexport function createLogUpdate(stream, {showCursor = false} = {}) {\n\tlet previousLineCount = 0;\n\tlet previousWidth = getWidth(stream);\n\tlet previousOutput = '';\n\n\tconst reset = () => {\n\t\tpreviousOutput = '';\n\t\tpreviousWidth = getWidth(stream);\n\t\tpreviousLineCount = 0;\n\t};\n\n\tconst render = (...arguments_) => {\n\t\tif (!showCursor) {\n\t\t\tcliCursor.hide();\n\t\t}\n\n\t\tlet output = fitToTerminalHeight(stream, arguments_.join(' ') + '\\n');\n\t\tconst width = getWidth(stream);\n\n\t\tif (output === previousOutput && previousWidth === width) {\n\t\t\treturn;\n\t\t}\n\n\t\tpreviousOutput = output;\n\t\tpreviousWidth = width;\n\t\toutput = wrapAnsi(output, width, {trim: false, hard: true, wordWrap: false});\n\n\t\tstream.write(ansiEscapes.eraseLines(previousLineCount) + output);\n\t\tpreviousLineCount = output.split('\\n').length;\n\t};\n\n\trender.clear = () => {\n\t\tstream.write(ansiEscapes.eraseLines(previousLineCount));\n\t\treset();\n\t};\n\n\trender.done = () => {\n\t\treset();\n\t\tif (!showCursor) {\n\t\t\tcliCursor.show();\n\t\t}\n\t};\n\n\treturn render;\n}\n\nconst logUpdate = createLogUpdate(process.stdout);\nexport default logUpdate;\n\nexport const logUpdateStderr = createLogUpdate(process.stderr);\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;;;;;;AAEA,MAAa,YAAY,WAAW,QAAQ,aAAa;AAEzD,MAAa,SAAS,WAAW,SAAS,UAAU,SAAS;AAE7D,MAAa,QAAQ,WAAW,SAAS,UAAU,QAAQ;AAE3D,MAAa,SAAS,WAAW,MAAM,SAAS,SAAS;AAEzD,MAAa,aAAa,WAAW,SAAS,U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,MAAM,iBAAiB,OAAO,QAAQ;CACtC,MAAM,QAAQ,KAAK,MAAM,KAAK;CAC9B,MAAM,WAAW,KAAK,IAAI,GAAG,MAAM,SAAS,eAAe;AAC3D,QAAO,WAAW,UAAU,MAAM,UAAU,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,KAAK,CAAC,CAAC,SAAS,EAAE,GAAG;;AAGhG,SAAgB,gBAAgB,QAAQ,EAAC,aAAa,UAAS,EAAE,EAAE;CAClE,IAAI,oBAAoB;CACxB,IAAI,gBAAgB,SAAS,OAAO;CACpC,IAAI,iBAAiB;CAErB,MAAM,cAAc;AACnB,mBAAiB;AACjB,kBAAgB,SAAS,OAAO;AAChC,sBAAoB;;CAGrB,MAAM,UAAU,GAAG,eAAe;AACjC,MAAI,CAAC,WACJ,oBAAU,MAAM;EAGjB,IAAI,SAAS,oBAAoB,QAAQ,WAAW,KAAK,IAAI,GAAG,KAAK;EACrE,MAAM,QAAQ,SAAS,OAAO;AAE9B,MAAI,WAAW,kBAAkB,kBAAkB,MAClD;AAGD,mBAAiB;AACjB,kBAAgB;AAChB,WAAS,SAAS,QAAQ,OAAO;GAAC,MAAM;GAAO,MAAM;GAAM,UAAU;GAAM,CAAC;AAE5E,SAAO,MAAME,WAAuB,kBAAkB,GAAG,OAAO;AAChE,sBAAoB,OAAO,MAAM,KAAK,CAAC;;AAGxC,QAAO,cAAc;AACpB,SAAO,MAAMA,WAAuB,kBAAkB,CAAC;AACvD,SAAO;;AAGR,QAAO,aAAa;AACnB,SAAO;AACP,MAAI,CAAC,WACJ,oBAAU,MAAM;;AAIlB,QAAO;;AAGR,MAAM,YAAY,gBAAgB,QAAQ,OAAO;AAGjD,MAAa,kBAAkB,gBAAgB,QAAQ,OAAO"}
|
|
1
|
+
{"version":3,"file":"log-update-i5LRJCHc.mjs","names":["isWindows","ansiStyles","isFullWidth","ansiEscapes.eraseLines"],"sources":["../../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js","../../../node_modules/.pnpm/ansi-escapes@7.1.0/node_modules/ansi-escapes/base.js","../../../node_modules/.pnpm/is-fullwidth-code-point@5.1.0/node_modules/is-fullwidth-code-point/index.js","../../../node_modules/.pnpm/slice-ansi@7.1.0/node_modules/slice-ansi/index.js","../../../node_modules/.pnpm/log-update@6.1.0/node_modules/log-update/index.js"],"sourcesContent":["/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */\n\nexport const isBrowser = globalThis.window?.document !== undefined;\n\nexport const isNode = globalThis.process?.versions?.node !== undefined;\n\nexport const isBun = globalThis.process?.versions?.bun !== undefined;\n\nexport const isDeno = globalThis.Deno?.version?.deno !== undefined;\n\nexport const isElectron = globalThis.process?.versions?.electron !== undefined;\n\nexport const isJsDom = globalThis.navigator?.userAgent?.includes('jsdom') === true;\n\nexport const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;\n\nexport const isDedicatedWorker = typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;\n\nexport const isSharedWorker = typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;\n\nexport const isServiceWorker = typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;\n\n// Note: I'm intentionally not DRYing up the other variables to keep them \"lazy\".\nconst platform = globalThis.navigator?.userAgentData?.platform;\n\nexport const isMacOs = platform === 'macOS'\n\t|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.\n\t|| globalThis.navigator?.userAgent?.includes(' Mac ') === true\n\t|| globalThis.process?.platform === 'darwin';\n\nexport const isWindows = platform === 'Windows'\n\t|| globalThis.navigator?.platform === 'Win32'\n\t|| globalThis.process?.platform === 'win32';\n\nexport const isLinux = platform === 'Linux'\n\t|| globalThis.navigator?.platform?.startsWith('Linux') === true\n\t|| globalThis.navigator?.userAgent?.includes(' Linux ') === true\n\t|| globalThis.process?.platform === 'linux';\n\nexport const isIos = platform === 'iOS'\n\t|| (globalThis.navigator?.platform === 'MacIntel' && globalThis.navigator?.maxTouchPoints > 1)\n\t|| /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);\n\nexport const isAndroid = platform === 'Android'\n\t|| globalThis.navigator?.platform === 'Android'\n\t|| globalThis.navigator?.userAgent?.includes(' Android ') === true\n\t|| globalThis.process?.platform === 'android';\n","import process from 'node:process';\nimport {isBrowser} from 'environment';\n\nconst ESC = '\\u001B[';\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\nconst isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === 'Apple_Terminal';\nconst isWindows = !isBrowser && process.platform === 'win32';\n\nconst cwdFunction = isBrowser ? () => {\n\tthrow new Error('`process.cwd()` only works in Node.js, not the browser.');\n} : process.cwd;\n\nexport const cursorTo = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tif (typeof y !== 'number') {\n\t\treturn ESC + (x + 1) + 'G';\n\t}\n\n\treturn ESC + (y + 1) + SEP + (x + 1) + 'H';\n};\n\nexport const cursorMove = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tlet returnValue = '';\n\n\tif (x < 0) {\n\t\treturnValue += ESC + (-x) + 'D';\n\t} else if (x > 0) {\n\t\treturnValue += ESC + x + 'C';\n\t}\n\n\tif (y < 0) {\n\t\treturnValue += ESC + (-y) + 'A';\n\t} else if (y > 0) {\n\t\treturnValue += ESC + y + 'B';\n\t}\n\n\treturn returnValue;\n};\n\nexport const cursorUp = (count = 1) => ESC + count + 'A';\nexport const cursorDown = (count = 1) => ESC + count + 'B';\nexport const cursorForward = (count = 1) => ESC + count + 'C';\nexport const cursorBackward = (count = 1) => ESC + count + 'D';\n\nexport const cursorLeft = ESC + 'G';\nexport const cursorSavePosition = isTerminalApp ? '\\u001B7' : ESC + 's';\nexport const cursorRestorePosition = isTerminalApp ? '\\u001B8' : ESC + 'u';\nexport const cursorGetPosition = ESC + '6n';\nexport const cursorNextLine = ESC + 'E';\nexport const cursorPrevLine = ESC + 'F';\nexport const cursorHide = ESC + '?25l';\nexport const cursorShow = ESC + '?25h';\n\nexport const eraseLines = count => {\n\tlet clear = '';\n\n\tfor (let i = 0; i < count; i++) {\n\t\tclear += eraseLine + (i < count - 1 ? cursorUp() : '');\n\t}\n\n\tif (count) {\n\t\tclear += cursorLeft;\n\t}\n\n\treturn clear;\n};\n\nexport const eraseEndLine = ESC + 'K';\nexport const eraseStartLine = ESC + '1K';\nexport const eraseLine = ESC + '2K';\nexport const eraseDown = ESC + 'J';\nexport const eraseUp = ESC + '1J';\nexport const eraseScreen = ESC + '2J';\nexport const scrollUp = ESC + 'S';\nexport const scrollDown = ESC + 'T';\n\nexport const clearScreen = '\\u001Bc';\n\nexport const clearViewport = `${eraseScreen}${ESC}H`;\n\nexport const clearTerminal = isWindows\n\t? `${eraseScreen}${ESC}0f`\n\t// 1. Erases the screen (Only done in case `2` is not supported)\n\t// 2. Erases the whole screen including scrollback buffer\n\t// 3. Moves cursor to the top-left position\n\t// More info: https://www.real-world-systems.com/docs/ANSIcode.html\n\t:\t`${eraseScreen}${ESC}3J${ESC}H`;\n\nexport const enterAlternativeScreen = ESC + '?1049h';\nexport const exitAlternativeScreen = ESC + '?1049l';\n\nexport const beep = BEL;\n\nexport const link = (text, url) => [\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\turl,\n\tBEL,\n\ttext,\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\tBEL,\n].join('');\n\nexport const image = (data, options = {}) => {\n\tlet returnValue = `${OSC}1337;File=inline=1`;\n\n\tif (options.width) {\n\t\treturnValue += `;width=${options.width}`;\n\t}\n\n\tif (options.height) {\n\t\treturnValue += `;height=${options.height}`;\n\t}\n\n\tif (options.preserveAspectRatio === false) {\n\t\treturnValue += ';preserveAspectRatio=0';\n\t}\n\n\treturn returnValue + ':' + Buffer.from(data).toString('base64') + BEL;\n};\n\nexport const iTerm = {\n\tsetCwd: (cwd = cwdFunction()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,\n\n\tannotation(message, options = {}) {\n\t\tlet returnValue = `${OSC}1337;`;\n\n\t\tconst hasX = options.x !== undefined;\n\t\tconst hasY = options.y !== undefined;\n\t\tif ((hasX || hasY) && !(hasX && hasY && options.length !== undefined)) {\n\t\t\tthrow new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');\n\t\t}\n\n\t\tmessage = message.replaceAll('|', '');\n\n\t\treturnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';\n\n\t\tif (options.length > 0) {\n\t\t\treturnValue += (\n\t\t\t\thasX\n\t\t\t\t\t? [message, options.length, options.x, options.y]\n\t\t\t\t\t: [options.length, message]\n\t\t\t).join('|');\n\t\t} else {\n\t\t\treturnValue += message;\n\t\t}\n\n\t\treturn returnValue + BEL;\n\t},\n};\n\nexport const ConEmu = {\n\tsetCwd: (cwd = cwdFunction()) => `${OSC}9;9;${cwd}${BEL}`,\n};\n\nexport const setCwd = (cwd = cwdFunction()) => iTerm.setCwd(cwd) + ConEmu.setCwd(cwd);\n","import {\n\t_isFullWidth as isFullWidth,\n\t_isWide as isWide,\n} from 'get-east-asian-width';\n\nexport default function isFullwidthCodePoint(codePoint) {\n\tif (!Number.isInteger(codePoint)) {\n\t\treturn false;\n\t}\n\n\treturn isFullWidth(codePoint) || isWide(codePoint);\n}\n","import ansiStyles from 'ansi-styles';\nimport isFullwidthCodePoint from 'is-fullwidth-code-point';\n\n// \\x1b and \\x9b\nconst ESCAPES = new Set([27, 155]);\n\nconst CODE_POINT_0 = '0'.codePointAt(0);\nconst CODE_POINT_9 = '9'.codePointAt(0);\n\nconst endCodesSet = new Set();\nconst endCodesMap = new Map();\nfor (const [start, end] of ansiStyles.codes) {\n\tendCodesSet.add(ansiStyles.color.ansi(end));\n\tendCodesMap.set(ansiStyles.color.ansi(start), ansiStyles.color.ansi(end));\n}\n\nfunction getEndCode(code) {\n\tif (endCodesSet.has(code)) {\n\t\treturn code;\n\t}\n\n\tif (endCodesMap.has(code)) {\n\t\treturn endCodesMap.get(code);\n\t}\n\n\tcode = code.slice(2);\n\tif (code.includes(';')) {\n\t\tcode = code[0] + '0';\n\t}\n\n\tconst returnValue = ansiStyles.codes.get(Number.parseInt(code, 10));\n\tif (returnValue) {\n\t\treturn ansiStyles.color.ansi(returnValue);\n\t}\n\n\treturn ansiStyles.reset.open;\n}\n\nfunction findNumberIndex(string) {\n\tfor (let index = 0; index < string.length; index++) {\n\t\tconst codePoint = string.codePointAt(index);\n\t\tif (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) {\n\t\t\treturn index;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nfunction parseAnsiCode(string, offset) {\n\tstring = string.slice(offset, offset + 19);\n\tconst startIndex = findNumberIndex(string);\n\tif (startIndex !== -1) {\n\t\tlet endIndex = string.indexOf('m', startIndex);\n\t\tif (endIndex === -1) {\n\t\t\tendIndex = string.length;\n\t\t}\n\n\t\treturn string.slice(0, endIndex + 1);\n\t}\n}\n\nfunction tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {\n\tconst returnValue = [];\n\n\tlet index = 0;\n\tlet visibleCount = 0;\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\treturnValue.push({\n\t\t\t\t\ttype: 'ansi',\n\t\t\t\t\tcode,\n\t\t\t\t\tendCode: getEndCode(code),\n\t\t\t\t});\n\t\t\t\tindex += code.length;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst isFullWidth = isFullwidthCodePoint(codePoint);\n\t\tconst character = String.fromCodePoint(codePoint);\n\n\t\treturnValue.push({\n\t\t\ttype: 'character',\n\t\t\tvalue: character,\n\t\t\tisFullWidth,\n\t\t});\n\n\t\tindex += character.length;\n\t\tvisibleCount += isFullWidth ? 2 : character.length;\n\n\t\tif (visibleCount >= endCharacter) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn returnValue;\n}\n\nfunction reduceAnsiCodes(codes) {\n\tlet returnValue = [];\n\n\tfor (const code of codes) {\n\t\tif (code.code === ansiStyles.reset.open) {\n\t\t\t// Reset code, disable all codes\n\t\t\treturnValue = [];\n\t\t} else if (endCodesSet.has(code.code)) {\n\t\t\t// This is an end code, disable all matching start codes\n\t\t\treturnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.code);\n\t\t} else {\n\t\t\t// This is a start code. Disable all styles this \"overrides\", then enable it\n\t\t\treturnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.endCode);\n\t\t\treturnValue.push(code);\n\t\t}\n\t}\n\n\treturn returnValue;\n}\n\nfunction undoAnsiCodes(codes) {\n\tconst reduced = reduceAnsiCodes(codes);\n\tconst endCodes = reduced.map(({endCode}) => endCode);\n\treturn endCodes.reverse().join('');\n}\n\nexport default function sliceAnsi(string, start, end) {\n\tconst tokens = tokenize(string, end);\n\tlet activeCodes = [];\n\tlet position = 0;\n\tlet returnValue = '';\n\tlet include = false;\n\n\tfor (const token of tokens) {\n\t\tif (end !== undefined && position >= end) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type === 'ansi') {\n\t\t\tactiveCodes.push(token);\n\t\t\tif (include) {\n\t\t\t\treturnValue += token.code;\n\t\t\t}\n\t\t} else {\n\t\t\t// Character\n\t\t\tif (!include && position >= start) {\n\t\t\t\tinclude = true;\n\t\t\t\t// Simplify active codes\n\t\t\t\tactiveCodes = reduceAnsiCodes(activeCodes);\n\t\t\t\treturnValue = activeCodes.map(({code}) => code).join('');\n\t\t\t}\n\n\t\t\tif (include) {\n\t\t\t\treturnValue += token.value;\n\t\t\t}\n\n\t\t\tposition += token.isFullWidth ? 2 : token.value.length;\n\t\t}\n\t}\n\n\t// Disable active codes at the end\n\treturnValue += undoAnsiCodes(activeCodes);\n\treturn returnValue;\n}\n","import process from 'node:process';\nimport ansiEscapes from 'ansi-escapes';\nimport cliCursor from 'cli-cursor';\nimport wrapAnsi from 'wrap-ansi';\nimport sliceAnsi from 'slice-ansi';\nimport stripAnsi from 'strip-ansi';\n\nconst defaultTerminalHeight = 24;\n\nconst getWidth = ({columns = 80}) => columns;\n\nconst fitToTerminalHeight = (stream, text) => {\n\tconst terminalHeight = stream.rows ?? defaultTerminalHeight;\n\tconst lines = text.split('\\n');\n\tconst toRemove = Math.max(0, lines.length - terminalHeight);\n\treturn toRemove ? sliceAnsi(text, stripAnsi(lines.slice(0, toRemove).join('\\n')).length + 1) : text;\n};\n\nexport function createLogUpdate(stream, {showCursor = false} = {}) {\n\tlet previousLineCount = 0;\n\tlet previousWidth = getWidth(stream);\n\tlet previousOutput = '';\n\n\tconst reset = () => {\n\t\tpreviousOutput = '';\n\t\tpreviousWidth = getWidth(stream);\n\t\tpreviousLineCount = 0;\n\t};\n\n\tconst render = (...arguments_) => {\n\t\tif (!showCursor) {\n\t\t\tcliCursor.hide();\n\t\t}\n\n\t\tlet output = fitToTerminalHeight(stream, arguments_.join(' ') + '\\n');\n\t\tconst width = getWidth(stream);\n\n\t\tif (output === previousOutput && previousWidth === width) {\n\t\t\treturn;\n\t\t}\n\n\t\tpreviousOutput = output;\n\t\tpreviousWidth = width;\n\t\toutput = wrapAnsi(output, width, {trim: false, hard: true, wordWrap: false});\n\n\t\tstream.write(ansiEscapes.eraseLines(previousLineCount) + output);\n\t\tpreviousLineCount = output.split('\\n').length;\n\t};\n\n\trender.clear = () => {\n\t\tstream.write(ansiEscapes.eraseLines(previousLineCount));\n\t\treset();\n\t};\n\n\trender.done = () => {\n\t\treset();\n\t\tif (!showCursor) {\n\t\t\tcliCursor.show();\n\t\t}\n\t};\n\n\treturn render;\n}\n\nconst logUpdate = createLogUpdate(process.stdout);\nexport default logUpdate;\n\nexport const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CAAC,WACJ,oBAAU,MAAM;;AAIlB,QAAO;;AAGR,MAAM,YAAY,gBAAgB,QAAQ,OAAO;AAGjD,MAAa,kBAAkB,gBAAgB,QAAQ,OAAO"}
|
|
Binary file
|
package/dist/sandbox.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, s as __toESM, t as __commonJS } from "./chunk-btbCw1m3.mjs";
|
|
2
|
-
import { a as source_exports, i as init_source, n as StyledError, r as require_cjs, t as app } from "./app-
|
|
2
|
+
import { a as source_exports, i as init_source, n as StyledError, r as require_cjs, t as app } from "./app-DCn8EUEY.mjs";
|
|
3
3
|
import "./string-width-D78SVDLD.mjs";
|
|
4
4
|
import "./cli-cursor-Dab4mDU2.mjs";
|
|
5
|
-
import "./token-
|
|
5
|
+
import "./token-util-DACSFqcB.mjs";
|
|
6
6
|
|
|
7
7
|
//#region ../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json
|
|
8
8
|
var require_package$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json": ((exports, module) => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { t as __commonJS } from "./chunk-btbCw1m3.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as require_token_util } from "./token-util-BpWskZEO.mjs";
|
|
2
|
+
import { r as require_token_error, t as require_token_util } from "./token-util-DACSFqcB.mjs";
|
|
4
3
|
|
|
5
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
6
|
-
var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.
|
|
4
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
5
|
+
var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js": ((exports, module) => {
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
8
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -29,13 +28,22 @@ var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@verc
|
|
|
29
28
|
module.exports = __toCommonJS(token_exports);
|
|
30
29
|
var import_token_error = require_token_error();
|
|
31
30
|
var import_token_util = require_token_util();
|
|
32
|
-
async function refreshToken() {
|
|
33
|
-
|
|
31
|
+
async function refreshToken(options) {
|
|
32
|
+
let projectId = options?.project;
|
|
33
|
+
let teamId = options?.team;
|
|
34
|
+
if (!projectId && !teamId) {
|
|
35
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
36
|
+
projectId = projectInfo.projectId;
|
|
37
|
+
teamId = projectInfo.teamId;
|
|
38
|
+
} else if (!projectId || !teamId) {
|
|
39
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
40
|
+
projectId = projectId ?? projectInfo.projectId;
|
|
41
|
+
teamId = teamId ?? projectInfo.teamId;
|
|
42
|
+
}
|
|
43
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");
|
|
34
44
|
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
35
|
-
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
|
|
36
|
-
const authToken = await (0, import_token_util.
|
|
37
|
-
if (!authToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");
|
|
38
|
-
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");
|
|
45
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {
|
|
46
|
+
const authToken = await (0, import_token_util.getVercelToken)({ expirationBufferMs: options?.expirationBufferMs });
|
|
39
47
|
maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
40
48
|
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
41
49
|
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
@@ -48,4 +56,4 @@ var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@verc
|
|
|
48
56
|
export default require_token();
|
|
49
57
|
|
|
50
58
|
export { };
|
|
51
|
-
//# sourceMappingURL=token-
|
|
59
|
+
//# sourceMappingURL=token-CFLlmxRf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-CFLlmxRf.mjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;IAAY,CAAC;;AAExH,SAAO;;CAET,IAAI,gBAAgB,QAAQ,YAAY,UAAU,EAAE,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,EAAE;AACtB,UAAS,eAAe,EACtB,oBAAoB,cACrB,CAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;AACtB,MAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,YAAY;AACxB,YAAS,YAAY;aACZ,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,aAAa,YAAY;AACrC,YAAS,UAAU,YAAY;;AAEjC,MAAI,CAAC,UACH,OAAM,IAAI,mBAAmB,qBAC3B,iGACD;EAEH,IAAI,cAAc,GAAG,kBAAkB,WAAW,UAAU;AAC5D,MAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,EAAE,SAAS,mBAAmB,EAAE;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,oBAC9B,CAAC;AACF,gBAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,OAAI,CAAC,WACH,OAAM,IAAI,mBAAmB,qBAAqB,+BAA+B;AAEnF,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;;AAEzD,UAAQ,IAAI,oBAAoB,WAAW"}
|
|
@@ -1,8 +1,89 @@
|
|
|
1
1
|
import { i as __require, t as __commonJS } from "./chunk-btbCw1m3.mjs";
|
|
2
|
-
import { t as require_token_error } from "./token-error-C0CafU2G.mjs";
|
|
3
2
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
5
|
-
var
|
|
3
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js
|
|
4
|
+
var require_token_error = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js": ((exports, module) => {
|
|
5
|
+
var __defProp$5 = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames$5 = Object.getOwnPropertyNames;
|
|
8
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export$5 = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp$5(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps$5 = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames$5(from)) if (!__hasOwnProp$5.call(to, key) && key !== except) __defProp$5(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc$5(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS$5 = (mod) => __copyProps$5(__defProp$5({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var token_error_exports = {};
|
|
26
|
+
__export$5(token_error_exports, { VercelOidcTokenError: () => VercelOidcTokenError });
|
|
27
|
+
module.exports = __toCommonJS$5(token_error_exports);
|
|
28
|
+
var VercelOidcTokenError = class extends Error {
|
|
29
|
+
constructor(message, cause) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.name = "VercelOidcTokenError";
|
|
32
|
+
this.cause = cause;
|
|
33
|
+
}
|
|
34
|
+
toString() {
|
|
35
|
+
if (this.cause) return `${this.name}: ${this.message}: ${this.cause}`;
|
|
36
|
+
return `${this.name}: ${this.message}`;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}) });
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js
|
|
43
|
+
var require_auth_errors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js": ((exports, module) => {
|
|
44
|
+
var __defProp$4 = Object.defineProperty;
|
|
45
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
46
|
+
var __getOwnPropNames$4 = Object.getOwnPropertyNames;
|
|
47
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
48
|
+
var __export$4 = (target, all) => {
|
|
49
|
+
for (var name in all) __defProp$4(target, name, {
|
|
50
|
+
get: all[name],
|
|
51
|
+
enumerable: true
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var __copyProps$4 = (to, from, except, desc) => {
|
|
55
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
56
|
+
for (let key of __getOwnPropNames$4(from)) if (!__hasOwnProp$4.call(to, key) && key !== except) __defProp$4(to, key, {
|
|
57
|
+
get: () => from[key],
|
|
58
|
+
enumerable: !(desc = __getOwnPropDesc$4(from, key)) || desc.enumerable
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return to;
|
|
62
|
+
};
|
|
63
|
+
var __toCommonJS$4 = (mod) => __copyProps$4(__defProp$4({}, "__esModule", { value: true }), mod);
|
|
64
|
+
var auth_errors_exports = {};
|
|
65
|
+
__export$4(auth_errors_exports, {
|
|
66
|
+
AccessTokenMissingError: () => AccessTokenMissingError,
|
|
67
|
+
RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError
|
|
68
|
+
});
|
|
69
|
+
module.exports = __toCommonJS$4(auth_errors_exports);
|
|
70
|
+
var AccessTokenMissingError = class extends Error {
|
|
71
|
+
constructor() {
|
|
72
|
+
super("No authentication found. Please log in with the Vercel CLI (vercel login).");
|
|
73
|
+
this.name = "AccessTokenMissingError";
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var RefreshAccessTokenFailedError = class extends Error {
|
|
77
|
+
constructor(cause) {
|
|
78
|
+
super("Failed to refresh authentication token.", { cause });
|
|
79
|
+
this.name = "RefreshAccessTokenFailedError";
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}) });
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js
|
|
86
|
+
var require_token_io = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js": ((exports, module) => {
|
|
6
87
|
var __create$2 = Object.create;
|
|
7
88
|
var __defProp$3 = Object.defineProperty;
|
|
8
89
|
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
@@ -66,8 +147,8 @@ var require_token_io = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@v
|
|
|
66
147
|
}) });
|
|
67
148
|
|
|
68
149
|
//#endregion
|
|
69
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
70
|
-
var require_auth_config = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.
|
|
150
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js
|
|
151
|
+
var require_auth_config = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js": ((exports, module) => {
|
|
71
152
|
var __create$1 = Object.create;
|
|
72
153
|
var __defProp$2 = Object.defineProperty;
|
|
73
154
|
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
@@ -129,17 +210,18 @@ var require_auth_config = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
129
210
|
});
|
|
130
211
|
fs$1.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });
|
|
131
212
|
}
|
|
132
|
-
function isValidAccessToken(authConfig) {
|
|
213
|
+
function isValidAccessToken(authConfig, expirationBufferMs = 0) {
|
|
133
214
|
if (!authConfig.token) return false;
|
|
134
215
|
if (typeof authConfig.expiresAt !== "number") return true;
|
|
135
216
|
const nowInSeconds = Math.floor(Date.now() / 1e3);
|
|
136
|
-
|
|
217
|
+
const bufferInSeconds = expirationBufferMs / 1e3;
|
|
218
|
+
return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;
|
|
137
219
|
}
|
|
138
220
|
}) });
|
|
139
221
|
|
|
140
222
|
//#endregion
|
|
141
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
142
|
-
var require_oauth = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.
|
|
223
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js
|
|
224
|
+
var require_oauth = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js": ((exports, module) => {
|
|
143
225
|
var __defProp$1 = Object.defineProperty;
|
|
144
226
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
145
227
|
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
@@ -212,8 +294,8 @@ var require_oauth = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@verc
|
|
|
212
294
|
}) });
|
|
213
295
|
|
|
214
296
|
//#endregion
|
|
215
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.
|
|
216
|
-
var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.
|
|
297
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js
|
|
298
|
+
var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js": ((exports, module) => {
|
|
217
299
|
var __create = Object.create;
|
|
218
300
|
var __defProp = Object.defineProperty;
|
|
219
301
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -245,9 +327,9 @@ var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
245
327
|
assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
|
|
246
328
|
findProjectInfo: () => findProjectInfo,
|
|
247
329
|
getTokenPayload: () => getTokenPayload,
|
|
248
|
-
getVercelCliToken: () => getVercelCliToken,
|
|
249
330
|
getVercelDataDir: () => getVercelDataDir,
|
|
250
331
|
getVercelOidcToken: () => getVercelOidcToken,
|
|
332
|
+
getVercelToken: () => getVercelToken,
|
|
251
333
|
isExpired: () => isExpired,
|
|
252
334
|
loadToken: () => loadToken,
|
|
253
335
|
saveToken: () => saveToken
|
|
@@ -259,26 +341,27 @@ var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
259
341
|
var import_token_io = require_token_io();
|
|
260
342
|
var import_auth_config = require_auth_config();
|
|
261
343
|
var import_oauth = require_oauth();
|
|
344
|
+
var import_auth_errors = require_auth_errors();
|
|
262
345
|
function getVercelDataDir() {
|
|
263
346
|
const vercelFolder = "com.vercel.cli";
|
|
264
347
|
const dataDir = (0, import_token_io.getUserDataDir)();
|
|
265
348
|
if (!dataDir) return null;
|
|
266
349
|
return path.join(dataDir, vercelFolder);
|
|
267
350
|
}
|
|
268
|
-
async function
|
|
351
|
+
async function getVercelToken(options) {
|
|
269
352
|
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
270
|
-
if (!authConfig)
|
|
271
|
-
if ((0, import_auth_config.isValidAccessToken)(authConfig)) return authConfig.token
|
|
353
|
+
if (!authConfig?.token) throw new import_auth_errors.AccessTokenMissingError();
|
|
354
|
+
if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) return authConfig.token;
|
|
272
355
|
if (!authConfig.refreshToken) {
|
|
273
356
|
(0, import_auth_config.writeAuthConfig)({});
|
|
274
|
-
|
|
357
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError("No refresh token available");
|
|
275
358
|
}
|
|
276
359
|
try {
|
|
277
360
|
const tokenResponse = await (0, import_oauth.refreshTokenRequest)({ refresh_token: authConfig.refreshToken });
|
|
278
361
|
const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);
|
|
279
362
|
if (tokensError || !tokens) {
|
|
280
363
|
(0, import_auth_config.writeAuthConfig)({});
|
|
281
|
-
|
|
364
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);
|
|
282
365
|
}
|
|
283
366
|
const updatedConfig = {
|
|
284
367
|
token: tokens.access_token,
|
|
@@ -286,10 +369,11 @@ var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
286
369
|
};
|
|
287
370
|
if (tokens.refresh_token) updatedConfig.refreshToken = tokens.refresh_token;
|
|
288
371
|
(0, import_auth_config.writeAuthConfig)(updatedConfig);
|
|
289
|
-
return updatedConfig.token
|
|
372
|
+
return updatedConfig.token;
|
|
290
373
|
} catch (error) {
|
|
291
374
|
(0, import_auth_config.writeAuthConfig)({});
|
|
292
|
-
|
|
375
|
+
if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) throw error;
|
|
376
|
+
throw new import_auth_errors.RefreshAccessTokenFailedError(error);
|
|
293
377
|
}
|
|
294
378
|
}
|
|
295
379
|
async function getVercelOidcToken(authToken, projectId, teamId) {
|
|
@@ -347,11 +431,11 @@ var require_token_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
347
431
|
const padded = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "=");
|
|
348
432
|
return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
|
|
349
433
|
}
|
|
350
|
-
function isExpired(token) {
|
|
351
|
-
return token.exp * 1e3 < Date.now();
|
|
434
|
+
function isExpired(token, bufferMs = 0) {
|
|
435
|
+
return token.exp * 1e3 < Date.now() + bufferMs;
|
|
352
436
|
}
|
|
353
437
|
}) });
|
|
354
438
|
|
|
355
439
|
//#endregion
|
|
356
|
-
export { require_token_util as t };
|
|
357
|
-
//# sourceMappingURL=token-util-
|
|
440
|
+
export { require_auth_errors as n, require_token_error as r, require_token_util as t };
|
|
441
|
+
//# sourceMappingURL=token-util-DACSFqcB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-util-DACSFqcB.mjs","names":["__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","import_os","import_token_error","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","__copyProps","__toESM","__toCommonJS","fs","path","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","__copyProps","__toCommonJS"],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-errors.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-io.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/auth-config.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/oauth.js","../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-util.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_errors_exports = {};\n__export(auth_errors_exports, {\n AccessTokenMissingError: () => AccessTokenMissingError,\n RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError\n});\nmodule.exports = __toCommonJS(auth_errors_exports);\nclass AccessTokenMissingError extends Error {\n constructor() {\n super(\n \"No authentication found. Please log in with the Vercel CLI (vercel login).\"\n );\n this.name = \"AccessTokenMissingError\";\n }\n}\nclass RefreshAccessTokenFailedError extends Error {\n constructor(cause) {\n super(\"Failed to refresh authentication token.\", { cause });\n this.name = \"RefreshAccessTokenFailedError\";\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AccessTokenMissingError,\n RefreshAccessTokenFailedError\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_io_exports = {};\n__export(token_io_exports, {\n findRootDir: () => findRootDir,\n getUserDataDir: () => getUserDataDir\n});\nmodule.exports = __toCommonJS(token_io_exports);\nvar import_path = __toESM(require(\"path\"));\nvar import_fs = __toESM(require(\"fs\"));\nvar import_os = __toESM(require(\"os\"));\nvar import_token_error = require(\"./token-error\");\nfunction findRootDir() {\n try {\n let dir = process.cwd();\n while (dir !== import_path.default.dirname(dir)) {\n const pkgPath = import_path.default.join(dir, \".vercel\");\n if (import_fs.default.existsSync(pkgPath)) {\n return dir;\n }\n dir = import_path.default.dirname(dir);\n }\n } catch (e) {\n throw new import_token_error.VercelOidcTokenError(\n \"Token refresh only supported in node server environments\"\n );\n }\n return null;\n}\nfunction getUserDataDir() {\n if (process.env.XDG_DATA_HOME) {\n return process.env.XDG_DATA_HOME;\n }\n switch (import_os.default.platform()) {\n case \"darwin\":\n return import_path.default.join(import_os.default.homedir(), \"Library/Application Support\");\n case \"linux\":\n return import_path.default.join(import_os.default.homedir(), \".local/share\");\n case \"win32\":\n if (process.env.LOCALAPPDATA) {\n return process.env.LOCALAPPDATA;\n }\n return null;\n default:\n return null;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n findRootDir,\n getUserDataDir\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar auth_config_exports = {};\n__export(auth_config_exports, {\n isValidAccessToken: () => isValidAccessToken,\n readAuthConfig: () => readAuthConfig,\n writeAuthConfig: () => writeAuthConfig\n});\nmodule.exports = __toCommonJS(auth_config_exports);\nvar fs = __toESM(require(\"fs\"));\nvar path = __toESM(require(\"path\"));\nvar import_token_util = require(\"./token-util\");\nfunction getAuthConfigPath() {\n const dataDir = (0, import_token_util.getVercelDataDir)();\n if (!dataDir) {\n throw new Error(\n `Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`\n );\n }\n return path.join(dataDir, \"auth.json\");\n}\nfunction readAuthConfig() {\n try {\n const authPath = getAuthConfigPath();\n if (!fs.existsSync(authPath)) {\n return null;\n }\n const content = fs.readFileSync(authPath, \"utf8\");\n if (!content) {\n return null;\n }\n return JSON.parse(content);\n } catch (error) {\n return null;\n }\n}\nfunction writeAuthConfig(config) {\n const authPath = getAuthConfigPath();\n const authDir = path.dirname(authPath);\n if (!fs.existsSync(authDir)) {\n fs.mkdirSync(authDir, { mode: 504, recursive: true });\n }\n fs.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 });\n}\nfunction isValidAccessToken(authConfig, expirationBufferMs = 0) {\n if (!authConfig.token)\n return false;\n if (typeof authConfig.expiresAt !== \"number\")\n return true;\n const nowInSeconds = Math.floor(Date.now() / 1e3);\n const bufferInSeconds = expirationBufferMs / 1e3;\n return authConfig.expiresAt >= nowInSeconds + bufferInSeconds;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n isValidAccessToken,\n readAuthConfig,\n writeAuthConfig\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar oauth_exports = {};\n__export(oauth_exports, {\n processTokenResponse: () => processTokenResponse,\n refreshTokenRequest: () => refreshTokenRequest\n});\nmodule.exports = __toCommonJS(oauth_exports);\nvar import_os = require(\"os\");\nconst VERCEL_ISSUER = \"https://vercel.com\";\nconst VERCEL_CLI_CLIENT_ID = \"cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp\";\nconst userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`;\nlet _tokenEndpoint = null;\nasync function getTokenEndpoint() {\n if (_tokenEndpoint) {\n return _tokenEndpoint;\n }\n const discoveryUrl = `${VERCEL_ISSUER}/.well-known/openid-configuration`;\n const response = await fetch(discoveryUrl, {\n headers: { \"user-agent\": userAgent }\n });\n if (!response.ok) {\n throw new Error(\"Failed to discover OAuth endpoints\");\n }\n const metadata = await response.json();\n if (!metadata || typeof metadata.token_endpoint !== \"string\") {\n throw new Error(\"Invalid OAuth discovery response\");\n }\n const endpoint = metadata.token_endpoint;\n _tokenEndpoint = endpoint;\n return endpoint;\n}\nasync function refreshTokenRequest(options) {\n const tokenEndpoint = await getTokenEndpoint();\n return await fetch(tokenEndpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"user-agent\": userAgent\n },\n body: new URLSearchParams({\n client_id: VERCEL_CLI_CLIENT_ID,\n grant_type: \"refresh_token\",\n ...options\n })\n });\n}\nasync function processTokenResponse(response) {\n const json = await response.json();\n if (!response.ok) {\n const errorMsg = typeof json === \"object\" && json && \"error\" in json ? String(json.error) : \"Token refresh failed\";\n return [new Error(errorMsg)];\n }\n if (typeof json !== \"object\" || json === null) {\n return [new Error(\"Invalid token response\")];\n }\n if (typeof json.access_token !== \"string\") {\n return [new Error(\"Missing access_token in response\")];\n }\n if (json.token_type !== \"Bearer\") {\n return [new Error(\"Invalid token_type in response\")];\n }\n if (typeof json.expires_in !== \"number\") {\n return [new Error(\"Missing expires_in in response\")];\n }\n return [null, json];\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n processTokenResponse,\n refreshTokenRequest\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_util_exports = {};\n__export(token_util_exports, {\n assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,\n findProjectInfo: () => findProjectInfo,\n getTokenPayload: () => getTokenPayload,\n getVercelDataDir: () => getVercelDataDir,\n getVercelOidcToken: () => getVercelOidcToken,\n getVercelToken: () => getVercelToken,\n isExpired: () => isExpired,\n loadToken: () => loadToken,\n saveToken: () => saveToken\n});\nmodule.exports = __toCommonJS(token_util_exports);\nvar path = __toESM(require(\"path\"));\nvar fs = __toESM(require(\"fs\"));\nvar import_token_error = require(\"./token-error\");\nvar import_token_io = require(\"./token-io\");\nvar import_auth_config = require(\"./auth-config\");\nvar import_oauth = require(\"./oauth\");\nvar import_auth_errors = require(\"./auth-errors\");\nfunction getVercelDataDir() {\n const vercelFolder = \"com.vercel.cli\";\n const dataDir = (0, import_token_io.getUserDataDir)();\n if (!dataDir) {\n return null;\n }\n return path.join(dataDir, vercelFolder);\n}\nasync function getVercelToken(options) {\n const authConfig = (0, import_auth_config.readAuthConfig)();\n if (!authConfig?.token) {\n throw new import_auth_errors.AccessTokenMissingError();\n }\n if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) {\n return authConfig.token;\n }\n if (!authConfig.refreshToken) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(\"No refresh token available\");\n }\n try {\n const tokenResponse = await (0, import_oauth.refreshTokenRequest)({\n refresh_token: authConfig.refreshToken\n });\n const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse);\n if (tokensError || !tokens) {\n (0, import_auth_config.writeAuthConfig)({});\n throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError);\n }\n const updatedConfig = {\n token: tokens.access_token,\n expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in\n };\n if (tokens.refresh_token) {\n updatedConfig.refreshToken = tokens.refresh_token;\n }\n (0, import_auth_config.writeAuthConfig)(updatedConfig);\n return updatedConfig.token;\n } catch (error) {\n (0, import_auth_config.writeAuthConfig)({});\n if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) {\n throw error;\n }\n throw new import_auth_errors.RefreshAccessTokenFailedError(error);\n }\n}\nasync function getVercelOidcToken(authToken, projectId, teamId) {\n const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : \"\"}`;\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${authToken}`\n }\n });\n if (!res.ok) {\n throw new import_token_error.VercelOidcTokenError(\n `Failed to refresh OIDC token: ${res.statusText}`\n );\n }\n const tokenRes = await res.json();\n assertVercelOidcTokenResponse(tokenRes);\n return tokenRes;\n}\nfunction assertVercelOidcTokenResponse(res) {\n if (!res || typeof res !== \"object\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again\"\n );\n }\n if (!(\"token\" in res) || typeof res.token !== \"string\") {\n throw new TypeError(\n \"Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again\"\n );\n }\n}\nfunction findProjectInfo() {\n const dir = (0, import_token_io.findRootDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find project root directory. Have you linked your project with `vc link?`\"\n );\n }\n const prjPath = path.join(dir, \".vercel\", \"project.json\");\n if (!fs.existsSync(prjPath)) {\n throw new import_token_error.VercelOidcTokenError(\n \"project.json not found, have you linked your project with `vc link?`\"\n );\n }\n const prj = JSON.parse(fs.readFileSync(prjPath, \"utf8\"));\n if (typeof prj.projectId !== \"string\" && typeof prj.orgId !== \"string\") {\n throw new TypeError(\n \"Expected a string-valued projectId property. Try running `vc link` to re-link your project.\"\n );\n }\n return { projectId: prj.projectId, teamId: prj.orgId };\n}\nfunction saveToken(token, projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n const tokenJson = JSON.stringify(token);\n fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });\n fs.writeFileSync(tokenPath, tokenJson);\n fs.chmodSync(tokenPath, 432);\n return;\n}\nfunction loadToken(projectId) {\n const dir = (0, import_token_io.getUserDataDir)();\n if (!dir) {\n throw new import_token_error.VercelOidcTokenError(\n \"Unable to find user data directory. Please reach out to Vercel support.\"\n );\n }\n const tokenPath = path.join(dir, \"com.vercel.token\", `${projectId}.json`);\n if (!fs.existsSync(tokenPath)) {\n return null;\n }\n const token = JSON.parse(fs.readFileSync(tokenPath, \"utf8\"));\n assertVercelOidcTokenResponse(token);\n return token;\n}\nfunction getTokenPayload(token) {\n const tokenParts = token.split(\".\");\n if (tokenParts.length !== 3) {\n throw new import_token_error.VercelOidcTokenError(\n \"Invalid token. Please run `vc env pull` and try again\"\n );\n }\n const base64 = tokenParts[1].replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64.padEnd(\n base64.length + (4 - base64.length % 4) % 4,\n \"=\"\n );\n return JSON.parse(Buffer.from(padded, \"base64\").toString(\"utf8\"));\n}\nfunction isExpired(token, bufferMs = 0) {\n return token.exp * 1e3 < Date.now() + bufferMs;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n assertVercelOidcTokenResponse,\n findProjectInfo,\n getTokenPayload,\n getVercelDataDir,\n getVercelOidcToken,\n getVercelToken,\n isExpired,\n loadToken,\n saveToken\n});\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;CACA,IAAIA,cAAY,OAAO;CACvB,IAAIC,qBAAmB,OAAO;CAC9B,IAAIC,sBAAoB,OAAO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pB,OAAO,UAAU,IAAI,OAAO,SAAS,KAAK,GAC1C,IACD;AACD,SAAO,KAAK,MAAM,OAAO,KAAK,QAAQ,SAAS,CAAC,SAAS,OAAO,CAAC;;CAEnE,SAAS,UAAU,OAAO,WAAW,GAAG;AACtC,SAAO,MAAM,MAAM,MAAM,KAAK,KAAK,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as stripAnsi, i as init_strip_ansi, t as stringWidth } from "./string-width-D78SVDLD.mjs";
|
|
2
|
-
import { t as ansi_styles_default } from "./ansi-styles-
|
|
2
|
+
import { t as ansi_styles_default } from "./ansi-styles-DEyvEjde.mjs";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
|
|
5
5
|
init_strip_ansi();
|
|
@@ -127,4 +127,4 @@ function wrapAnsi(string, columns, options) {
|
|
|
127
127
|
|
|
128
128
|
//#endregion
|
|
129
129
|
export { wrapAnsi as t };
|
|
130
|
-
//# sourceMappingURL=wrap-ansi-
|
|
130
|
+
//# sourceMappingURL=wrap-ansi-zdFz5AsC.mjs.map
|