};
+ if (typeof window !== "undefined" && window.gradio_api_info) {
+ api_info = window.gradio_api_info;
+ } else {
+ if (semiver(config?.version || "2.0.0", "3.30") < 0) {
+ response = await this.fetch(SPACE_FETCHER_URL, {
+ method: "POST",
+ body: JSON.stringify({
+ serialize: false,
+ config: JSON.stringify(config)
+ }),
+ headers,
+ credentials: "include"
+ });
+ } else {
+ const url = join_urls(config.root, this.api_prefix, API_INFO_URL);
+ response = await this.fetch(url, {
+ headers,
+ credentials: "include"
+ });
+ }
+
+ if (!response.ok) {
+ throw new Error(BROKEN_CONNECTION_MSG);
+ }
+ api_info = await response.json();
+ }
+ if ("api" in api_info) {
+ api_info = api_info.api;
+ }
+
+ if (
+ api_info.named_endpoints["/predict"] &&
+ !api_info.unnamed_endpoints["0"]
+ ) {
+ api_info.unnamed_endpoints[0] = api_info.named_endpoints["/predict"];
+ }
+
+ return transform_api_info(api_info, config, this.api_map);
+ } catch (e) {
+ throw new Error("Could not get API info. " + (e as Error).message);
+ }
+}
diff --git a/node_modules/@gradio/client/src/vite-env.d.ts b/node_modules/@gradio/client/src/vite-env.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..11f02fe2a0061d6e6e1f271b21da95423b448b32
--- /dev/null
+++ b/node_modules/@gradio/client/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/node_modules/@gradio/client/tsconfig.json b/node_modules/@gradio/client/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..541ef0cb9d7eabe46d83d046ea2006ce97672c6b
--- /dev/null
+++ b/node_modules/@gradio/client/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "include": ["src/**/*"],
+ "exclude": ["src/**/*.test.ts", "src/**/*.node-test.ts"],
+ "compilerOptions": {
+ "allowJs": true,
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "outDir": "dist",
+ "declarationMap": true,
+ "module": "ESNext",
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "skipLibCheck": true,
+
+ /* Bundler */
+ "moduleResolution": "Bundler",
+ "skipDefaultLibCheck": true,
+ "allowImportingTsExtensions": true,
+ "esModuleInterop": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+
+ /* Linting */
+ "strict": true
+ }
+}
diff --git a/node_modules/@gradio/client/vite.config.js b/node_modules/@gradio/client/vite.config.js
new file mode 100644
index 0000000000000000000000000000000000000000..257b9baded27725aa23acb8164e824635eaed908
--- /dev/null
+++ b/node_modules/@gradio/client/vite.config.js
@@ -0,0 +1,45 @@
+import { defineConfig } from "vite";
+import { svelte } from "@sveltejs/vite-plugin-svelte";
+
+const TEST_MODE = process.env.TEST_MODE || "happy-dom";
+
+export default defineConfig(({ mode }) => {
+ if (mode === "preview") {
+ return {
+ entry: "index.html"
+ };
+ }
+ return {
+ build: {
+ lib: {
+ entry: "src/index.ts",
+ formats: ["es"],
+ fileName: (format) => `index.${format}.js`
+ },
+ rollupOptions: {
+ input: "src/index.ts",
+ output: {
+ dir: "dist"
+ }
+ }
+ },
+ plugins: [svelte()],
+
+ mode: process.env.MODE || "development",
+ test: {
+ include: ["./src/test/*.test.*"],
+ environment: TEST_MODE
+ },
+ ssr: {
+ target: "node",
+ format: "esm",
+ noExternal: [
+ "ws",
+ "semiver",
+ "bufferutil",
+ "@gradio/upload",
+ "fetch-event-stream"
+ ]
+ }
+ };
+});
diff --git a/node_modules/@inquirer/confirm/LICENSE b/node_modules/@inquirer/confirm/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f7186988726152b8dfb1bbafe940a712da142e3e
--- /dev/null
+++ b/node_modules/@inquirer/confirm/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2025 Simon Boudrias
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@inquirer/confirm/README.md b/node_modules/@inquirer/confirm/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..0a259af6f573c25710db24c84e4b40c7b19e1325
--- /dev/null
+++ b/node_modules/@inquirer/confirm/README.md
@@ -0,0 +1,102 @@
+# `@inquirer/confirm`
+
+Simple interactive command line prompt to gather boolean input from users.
+
+
+
+# Special Thanks
+
+
+
+[](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)
+
+### [Graphite is the AI developer productivity platform helping teams on GitHub ship higher quality software, faster](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)
+
+
+
+# Installation
+
+
+
+ npm |
+ yarn |
+
+
+
+
+```sh
+npm install @inquirer/prompts
+```
+
+ |
+
+
+```sh
+yarn add @inquirer/prompts
+```
+
+ |
+
+
+Or |
+
+
+
+
+```sh
+npm install @inquirer/confirm
+```
+
+ |
+
+
+```sh
+yarn add @inquirer/confirm
+```
+
+ |
+
+
+
+# Usage
+
+```js
+import { confirm } from '@inquirer/prompts';
+// Or
+// import confirm from '@inquirer/confirm';
+
+const answer = await confirm({ message: 'Continue?' });
+```
+
+## Options
+
+| Property | Type | Required | Description |
+| ----------- | ----------------------- | -------- | ------------------------------------------------------- |
+| message | `string` | yes | The question to ask |
+| default | `boolean` | no | Default answer (true or false) |
+| transformer | `(boolean) => string` | no | Transform the prompt printed message to a custom string |
+| theme | [See Theming](#Theming) | no | Customize look of the prompt. |
+
+## Theming
+
+You can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.
+
+```ts
+type Theme = {
+ prefix: string | { idle: string; done: string };
+ spinner: {
+ interval: number;
+ frames: string[];
+ };
+ style: {
+ answer: (text: string) => string;
+ message: (text: string, status: 'idle' | 'done' | 'loading') => string;
+ defaultAnswer: (text: string) => string;
+ };
+};
+```
+
+# License
+
+Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license.
diff --git a/node_modules/@inquirer/confirm/dist/commonjs/index.d.ts b/node_modules/@inquirer/confirm/dist/commonjs/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d3d323add1e962e96e7547ceaae4d3208ef92360
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/commonjs/index.d.ts
@@ -0,0 +1,10 @@
+import { type Theme } from '@inquirer/core';
+import type { PartialDeep } from '@inquirer/type';
+type ConfirmConfig = {
+ message: string;
+ default?: boolean;
+ transformer?: (value: boolean) => string;
+ theme?: PartialDeep;
+};
+declare const _default: import("@inquirer/type").Prompt;
+export default _default;
diff --git a/node_modules/@inquirer/confirm/dist/commonjs/index.js b/node_modules/@inquirer/confirm/dist/commonjs/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..f4b51f12af7c484e2a424814747d3f2d5f93d3d5
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/commonjs/index.js
@@ -0,0 +1,48 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const core_1 = require("@inquirer/core");
+function getBooleanValue(value, defaultValue) {
+ let answer = defaultValue !== false;
+ if (/^(y|yes)/i.test(value))
+ answer = true;
+ else if (/^(n|no)/i.test(value))
+ answer = false;
+ return answer;
+}
+function boolToString(value) {
+ return value ? 'Yes' : 'No';
+}
+exports.default = (0, core_1.createPrompt)((config, done) => {
+ const { transformer = boolToString } = config;
+ const [status, setStatus] = (0, core_1.useState)('idle');
+ const [value, setValue] = (0, core_1.useState)('');
+ const theme = (0, core_1.makeTheme)(config.theme);
+ const prefix = (0, core_1.usePrefix)({ status, theme });
+ (0, core_1.useKeypress)((key, rl) => {
+ if ((0, core_1.isEnterKey)(key)) {
+ const answer = getBooleanValue(value, config.default);
+ setValue(transformer(answer));
+ setStatus('done');
+ done(answer);
+ }
+ else if (key.name === 'tab') {
+ const answer = boolToString(!getBooleanValue(value, config.default));
+ rl.clearLine(0); // Remove the tab character.
+ rl.write(answer);
+ setValue(answer);
+ }
+ else {
+ setValue(rl.line);
+ }
+ });
+ let formattedValue = value;
+ let defaultValue = '';
+ if (status === 'done') {
+ formattedValue = theme.style.answer(value);
+ }
+ else {
+ defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? 'y/N' : 'Y/n')}`;
+ }
+ const message = theme.style.message(config.message, status);
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
+});
diff --git a/node_modules/@inquirer/confirm/dist/commonjs/package.json b/node_modules/@inquirer/confirm/dist/commonjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/@inquirer/confirm/dist/esm/index.d.ts b/node_modules/@inquirer/confirm/dist/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d3d323add1e962e96e7547ceaae4d3208ef92360
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/esm/index.d.ts
@@ -0,0 +1,10 @@
+import { type Theme } from '@inquirer/core';
+import type { PartialDeep } from '@inquirer/type';
+type ConfirmConfig = {
+ message: string;
+ default?: boolean;
+ transformer?: (value: boolean) => string;
+ theme?: PartialDeep;
+};
+declare const _default: import("@inquirer/type").Prompt;
+export default _default;
diff --git a/node_modules/@inquirer/confirm/dist/esm/index.js b/node_modules/@inquirer/confirm/dist/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..970c2b65d08a191a11d9a55b18a160052ae15aef
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/esm/index.js
@@ -0,0 +1,46 @@
+import { createPrompt, useState, useKeypress, isEnterKey, usePrefix, makeTheme, } from '@inquirer/core';
+function getBooleanValue(value, defaultValue) {
+ let answer = defaultValue !== false;
+ if (/^(y|yes)/i.test(value))
+ answer = true;
+ else if (/^(n|no)/i.test(value))
+ answer = false;
+ return answer;
+}
+function boolToString(value) {
+ return value ? 'Yes' : 'No';
+}
+export default createPrompt((config, done) => {
+ const { transformer = boolToString } = config;
+ const [status, setStatus] = useState('idle');
+ const [value, setValue] = useState('');
+ const theme = makeTheme(config.theme);
+ const prefix = usePrefix({ status, theme });
+ useKeypress((key, rl) => {
+ if (isEnterKey(key)) {
+ const answer = getBooleanValue(value, config.default);
+ setValue(transformer(answer));
+ setStatus('done');
+ done(answer);
+ }
+ else if (key.name === 'tab') {
+ const answer = boolToString(!getBooleanValue(value, config.default));
+ rl.clearLine(0); // Remove the tab character.
+ rl.write(answer);
+ setValue(answer);
+ }
+ else {
+ setValue(rl.line);
+ }
+ });
+ let formattedValue = value;
+ let defaultValue = '';
+ if (status === 'done') {
+ formattedValue = theme.style.answer(value);
+ }
+ else {
+ defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? 'y/N' : 'Y/n')}`;
+ }
+ const message = theme.style.message(config.message, status);
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
+});
diff --git a/node_modules/@inquirer/confirm/dist/esm/package.json b/node_modules/@inquirer/confirm/dist/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/node_modules/@inquirer/confirm/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "module"
+}
diff --git a/node_modules/@inquirer/confirm/package.json b/node_modules/@inquirer/confirm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..8cb1cc3c100b7ed7dead567f7a3e4d2b750150a7
--- /dev/null
+++ b/node_modules/@inquirer/confirm/package.json
@@ -0,0 +1,110 @@
+{
+ "name": "@inquirer/confirm",
+ "version": "5.1.9",
+ "description": "Inquirer confirm prompt",
+ "keywords": [
+ "answer",
+ "answers",
+ "ask",
+ "base",
+ "cli",
+ "command",
+ "command-line",
+ "confirm",
+ "enquirer",
+ "generate",
+ "generator",
+ "hyper",
+ "input",
+ "inquire",
+ "inquirer",
+ "interface",
+ "iterm",
+ "javascript",
+ "menu",
+ "node",
+ "nodejs",
+ "prompt",
+ "promptly",
+ "prompts",
+ "question",
+ "readline",
+ "scaffold",
+ "scaffolder",
+ "scaffolding",
+ "stdin",
+ "stdout",
+ "terminal",
+ "tty",
+ "ui",
+ "yeoman",
+ "yo",
+ "zsh"
+ ],
+ "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/README.md",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/SBoudrias/Inquirer.js.git"
+ },
+ "license": "MIT",
+ "author": "Simon Boudrias ",
+ "sideEffects": false,
+ "type": "module",
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "import": {
+ "types": "./dist/esm/index.d.ts",
+ "default": "./dist/esm/index.js"
+ },
+ "require": {
+ "types": "./dist/commonjs/index.d.ts",
+ "default": "./dist/commonjs/index.js"
+ }
+ }
+ },
+ "main": "./dist/commonjs/index.js",
+ "module": "./dist/esm/index.js",
+ "types": "./dist/commonjs/index.d.ts",
+ "files": [
+ "dist"
+ ],
+ "scripts": {
+ "attw": "attw --pack",
+ "tsc": "tshy"
+ },
+ "dependencies": {
+ "@inquirer/core": "^10.1.10",
+ "@inquirer/type": "^3.0.6"
+ },
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.17.4",
+ "@inquirer/testing": "^2.1.46",
+ "@repo/tsconfig": "workspace:*",
+ "tshy": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "tshy": {
+ "exclude": [
+ "src/**/*.test.ts"
+ ],
+ "exports": {
+ "./package.json": "./package.json",
+ ".": "./src/index.ts"
+ }
+ },
+ "peerDependencies": {
+ "@types/node": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ },
+ "gitHead": "d367155a8d64d8b3e93f9c763adccf708aedc8a8"
+}
diff --git a/node_modules/@inquirer/core/LICENSE b/node_modules/@inquirer/core/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f7186988726152b8dfb1bbafe940a712da142e3e
--- /dev/null
+++ b/node_modules/@inquirer/core/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2025 Simon Boudrias
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@inquirer/core/README.md b/node_modules/@inquirer/core/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..6f72b0f04666012a5bff6abcc4e7b9fa24d61d35
--- /dev/null
+++ b/node_modules/@inquirer/core/README.md
@@ -0,0 +1,393 @@
+# `@inquirer/core`
+
+The `@inquirer/core` package is the library enabling the creation of Inquirer prompts.
+
+It aims to implements a lightweight API similar to React hooks - but without JSX.
+
+# Special Thanks
+
+
+
+[](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)
+
+### [Graphite is the AI developer productivity platform helping teams on GitHub ship higher quality software, faster](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)
+
+
+
+# Installation
+
+
+
+ npm |
+ yarn |
+
+
+
+
+```sh
+npm install @inquirer/core
+```
+
+ |
+
+
+```sh
+yarn add @inquirer/core
+```
+
+ |
+
+
+
+# Usage
+
+## Basic concept
+
+Visual terminal apps are at their core strings rendered onto the terminal.
+
+The most basic prompt is a function returning a string that'll be rendered in the terminal. This function will run every time the prompt state change, and the new returned string will replace the previously rendered one. The prompt cursor appears after the string.
+
+Wrapping the rendering function with `createPrompt()` will setup the rendering layer, inject the state management utilities, and wait until the `done` callback is called.
+
+```ts
+import { createPrompt } from '@inquirer/core';
+
+const input = createPrompt((config, done) => {
+ // Implement logic
+
+ return '? My question';
+});
+
+// And it is then called as
+const answer = await input({
+ /* config */
+});
+```
+
+## Hooks
+
+State management and user interactions are handled through hooks. Hooks are common [within the React ecosystem](https://react.dev/reference/react/hooks), and Inquirer reimplement the common ones.
+
+### State hook
+
+State lets a component “remember” information like user input. For example, an input prompt can use state to store the input value, while a list prompt can use state to track the cursor index.
+
+`useState` declares a state variable that you can update directly.
+
+```ts
+import { createPrompt, useState } from '@inquirer/core';
+
+const input = createPrompt((config, done) => {
+ const [index, setIndex] = useState(0);
+
+ // ...
+```
+
+### Keypress hook
+
+Almost all prompts need to react to user actions. In a terminal, this is done through typing.
+
+`useKeypress` allows you to react to keypress events, and access the prompt line.
+
+```ts
+const input = createPrompt((config, done) => {
+ useKeypress((key) => {
+ if (key.name === 'enter') {
+ done(answer);
+ }
+ });
+
+ // ...
+```
+
+Behind the scenes, Inquirer prompts are wrappers around [readlines](https://nodejs.org/api/readline.html). Aside the keypress event object, the hook also pass the active readline instance to the event handler.
+
+```ts
+const input = createPrompt((config, done) => {
+ useKeypress((key, readline) => {
+ setValue(readline.line);
+ });
+
+ // ...
+```
+
+### Ref hook
+
+Refs let a prompt hold some information that isn’t used for rendering, like a class instance or a timeout ID. Unlike with state, updating a ref does not re-render your prompt. Refs are an “escape hatch” from the rendering paradigm.
+
+`useRef` declares a ref. You can hold any value in it, but most often it’s used to hold a timeout ID.
+
+```ts
+const input = createPrompt((config, done) => {
+ const timeout = useRef(null);
+
+ // ...
+```
+
+### Effect Hook
+
+Effects let a prompt connect to and synchronize with external systems. This includes dealing with network or animations.
+
+`useEffect` connects a component to an external system.
+
+```ts
+const chat = createPrompt((config, done) => {
+ useEffect(() => {
+ const connection = createConnection(roomId);
+ connection.connect();
+ return () => connection.disconnect();
+ }, [roomId]);
+
+ // ...
+```
+
+### Performance hook
+
+A common way to optimize re-rendering performance is to skip unnecessary work. For example, you can tell Inquirer to reuse a cached calculation or to skip a re-render if the data has not changed since the previous render.
+
+`useMemo` lets you cache the result of an expensive calculation.
+
+```ts
+const todoSelect = createPrompt((config, done) => {
+ const visibleTodos = useMemo(() => filterTodos(todos, tab), [todos, tab]);
+
+ // ...
+```
+
+### Rendering hooks
+
+#### Prefix / loading
+
+All default prompts, and most custom ones, uses a prefix at the beginning of the prompt line. This helps visually delineate different questions, and provides a convenient area to render a loading spinner.
+
+`usePrefix` is a built-in hook to do this.
+
+```ts
+const input = createPrompt((config, done) => {
+ const prefix = usePrefix({ status });
+
+ return `${prefix} My question`;
+});
+```
+
+#### Pagination
+
+When looping through a long list of options (like in the `select` prompt), paginating the results appearing on the screen at once can be necessary. The `usePagination` hook is the utility used within the `select` and `checkbox` prompts to cycle through the list of options.
+
+Pagination works by taking in the list of options and returning a subset of the rendered items that fit within the page. The hook takes in a few options. It needs a list of options (`items`), and a `pageSize` which is the number of lines to be rendered. The `active` index is the index of the currently selected/selectable item. The `loop` option is a boolean that indicates if the list should loop around when reaching the end: this is the default behavior. The pagination hook renders items only as necessary, so it takes a function that can render an item at an index, including an `active` state, called `renderItem`.
+
+```js
+export default createPrompt((config, done) => {
+ const [active, setActive] = useState(0);
+
+ const allChoices = config.choices.map((choice) => choice.name);
+
+ const page = usePagination({
+ items: allChoices,
+ active: active,
+ renderItem: ({ item, index, isActive }) => `${isActive ? ">" : " "}${index}. ${item.toString()}`
+ pageSize: config.pageSize,
+ loop: config.loop,
+ });
+
+ return `... ${page}`;
+});
+```
+
+## `createPrompt()` API
+
+As we saw earlier, the rendering function should return a string, and eventually call `done` to close the prompt and return the answer.
+
+```ts
+const input = createPrompt((config, done) => {
+ const [value, setValue] = useState();
+
+ useKeypress((key, readline) => {
+ if (key.name === 'enter') {
+ done(answer);
+ } else {
+ setValue(readline.line);
+ }
+ });
+
+ return `? ${config.message} ${value}`;
+});
+```
+
+The rendering function can also return a tuple of 2 string (`[string, string]`.) The first string represents the prompt. The second one is content to render under the prompt, like an error message. The text input cursor will appear after the first string.
+
+```ts
+const number = createPrompt((config, done) => {
+ // Add some logic here
+
+ return [`? My question ${input}`, `! The input must be a number`];
+});
+```
+
+### Typescript
+
+If using typescript, `createPrompt` takes 2 generic arguments.
+
+```ts
+// createPrompt
+const input = createPrompt(// ...
+```
+
+The first one is the type of the resolved value
+
+```ts
+const answer: string = await input();
+```
+
+The second one is the type of the prompt config; in other words the interface the created prompt will provide to users.
+
+```ts
+const answer = await input({
+ message: 'My question',
+});
+```
+
+## Key utilities
+
+Listening for keypress events inside an inquirer prompt is a very common pattern. To ease this, we export a few utility functions taking in the keypress event object and return a boolean:
+
+- `isEnterKey()`
+- `isBackspaceKey()`
+- `isSpaceKey()`
+- `isUpKey()` - Note: this utility will handle vim and emacs keybindings (up, `k`, and `ctrl+p`)
+- `isDownKey()` - Note: this utility will handle vim and emacs keybindings (down, `j`, and `ctrl+n`)
+- `isNumberKey()` one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
+
+## Theming
+
+Theming utilities will allow you to expose customization of the prompt style. Inquirer also has a few standard theme values shared across all the official prompts.
+
+To allow standard customization:
+
+```ts
+import { createPrompt, usePrefix, makeTheme, type Theme } from '@inquirer/core';
+import type { PartialDeep } from '@inquirer/type';
+
+type PromptConfig = {
+ theme?: PartialDeep;
+};
+
+export default createPrompt((config, done) => {
+ const theme = makeTheme(config.theme);
+
+ const prefix = usePrefix({ status, theme });
+
+ return `${prefix} ${theme.style.highlight('hello')}`;
+});
+```
+
+To setup a custom theme:
+
+```ts
+import { createPrompt, makeTheme, type Theme } from '@inquirer/core';
+import type { PartialDeep } from '@inquirer/type';
+
+type PromptTheme = {};
+
+const promptTheme: PromptTheme = {
+ icon: '!',
+};
+
+type PromptConfig = {
+ theme?: PartialDeep>;
+};
+
+export default createPrompt((config, done) => {
+ const theme = makeTheme(promptTheme, config.theme);
+
+ const prefix = usePrefix({ status, theme });
+
+ return `${prefix} ${theme.icon}`;
+});
+```
+
+The [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):
+
+```ts
+type DefaultTheme = {
+ prefix: string | { idle: string; done: string };
+ spinner: {
+ interval: number;
+ frames: string[];
+ };
+ style: {
+ answer: (text: string) => string;
+ message: (text: string, status: 'idle' | 'done' | 'loading') => string;
+ error: (text: string) => string;
+ defaultAnswer: (text: string) => string;
+ help: (text: string) => string;
+ highlight: (text: string) => string;
+ key: (text: string) => string;
+ };
+};
+```
+
+# Examples
+
+You can refer to any `@inquirer/prompts` prompts for real examples:
+
+- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)
+- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)
+- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)
+- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)
+- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)
+- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)
+- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)
+- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)
+
+```ts
+import colors from 'yoctocolors';
+import {
+ createPrompt,
+ useState,
+ useKeypress,
+ isEnterKey,
+ usePrefix,
+ type Status,
+} from '@inquirer/core';
+
+const confirm = createPrompt(
+ (config, done) => {
+ const [status, setStatus] = useState('idle');
+ const [value, setValue] = useState('');
+ const prefix = usePrefix({});
+
+ useKeypress((key, rl) => {
+ if (isEnterKey(key)) {
+ const answer = value ? /^y(es)?/i.test(value) : config.default !== false;
+ setValue(answer ? 'yes' : 'no');
+ setStatus('done');
+ done(answer);
+ } else {
+ setValue(rl.line);
+ }
+ });
+
+ let formattedValue = value;
+ let defaultValue = '';
+ if (status === 'done') {
+ formattedValue = colors.cyan(value);
+ } else {
+ defaultValue = colors.dim(config.default === false ? ' (y/N)' : ' (Y/n)');
+ }
+
+ const message = colors.bold(config.message);
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
+ },
+);
+
+/**
+ * Which then can be used like this:
+ */
+const answer = await confirm({ message: 'Do you want to continue?' });
+```
+
+# License
+
+Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license.
diff --git a/node_modules/@inquirer/core/dist/commonjs/index.d.ts b/node_modules/@inquirer/core/dist/commonjs/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2f285728f6d497acd9ce2561fa2291412146b220
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/index.d.ts
@@ -0,0 +1,13 @@
+export * from './lib/key.ts';
+export * from './lib/errors.ts';
+export { usePrefix } from './lib/use-prefix.ts';
+export { useState } from './lib/use-state.ts';
+export { useEffect } from './lib/use-effect.ts';
+export { useMemo } from './lib/use-memo.ts';
+export { useRef } from './lib/use-ref.ts';
+export { useKeypress } from './lib/use-keypress.ts';
+export { makeTheme } from './lib/make-theme.ts';
+export type { Theme, Status } from './lib/theme.ts';
+export { usePagination } from './lib/pagination/use-pagination.ts';
+export { createPrompt } from './lib/create-prompt.ts';
+export { Separator } from './lib/Separator.ts';
diff --git a/node_modules/@inquirer/core/dist/commonjs/index.js b/node_modules/@inquirer/core/dist/commonjs/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..256d5f7861971790168caef8a08e7c6f1cd5555f
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/index.js
@@ -0,0 +1,39 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Separator = exports.createPrompt = exports.usePagination = exports.makeTheme = exports.useKeypress = exports.useRef = exports.useMemo = exports.useEffect = exports.useState = exports.usePrefix = void 0;
+__exportStar(require("./lib/key.js"), exports);
+__exportStar(require("./lib/errors.js"), exports);
+var use_prefix_ts_1 = require("./lib/use-prefix.js");
+Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_ts_1.usePrefix; } });
+var use_state_ts_1 = require("./lib/use-state.js");
+Object.defineProperty(exports, "useState", { enumerable: true, get: function () { return use_state_ts_1.useState; } });
+var use_effect_ts_1 = require("./lib/use-effect.js");
+Object.defineProperty(exports, "useEffect", { enumerable: true, get: function () { return use_effect_ts_1.useEffect; } });
+var use_memo_ts_1 = require("./lib/use-memo.js");
+Object.defineProperty(exports, "useMemo", { enumerable: true, get: function () { return use_memo_ts_1.useMemo; } });
+var use_ref_ts_1 = require("./lib/use-ref.js");
+Object.defineProperty(exports, "useRef", { enumerable: true, get: function () { return use_ref_ts_1.useRef; } });
+var use_keypress_ts_1 = require("./lib/use-keypress.js");
+Object.defineProperty(exports, "useKeypress", { enumerable: true, get: function () { return use_keypress_ts_1.useKeypress; } });
+var make_theme_ts_1 = require("./lib/make-theme.js");
+Object.defineProperty(exports, "makeTheme", { enumerable: true, get: function () { return make_theme_ts_1.makeTheme; } });
+var use_pagination_ts_1 = require("./lib/pagination/use-pagination.js");
+Object.defineProperty(exports, "usePagination", { enumerable: true, get: function () { return use_pagination_ts_1.usePagination; } });
+var create_prompt_ts_1 = require("./lib/create-prompt.js");
+Object.defineProperty(exports, "createPrompt", { enumerable: true, get: function () { return create_prompt_ts_1.createPrompt; } });
+var Separator_ts_1 = require("./lib/Separator.js");
+Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return Separator_ts_1.Separator; } });
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/Separator.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/Separator.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..028355567638da2eac0e8c759ce6a3ce07dd643b
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/Separator.d.ts
@@ -0,0 +1,10 @@
+/**
+ * Separator object
+ * Used to space/separate choices group
+ */
+export declare class Separator {
+ readonly separator: string;
+ readonly type: string;
+ constructor(separator?: string);
+ static isSeparator(choice: unknown): choice is Separator;
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/Separator.js b/node_modules/@inquirer/core/dist/commonjs/lib/Separator.js
new file mode 100644
index 0000000000000000000000000000000000000000..5f4ab93733791f31b6952b13f8598f9313a02087
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/Separator.js
@@ -0,0 +1,28 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Separator = void 0;
+const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs"));
+const figures_1 = __importDefault(require("@inquirer/figures"));
+/**
+ * Separator object
+ * Used to space/separate choices group
+ */
+class Separator {
+ separator = yoctocolors_cjs_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line));
+ type = 'separator';
+ constructor(separator) {
+ if (separator) {
+ this.separator = separator;
+ }
+ }
+ static isSeparator(choice) {
+ return Boolean(choice &&
+ typeof choice === 'object' &&
+ 'type' in choice &&
+ choice.type === 'separator');
+ }
+}
+exports.Separator = Separator;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4414db45697e4e2d9dc2f0d3894b4891746cb4b3
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.d.ts
@@ -0,0 +1,4 @@
+import { type Prompt, type Prettify } from '@inquirer/type';
+type ViewFunction = (config: Prettify, done: (value: Value) => void) => string | [string, string | undefined];
+export declare function createPrompt(view: ViewFunction): Prompt;
+export {};
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.js b/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.js
new file mode 100644
index 0000000000000000000000000000000000000000..241cab08468af800b8e6593fb0c27868077dee2b
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.js
@@ -0,0 +1,149 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.createPrompt = createPrompt;
+const readline = __importStar(require("node:readline"));
+const node_async_hooks_1 = require("node:async_hooks");
+const mute_stream_1 = __importDefault(require("mute-stream"));
+const signal_exit_1 = require("signal-exit");
+const screen_manager_ts_1 = __importDefault(require("./screen-manager.js"));
+const promise_polyfill_ts_1 = require("./promise-polyfill.js");
+const hook_engine_ts_1 = require("./hook-engine.js");
+const errors_ts_1 = require("./errors.js");
+function getCallSites() {
+ const _prepareStackTrace = Error.prepareStackTrace;
+ let result = [];
+ try {
+ Error.prepareStackTrace = (_, callSites) => {
+ const callSitesWithoutCurrent = callSites.slice(1);
+ result = callSitesWithoutCurrent;
+ return callSitesWithoutCurrent;
+ };
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions, unicorn/error-message
+ new Error().stack;
+ }
+ catch {
+ // An error will occur if the Node flag --frozen-intrinsics is used.
+ // https://nodejs.org/api/cli.html#--frozen-intrinsics
+ return result;
+ }
+ Error.prepareStackTrace = _prepareStackTrace;
+ return result;
+}
+function createPrompt(view) {
+ const callSites = getCallSites();
+ const prompt = (config, context = {}) => {
+ // Default `input` to stdin
+ const { input = process.stdin, signal } = context;
+ const cleanups = new Set();
+ // Add mute capabilities to the output
+ const output = new mute_stream_1.default();
+ output.pipe(context.output ?? process.stdout);
+ const rl = readline.createInterface({
+ terminal: true,
+ input,
+ output,
+ });
+ const screen = new screen_manager_ts_1.default(rl);
+ const { promise, resolve, reject } = promise_polyfill_ts_1.PromisePolyfill.withResolver();
+ const cancel = () => reject(new errors_ts_1.CancelPromptError());
+ if (signal) {
+ const abort = () => reject(new errors_ts_1.AbortPromptError({ cause: signal.reason }));
+ if (signal.aborted) {
+ abort();
+ return Object.assign(promise, { cancel });
+ }
+ signal.addEventListener('abort', abort);
+ cleanups.add(() => signal.removeEventListener('abort', abort));
+ }
+ cleanups.add((0, signal_exit_1.onExit)((code, signal) => {
+ reject(new errors_ts_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
+ }));
+ // Re-renders only happen when the state change; but the readline cursor could change position
+ // and that also requires a re-render (and a manual one because we mute the streams).
+ // We set the listener after the initial workLoop to avoid a double render if render triggered
+ // by a state change sets the cursor to the right position.
+ const checkCursorPos = () => screen.checkCursorPos();
+ rl.input.on('keypress', checkCursorPos);
+ cleanups.add(() => rl.input.removeListener('keypress', checkCursorPos));
+ return (0, hook_engine_ts_1.withHooks)(rl, (cycle) => {
+ // The close event triggers immediately when the user press ctrl+c. SignalExit on the other hand
+ // triggers after the process is done (which happens after timeouts are done triggering.)
+ // We triggers the hooks cleanup phase on rl `close` so active timeouts can be cleared.
+ const hooksCleanup = node_async_hooks_1.AsyncResource.bind(() => hook_engine_ts_1.effectScheduler.clearAll());
+ rl.on('close', hooksCleanup);
+ cleanups.add(() => rl.removeListener('close', hooksCleanup));
+ cycle(() => {
+ try {
+ const nextView = view(config, (value) => {
+ setImmediate(() => resolve(value));
+ });
+ // Typescript won't allow this, but not all users rely on typescript.
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+ if (nextView === undefined) {
+ const callerFilename = callSites[1]?.getFileName();
+ throw new Error(`Prompt functions must return a string.\n at ${callerFilename}`);
+ }
+ const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;
+ screen.render(content, bottomContent);
+ hook_engine_ts_1.effectScheduler.run();
+ }
+ catch (error) {
+ reject(error);
+ }
+ });
+ return Object.assign(promise
+ .then((answer) => {
+ hook_engine_ts_1.effectScheduler.clearAll();
+ return answer;
+ }, (error) => {
+ hook_engine_ts_1.effectScheduler.clearAll();
+ throw error;
+ })
+ // Wait for the promise to settle, then cleanup.
+ .finally(() => {
+ cleanups.forEach((cleanup) => cleanup());
+ screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
+ output.end();
+ })
+ // Once cleanup is done, let the expose promise resolve/reject to the internal one.
+ .then(() => promise), { cancel });
+ });
+ };
+ return prompt;
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/errors.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/errors.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b9df681e623b3a0798c95080f009ff994e4e7010
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/errors.d.ts
@@ -0,0 +1,20 @@
+export declare class AbortPromptError extends Error {
+ name: string;
+ message: string;
+ constructor(options?: {
+ cause?: unknown;
+ });
+}
+export declare class CancelPromptError extends Error {
+ name: string;
+ message: string;
+}
+export declare class ExitPromptError extends Error {
+ name: string;
+}
+export declare class HookError extends Error {
+ name: string;
+}
+export declare class ValidationError extends Error {
+ name: string;
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/errors.js b/node_modules/@inquirer/core/dist/commonjs/lib/errors.js
new file mode 100644
index 0000000000000000000000000000000000000000..df3b9749333f6c09d86b85b85d4ba3769c4eecf5
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/errors.js
@@ -0,0 +1,29 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ValidationError = exports.HookError = exports.ExitPromptError = exports.CancelPromptError = exports.AbortPromptError = void 0;
+class AbortPromptError extends Error {
+ name = 'AbortPromptError';
+ message = 'Prompt was aborted';
+ constructor(options) {
+ super();
+ this.cause = options?.cause;
+ }
+}
+exports.AbortPromptError = AbortPromptError;
+class CancelPromptError extends Error {
+ name = 'CancelPromptError';
+ message = 'Prompt was canceled';
+}
+exports.CancelPromptError = CancelPromptError;
+class ExitPromptError extends Error {
+ name = 'ExitPromptError';
+}
+exports.ExitPromptError = ExitPromptError;
+class HookError extends Error {
+ name = 'HookError';
+}
+exports.HookError = HookError;
+class ValidationError extends Error {
+ name = 'ValidationError';
+}
+exports.ValidationError = ValidationError;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c4715a8843bfe2fa80c14b542dc56ee84dc1e250
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.d.ts
@@ -0,0 +1,23 @@
+import type { InquirerReadline } from '@inquirer/type';
+export declare function withHooks(rl: InquirerReadline, cb: (cycle: (render: () => void) => void) => T): T;
+export declare function readline(): InquirerReadline;
+export declare function withUpdates R>(fn: T): (...args: Parameters) => R;
+type SetPointer = {
+ get(): Value;
+ set(value: Value): void;
+ initialized: true;
+};
+type UnsetPointer = {
+ get(): void;
+ set(value: Value): void;
+ initialized: false;
+};
+type Pointer = SetPointer | UnsetPointer;
+export declare function withPointer(cb: (pointer: Pointer) => ReturnValue): ReturnValue;
+export declare function handleChange(): void;
+export declare const effectScheduler: {
+ queue(cb: (readline: InquirerReadline) => void | (() => void)): void;
+ run(): void;
+ clearAll(): void;
+};
+export {};
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.js b/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.js
new file mode 100644
index 0000000000000000000000000000000000000000..479b91f496bf3344fcbe2fc89565f204c8a8f0b0
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.js
@@ -0,0 +1,118 @@
+"use strict";
+/* eslint @typescript-eslint/no-explicit-any: ["off"] */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.effectScheduler = void 0;
+exports.withHooks = withHooks;
+exports.readline = readline;
+exports.withUpdates = withUpdates;
+exports.withPointer = withPointer;
+exports.handleChange = handleChange;
+const node_async_hooks_1 = require("node:async_hooks");
+const errors_ts_1 = require("./errors.js");
+const hookStorage = new node_async_hooks_1.AsyncLocalStorage();
+function createStore(rl) {
+ const store = {
+ rl,
+ hooks: [],
+ hooksCleanup: [],
+ hooksEffect: [],
+ index: 0,
+ handleChange() { },
+ };
+ return store;
+}
+// Run callback in with the hook engine setup.
+function withHooks(rl, cb) {
+ const store = createStore(rl);
+ return hookStorage.run(store, () => {
+ function cycle(render) {
+ store.handleChange = () => {
+ store.index = 0;
+ render();
+ };
+ store.handleChange();
+ }
+ return cb(cycle);
+ });
+}
+// Safe getStore utility that'll return the store or throw if undefined.
+function getStore() {
+ const store = hookStorage.getStore();
+ if (!store) {
+ throw new errors_ts_1.HookError('[Inquirer] Hook functions can only be called from within a prompt');
+ }
+ return store;
+}
+function readline() {
+ return getStore().rl;
+}
+// Merge state updates happening within the callback function to avoid multiple renders.
+function withUpdates(fn) {
+ const wrapped = (...args) => {
+ const store = getStore();
+ let shouldUpdate = false;
+ const oldHandleChange = store.handleChange;
+ store.handleChange = () => {
+ shouldUpdate = true;
+ };
+ const returnValue = fn(...args);
+ if (shouldUpdate) {
+ oldHandleChange();
+ }
+ store.handleChange = oldHandleChange;
+ return returnValue;
+ };
+ return node_async_hooks_1.AsyncResource.bind(wrapped);
+}
+function withPointer(cb) {
+ const store = getStore();
+ const { index } = store;
+ const pointer = {
+ get() {
+ return store.hooks[index];
+ },
+ set(value) {
+ store.hooks[index] = value;
+ },
+ initialized: index in store.hooks,
+ };
+ const returnValue = cb(pointer);
+ store.index++;
+ return returnValue;
+}
+function handleChange() {
+ getStore().handleChange();
+}
+exports.effectScheduler = {
+ queue(cb) {
+ const store = getStore();
+ const { index } = store;
+ store.hooksEffect.push(() => {
+ store.hooksCleanup[index]?.();
+ const cleanFn = cb(readline());
+ if (cleanFn != null && typeof cleanFn !== 'function') {
+ throw new errors_ts_1.ValidationError('useEffect return value must be a cleanup function or nothing.');
+ }
+ store.hooksCleanup[index] = cleanFn;
+ });
+ },
+ run() {
+ const store = getStore();
+ withUpdates(() => {
+ store.hooksEffect.forEach((effect) => {
+ effect();
+ });
+ // Warning: Clean the hooks before exiting the `withUpdates` block.
+ // Failure to do so means an updates would hit the same effects again.
+ store.hooksEffect.length = 0;
+ })();
+ },
+ clearAll() {
+ const store = getStore();
+ store.hooksCleanup.forEach((cleanFn) => {
+ cleanFn?.();
+ });
+ store.hooksEffect.length = 0;
+ store.hooksCleanup.length = 0;
+ },
+};
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/key.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/key.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e2ad3dc2aeb8372dd0c900c3408326339ae46045
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/key.d.ts
@@ -0,0 +1,10 @@
+export type KeypressEvent = {
+ name: string;
+ ctrl: boolean;
+};
+export declare const isUpKey: (key: KeypressEvent) => boolean;
+export declare const isDownKey: (key: KeypressEvent) => boolean;
+export declare const isSpaceKey: (key: KeypressEvent) => boolean;
+export declare const isBackspaceKey: (key: KeypressEvent) => boolean;
+export declare const isNumberKey: (key: KeypressEvent) => boolean;
+export declare const isEnterKey: (key: KeypressEvent) => boolean;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/key.js b/node_modules/@inquirer/core/dist/commonjs/lib/key.js
new file mode 100644
index 0000000000000000000000000000000000000000..d571f185557d63efa155245020a9c3efa35db8ed
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/key.js
@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isEnterKey = exports.isNumberKey = exports.isBackspaceKey = exports.isSpaceKey = exports.isDownKey = exports.isUpKey = void 0;
+const isUpKey = (key) =>
+// The up key
+key.name === 'up' ||
+ // Vim keybinding
+ key.name === 'k' ||
+ // Emacs keybinding
+ (key.ctrl && key.name === 'p');
+exports.isUpKey = isUpKey;
+const isDownKey = (key) =>
+// The down key
+key.name === 'down' ||
+ // Vim keybinding
+ key.name === 'j' ||
+ // Emacs keybinding
+ (key.ctrl && key.name === 'n');
+exports.isDownKey = isDownKey;
+const isSpaceKey = (key) => key.name === 'space';
+exports.isSpaceKey = isSpaceKey;
+const isBackspaceKey = (key) => key.name === 'backspace';
+exports.isBackspaceKey = isBackspaceKey;
+const isNumberKey = (key) => '1234567890'.includes(key.name);
+exports.isNumberKey = isNumberKey;
+const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';
+exports.isEnterKey = isEnterKey;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c7aae8b225c01c27c531617a09cec62ba2c1e4f6
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.d.ts
@@ -0,0 +1,3 @@
+import type { Prettify, PartialDeep } from '@inquirer/type';
+import { type Theme } from './theme.ts';
+export declare function makeTheme(...themes: ReadonlyArray>>): Prettify>;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.js b/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.js
new file mode 100644
index 0000000000000000000000000000000000000000..b4b2c6635a91ae5546e9b8fa3c8da40c764a5427
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.makeTheme = makeTheme;
+const theme_ts_1 = require("./theme.js");
+function isPlainObject(value) {
+ if (typeof value !== 'object' || value === null)
+ return false;
+ let proto = value;
+ while (Object.getPrototypeOf(proto) !== null) {
+ proto = Object.getPrototypeOf(proto);
+ }
+ return Object.getPrototypeOf(value) === proto;
+}
+function deepMerge(...objects) {
+ const output = {};
+ for (const obj of objects) {
+ for (const [key, value] of Object.entries(obj)) {
+ const prevValue = output[key];
+ output[key] =
+ isPlainObject(prevValue) && isPlainObject(value)
+ ? deepMerge(prevValue, value)
+ : value;
+ }
+ }
+ return output;
+}
+function makeTheme(...themes) {
+ const themesToMerge = [
+ theme_ts_1.defaultTheme,
+ ...themes.filter((theme) => theme != null),
+ ];
+ return deepMerge(...themesToMerge);
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..576619594e2faf3fe0cc55ca35fd525f5d5de8ff
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.d.ts
@@ -0,0 +1,26 @@
+import { type Prettify } from '@inquirer/type';
+/** Represents an item that's part of a layout, about to be rendered */
+export type Layout = {
+ item: T;
+ index: number;
+ isActive: boolean;
+};
+/**
+ * Renders a page of items as lines that fit within the given width ensuring
+ * that the number of lines is not greater than the page size, and the active
+ * item renders at the provided position, while prioritizing that as many lines
+ * of the active item get rendered as possible.
+ */
+export declare function lines({ items, width, renderItem, active, position: requested, pageSize, }: {
+ items: ReadonlyArray;
+ /** The width of a rendered line in characters. */
+ width: number;
+ /** Renders an item as part of a page. */
+ renderItem: (layout: Prettify>) => string;
+ /** The index of the active item in the list of items. */
+ active: number;
+ /** The position on the page at which to render the active item. */
+ position: number;
+ /** The number of lines to render per page. */
+ pageSize: number;
+}): string[];
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.js b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.js
new file mode 100644
index 0000000000000000000000000000000000000000..2f25af7903160db930ce980205726c15c82fb90f
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/lines.js
@@ -0,0 +1,62 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.lines = lines;
+const utils_ts_1 = require("../utils.js");
+function split(content, width) {
+ return (0, utils_ts_1.breakLines)(content, width).split('\n');
+}
+/**
+ * Rotates an array of items by an integer number of positions.
+ * @param {number} count The number of positions to rotate by
+ * @param {T[]} items The items to rotate
+ */
+function rotate(count, items) {
+ const max = items.length;
+ const offset = ((count % max) + max) % max;
+ return [...items.slice(offset), ...items.slice(0, offset)];
+}
+/**
+ * Renders a page of items as lines that fit within the given width ensuring
+ * that the number of lines is not greater than the page size, and the active
+ * item renders at the provided position, while prioritizing that as many lines
+ * of the active item get rendered as possible.
+ */
+function lines({ items, width, renderItem, active, position: requested, pageSize, }) {
+ const layouts = items.map((item, index) => ({
+ item,
+ index,
+ isActive: index === active,
+ }));
+ const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
+ const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split(renderItem(layoutsInPage[index]), width);
+ // Create a blank array of lines for the page
+ const pageBuffer = Array.from({ length: pageSize });
+ // Render the active item to decide the position
+ const activeItem = renderItemAt(requested).slice(0, pageSize);
+ const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
+ // Add the lines of the active item into the page
+ pageBuffer.splice(position, activeItem.length, ...activeItem);
+ // Fill the page under the active item
+ let bufferPointer = position + activeItem.length;
+ let layoutPointer = requested + 1;
+ while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
+ for (const line of renderItemAt(layoutPointer)) {
+ pageBuffer[bufferPointer++] = line;
+ if (bufferPointer >= pageSize)
+ break;
+ }
+ layoutPointer++;
+ }
+ // Fill the page over the active item
+ bufferPointer = position - 1;
+ layoutPointer = requested - 1;
+ while (bufferPointer >= 0 && layoutPointer >= 0) {
+ for (const line of renderItemAt(layoutPointer).reverse()) {
+ pageBuffer[bufferPointer--] = line;
+ if (bufferPointer < 0)
+ break;
+ }
+ layoutPointer--;
+ }
+ return pageBuffer.filter((line) => typeof line === 'string');
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d74870e6c816b2a2b04d02ffa3b359f4d103ec8d
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.d.ts
@@ -0,0 +1,20 @@
+/**
+ * Creates the next position for the active item considering a finite list of
+ * items to be rendered on a page.
+ */
+export declare function finite({ active, pageSize, total, }: {
+ active: number;
+ pageSize: number;
+ total: number;
+}): number;
+/**
+ * Creates the next position for the active item considering an infinitely
+ * looping list of items to be rendered on the page.
+ */
+export declare function infinite({ active, lastActive, total, pageSize, pointer, }: {
+ active: number;
+ lastActive: number;
+ total: number;
+ pageSize: number;
+ pointer: number;
+}): number;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.js b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.js
new file mode 100644
index 0000000000000000000000000000000000000000..9fb765817741bfb9f6c6e7842a581976b93dc422
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/position.js
@@ -0,0 +1,31 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.finite = finite;
+exports.infinite = infinite;
+/**
+ * Creates the next position for the active item considering a finite list of
+ * items to be rendered on a page.
+ */
+function finite({ active, pageSize, total, }) {
+ const middle = Math.floor(pageSize / 2);
+ if (total <= pageSize || active < middle)
+ return active;
+ if (active >= total - middle)
+ return active + pageSize - total;
+ return middle;
+}
+/**
+ * Creates the next position for the active item considering an infinitely
+ * looping list of items to be rendered on the page.
+ */
+function infinite({ active, lastActive, total, pageSize, pointer, }) {
+ if (total <= pageSize)
+ return active;
+ // Move the position only when the user moves down, and when the
+ // navigation fits within a single page
+ if (lastActive < active && active - lastActive < pageSize) {
+ // Limit it to the middle of the list
+ return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
+ }
+ return pointer;
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7af6097ab2210957dea3355bde1adcd82dc0b228
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.d.ts
@@ -0,0 +1,15 @@
+import type { Prettify } from '@inquirer/type';
+import { type Theme } from '../theme.ts';
+import { type Layout } from './lines.ts';
+export declare function usePagination({ items, active, renderItem, pageSize, loop, }: {
+ items: ReadonlyArray;
+ /** The index of the active item. */
+ active: number;
+ /** Renders an item as part of a page. */
+ renderItem: (layout: Prettify>) => string;
+ /** The size of the page. */
+ pageSize: number;
+ /** Allows creating an infinitely looping list. `true` if unspecified. */
+ loop?: boolean;
+ theme?: Theme;
+}): string;
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.js b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.js
new file mode 100644
index 0000000000000000000000000000000000000000..5bef5aeafc4d12aa41bdde99ecd7c621a954f2f2
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.usePagination = usePagination;
+const use_ref_ts_1 = require("../use-ref.js");
+const utils_ts_1 = require("../utils.js");
+const lines_ts_1 = require("./lines.js");
+const position_ts_1 = require("./position.js");
+function usePagination({ items, active, renderItem, pageSize, loop = true, }) {
+ const state = (0, use_ref_ts_1.useRef)({ position: 0, lastActive: 0 });
+ const position = loop
+ ? (0, position_ts_1.infinite)({
+ active,
+ lastActive: state.current.lastActive,
+ total: items.length,
+ pageSize,
+ pointer: state.current.position,
+ })
+ : (0, position_ts_1.finite)({
+ active,
+ total: items.length,
+ pageSize,
+ });
+ state.current.position = position;
+ state.current.lastActive = active;
+ return (0, lines_ts_1.lines)({
+ items,
+ width: (0, utils_ts_1.readlineWidth)(),
+ renderItem,
+ active,
+ position,
+ pageSize,
+ }).join('\n');
+}
diff --git a/node_modules/@inquirer/core/dist/commonjs/lib/promise-polyfill.d.ts b/node_modules/@inquirer/core/dist/commonjs/lib/promise-polyfill.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0e4f74ca61d0b9ad9e7f092c436b79d137c0bb22
--- /dev/null
+++ b/node_modules/@inquirer/core/dist/commonjs/lib/promise-polyfill.d.ts
@@ -0,0 +1,7 @@
+export declare class PromisePolyfill extends Promise {
+ static withResolver(): {
+ promise: Promise