@kubb/agent 5.0.0-alpha.34 → 5.0.0-alpha.36
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1790 -20812
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +16 -14
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +16 -14
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/constants.js +18 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/permessage-deflate.js +514 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/sender.js +602 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/stream.js +159 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket-server.js +540 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket.js +1388 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/package.json +69 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/wrapper.mjs +8 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/event-target.js +292 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/extension.js +203 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/limiter.js +55 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/receiver.js +706 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/validation.js +152 -0
- package/.output/server/node_modules/@clack/core/dist/index.mjs +11 -0
- package/.output/server/node_modules/@clack/core/package.json +60 -0
- package/.output/server/node_modules/@clack/prompts/dist/index.mjs +137 -0
- package/.output/server/node_modules/@clack/prompts/package.json +65 -0
- package/.output/server/node_modules/@kubb/ast/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/ast/dist/index.js +423 -0
- package/.output/server/node_modules/@kubb/ast/package.json +70 -0
- package/.output/server/node_modules/@kubb/core/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/core/dist/hooks.js +23 -0
- package/.output/server/node_modules/@kubb/core/dist/index.js +2311 -0
- package/.output/server/node_modules/@kubb/core/package.json +109 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-O_arW02_.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/defaultParser-iCpMSYCp.js +15 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/getRelativePath-NAm_Y-vp.js +55 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +653 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/onProcessExit-Cput7j2c.js +742 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +101 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +375 -0
- package/.output/server/node_modules/@kubb/fabric-core/package.json +111 -0
- package/.output/server/node_modules/@kubb/oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/oas/dist/index.js +918 -0
- package/.output/server/node_modules/@kubb/oas/package.json +94 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/StaticClassClient-bCe7RG_w.js +636 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/components.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/generators-BffddRNu.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/index.js +124 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/axios.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/fetch.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/config.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/package.json +153 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/components-BK_6GU4v.js +257 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/generators-D5YFtyyC.js +71 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/index.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/package.json +108 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/components-BkBIov4R.js +419 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/fakerGenerator-BztogaeO.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/index.js +141 -0
- package/.output/server/node_modules/@kubb/plugin-faker/package.json +103 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/Server-H3SwqhwF.js +178 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/generators-BqkMrcs9.js +274 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/index.js +122 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/package.json +107 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/components-DgtTZkWX.js +277 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/generators-C34kqa1L.js +161 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/index.js +84 -0
- package/.output/server/node_modules/@kubb/plugin-msw/package.json +109 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/SchemaMapper-CqMkO2T1.js +58 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators-D7C3CXsN.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/getFooter-Pw3tLCiV.js +112 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/hooks.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/index.js +408 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/requestBody-pRavthCw.js +1336 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/utils.js +268 -0
- package/.output/server/node_modules/@kubb/plugin-oas/package.json +122 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/components-CpyHYGOw.js +1520 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/generators-CpiBv5eE.js +1427 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/index.js +166 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/package.json +112 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/index.js +65 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/package.json +85 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/static/redoc.hbs +22 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/components-BhStIi1M.js +665 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/generators-CQClzsST.js +415 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/components-DntKBsnB.js +666 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/generators-BtTsGGrM.js +414 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/components-DRDGvgXG.js +702 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/generators-ClWZJ-YG.js +399 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/index.js +144 -0
- package/.output/server/node_modules/@kubb/plugin-swr/package.json +115 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/components-C7fu-sK1.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/index.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/plugin-CYC-FGXe.js +479 -0
- package/.output/server/node_modules/@kubb/plugin-ts/package.json +105 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/components-_AMBl0g-.js +1029 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/generators-Zb1s5Wmb.js +661 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/index.js +157 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/package.json +114 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/components-eECfXVou.js +842 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/generators-D1R6NNf2.js +290 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/index.js +175 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/templates/ToZod.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-zod/package.json +112 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/chunk-BGCRLu6H.js +38 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +525 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-Bl0DfUmV.js +1448 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +12 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/reactPlugin-QQPrjNuQ.js +17813 -0
- package/.output/server/node_modules/@kubb/react-fabric/package.json +143 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +11 -1
- package/.output/server/node_modules/@redocly/config/package.json +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +25 -10
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +32 -29
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +47 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +45 -41
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +3 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +41 -55
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +28 -16
- package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
- package/.output/server/node_modules/buffer-from/index.js +72 -0
- package/.output/server/node_modules/buffer-from/package.json +19 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/index.js +171 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
- package/.output/server/node_modules/fast-string-truncated-width/package.json +35 -0
- package/.output/server/node_modules/fast-string-width/dist/index.js +14 -0
- package/.output/server/node_modules/fast-string-width/package.json +34 -0
- package/.output/server/node_modules/fast-wrap-ansi/lib/main.js +216 -0
- package/.output/server/node_modules/fast-wrap-ansi/package.json +51 -0
- package/.output/server/node_modules/p-limit/index.js +127 -0
- package/.output/server/node_modules/p-limit/package.json +58 -0
- package/.output/server/node_modules/react-devtools-core/dist/backend.js +18302 -0
- package/.output/server/node_modules/react-devtools-core/package.json +38 -0
- package/.output/server/node_modules/sisteransi/package.json +34 -0
- package/.output/server/node_modules/sisteransi/src/index.js +58 -0
- package/.output/server/node_modules/source-map-support/package.json +31 -0
- package/.output/server/node_modules/source-map-support/source-map-support.js +625 -0
- package/.output/server/node_modules/typescript/lib/typescript.js +200276 -0
- package/.output/server/node_modules/typescript/package.json +120 -0
- package/.output/server/node_modules/yocto-queue/index.js +90 -0
- package/.output/server/node_modules/yocto-queue/package.json +48 -0
- package/.output/server/package.json +35 -4
- package/package.json +20 -20
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/buffer-util.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/event-target.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/extension.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/limiter.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/receiver.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/subprotocol.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/validation.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/permessage-deflate.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/sender.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/stream.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket-server.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/package.json +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/wrapper.mjs +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import stringWidth from 'fast-string-width';
|
|
2
|
+
const ESC = '\x1B';
|
|
3
|
+
const CSI = '\x9B';
|
|
4
|
+
const END_CODE = 39;
|
|
5
|
+
const ANSI_ESCAPE_BELL = '\u0007';
|
|
6
|
+
const ANSI_CSI = '[';
|
|
7
|
+
const ANSI_OSC = ']';
|
|
8
|
+
const ANSI_SGR_TERMINATOR = 'm';
|
|
9
|
+
const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
10
|
+
const GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');
|
|
11
|
+
const getClosingCode = (openingCode) => {
|
|
12
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
13
|
+
return 39;
|
|
14
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
15
|
+
return 39;
|
|
16
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
17
|
+
return 49;
|
|
18
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
19
|
+
return 49;
|
|
20
|
+
if (openingCode === 1 || openingCode === 2)
|
|
21
|
+
return 22;
|
|
22
|
+
if (openingCode === 3)
|
|
23
|
+
return 23;
|
|
24
|
+
if (openingCode === 4)
|
|
25
|
+
return 24;
|
|
26
|
+
if (openingCode === 7)
|
|
27
|
+
return 27;
|
|
28
|
+
if (openingCode === 8)
|
|
29
|
+
return 28;
|
|
30
|
+
if (openingCode === 9)
|
|
31
|
+
return 29;
|
|
32
|
+
if (openingCode === 0)
|
|
33
|
+
return 0;
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
37
|
+
const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
38
|
+
const wrapWord = (rows, word, columns) => {
|
|
39
|
+
const characters = word[Symbol.iterator]();
|
|
40
|
+
let isInsideEscape = false;
|
|
41
|
+
let isInsideLinkEscape = false;
|
|
42
|
+
let lastRow = rows.at(-1);
|
|
43
|
+
let visible = lastRow === undefined ? 0 : stringWidth(lastRow);
|
|
44
|
+
let currentCharacter = characters.next();
|
|
45
|
+
let nextCharacter = characters.next();
|
|
46
|
+
let rawCharacterIndex = 0;
|
|
47
|
+
while (!currentCharacter.done) {
|
|
48
|
+
const character = currentCharacter.value;
|
|
49
|
+
const characterLength = stringWidth(character);
|
|
50
|
+
if (visible + characterLength <= columns) {
|
|
51
|
+
rows[rows.length - 1] += character;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
rows.push(character);
|
|
55
|
+
visible = 0;
|
|
56
|
+
}
|
|
57
|
+
if (character === ESC || character === CSI) {
|
|
58
|
+
isInsideEscape = true;
|
|
59
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
60
|
+
}
|
|
61
|
+
if (isInsideEscape) {
|
|
62
|
+
if (isInsideLinkEscape) {
|
|
63
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
64
|
+
isInsideEscape = false;
|
|
65
|
+
isInsideLinkEscape = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (character === ANSI_SGR_TERMINATOR) {
|
|
69
|
+
isInsideEscape = false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
visible += characterLength;
|
|
74
|
+
if (visible === columns && !nextCharacter.done) {
|
|
75
|
+
rows.push('');
|
|
76
|
+
visible = 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
currentCharacter = nextCharacter;
|
|
80
|
+
nextCharacter = characters.next();
|
|
81
|
+
rawCharacterIndex += character.length;
|
|
82
|
+
}
|
|
83
|
+
lastRow = rows.at(-1);
|
|
84
|
+
if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
|
|
85
|
+
rows[rows.length - 2] += rows.pop();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const stringVisibleTrimSpacesRight = (string) => {
|
|
89
|
+
const words = string.split(' ');
|
|
90
|
+
let last = words.length;
|
|
91
|
+
while (last) {
|
|
92
|
+
if (stringWidth(words[last - 1])) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
last--;
|
|
96
|
+
}
|
|
97
|
+
if (last === words.length) {
|
|
98
|
+
return string;
|
|
99
|
+
}
|
|
100
|
+
return words.slice(0, last).join(' ') + words.slice(last).join('');
|
|
101
|
+
};
|
|
102
|
+
const exec = (string, columns, options = {}) => {
|
|
103
|
+
if (options.trim !== false && string.trim() === '') {
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
let returnValue = '';
|
|
107
|
+
let escapeCode;
|
|
108
|
+
let escapeUrl;
|
|
109
|
+
const words = string.split(' ');
|
|
110
|
+
let rows = [''];
|
|
111
|
+
let rowLength = 0;
|
|
112
|
+
for (let index = 0; index < words.length; index++) {
|
|
113
|
+
const word = words[index];
|
|
114
|
+
if (options.trim !== false) {
|
|
115
|
+
const row = rows.at(-1) ?? '';
|
|
116
|
+
const trimmed = row.trimStart();
|
|
117
|
+
if (row.length !== trimmed.length) {
|
|
118
|
+
rows[rows.length - 1] = trimmed;
|
|
119
|
+
rowLength = stringWidth(trimmed);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (index !== 0) {
|
|
123
|
+
if (rowLength >= columns &&
|
|
124
|
+
(options.wordWrap === false || options.trim === false)) {
|
|
125
|
+
rows.push('');
|
|
126
|
+
rowLength = 0;
|
|
127
|
+
}
|
|
128
|
+
if (rowLength || options.trim === false) {
|
|
129
|
+
rows[rows.length - 1] += ' ';
|
|
130
|
+
rowLength++;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const wordLength = stringWidth(word);
|
|
134
|
+
if (options.hard && wordLength > columns) {
|
|
135
|
+
const remainingColumns = columns - rowLength;
|
|
136
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
137
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
138
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
139
|
+
rows.push('');
|
|
140
|
+
}
|
|
141
|
+
wrapWord(rows, word, columns);
|
|
142
|
+
rowLength = stringWidth(rows.at(-1) ?? '');
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
146
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
147
|
+
wrapWord(rows, word, columns);
|
|
148
|
+
rowLength = stringWidth(rows.at(-1) ?? '');
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
rows.push('');
|
|
152
|
+
rowLength = 0;
|
|
153
|
+
}
|
|
154
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
155
|
+
wrapWord(rows, word, columns);
|
|
156
|
+
rowLength = stringWidth(rows.at(-1) ?? '');
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
rows[rows.length - 1] += word;
|
|
160
|
+
rowLength += wordLength;
|
|
161
|
+
}
|
|
162
|
+
if (options.trim !== false) {
|
|
163
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
164
|
+
}
|
|
165
|
+
const preString = rows.join('\n');
|
|
166
|
+
let inSurrogate = false;
|
|
167
|
+
for (let i = 0; i < preString.length; i++) {
|
|
168
|
+
const character = preString[i];
|
|
169
|
+
returnValue += character;
|
|
170
|
+
if (!inSurrogate) {
|
|
171
|
+
inSurrogate = character >= '\ud800' && character <= '\udbff';
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
if (character === ESC || character === CSI) {
|
|
177
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
178
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
179
|
+
const groups = groupsResult?.groups;
|
|
180
|
+
if (groups?.code !== undefined) {
|
|
181
|
+
const code = Number.parseFloat(groups.code);
|
|
182
|
+
escapeCode = code === END_CODE ? undefined : code;
|
|
183
|
+
}
|
|
184
|
+
else if (groups?.uri !== undefined) {
|
|
185
|
+
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (preString[i + 1] === '\n') {
|
|
189
|
+
if (escapeUrl) {
|
|
190
|
+
returnValue += wrapAnsiHyperlink('');
|
|
191
|
+
}
|
|
192
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
|
|
193
|
+
if (escapeCode && closingCode) {
|
|
194
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else if (character === '\n') {
|
|
198
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
199
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
200
|
+
}
|
|
201
|
+
if (escapeUrl) {
|
|
202
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return returnValue;
|
|
207
|
+
};
|
|
208
|
+
const CRLF_OR_LF = /\r?\n/;
|
|
209
|
+
export function wrapAnsi(string, columns, options) {
|
|
210
|
+
return String(string)
|
|
211
|
+
.normalize()
|
|
212
|
+
.split(CRLF_OR_LF)
|
|
213
|
+
.map((line) => exec(line, columns, options))
|
|
214
|
+
.join('\n');
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fast-wrap-ansi",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"files": [
|
|
5
|
+
"lib"
|
|
6
|
+
],
|
|
7
|
+
"description": "A tiny and fast text wrap library which takes ANSI escapes into account.",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"wrap",
|
|
10
|
+
"ansi",
|
|
11
|
+
"term",
|
|
12
|
+
"colors"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/43081j/fast-wrap-ansi#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/43081j/fast-wrap-ansi/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/43081j/fast-wrap-ansi.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "James Garbutt (https://github.com/43081j)",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "lib/main.js",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"format": "prettier --write src test",
|
|
28
|
+
"lint": "npm run lint:js && npm run lint:format && npm run lint:types",
|
|
29
|
+
"lint:js": "eslint src test",
|
|
30
|
+
"lint:format": "prettier --check src test",
|
|
31
|
+
"lint:types": "npx tsc --noEmit -p tsconfig.test.json",
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"test": "vitest run"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "^9.32.0",
|
|
37
|
+
"@types/node": "^24.2.0",
|
|
38
|
+
"eslint": "^9.32.0",
|
|
39
|
+
"fast-wrap-ansi-prod": "npm:fast-wrap-ansi@*",
|
|
40
|
+
"picocolors": "^1.1.1",
|
|
41
|
+
"prettier": "^3.6.2",
|
|
42
|
+
"tinybench": "^5.0.1",
|
|
43
|
+
"typescript": "^5.8.3",
|
|
44
|
+
"typescript-eslint": "^8.38.0",
|
|
45
|
+
"vitest": "^3.2.4",
|
|
46
|
+
"wrap-ansi": "^9.0.2"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"fast-string-width": "^1.1.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import Queue from 'yocto-queue';
|
|
2
|
+
|
|
3
|
+
export default function pLimit(concurrency) {
|
|
4
|
+
let rejectOnClear = false;
|
|
5
|
+
|
|
6
|
+
if (typeof concurrency === 'object') {
|
|
7
|
+
({concurrency, rejectOnClear = false} = concurrency);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
validateConcurrency(concurrency);
|
|
11
|
+
|
|
12
|
+
if (typeof rejectOnClear !== 'boolean') {
|
|
13
|
+
throw new TypeError('Expected `rejectOnClear` to be a boolean');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const queue = new Queue();
|
|
17
|
+
let activeCount = 0;
|
|
18
|
+
|
|
19
|
+
const resumeNext = () => {
|
|
20
|
+
// Process the next queued function if we're under the concurrency limit
|
|
21
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
22
|
+
activeCount++;
|
|
23
|
+
queue.dequeue().run();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const next = () => {
|
|
28
|
+
activeCount--;
|
|
29
|
+
resumeNext();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const run = async (function_, resolve, arguments_) => {
|
|
33
|
+
// Execute the function and capture the result promise
|
|
34
|
+
const result = (async () => function_(...arguments_))();
|
|
35
|
+
|
|
36
|
+
// Resolve immediately with the promise (don't wait for completion)
|
|
37
|
+
resolve(result);
|
|
38
|
+
|
|
39
|
+
// Wait for the function to complete (success or failure)
|
|
40
|
+
// We catch errors here to prevent unhandled rejections,
|
|
41
|
+
// but the original promise rejection is preserved for the caller
|
|
42
|
+
try {
|
|
43
|
+
await result;
|
|
44
|
+
} catch {}
|
|
45
|
+
|
|
46
|
+
// Decrement active count and process next queued function
|
|
47
|
+
next();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const enqueue = (function_, resolve, reject, arguments_) => {
|
|
51
|
+
const queueItem = {reject};
|
|
52
|
+
|
|
53
|
+
// Queue the internal resolve function instead of the run function
|
|
54
|
+
// to preserve the asynchronous execution context.
|
|
55
|
+
new Promise(internalResolve => { // eslint-disable-line promise/param-names
|
|
56
|
+
queueItem.run = internalResolve;
|
|
57
|
+
queue.enqueue(queueItem);
|
|
58
|
+
}).then(run.bind(undefined, function_, resolve, arguments_)); // eslint-disable-line promise/prefer-await-to-then
|
|
59
|
+
|
|
60
|
+
// Start processing immediately if we haven't reached the concurrency limit
|
|
61
|
+
if (activeCount < concurrency) {
|
|
62
|
+
resumeNext();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const generator = (function_, ...arguments_) => new Promise((resolve, reject) => {
|
|
67
|
+
enqueue(function_, resolve, reject, arguments_);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
Object.defineProperties(generator, {
|
|
71
|
+
activeCount: {
|
|
72
|
+
get: () => activeCount,
|
|
73
|
+
},
|
|
74
|
+
pendingCount: {
|
|
75
|
+
get: () => queue.size,
|
|
76
|
+
},
|
|
77
|
+
clearQueue: {
|
|
78
|
+
value() {
|
|
79
|
+
if (!rejectOnClear) {
|
|
80
|
+
queue.clear();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const abortError = AbortSignal.abort().reason;
|
|
85
|
+
|
|
86
|
+
while (queue.size > 0) {
|
|
87
|
+
queue.dequeue().reject(abortError);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
concurrency: {
|
|
92
|
+
get: () => concurrency,
|
|
93
|
+
|
|
94
|
+
set(newConcurrency) {
|
|
95
|
+
validateConcurrency(newConcurrency);
|
|
96
|
+
concurrency = newConcurrency;
|
|
97
|
+
|
|
98
|
+
queueMicrotask(() => {
|
|
99
|
+
// eslint-disable-next-line no-unmodified-loop-condition
|
|
100
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
101
|
+
resumeNext();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
map: {
|
|
107
|
+
async value(iterable, function_) {
|
|
108
|
+
const promises = Array.from(iterable, (value, index) => this(function_, value, index));
|
|
109
|
+
return Promise.all(promises);
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
return generator;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function limitFunction(function_, options) {
|
|
118
|
+
const limit = pLimit(options);
|
|
119
|
+
|
|
120
|
+
return (...arguments_) => limit(() => function_(...arguments_));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function validateConcurrency(concurrency) {
|
|
124
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
125
|
+
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "p-limit",
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/p-limit",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "xo && ava && tsd",
|
|
24
|
+
"benchmark": "node benchmark.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"promise",
|
|
32
|
+
"limit",
|
|
33
|
+
"limited",
|
|
34
|
+
"concurrency",
|
|
35
|
+
"throttle",
|
|
36
|
+
"throat",
|
|
37
|
+
"rate",
|
|
38
|
+
"batch",
|
|
39
|
+
"ratelimit",
|
|
40
|
+
"task",
|
|
41
|
+
"queue",
|
|
42
|
+
"async",
|
|
43
|
+
"await",
|
|
44
|
+
"promises",
|
|
45
|
+
"bluebird"
|
|
46
|
+
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"yocto-queue": "^1.2.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"ava": "^6.4.1",
|
|
52
|
+
"in-range": "^3.0.0",
|
|
53
|
+
"random-int": "^3.0.0",
|
|
54
|
+
"time-span": "^5.1.0",
|
|
55
|
+
"tsd": "^0.33.0",
|
|
56
|
+
"xo": "^1.2.1"
|
|
57
|
+
}
|
|
58
|
+
}
|