Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +1 -0
- extensions/channels/dist/index.d.ts +145 -0
- extensions/channels/dist/index.js +95 -0
- extensions/channels/dist/index.js.map +1 -0
- extensions/channels/node_modules/.package-lock.json +986 -0
- extensions/channels/node_modules/@clack/core/CHANGELOG.md +340 -0
- extensions/channels/node_modules/@clack/core/LICENSE +9 -0
- extensions/channels/node_modules/@clack/core/README.md +22 -0
- extensions/channels/node_modules/@clack/core/dist/index.d.mts +349 -0
- extensions/channels/node_modules/@clack/core/dist/index.mjs +11 -0
- extensions/channels/node_modules/@clack/core/dist/index.mjs.map +1 -0
- extensions/channels/node_modules/@clack/core/package.json +60 -0
- extensions/channels/node_modules/@clack/prompts/CHANGELOG.md +576 -0
- extensions/channels/node_modules/@clack/prompts/LICENSE +9 -0
- extensions/channels/node_modules/@clack/prompts/README.md +270 -0
- extensions/channels/node_modules/@clack/prompts/dist/index.d.mts +391 -0
- extensions/channels/node_modules/@clack/prompts/dist/index.mjs +137 -0
- extensions/channels/node_modules/@clack/prompts/dist/index.mjs.map +0 -0
- extensions/channels/node_modules/@clack/prompts/package.json +65 -0
- extensions/channels/node_modules/@derhuerst/http-basic/LICENSE +19 -0
- extensions/channels/node_modules/@derhuerst/http-basic/README.md +101 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.d.ts +10 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.js.flow +14 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.d.ts +4 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.js.flow +11 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.d.ts +12 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.js +112 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.js.flow +24 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.d.ts +3 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.js.flow +7 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.d.ts +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.js.flow +15 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.d.ts +8 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.js.flow +19 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.d.ts +9 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.js +59 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.js.flow +21 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.d.ts +27 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.js +2 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.js.flow +49 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.d.ts +14 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.js +54 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.js.flow +16 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-utils.d.ts +6 -0
- extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-utils.js +45 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
extensions/channels/node_modules/@larksuiteoapi/node-sdk/types/index.d.ts filter=lfs diff=lfs merge=lfs -text
|
extensions/channels/dist/index.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export { DEFAULT_ACCOUNT_ID as DINGTALK_DEFAULT_ACCOUNT_ID, DingtalkConfig, DingtalkSendResult, ResolvedDingtalkAccount, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime } from '@openclaw-china/dingtalk';
|
| 2 |
+
export { DEFAULT_ACCOUNT_ID as FEISHU_DEFAULT_ACCOUNT_ID, FeishuConfig, FeishuSendResult, ResolvedFeishuAccount, feishuPlugin, getFeishuRuntime, sendMessageFeishu, setFeishuRuntime } from '@openclaw-china/feishu-china';
|
| 3 |
+
export { ResolvedWecomAccount, DEFAULT_ACCOUNT_ID as WECOM_DEFAULT_ACCOUNT_ID, WecomConfig, WecomInboundMessage, getWecomRuntime, setWecomRuntime, wecomPlugin } from '@openclaw-china/wecom';
|
| 4 |
+
export { AccessTokenCacheEntry, ResolvedWecomAppAccount, DEFAULT_ACCOUNT_ID as WECOM_APP_DEFAULT_ACCOUNT_ID, WecomAppConfig, WecomAppDmPolicy, WecomAppInboundMessage, WecomAppSendTarget, clearAccessTokenCache, clearAllAccessTokenCache, downloadAndSendImage, getAccessToken, getWecomAppRuntime, sendWecomAppImageMessage, sendWecomAppMarkdownMessage, sendWecomAppMessage, setWecomAppRuntime, stripMarkdown, wecomAppPlugin } from '@openclaw-china/wecom-app';
|
| 5 |
+
export { ResolvedWecomKfAccount, DEFAULT_ACCOUNT_ID as WECOM_KF_DEFAULT_ACCOUNT_ID, WecomKfAccountConfig, WecomKfConfig, WecomKfDmPolicy, SyncMsgItem as WecomKfSyncMsgItem, SyncMsgResponse as WecomKfSyncMsgResponse, getWecomKfRuntime, setWecomKfRuntime, wecomKfPlugin } from '@openclaw-china/wecom-kf';
|
| 6 |
+
export { DEFAULT_ACCOUNT_ID as QQBOT_DEFAULT_ACCOUNT_ID, QQBotConfig, QQBotSendResult, ResolvedQQBotAccount, getQQBotRuntime, qqbotPlugin, setQQBotRuntime } from '@openclaw-china/qqbot';
|
| 7 |
+
export { ResolvedWechatMpAccount, DEFAULT_ACCOUNT_ID as WECHAT_MP_DEFAULT_ACCOUNT_ID, WechatMpAccountConfig, WechatMpActiveDeliveryMode, WechatMpConfig, WechatMpDmPolicy, WechatMpMessageMode, WechatMpReplyMode, getWechatMpRuntime, sendWechatMpActiveText, setWechatMpRuntime, wechatMpPlugin } from '@openclaw-china/wechat-mp';
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* @openclaw-china/channels
|
| 11 |
+
* 统一渠道包入口
|
| 12 |
+
*
|
| 13 |
+
* 导出所有渠道插件,提供统一注册函数
|
| 14 |
+
*
|
| 15 |
+
* Requirements: Unified Package Entry, Unified Distribution
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* 渠道配置接口
|
| 20 |
+
*/
|
| 21 |
+
interface ChannelConfig {
|
| 22 |
+
/** 是否启用该渠道 */
|
| 23 |
+
enabled?: boolean;
|
| 24 |
+
[key: string]: unknown;
|
| 25 |
+
}
|
| 26 |
+
interface WecomRouteConfig extends ChannelConfig {
|
| 27 |
+
webhookPath?: string;
|
| 28 |
+
accounts?: Record<string, {
|
| 29 |
+
webhookPath?: string;
|
| 30 |
+
}>;
|
| 31 |
+
}
|
| 32 |
+
interface WecomAppRouteConfig extends ChannelConfig {
|
| 33 |
+
webhookPath?: string;
|
| 34 |
+
accounts?: Record<string, {
|
| 35 |
+
webhookPath?: string;
|
| 36 |
+
}>;
|
| 37 |
+
}
|
| 38 |
+
interface WecomKfRouteConfig extends ChannelConfig {
|
| 39 |
+
webhookPath?: string;
|
| 40 |
+
accounts?: Record<string, {
|
| 41 |
+
webhookPath?: string;
|
| 42 |
+
}>;
|
| 43 |
+
}
|
| 44 |
+
interface WechatMpRouteConfig extends ChannelConfig {
|
| 45 |
+
webhookPath?: string;
|
| 46 |
+
accounts?: Record<string, {
|
| 47 |
+
webhookPath?: string;
|
| 48 |
+
}>;
|
| 49 |
+
}
|
| 50 |
+
/**
|
| 51 |
+
* Moltbot 配置接口(符合官方约定)
|
| 52 |
+
* 配置路径: channels.<id>.enabled
|
| 53 |
+
*/
|
| 54 |
+
interface MoltbotConfig {
|
| 55 |
+
channels?: {
|
| 56 |
+
dingtalk?: ChannelConfig;
|
| 57 |
+
"feishu-china"?: ChannelConfig;
|
| 58 |
+
wecom?: WecomRouteConfig;
|
| 59 |
+
"wecom-app"?: WecomAppRouteConfig;
|
| 60 |
+
"wecom-kf"?: WecomKfRouteConfig;
|
| 61 |
+
"wechat-mp"?: WechatMpRouteConfig;
|
| 62 |
+
qqbot?: ChannelConfig;
|
| 63 |
+
qq?: ChannelConfig;
|
| 64 |
+
[key: string]: ChannelConfig | undefined;
|
| 65 |
+
};
|
| 66 |
+
[key: string]: unknown;
|
| 67 |
+
}
|
| 68 |
+
/**
|
| 69 |
+
* Moltbot 插件 API 接口
|
| 70 |
+
*/
|
| 71 |
+
interface MoltbotPluginApi {
|
| 72 |
+
registerChannel: (opts: {
|
| 73 |
+
plugin: unknown;
|
| 74 |
+
}) => void;
|
| 75 |
+
registerCli?: (registrar: (ctx: {
|
| 76 |
+
program: unknown;
|
| 77 |
+
config?: MoltbotConfig;
|
| 78 |
+
}) => void | Promise<void>, opts?: {
|
| 79 |
+
commands?: string[];
|
| 80 |
+
}) => void;
|
| 81 |
+
logger?: {
|
| 82 |
+
info?: (message: string) => void;
|
| 83 |
+
warn?: (message: string) => void;
|
| 84 |
+
error?: (message: string) => void;
|
| 85 |
+
};
|
| 86 |
+
runtime?: {
|
| 87 |
+
config?: {
|
| 88 |
+
writeConfigFile?: (cfg: unknown) => Promise<void>;
|
| 89 |
+
};
|
| 90 |
+
};
|
| 91 |
+
config?: MoltbotConfig;
|
| 92 |
+
[key: string]: unknown;
|
| 93 |
+
}
|
| 94 |
+
/**
|
| 95 |
+
* 支持的渠道列表
|
| 96 |
+
*/
|
| 97 |
+
declare const SUPPORTED_CHANNELS: readonly ["dingtalk", "feishu-china", "wecom", "wecom-app", "wecom-kf", "wechat-mp", "qqbot"];
|
| 98 |
+
type SupportedChannel = (typeof SUPPORTED_CHANNELS)[number];
|
| 99 |
+
/**
|
| 100 |
+
* 根据 Moltbot 配置注册启用的渠道
|
| 101 |
+
*
|
| 102 |
+
* 符合 Moltbot 官方约定:从 cfg.channels.<id>.enabled 读取配置
|
| 103 |
+
*
|
| 104 |
+
* @param api Moltbot 鎻掍欢 API
|
| 105 |
+
* @param cfg Moltbot 配置(可选,默认从 api.config 读取)
|
| 106 |
+
*
|
| 107 |
+
* @example
|
| 108 |
+
* ```ts
|
| 109 |
+
* // moltbot.json 配置
|
| 110 |
+
* {
|
| 111 |
+
* "channels": {
|
| 112 |
+
* "dingtalk": {
|
| 113 |
+
* "enabled": true,
|
| 114 |
+
* "clientId": "...",
|
| 115 |
+
* "clientSecret": "..."
|
| 116 |
+
* }
|
| 117 |
+
* }
|
| 118 |
+
* }
|
| 119 |
+
* ```
|
| 120 |
+
*/
|
| 121 |
+
declare function registerChannelsByConfig(api: MoltbotPluginApi, cfg?: MoltbotConfig): void;
|
| 122 |
+
/**
|
| 123 |
+
* 统一渠道插件定义
|
| 124 |
+
*
|
| 125 |
+
* 包含所有支持的渠道,通过配置启用
|
| 126 |
+
* 配置路径符合 Moltbot 官方约定: channels.<id>
|
| 127 |
+
*/
|
| 128 |
+
declare const channelsPlugin: {
|
| 129 |
+
id: string;
|
| 130 |
+
name: string;
|
| 131 |
+
description: string;
|
| 132 |
+
configSchema: {
|
| 133 |
+
type: string;
|
| 134 |
+
additionalProperties: boolean;
|
| 135 |
+
properties: {};
|
| 136 |
+
};
|
| 137 |
+
/**
|
| 138 |
+
* 注册所有启用的渠道
|
| 139 |
+
*
|
| 140 |
+
* 从 api.config.channels.<id>.enabled 读取配置
|
| 141 |
+
*/
|
| 142 |
+
register(api: MoltbotPluginApi): void;
|
| 143 |
+
};
|
| 144 |
+
|
| 145 |
+
export { type ChannelConfig, type MoltbotConfig, type MoltbotPluginApi, SUPPORTED_CHANNELS, type SupportedChannel, type WechatMpRouteConfig, type WecomAppRouteConfig, type WecomKfRouteConfig, type WecomRouteConfig, channelsPlugin as default, registerChannelsByConfig };
|
extensions/channels/dist/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import dingtalkEntry from '@openclaw-china/dingtalk';
|
| 2 |
+
export { DEFAULT_ACCOUNT_ID as DINGTALK_DEFAULT_ACCOUNT_ID, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime } from '@openclaw-china/dingtalk';
|
| 3 |
+
import feishuEntry from '@openclaw-china/feishu-china';
|
| 4 |
+
export { DEFAULT_ACCOUNT_ID as FEISHU_DEFAULT_ACCOUNT_ID, feishuPlugin, getFeishuRuntime, sendMessageFeishu, setFeishuRuntime } from '@openclaw-china/feishu-china';
|
| 5 |
+
import wecomEntry from '@openclaw-china/wecom';
|
| 6 |
+
export { DEFAULT_ACCOUNT_ID as WECOM_DEFAULT_ACCOUNT_ID, getWecomRuntime, setWecomRuntime, wecomPlugin } from '@openclaw-china/wecom';
|
| 7 |
+
import wecomAppEntry from '@openclaw-china/wecom-app';
|
| 8 |
+
export { DEFAULT_ACCOUNT_ID as WECOM_APP_DEFAULT_ACCOUNT_ID, clearAccessTokenCache, clearAllAccessTokenCache, downloadAndSendImage, getAccessToken, getWecomAppRuntime, sendWecomAppImageMessage, sendWecomAppMarkdownMessage, sendWecomAppMessage, setWecomAppRuntime, stripMarkdown, wecomAppPlugin } from '@openclaw-china/wecom-app';
|
| 9 |
+
import wecomKfEntry from '@openclaw-china/wecom-kf';
|
| 10 |
+
export { DEFAULT_ACCOUNT_ID as WECOM_KF_DEFAULT_ACCOUNT_ID, getWecomKfRuntime, setWecomKfRuntime, wecomKfPlugin } from '@openclaw-china/wecom-kf';
|
| 11 |
+
import qqbotEntry from '@openclaw-china/qqbot';
|
| 12 |
+
export { DEFAULT_ACCOUNT_ID as QQBOT_DEFAULT_ACCOUNT_ID, getQQBotRuntime, qqbotPlugin, setQQBotRuntime } from '@openclaw-china/qqbot';
|
| 13 |
+
import wechatMpEntry from '@openclaw-china/wechat-mp';
|
| 14 |
+
export { DEFAULT_ACCOUNT_ID as WECHAT_MP_DEFAULT_ACCOUNT_ID, getWechatMpRuntime, sendWechatMpActiveText, setWechatMpRuntime, wechatMpPlugin } from '@openclaw-china/wechat-mp';
|
| 15 |
+
import { registerChinaSetupCli, showChinaInstallHint } from '@openclaw-china/shared';
|
| 16 |
+
|
| 17 |
+
// src/index.ts
|
| 18 |
+
var SUPPORTED_CHANNELS = ["dingtalk", "feishu-china", "wecom", "wecom-app", "wecom-kf", "wechat-mp", "qqbot"];
|
| 19 |
+
var channelPlugins = {
|
| 20 |
+
dingtalk: {
|
| 21 |
+
register: (api) => {
|
| 22 |
+
dingtalkEntry.register(api);
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"feishu-china": {
|
| 26 |
+
register: (api) => {
|
| 27 |
+
feishuEntry.register(api);
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
wecom: {
|
| 31 |
+
register: (api) => {
|
| 32 |
+
wecomEntry.register(api);
|
| 33 |
+
}
|
| 34 |
+
},
|
| 35 |
+
"wecom-app": {
|
| 36 |
+
register: (api) => {
|
| 37 |
+
wecomAppEntry.register(api);
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
"wecom-kf": {
|
| 41 |
+
register: (api) => {
|
| 42 |
+
wecomKfEntry.register(api);
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"wechat-mp": {
|
| 46 |
+
register: (api) => {
|
| 47 |
+
wechatMpEntry.register(api);
|
| 48 |
+
}
|
| 49 |
+
},
|
| 50 |
+
qqbot: {
|
| 51 |
+
register: (api) => {
|
| 52 |
+
qqbotEntry.register(api);
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
};
|
| 56 |
+
function registerChannelsByConfig(api, cfg) {
|
| 57 |
+
const config = cfg ?? api.config;
|
| 58 |
+
const channelsConfig = config?.channels;
|
| 59 |
+
if (!channelsConfig) {
|
| 60 |
+
return;
|
| 61 |
+
}
|
| 62 |
+
for (const channelId of SUPPORTED_CHANNELS) {
|
| 63 |
+
const channelConfig = channelsConfig[channelId];
|
| 64 |
+
if (!channelConfig?.enabled) {
|
| 65 |
+
continue;
|
| 66 |
+
}
|
| 67 |
+
const plugin = channelPlugins[channelId];
|
| 68 |
+
plugin.register(api);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
var channelsPlugin = {
|
| 72 |
+
id: "channels",
|
| 73 |
+
name: "Moltbot China Channels",
|
| 74 |
+
description: "\u7EDF\u4E00\u6E20\u9053\u5305\uFF0C\u652F\u6301\u9489\u9489\u3001\u98DE\u4E66\u3001\u4F01\u4E1A\u5FAE\u4FE1\u3001\u5FAE\u4FE1\u516C\u4F17\u53F7\u3001QQ Bot",
|
| 75 |
+
configSchema: {
|
| 76 |
+
type: "object",
|
| 77 |
+
additionalProperties: false,
|
| 78 |
+
properties: {}
|
| 79 |
+
},
|
| 80 |
+
/**
|
| 81 |
+
* 注册所有启用的渠道
|
| 82 |
+
*
|
| 83 |
+
* 从 api.config.channels.<id>.enabled 读取配置
|
| 84 |
+
*/
|
| 85 |
+
register(api) {
|
| 86 |
+
registerChinaSetupCli(api, { channels: SUPPORTED_CHANNELS });
|
| 87 |
+
showChinaInstallHint(api);
|
| 88 |
+
registerChannelsByConfig(api);
|
| 89 |
+
}
|
| 90 |
+
};
|
| 91 |
+
var index_default = channelsPlugin;
|
| 92 |
+
|
| 93 |
+
export { SUPPORTED_CHANNELS, index_default as default, registerChannelsByConfig };
|
| 94 |
+
//# sourceMappingURL=index.js.map
|
| 95 |
+
//# sourceMappingURL=index.js.map
|
extensions/channels/dist/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAyPO,IAAM,kBAAA,GAAqB,CAAC,UAAA,EAAY,cAAA,EAAgB,SAAS,WAAA,EAAa,UAAA,EAAY,aAAa,OAAO;AAKrH,IAAM,cAAA,GAA0F;AAAA,EAC9F,QAAA,EAAU;AAAA,IACR,QAAA,EAAU,CAAC,GAAA,KAA0B;AACnC,MAAA,aAAA,CAAc,SAAS,GAAG,CAAA;AAAA,IAC5B;AAAA,GACF;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,QAAA,EAAU,CAAC,GAAA,KAA0B;AACnC,MAAA,WAAA,CAAY,SAAS,GAAG,CAAA;AAAA,IAC1B;AAAA,GACF;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,CAAC,GAAA,KAA0B;AACnC,MAAA,UAAA,CAAW,SAAS,GAAG,CAAA;AAAA,IACzB;AAAA,GACF;AAAA,EAC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;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,GAAA,EAAuB;AAC9B,IAAA,qBAAA,CAAsB,GAAA,EAAK,EAAE,QAAA,EAAU,kBAAA,EAAoB,CAAA;AAC3D,IAAA,oBAAA,CAAqB,GAAG,CAAA;AACxB,IAAA,wBAAA,CAAyB,GAAG,CAAA;AAAA,EAC9B;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["/**\r\n * @openclaw-china/channels\r\n * 统一渠道包入口\r\n *\r\n * 导出所有渠道插件,提供统一注册函数\r\n *\r\n * Requirements: Unified Package Entry, Unified Distribution\r\n */\r\n\r\n// 导出 DingTalk 插件\r\nimport {\r\n dingtalkPlugin,\r\n DEFAULT_ACCOUNT_ID as DINGTALK_DEFAULT_ACCOUNT_ID,\r\n sendMessageDingtalk,\r\n setDingtalkRuntime,\r\n getDingtalkRuntime,\r\n} from \"@openclaw-china/dingtalk\";\r\nimport dingtalkEntry from \"@openclaw-china/dingtalk\";\r\nimport {\r\n feishuPlugin,\r\n DEFAULT_ACCOUNT_ID as FEISHU_DEFAULT_ACCOUNT_ID,\r\n sendMessageFeishu,\r\n setFeishuRuntime,\r\n getFeishuRuntime,\r\n} from \"@openclaw-china/feishu-china\";\r\nimport feishuEntry from \"@openclaw-china/feishu-china\";\r\nimport {\r\n wecomPlugin,\r\n DEFAULT_ACCOUNT_ID as WECOM_DEFAULT_ACCOUNT_ID,\r\n setWecomRuntime,\r\n getWecomRuntime,\r\n} from \"@openclaw-china/wecom\";\r\nimport wecomEntry from \"@openclaw-china/wecom\";\r\nimport {\r\n wecomAppPlugin,\r\n DEFAULT_ACCOUNT_ID as WECOM_APP_DEFAULT_ACCOUNT_ID,\r\n setWecomAppRuntime,\r\n getWecomAppRuntime,\r\n sendWecomAppMessage,\r\n getAccessToken,\r\n sendWecomAppMarkdownMessage,\r\n stripMarkdown,\r\n clearAccessTokenCache,\r\n clearAllAccessTokenCache,\r\n downloadAndSendImage,\r\n sendWecomAppImageMessage,\r\n} from \"@openclaw-china/wecom-app\";\r\nimport wecomAppEntry from \"@openclaw-china/wecom-app\";\r\nimport {\r\n wecomKfPlugin,\r\n DEFAULT_ACCOUNT_ID as WECOM_KF_DEFAULT_ACCOUNT_ID,\r\n setWecomKfRuntime,\r\n getWecomKfRuntime,\r\n} from \"@openclaw-china/wecom-kf\";\r\nimport wecomKfEntry from \"@openclaw-china/wecom-kf\";\r\nimport {\r\n qqbotPlugin,\r\n DEFAULT_ACCOUNT_ID as QQBOT_DEFAULT_ACCOUNT_ID,\r\n setQQBotRuntime,\r\n getQQBotRuntime,\r\n} from \"@openclaw-china/qqbot\";\r\nimport qqbotEntry from \"@openclaw-china/qqbot\";\r\nimport {\r\n wechatMpPlugin,\r\n DEFAULT_ACCOUNT_ID as WECHAT_MP_DEFAULT_ACCOUNT_ID,\r\n setWechatMpRuntime,\r\n getWechatMpRuntime,\r\n sendWechatMpActiveText,\r\n} from \"@openclaw-china/wechat-mp\";\r\nimport wechatMpEntry from \"@openclaw-china/wechat-mp\";\r\nimport { registerChinaSetupCli, showChinaInstallHint } from \"@openclaw-china/shared\";\r\n\r\nexport {\r\n dingtalkPlugin,\r\n DINGTALK_DEFAULT_ACCOUNT_ID,\r\n sendMessageDingtalk,\r\n setDingtalkRuntime,\r\n getDingtalkRuntime,\r\n feishuPlugin,\r\n FEISHU_DEFAULT_ACCOUNT_ID,\r\n sendMessageFeishu,\r\n setFeishuRuntime,\r\n getFeishuRuntime,\r\n wecomPlugin,\r\n WECOM_DEFAULT_ACCOUNT_ID,\r\n setWecomRuntime,\r\n getWecomRuntime,\r\n wecomAppPlugin,\r\n WECOM_APP_DEFAULT_ACCOUNT_ID,\r\n setWecomAppRuntime,\r\n getWecomAppRuntime,\r\n sendWecomAppMessage,\r\n getAccessToken,\r\n sendWecomAppMarkdownMessage,\r\n stripMarkdown,\r\n clearAccessTokenCache,\r\n clearAllAccessTokenCache,\r\n downloadAndSendImage,\r\n sendWecomAppImageMessage,\r\n wecomKfPlugin,\r\n WECOM_KF_DEFAULT_ACCOUNT_ID,\r\n setWecomKfRuntime,\r\n getWecomKfRuntime,\r\n qqbotPlugin,\r\n QQBOT_DEFAULT_ACCOUNT_ID,\r\n setQQBotRuntime,\r\n getQQBotRuntime,\r\n wechatMpPlugin,\r\n WECHAT_MP_DEFAULT_ACCOUNT_ID,\r\n setWechatMpRuntime,\r\n getWechatMpRuntime,\r\n sendWechatMpActiveText,\r\n};\r\n\r\nexport type {\r\n DingtalkConfig,\r\n ResolvedDingtalkAccount,\r\n DingtalkSendResult,\r\n} from \"@openclaw-china/dingtalk\";\r\nexport type {\r\n FeishuConfig,\r\n ResolvedFeishuAccount,\r\n FeishuSendResult,\r\n} from \"@openclaw-china/feishu-china\";\r\nexport type { WecomConfig, ResolvedWecomAccount, WecomInboundMessage } from \"@openclaw-china/wecom\";\r\nexport type {\r\n WecomAppConfig,\r\n ResolvedWecomAppAccount,\r\n WecomAppInboundMessage,\r\n WecomAppDmPolicy,\r\n WecomAppSendTarget,\r\n AccessTokenCacheEntry,\r\n} from \"@openclaw-china/wecom-app\";\r\nexport type {\r\n WecomKfConfig,\r\n WecomKfAccountConfig,\r\n ResolvedWecomKfAccount,\r\n WecomKfDmPolicy,\r\n SyncMsgItem as WecomKfSyncMsgItem,\r\n SyncMsgResponse as WecomKfSyncMsgResponse,\r\n} from \"@openclaw-china/wecom-kf\";\r\nexport type { QQBotConfig, ResolvedQQBotAccount, QQBotSendResult } from \"@openclaw-china/qqbot\";\r\nexport type {\r\n WechatMpConfig,\r\n WechatMpAccountConfig,\r\n ResolvedWechatMpAccount,\r\n WechatMpDmPolicy,\r\n WechatMpMessageMode,\r\n WechatMpReplyMode,\r\n WechatMpActiveDeliveryMode,\r\n} from \"@openclaw-china/wechat-mp\";\r\n\r\n// TODO: 后续添加其他渠道\r\n// export { qqPlugin } from \"@openclaw-china/qq\";\r\n\r\n/**\r\n * 渠道配置接口\r\n */\r\nexport interface ChannelConfig {\r\n /** 是否启用该渠道 */\r\n enabled?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport interface WecomRouteConfig extends ChannelConfig {\r\n webhookPath?: string;\r\n accounts?: Record<\r\n string,\r\n {\r\n webhookPath?: string;\r\n }\r\n >;\r\n}\r\n\r\nexport interface WecomAppRouteConfig extends ChannelConfig {\r\n webhookPath?: string;\r\n accounts?: Record<\r\n string,\r\n {\r\n webhookPath?: string;\r\n }\r\n >;\r\n}\r\n\r\nexport interface WecomKfRouteConfig extends ChannelConfig {\r\n webhookPath?: string;\r\n accounts?: Record<\r\n string,\r\n {\r\n webhookPath?: string;\r\n }\r\n >;\r\n}\r\n\r\nexport interface WechatMpRouteConfig extends ChannelConfig {\r\n webhookPath?: string;\r\n accounts?: Record<\r\n string,\r\n {\r\n webhookPath?: string;\r\n }\r\n >;\r\n}\r\n\r\n/**\r\n * Moltbot 配置接口(符合官方约定)\r\n * 配置路径: channels.<id>.enabled\r\n */\r\nexport interface MoltbotConfig {\r\n channels?: {\r\n dingtalk?: ChannelConfig;\r\n \"feishu-china\"?: ChannelConfig;\r\n wecom?: WecomRouteConfig;\r\n \"wecom-app\"?: WecomAppRouteConfig;\r\n \"wecom-kf\"?: WecomKfRouteConfig;\r\n \"wechat-mp\"?: WechatMpRouteConfig;\r\n qqbot?: ChannelConfig;\r\n qq?: ChannelConfig;\r\n [key: string]: ChannelConfig | undefined;\r\n };\r\n [key: string]: unknown;\r\n}\r\n\r\n/**\r\n * Moltbot 插件 API 接口\r\n */\r\nexport interface MoltbotPluginApi {\r\n registerChannel: (opts: { plugin: unknown }) => void;\r\n registerCli?: (\r\n registrar: (ctx: { program: unknown; config?: MoltbotConfig }) => void | Promise<void>,\r\n opts?: { commands?: string[] }\r\n ) => void;\r\n logger?: {\r\n info?: (message: string) => void;\r\n warn?: (message: string) => void;\r\n error?: (message: string) => void;\r\n };\r\n runtime?: {\r\n config?: {\r\n writeConfigFile?: (cfg: unknown) => Promise<void>;\r\n };\r\n };\r\n config?: MoltbotConfig;\r\n [key: string]: unknown;\r\n}\r\n\r\n/**\r\n * 支持的渠道列表\r\n */\r\nexport const SUPPORTED_CHANNELS = [\"dingtalk\", \"feishu-china\", \"wecom\", \"wecom-app\", \"wecom-kf\", \"wechat-mp\", \"qqbot\"] as const;\r\n// TODO: 鍚庣画娣诲姞 \"qq\"\r\n\r\nexport type SupportedChannel = (typeof SUPPORTED_CHANNELS)[number];\r\n\r\nconst channelPlugins: Record<SupportedChannel, { register: (api: MoltbotPluginApi) => void }> = {\r\n dingtalk: {\r\n register: (api: MoltbotPluginApi) => {\r\n dingtalkEntry.register(api);\r\n },\r\n },\r\n \"feishu-china\": {\r\n register: (api: MoltbotPluginApi) => {\r\n feishuEntry.register(api);\r\n },\r\n },\r\n wecom: {\r\n register: (api: MoltbotPluginApi) => {\r\n wecomEntry.register(api);\r\n },\r\n },\r\n \"wecom-app\": {\r\n register: (api: MoltbotPluginApi) => {\r\n wecomAppEntry.register(api);\r\n },\r\n },\r\n \"wecom-kf\": {\r\n register: (api: MoltbotPluginApi) => {\r\n wecomKfEntry.register(api);\r\n },\r\n },\r\n \"wechat-mp\": {\r\n register: (api: MoltbotPluginApi) => {\r\n wechatMpEntry.register(api);\r\n },\r\n },\r\n qqbot: {\r\n register: (api: MoltbotPluginApi) => {\r\n qqbotEntry.register(api);\r\n },\r\n },\r\n};\r\n\r\n/**\r\n * 根据 Moltbot 配置注册启用的渠道\r\n *\r\n * 符合 Moltbot 官方约定:从 cfg.channels.<id>.enabled 读取配置\r\n *\r\n * @param api Moltbot 鎻掍欢 API\r\n * @param cfg Moltbot 配置(可选,默认从 api.config 读取)\r\n *\r\n * @example\r\n * ```ts\r\n * // moltbot.json 配置\r\n * {\r\n * \"channels\": {\r\n * \"dingtalk\": {\r\n * \"enabled\": true,\r\n * \"clientId\": \"...\",\r\n * \"clientSecret\": \"...\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport function registerChannelsByConfig(\r\n api: MoltbotPluginApi,\r\n cfg?: MoltbotConfig\r\n): void {\r\n // 从 api.config 或传入的 cfg 获取配置\r\n const config = cfg ?? api.config;\r\n const channelsConfig = config?.channels;\r\n\r\n if (!channelsConfig) {\r\n return;\r\n }\r\n\r\n for (const channelId of SUPPORTED_CHANNELS) {\r\n // 符合官方约定:从 channels.<id>.enabled 读取\r\n const channelConfig = channelsConfig[channelId];\r\n\r\n // 跳过未启用的渠道\r\n if (!channelConfig?.enabled) {\r\n continue;\r\n }\r\n\r\n const plugin = channelPlugins[channelId];\r\n plugin.register(api);\r\n }\r\n}\r\n\r\n/**\r\n * 统一渠道插件定义\r\n *\r\n * 包含所有支持的渠道,通过配置启用\r\n * 配置路径符合 Moltbot 官方约定: channels.<id>\r\n */\r\nconst channelsPlugin = {\r\n id: \"channels\",\r\n name: \"Moltbot China Channels\",\r\n description: \"统一渠道包,支持钉钉、飞书、企业微信、微信公众号、QQ Bot\",\r\n\r\n configSchema: {\r\n type: \"object\",\r\n additionalProperties: false,\r\n properties: {},\r\n },\r\n\r\n /**\r\n * 注册所有启用的渠道\r\n *\r\n * 从 api.config.channels.<id>.enabled 读取配置\r\n */\r\n register(api: MoltbotPluginApi) {\r\n registerChinaSetupCli(api, { channels: SUPPORTED_CHANNELS });\r\n showChinaInstallHint(api);\r\n registerChannelsByConfig(api);\r\n },\r\n};\r\n\r\nexport default channelsPlugin;\r\n"]}
|
extensions/channels/node_modules/.package-lock.json
ADDED
|
@@ -0,0 +1,986 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@openclaw-china/channels",
|
| 3 |
+
"version": "2026.3.29",
|
| 4 |
+
"lockfileVersion": 3,
|
| 5 |
+
"requires": true,
|
| 6 |
+
"packages": {
|
| 7 |
+
"node_modules/@clack/core": {
|
| 8 |
+
"version": "1.2.0",
|
| 9 |
+
"resolved": "https://registry.npmjs.org/@clack/core/-/core-1.2.0.tgz",
|
| 10 |
+
"integrity": "sha512-qfxof/3T3t9DPU/Rj3OmcFyZInceqj/NVtO9rwIuJqCUgh32gwPjpFQQp/ben07qKlhpwq7GzfWpST4qdJ5Drg==",
|
| 11 |
+
"license": "MIT",
|
| 12 |
+
"dependencies": {
|
| 13 |
+
"fast-wrap-ansi": "^0.1.3",
|
| 14 |
+
"sisteransi": "^1.0.5"
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"node_modules/@clack/prompts": {
|
| 18 |
+
"version": "1.2.0",
|
| 19 |
+
"resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.2.0.tgz",
|
| 20 |
+
"integrity": "sha512-4jmztR9fMqPMjz6H/UZXj0zEmE43ha1euENwkckKKel4XpSfokExPo5AiVStdHSAlHekz4d0CA/r45Ok1E4D3w==",
|
| 21 |
+
"license": "MIT",
|
| 22 |
+
"dependencies": {
|
| 23 |
+
"@clack/core": "1.2.0",
|
| 24 |
+
"fast-string-width": "^1.1.0",
|
| 25 |
+
"fast-wrap-ansi": "^0.1.3",
|
| 26 |
+
"sisteransi": "^1.0.5"
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"node_modules/@derhuerst/http-basic": {
|
| 30 |
+
"version": "8.2.4",
|
| 31 |
+
"resolved": "https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz",
|
| 32 |
+
"integrity": "sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==",
|
| 33 |
+
"license": "MIT",
|
| 34 |
+
"dependencies": {
|
| 35 |
+
"caseless": "^0.12.0",
|
| 36 |
+
"concat-stream": "^2.0.0",
|
| 37 |
+
"http-response-object": "^3.0.1",
|
| 38 |
+
"parse-cache-control": "^1.0.1"
|
| 39 |
+
},
|
| 40 |
+
"engines": {
|
| 41 |
+
"node": ">=6.0.0"
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"node_modules/@larksuiteoapi/node-sdk": {
|
| 45 |
+
"version": "1.60.0",
|
| 46 |
+
"resolved": "https://registry.npmjs.org/@larksuiteoapi/node-sdk/-/node-sdk-1.60.0.tgz",
|
| 47 |
+
"integrity": "sha512-MS1eXx7K6HHIyIcCBkJLb21okoa8ZatUGQWZaCCUePm6a37RWFmT6ZKlKvHxAanSX26wNuNlwP0RhgscsE+T6g==",
|
| 48 |
+
"license": "MIT",
|
| 49 |
+
"dependencies": {
|
| 50 |
+
"axios": "~1.13.3",
|
| 51 |
+
"lodash.identity": "^3.0.0",
|
| 52 |
+
"lodash.merge": "^4.6.2",
|
| 53 |
+
"lodash.pickby": "^4.6.0",
|
| 54 |
+
"protobufjs": "^7.2.6",
|
| 55 |
+
"qs": "^6.14.2",
|
| 56 |
+
"ws": "^8.19.0"
|
| 57 |
+
}
|
| 58 |
+
},
|
| 59 |
+
"node_modules/@openclaw-china/dingtalk": {
|
| 60 |
+
"version": "2026.3.29",
|
| 61 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/dingtalk/-/dingtalk-2026.3.29.tgz",
|
| 62 |
+
"integrity": "sha512-Z5ba3oIOUDAaluOuoddc4f8eA+tebtjBxLAHwbMPc7V68YNmxdFAjVwG+OFG4GRc1KeUo/XQPfyHVjZ2r4X5oQ==",
|
| 63 |
+
"license": "MIT",
|
| 64 |
+
"dependencies": {
|
| 65 |
+
"@openclaw-china/shared": "2026.3.29",
|
| 66 |
+
"dingtalk-stream": "^2.1.4"
|
| 67 |
+
},
|
| 68 |
+
"peerDependencies": {
|
| 69 |
+
"moltbot": ">=0.1.0"
|
| 70 |
+
},
|
| 71 |
+
"peerDependenciesMeta": {
|
| 72 |
+
"moltbot": {
|
| 73 |
+
"optional": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
},
|
| 77 |
+
"node_modules/@openclaw-china/feishu-china": {
|
| 78 |
+
"version": "2026.3.29",
|
| 79 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/feishu-china/-/feishu-china-2026.3.29.tgz",
|
| 80 |
+
"integrity": "sha512-Z1nQrrYjTVeA14vG8aEMBRaxmALqEvoLh3Wchs+8zTBDRYjWCDQEEAI5AwPKK3NUddSWXaFbIdufbk3i4wn9Bg==",
|
| 81 |
+
"license": "MIT",
|
| 82 |
+
"dependencies": {
|
| 83 |
+
"@larksuiteoapi/node-sdk": "^1.46.0",
|
| 84 |
+
"@openclaw-china/shared": "2026.3.29"
|
| 85 |
+
},
|
| 86 |
+
"peerDependencies": {
|
| 87 |
+
"moltbot": ">=0.1.0"
|
| 88 |
+
},
|
| 89 |
+
"peerDependenciesMeta": {
|
| 90 |
+
"moltbot": {
|
| 91 |
+
"optional": true
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
},
|
| 95 |
+
"node_modules/@openclaw-china/qqbot": {
|
| 96 |
+
"version": "2026.3.29",
|
| 97 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/qqbot/-/qqbot-2026.3.29.tgz",
|
| 98 |
+
"integrity": "sha512-SdBowhj2TXjffpdx5lclmLRMlqpo5/g74SE8PPTW8co2snrtDMsAMEaEsET35mGQoyfT+JYjjcxFMocYEf1HDw==",
|
| 99 |
+
"license": "MIT",
|
| 100 |
+
"dependencies": {
|
| 101 |
+
"@openclaw-china/shared": "2026.3.29",
|
| 102 |
+
"ffmpeg-static": "^5.3.0",
|
| 103 |
+
"silk-wasm": "^3.7.1",
|
| 104 |
+
"ws": "^8.18.0"
|
| 105 |
+
},
|
| 106 |
+
"peerDependencies": {
|
| 107 |
+
"moltbot": ">=0.1.0"
|
| 108 |
+
},
|
| 109 |
+
"peerDependenciesMeta": {
|
| 110 |
+
"moltbot": {
|
| 111 |
+
"optional": true
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
},
|
| 115 |
+
"node_modules/@openclaw-china/shared": {
|
| 116 |
+
"version": "2026.3.29",
|
| 117 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/shared/-/shared-2026.3.29.tgz",
|
| 118 |
+
"integrity": "sha512-a9+AdT8HNmgiki2ZWDPwDPr34UdfuggmxPPaq4K7KlcvLNnJYBeTmjHo0WGmw5ln8S/Ta48pi3CaI6WmSoqwkQ==",
|
| 119 |
+
"dependencies": {
|
| 120 |
+
"@clack/prompts": "^1.0.0"
|
| 121 |
+
}
|
| 122 |
+
},
|
| 123 |
+
"node_modules/@openclaw-china/wechat-mp": {
|
| 124 |
+
"version": "2026.3.29",
|
| 125 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/wechat-mp/-/wechat-mp-2026.3.29.tgz",
|
| 126 |
+
"integrity": "sha512-ggTzHo766D/u2nR8lghnPCHZPhPJeuqCfe2fkrM3jazfBUhoFq8nwv0SylZCNqbCs4PdMSCUAHTwYXRmyskHAQ==",
|
| 127 |
+
"license": "MIT",
|
| 128 |
+
"dependencies": {
|
| 129 |
+
"@openclaw-china/shared": "2026.3.29"
|
| 130 |
+
}
|
| 131 |
+
},
|
| 132 |
+
"node_modules/@openclaw-china/wecom": {
|
| 133 |
+
"version": "2026.3.29",
|
| 134 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/wecom/-/wecom-2026.3.29.tgz",
|
| 135 |
+
"integrity": "sha512-2WDhSuBlxnrTkidpjKO76zBl/0wjCYtxGdZe9z90u0hlHz2CgzQ9TlOTjCoxMJxkUZngGgUXN7zhz+jg9yV2Vg==",
|
| 136 |
+
"license": "MIT",
|
| 137 |
+
"dependencies": {
|
| 138 |
+
"@openclaw-china/shared": "2026.3.29",
|
| 139 |
+
"@wecom/aibot-node-sdk": "^1.0.2",
|
| 140 |
+
"ws": "^8.18.0"
|
| 141 |
+
},
|
| 142 |
+
"peerDependencies": {
|
| 143 |
+
"moltbot": ">=0.1.0"
|
| 144 |
+
},
|
| 145 |
+
"peerDependenciesMeta": {
|
| 146 |
+
"moltbot": {
|
| 147 |
+
"optional": true
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
},
|
| 151 |
+
"node_modules/@openclaw-china/wecom-app": {
|
| 152 |
+
"version": "2026.3.29",
|
| 153 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/wecom-app/-/wecom-app-2026.3.29.tgz",
|
| 154 |
+
"integrity": "sha512-t1C4L0YnXhAcpLzIQxSQveoVP7AbMIc6glzOTn9gUocKWmV7joPl4wTa8VSxFR/OHRCobcwUYDUldCl2xyLiBQ==",
|
| 155 |
+
"license": "MIT",
|
| 156 |
+
"dependencies": {
|
| 157 |
+
"@openclaw-china/shared": "2026.3.29",
|
| 158 |
+
"ffmpeg-static": "^5.3.0"
|
| 159 |
+
},
|
| 160 |
+
"peerDependencies": {
|
| 161 |
+
"moltbot": ">=0.1.0"
|
| 162 |
+
},
|
| 163 |
+
"peerDependenciesMeta": {
|
| 164 |
+
"moltbot": {
|
| 165 |
+
"optional": true
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
},
|
| 169 |
+
"node_modules/@openclaw-china/wecom-kf": {
|
| 170 |
+
"version": "2026.3.29",
|
| 171 |
+
"resolved": "https://registry.npmjs.org/@openclaw-china/wecom-kf/-/wecom-kf-2026.3.29.tgz",
|
| 172 |
+
"integrity": "sha512-cRlwrUHWfk87EO/3r84Z+Urc7S2yodifc496rLzYy4vwwCeXoTGtPoU/82v9gUP0+9683ICBwQUovjJgiXSeTg==",
|
| 173 |
+
"license": "MIT",
|
| 174 |
+
"dependencies": {
|
| 175 |
+
"@openclaw-china/shared": "2026.3.29"
|
| 176 |
+
},
|
| 177 |
+
"peerDependencies": {
|
| 178 |
+
"moltbot": ">=0.1.0"
|
| 179 |
+
},
|
| 180 |
+
"peerDependenciesMeta": {
|
| 181 |
+
"moltbot": {
|
| 182 |
+
"optional": true
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
},
|
| 186 |
+
"node_modules/@protobufjs/aspromise": {
|
| 187 |
+
"version": "1.1.2",
|
| 188 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
|
| 189 |
+
"integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
|
| 190 |
+
"license": "BSD-3-Clause"
|
| 191 |
+
},
|
| 192 |
+
"node_modules/@protobufjs/base64": {
|
| 193 |
+
"version": "1.1.2",
|
| 194 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
|
| 195 |
+
"integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
|
| 196 |
+
"license": "BSD-3-Clause"
|
| 197 |
+
},
|
| 198 |
+
"node_modules/@protobufjs/codegen": {
|
| 199 |
+
"version": "2.0.4",
|
| 200 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
|
| 201 |
+
"integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
|
| 202 |
+
"license": "BSD-3-Clause"
|
| 203 |
+
},
|
| 204 |
+
"node_modules/@protobufjs/eventemitter": {
|
| 205 |
+
"version": "1.1.0",
|
| 206 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
|
| 207 |
+
"integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
|
| 208 |
+
"license": "BSD-3-Clause"
|
| 209 |
+
},
|
| 210 |
+
"node_modules/@protobufjs/fetch": {
|
| 211 |
+
"version": "1.1.0",
|
| 212 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
|
| 213 |
+
"integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
|
| 214 |
+
"license": "BSD-3-Clause",
|
| 215 |
+
"dependencies": {
|
| 216 |
+
"@protobufjs/aspromise": "^1.1.1",
|
| 217 |
+
"@protobufjs/inquire": "^1.1.0"
|
| 218 |
+
}
|
| 219 |
+
},
|
| 220 |
+
"node_modules/@protobufjs/float": {
|
| 221 |
+
"version": "1.0.2",
|
| 222 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
|
| 223 |
+
"integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
|
| 224 |
+
"license": "BSD-3-Clause"
|
| 225 |
+
},
|
| 226 |
+
"node_modules/@protobufjs/inquire": {
|
| 227 |
+
"version": "1.1.0",
|
| 228 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
|
| 229 |
+
"integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",
|
| 230 |
+
"license": "BSD-3-Clause"
|
| 231 |
+
},
|
| 232 |
+
"node_modules/@protobufjs/path": {
|
| 233 |
+
"version": "1.1.2",
|
| 234 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
|
| 235 |
+
"integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
|
| 236 |
+
"license": "BSD-3-Clause"
|
| 237 |
+
},
|
| 238 |
+
"node_modules/@protobufjs/pool": {
|
| 239 |
+
"version": "1.1.0",
|
| 240 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
|
| 241 |
+
"integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
|
| 242 |
+
"license": "BSD-3-Clause"
|
| 243 |
+
},
|
| 244 |
+
"node_modules/@protobufjs/utf8": {
|
| 245 |
+
"version": "1.1.0",
|
| 246 |
+
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
|
| 247 |
+
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
|
| 248 |
+
"license": "BSD-3-Clause"
|
| 249 |
+
},
|
| 250 |
+
"node_modules/@types/node": {
|
| 251 |
+
"version": "22.19.17",
|
| 252 |
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz",
|
| 253 |
+
"integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==",
|
| 254 |
+
"license": "MIT",
|
| 255 |
+
"dependencies": {
|
| 256 |
+
"undici-types": "~6.21.0"
|
| 257 |
+
}
|
| 258 |
+
},
|
| 259 |
+
"node_modules/@wecom/aibot-node-sdk": {
|
| 260 |
+
"version": "1.0.6",
|
| 261 |
+
"resolved": "https://registry.npmjs.org/@wecom/aibot-node-sdk/-/aibot-node-sdk-1.0.6.tgz",
|
| 262 |
+
"integrity": "sha512-WZJN3Q+s+94Qjc0VW8d5W1cVkA3emYxiqf+mNRO9UEHoF40puHvizreNMtudjFhm7mmkYiK5ue/QzNiCk+xwLA==",
|
| 263 |
+
"license": "MIT",
|
| 264 |
+
"dependencies": {
|
| 265 |
+
"axios": "^1.6.7",
|
| 266 |
+
"eventemitter3": "^5.0.1",
|
| 267 |
+
"ws": "^8.16.0"
|
| 268 |
+
}
|
| 269 |
+
},
|
| 270 |
+
"node_modules/agent-base": {
|
| 271 |
+
"version": "6.0.2",
|
| 272 |
+
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
| 273 |
+
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
| 274 |
+
"license": "MIT",
|
| 275 |
+
"dependencies": {
|
| 276 |
+
"debug": "4"
|
| 277 |
+
},
|
| 278 |
+
"engines": {
|
| 279 |
+
"node": ">= 6.0.0"
|
| 280 |
+
}
|
| 281 |
+
},
|
| 282 |
+
"node_modules/asynckit": {
|
| 283 |
+
"version": "0.4.0",
|
| 284 |
+
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
| 285 |
+
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
| 286 |
+
"license": "MIT"
|
| 287 |
+
},
|
| 288 |
+
"node_modules/axios": {
|
| 289 |
+
"version": "1.13.6",
|
| 290 |
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
|
| 291 |
+
"integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
|
| 292 |
+
"license": "MIT",
|
| 293 |
+
"dependencies": {
|
| 294 |
+
"follow-redirects": "^1.15.11",
|
| 295 |
+
"form-data": "^4.0.5",
|
| 296 |
+
"proxy-from-env": "^1.1.0"
|
| 297 |
+
}
|
| 298 |
+
},
|
| 299 |
+
"node_modules/buffer-from": {
|
| 300 |
+
"version": "1.1.2",
|
| 301 |
+
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
| 302 |
+
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
| 303 |
+
"license": "MIT"
|
| 304 |
+
},
|
| 305 |
+
"node_modules/call-bind-apply-helpers": {
|
| 306 |
+
"version": "1.0.2",
|
| 307 |
+
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
| 308 |
+
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
| 309 |
+
"license": "MIT",
|
| 310 |
+
"dependencies": {
|
| 311 |
+
"es-errors": "^1.3.0",
|
| 312 |
+
"function-bind": "^1.1.2"
|
| 313 |
+
},
|
| 314 |
+
"engines": {
|
| 315 |
+
"node": ">= 0.4"
|
| 316 |
+
}
|
| 317 |
+
},
|
| 318 |
+
"node_modules/call-bound": {
|
| 319 |
+
"version": "1.0.4",
|
| 320 |
+
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
| 321 |
+
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
| 322 |
+
"license": "MIT",
|
| 323 |
+
"dependencies": {
|
| 324 |
+
"call-bind-apply-helpers": "^1.0.2",
|
| 325 |
+
"get-intrinsic": "^1.3.0"
|
| 326 |
+
},
|
| 327 |
+
"engines": {
|
| 328 |
+
"node": ">= 0.4"
|
| 329 |
+
},
|
| 330 |
+
"funding": {
|
| 331 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 332 |
+
}
|
| 333 |
+
},
|
| 334 |
+
"node_modules/caseless": {
|
| 335 |
+
"version": "0.12.0",
|
| 336 |
+
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
| 337 |
+
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
|
| 338 |
+
"license": "Apache-2.0"
|
| 339 |
+
},
|
| 340 |
+
"node_modules/combined-stream": {
|
| 341 |
+
"version": "1.0.8",
|
| 342 |
+
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
| 343 |
+
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
| 344 |
+
"license": "MIT",
|
| 345 |
+
"dependencies": {
|
| 346 |
+
"delayed-stream": "~1.0.0"
|
| 347 |
+
},
|
| 348 |
+
"engines": {
|
| 349 |
+
"node": ">= 0.8"
|
| 350 |
+
}
|
| 351 |
+
},
|
| 352 |
+
"node_modules/concat-stream": {
|
| 353 |
+
"version": "2.0.0",
|
| 354 |
+
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
|
| 355 |
+
"integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
|
| 356 |
+
"engines": [
|
| 357 |
+
"node >= 6.0"
|
| 358 |
+
],
|
| 359 |
+
"license": "MIT",
|
| 360 |
+
"dependencies": {
|
| 361 |
+
"buffer-from": "^1.0.0",
|
| 362 |
+
"inherits": "^2.0.3",
|
| 363 |
+
"readable-stream": "^3.0.2",
|
| 364 |
+
"typedarray": "^0.0.6"
|
| 365 |
+
}
|
| 366 |
+
},
|
| 367 |
+
"node_modules/debug": {
|
| 368 |
+
"version": "4.4.3",
|
| 369 |
+
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
| 370 |
+
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
| 371 |
+
"license": "MIT",
|
| 372 |
+
"dependencies": {
|
| 373 |
+
"ms": "^2.1.3"
|
| 374 |
+
},
|
| 375 |
+
"engines": {
|
| 376 |
+
"node": ">=6.0"
|
| 377 |
+
},
|
| 378 |
+
"peerDependenciesMeta": {
|
| 379 |
+
"supports-color": {
|
| 380 |
+
"optional": true
|
| 381 |
+
}
|
| 382 |
+
}
|
| 383 |
+
},
|
| 384 |
+
"node_modules/delayed-stream": {
|
| 385 |
+
"version": "1.0.0",
|
| 386 |
+
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
| 387 |
+
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
| 388 |
+
"license": "MIT",
|
| 389 |
+
"engines": {
|
| 390 |
+
"node": ">=0.4.0"
|
| 391 |
+
}
|
| 392 |
+
},
|
| 393 |
+
"node_modules/dingtalk-stream": {
|
| 394 |
+
"version": "2.1.5",
|
| 395 |
+
"resolved": "https://registry.npmjs.org/dingtalk-stream/-/dingtalk-stream-2.1.5.tgz",
|
| 396 |
+
"integrity": "sha512-6H3tSc/mE6hMj4RBB5ntkI4ycC498RobmtMxfLS8eBTRPjBZlhUdDYEHA0asOoTLSzC2PHqupr4D4HVoaU7bRQ==",
|
| 397 |
+
"license": "MIT",
|
| 398 |
+
"dependencies": {
|
| 399 |
+
"axios": "^1.4.0",
|
| 400 |
+
"debug": "^4.3.4",
|
| 401 |
+
"ws": "^8.13.0"
|
| 402 |
+
}
|
| 403 |
+
},
|
| 404 |
+
"node_modules/dunder-proto": {
|
| 405 |
+
"version": "1.0.1",
|
| 406 |
+
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
| 407 |
+
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
| 408 |
+
"license": "MIT",
|
| 409 |
+
"dependencies": {
|
| 410 |
+
"call-bind-apply-helpers": "^1.0.1",
|
| 411 |
+
"es-errors": "^1.3.0",
|
| 412 |
+
"gopd": "^1.2.0"
|
| 413 |
+
},
|
| 414 |
+
"engines": {
|
| 415 |
+
"node": ">= 0.4"
|
| 416 |
+
}
|
| 417 |
+
},
|
| 418 |
+
"node_modules/env-paths": {
|
| 419 |
+
"version": "2.2.1",
|
| 420 |
+
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
| 421 |
+
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
|
| 422 |
+
"license": "MIT",
|
| 423 |
+
"engines": {
|
| 424 |
+
"node": ">=6"
|
| 425 |
+
}
|
| 426 |
+
},
|
| 427 |
+
"node_modules/es-define-property": {
|
| 428 |
+
"version": "1.0.1",
|
| 429 |
+
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
| 430 |
+
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
| 431 |
+
"license": "MIT",
|
| 432 |
+
"engines": {
|
| 433 |
+
"node": ">= 0.4"
|
| 434 |
+
}
|
| 435 |
+
},
|
| 436 |
+
"node_modules/es-errors": {
|
| 437 |
+
"version": "1.3.0",
|
| 438 |
+
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
| 439 |
+
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
| 440 |
+
"license": "MIT",
|
| 441 |
+
"engines": {
|
| 442 |
+
"node": ">= 0.4"
|
| 443 |
+
}
|
| 444 |
+
},
|
| 445 |
+
"node_modules/es-object-atoms": {
|
| 446 |
+
"version": "1.1.1",
|
| 447 |
+
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
| 448 |
+
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
| 449 |
+
"license": "MIT",
|
| 450 |
+
"dependencies": {
|
| 451 |
+
"es-errors": "^1.3.0"
|
| 452 |
+
},
|
| 453 |
+
"engines": {
|
| 454 |
+
"node": ">= 0.4"
|
| 455 |
+
}
|
| 456 |
+
},
|
| 457 |
+
"node_modules/es-set-tostringtag": {
|
| 458 |
+
"version": "2.1.0",
|
| 459 |
+
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
| 460 |
+
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
| 461 |
+
"license": "MIT",
|
| 462 |
+
"dependencies": {
|
| 463 |
+
"es-errors": "^1.3.0",
|
| 464 |
+
"get-intrinsic": "^1.2.6",
|
| 465 |
+
"has-tostringtag": "^1.0.2",
|
| 466 |
+
"hasown": "^2.0.2"
|
| 467 |
+
},
|
| 468 |
+
"engines": {
|
| 469 |
+
"node": ">= 0.4"
|
| 470 |
+
}
|
| 471 |
+
},
|
| 472 |
+
"node_modules/eventemitter3": {
|
| 473 |
+
"version": "5.0.4",
|
| 474 |
+
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
|
| 475 |
+
"integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
|
| 476 |
+
"license": "MIT"
|
| 477 |
+
},
|
| 478 |
+
"node_modules/fast-string-truncated-width": {
|
| 479 |
+
"version": "1.2.1",
|
| 480 |
+
"resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-1.2.1.tgz",
|
| 481 |
+
"integrity": "sha512-Q9acT/+Uu3GwGj+5w/zsGuQjh9O1TyywhIwAxHudtWrgF09nHOPrvTLhQevPbttcxjr/SNN7mJmfOw/B1bXgow==",
|
| 482 |
+
"license": "MIT"
|
| 483 |
+
},
|
| 484 |
+
"node_modules/fast-string-width": {
|
| 485 |
+
"version": "1.1.0",
|
| 486 |
+
"resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-1.1.0.tgz",
|
| 487 |
+
"integrity": "sha512-O3fwIVIH5gKB38QNbdg+3760ZmGz0SZMgvwJbA1b2TGXceKE6A2cOlfogh1iw8lr049zPyd7YADHy+B7U4W9bQ==",
|
| 488 |
+
"license": "MIT",
|
| 489 |
+
"dependencies": {
|
| 490 |
+
"fast-string-truncated-width": "^1.2.0"
|
| 491 |
+
}
|
| 492 |
+
},
|
| 493 |
+
"node_modules/fast-wrap-ansi": {
|
| 494 |
+
"version": "0.1.6",
|
| 495 |
+
"resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.1.6.tgz",
|
| 496 |
+
"integrity": "sha512-HlUwET7a5gqjURj70D5jl7aC3Zmy4weA1SHUfM0JFI0Ptq987NH2TwbBFLoERhfwk+E+eaq4EK3jXoT+R3yp3w==",
|
| 497 |
+
"license": "MIT",
|
| 498 |
+
"dependencies": {
|
| 499 |
+
"fast-string-width": "^1.1.0"
|
| 500 |
+
}
|
| 501 |
+
},
|
| 502 |
+
"node_modules/ffmpeg-static": {
|
| 503 |
+
"version": "5.3.0",
|
| 504 |
+
"resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-5.3.0.tgz",
|
| 505 |
+
"integrity": "sha512-H+K6sW6TiIX6VGend0KQwthe+kaceeH/luE8dIZyOP35ik7ahYojDuqlTV1bOrtEwl01sy2HFNGQfi5IDJvotg==",
|
| 506 |
+
"hasInstallScript": true,
|
| 507 |
+
"license": "GPL-3.0-or-later",
|
| 508 |
+
"dependencies": {
|
| 509 |
+
"@derhuerst/http-basic": "^8.2.0",
|
| 510 |
+
"env-paths": "^2.2.0",
|
| 511 |
+
"https-proxy-agent": "^5.0.0",
|
| 512 |
+
"progress": "^2.0.3"
|
| 513 |
+
},
|
| 514 |
+
"engines": {
|
| 515 |
+
"node": ">=16"
|
| 516 |
+
}
|
| 517 |
+
},
|
| 518 |
+
"node_modules/follow-redirects": {
|
| 519 |
+
"version": "1.15.11",
|
| 520 |
+
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
| 521 |
+
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
| 522 |
+
"funding": [
|
| 523 |
+
{
|
| 524 |
+
"type": "individual",
|
| 525 |
+
"url": "https://github.com/sponsors/RubenVerborgh"
|
| 526 |
+
}
|
| 527 |
+
],
|
| 528 |
+
"license": "MIT",
|
| 529 |
+
"engines": {
|
| 530 |
+
"node": ">=4.0"
|
| 531 |
+
},
|
| 532 |
+
"peerDependenciesMeta": {
|
| 533 |
+
"debug": {
|
| 534 |
+
"optional": true
|
| 535 |
+
}
|
| 536 |
+
}
|
| 537 |
+
},
|
| 538 |
+
"node_modules/form-data": {
|
| 539 |
+
"version": "4.0.5",
|
| 540 |
+
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
| 541 |
+
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
| 542 |
+
"license": "MIT",
|
| 543 |
+
"dependencies": {
|
| 544 |
+
"asynckit": "^0.4.0",
|
| 545 |
+
"combined-stream": "^1.0.8",
|
| 546 |
+
"es-set-tostringtag": "^2.1.0",
|
| 547 |
+
"hasown": "^2.0.2",
|
| 548 |
+
"mime-types": "^2.1.12"
|
| 549 |
+
},
|
| 550 |
+
"engines": {
|
| 551 |
+
"node": ">= 6"
|
| 552 |
+
}
|
| 553 |
+
},
|
| 554 |
+
"node_modules/function-bind": {
|
| 555 |
+
"version": "1.1.2",
|
| 556 |
+
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
| 557 |
+
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
| 558 |
+
"license": "MIT",
|
| 559 |
+
"funding": {
|
| 560 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 561 |
+
}
|
| 562 |
+
},
|
| 563 |
+
"node_modules/get-intrinsic": {
|
| 564 |
+
"version": "1.3.0",
|
| 565 |
+
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
| 566 |
+
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
| 567 |
+
"license": "MIT",
|
| 568 |
+
"dependencies": {
|
| 569 |
+
"call-bind-apply-helpers": "^1.0.2",
|
| 570 |
+
"es-define-property": "^1.0.1",
|
| 571 |
+
"es-errors": "^1.3.0",
|
| 572 |
+
"es-object-atoms": "^1.1.1",
|
| 573 |
+
"function-bind": "^1.1.2",
|
| 574 |
+
"get-proto": "^1.0.1",
|
| 575 |
+
"gopd": "^1.2.0",
|
| 576 |
+
"has-symbols": "^1.1.0",
|
| 577 |
+
"hasown": "^2.0.2",
|
| 578 |
+
"math-intrinsics": "^1.1.0"
|
| 579 |
+
},
|
| 580 |
+
"engines": {
|
| 581 |
+
"node": ">= 0.4"
|
| 582 |
+
},
|
| 583 |
+
"funding": {
|
| 584 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 585 |
+
}
|
| 586 |
+
},
|
| 587 |
+
"node_modules/get-proto": {
|
| 588 |
+
"version": "1.0.1",
|
| 589 |
+
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
| 590 |
+
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
| 591 |
+
"license": "MIT",
|
| 592 |
+
"dependencies": {
|
| 593 |
+
"dunder-proto": "^1.0.1",
|
| 594 |
+
"es-object-atoms": "^1.0.0"
|
| 595 |
+
},
|
| 596 |
+
"engines": {
|
| 597 |
+
"node": ">= 0.4"
|
| 598 |
+
}
|
| 599 |
+
},
|
| 600 |
+
"node_modules/gopd": {
|
| 601 |
+
"version": "1.2.0",
|
| 602 |
+
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
| 603 |
+
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
| 604 |
+
"license": "MIT",
|
| 605 |
+
"engines": {
|
| 606 |
+
"node": ">= 0.4"
|
| 607 |
+
},
|
| 608 |
+
"funding": {
|
| 609 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 610 |
+
}
|
| 611 |
+
},
|
| 612 |
+
"node_modules/has-symbols": {
|
| 613 |
+
"version": "1.1.0",
|
| 614 |
+
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
| 615 |
+
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
| 616 |
+
"license": "MIT",
|
| 617 |
+
"engines": {
|
| 618 |
+
"node": ">= 0.4"
|
| 619 |
+
},
|
| 620 |
+
"funding": {
|
| 621 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 622 |
+
}
|
| 623 |
+
},
|
| 624 |
+
"node_modules/has-tostringtag": {
|
| 625 |
+
"version": "1.0.2",
|
| 626 |
+
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
| 627 |
+
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
| 628 |
+
"license": "MIT",
|
| 629 |
+
"dependencies": {
|
| 630 |
+
"has-symbols": "^1.0.3"
|
| 631 |
+
},
|
| 632 |
+
"engines": {
|
| 633 |
+
"node": ">= 0.4"
|
| 634 |
+
},
|
| 635 |
+
"funding": {
|
| 636 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 637 |
+
}
|
| 638 |
+
},
|
| 639 |
+
"node_modules/hasown": {
|
| 640 |
+
"version": "2.0.2",
|
| 641 |
+
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
| 642 |
+
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
| 643 |
+
"license": "MIT",
|
| 644 |
+
"dependencies": {
|
| 645 |
+
"function-bind": "^1.1.2"
|
| 646 |
+
},
|
| 647 |
+
"engines": {
|
| 648 |
+
"node": ">= 0.4"
|
| 649 |
+
}
|
| 650 |
+
},
|
| 651 |
+
"node_modules/http-response-object": {
|
| 652 |
+
"version": "3.0.2",
|
| 653 |
+
"resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz",
|
| 654 |
+
"integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==",
|
| 655 |
+
"license": "MIT",
|
| 656 |
+
"dependencies": {
|
| 657 |
+
"@types/node": "^10.0.3"
|
| 658 |
+
}
|
| 659 |
+
},
|
| 660 |
+
"node_modules/http-response-object/node_modules/@types/node": {
|
| 661 |
+
"version": "10.17.60",
|
| 662 |
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
|
| 663 |
+
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==",
|
| 664 |
+
"license": "MIT"
|
| 665 |
+
},
|
| 666 |
+
"node_modules/https-proxy-agent": {
|
| 667 |
+
"version": "5.0.1",
|
| 668 |
+
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
| 669 |
+
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
| 670 |
+
"license": "MIT",
|
| 671 |
+
"dependencies": {
|
| 672 |
+
"agent-base": "6",
|
| 673 |
+
"debug": "4"
|
| 674 |
+
},
|
| 675 |
+
"engines": {
|
| 676 |
+
"node": ">= 6"
|
| 677 |
+
}
|
| 678 |
+
},
|
| 679 |
+
"node_modules/inherits": {
|
| 680 |
+
"version": "2.0.4",
|
| 681 |
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
| 682 |
+
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
| 683 |
+
"license": "ISC"
|
| 684 |
+
},
|
| 685 |
+
"node_modules/lodash.identity": {
|
| 686 |
+
"version": "3.0.0",
|
| 687 |
+
"resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-3.0.0.tgz",
|
| 688 |
+
"integrity": "sha512-AupTIzdLQxJS5wIYUQlgGyk2XRTfGXA+MCghDHqZk0pzUNYvd3EESS6dkChNauNYVIutcb0dfHw1ri9Q1yPV8Q==",
|
| 689 |
+
"license": "MIT"
|
| 690 |
+
},
|
| 691 |
+
"node_modules/lodash.merge": {
|
| 692 |
+
"version": "4.6.2",
|
| 693 |
+
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
| 694 |
+
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
| 695 |
+
"license": "MIT"
|
| 696 |
+
},
|
| 697 |
+
"node_modules/lodash.pickby": {
|
| 698 |
+
"version": "4.6.0",
|
| 699 |
+
"resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz",
|
| 700 |
+
"integrity": "sha512-AZV+GsS/6ckvPOVQPXSiFFacKvKB4kOQu6ynt9wz0F3LO4R9Ij4K1ddYsIytDpSgLz88JHd9P+oaLeej5/Sl7Q==",
|
| 701 |
+
"license": "MIT"
|
| 702 |
+
},
|
| 703 |
+
"node_modules/long": {
|
| 704 |
+
"version": "5.3.2",
|
| 705 |
+
"resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
|
| 706 |
+
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
|
| 707 |
+
"license": "Apache-2.0"
|
| 708 |
+
},
|
| 709 |
+
"node_modules/math-intrinsics": {
|
| 710 |
+
"version": "1.1.0",
|
| 711 |
+
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
| 712 |
+
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
| 713 |
+
"license": "MIT",
|
| 714 |
+
"engines": {
|
| 715 |
+
"node": ">= 0.4"
|
| 716 |
+
}
|
| 717 |
+
},
|
| 718 |
+
"node_modules/mime-db": {
|
| 719 |
+
"version": "1.52.0",
|
| 720 |
+
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
| 721 |
+
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
| 722 |
+
"license": "MIT",
|
| 723 |
+
"engines": {
|
| 724 |
+
"node": ">= 0.6"
|
| 725 |
+
}
|
| 726 |
+
},
|
| 727 |
+
"node_modules/mime-types": {
|
| 728 |
+
"version": "2.1.35",
|
| 729 |
+
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
| 730 |
+
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
| 731 |
+
"license": "MIT",
|
| 732 |
+
"dependencies": {
|
| 733 |
+
"mime-db": "1.52.0"
|
| 734 |
+
},
|
| 735 |
+
"engines": {
|
| 736 |
+
"node": ">= 0.6"
|
| 737 |
+
}
|
| 738 |
+
},
|
| 739 |
+
"node_modules/ms": {
|
| 740 |
+
"version": "2.1.3",
|
| 741 |
+
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
| 742 |
+
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
| 743 |
+
"license": "MIT"
|
| 744 |
+
},
|
| 745 |
+
"node_modules/object-inspect": {
|
| 746 |
+
"version": "1.13.4",
|
| 747 |
+
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
| 748 |
+
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
| 749 |
+
"license": "MIT",
|
| 750 |
+
"engines": {
|
| 751 |
+
"node": ">= 0.4"
|
| 752 |
+
},
|
| 753 |
+
"funding": {
|
| 754 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 755 |
+
}
|
| 756 |
+
},
|
| 757 |
+
"node_modules/parse-cache-control": {
|
| 758 |
+
"version": "1.0.1",
|
| 759 |
+
"resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz",
|
| 760 |
+
"integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg=="
|
| 761 |
+
},
|
| 762 |
+
"node_modules/progress": {
|
| 763 |
+
"version": "2.0.3",
|
| 764 |
+
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
| 765 |
+
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
| 766 |
+
"license": "MIT",
|
| 767 |
+
"engines": {
|
| 768 |
+
"node": ">=0.4.0"
|
| 769 |
+
}
|
| 770 |
+
},
|
| 771 |
+
"node_modules/protobufjs": {
|
| 772 |
+
"version": "7.5.4",
|
| 773 |
+
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
|
| 774 |
+
"integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",
|
| 775 |
+
"hasInstallScript": true,
|
| 776 |
+
"license": "BSD-3-Clause",
|
| 777 |
+
"dependencies": {
|
| 778 |
+
"@protobufjs/aspromise": "^1.1.2",
|
| 779 |
+
"@protobufjs/base64": "^1.1.2",
|
| 780 |
+
"@protobufjs/codegen": "^2.0.4",
|
| 781 |
+
"@protobufjs/eventemitter": "^1.1.0",
|
| 782 |
+
"@protobufjs/fetch": "^1.1.0",
|
| 783 |
+
"@protobufjs/float": "^1.0.2",
|
| 784 |
+
"@protobufjs/inquire": "^1.1.0",
|
| 785 |
+
"@protobufjs/path": "^1.1.2",
|
| 786 |
+
"@protobufjs/pool": "^1.1.0",
|
| 787 |
+
"@protobufjs/utf8": "^1.1.0",
|
| 788 |
+
"@types/node": ">=13.7.0",
|
| 789 |
+
"long": "^5.0.0"
|
| 790 |
+
},
|
| 791 |
+
"engines": {
|
| 792 |
+
"node": ">=12.0.0"
|
| 793 |
+
}
|
| 794 |
+
},
|
| 795 |
+
"node_modules/proxy-from-env": {
|
| 796 |
+
"version": "1.1.0",
|
| 797 |
+
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
| 798 |
+
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
|
| 799 |
+
"license": "MIT"
|
| 800 |
+
},
|
| 801 |
+
"node_modules/qs": {
|
| 802 |
+
"version": "6.15.1",
|
| 803 |
+
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz",
|
| 804 |
+
"integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==",
|
| 805 |
+
"license": "BSD-3-Clause",
|
| 806 |
+
"dependencies": {
|
| 807 |
+
"side-channel": "^1.1.0"
|
| 808 |
+
},
|
| 809 |
+
"engines": {
|
| 810 |
+
"node": ">=0.6"
|
| 811 |
+
},
|
| 812 |
+
"funding": {
|
| 813 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 814 |
+
}
|
| 815 |
+
},
|
| 816 |
+
"node_modules/readable-stream": {
|
| 817 |
+
"version": "3.6.2",
|
| 818 |
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
| 819 |
+
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
| 820 |
+
"license": "MIT",
|
| 821 |
+
"dependencies": {
|
| 822 |
+
"inherits": "^2.0.3",
|
| 823 |
+
"string_decoder": "^1.1.1",
|
| 824 |
+
"util-deprecate": "^1.0.1"
|
| 825 |
+
},
|
| 826 |
+
"engines": {
|
| 827 |
+
"node": ">= 6"
|
| 828 |
+
}
|
| 829 |
+
},
|
| 830 |
+
"node_modules/safe-buffer": {
|
| 831 |
+
"version": "5.2.1",
|
| 832 |
+
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
| 833 |
+
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
| 834 |
+
"funding": [
|
| 835 |
+
{
|
| 836 |
+
"type": "github",
|
| 837 |
+
"url": "https://github.com/sponsors/feross"
|
| 838 |
+
},
|
| 839 |
+
{
|
| 840 |
+
"type": "patreon",
|
| 841 |
+
"url": "https://www.patreon.com/feross"
|
| 842 |
+
},
|
| 843 |
+
{
|
| 844 |
+
"type": "consulting",
|
| 845 |
+
"url": "https://feross.org/support"
|
| 846 |
+
}
|
| 847 |
+
],
|
| 848 |
+
"license": "MIT"
|
| 849 |
+
},
|
| 850 |
+
"node_modules/side-channel": {
|
| 851 |
+
"version": "1.1.0",
|
| 852 |
+
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
| 853 |
+
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
| 854 |
+
"license": "MIT",
|
| 855 |
+
"dependencies": {
|
| 856 |
+
"es-errors": "^1.3.0",
|
| 857 |
+
"object-inspect": "^1.13.3",
|
| 858 |
+
"side-channel-list": "^1.0.0",
|
| 859 |
+
"side-channel-map": "^1.0.1",
|
| 860 |
+
"side-channel-weakmap": "^1.0.2"
|
| 861 |
+
},
|
| 862 |
+
"engines": {
|
| 863 |
+
"node": ">= 0.4"
|
| 864 |
+
},
|
| 865 |
+
"funding": {
|
| 866 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 867 |
+
}
|
| 868 |
+
},
|
| 869 |
+
"node_modules/side-channel-list": {
|
| 870 |
+
"version": "1.0.1",
|
| 871 |
+
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
|
| 872 |
+
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
|
| 873 |
+
"license": "MIT",
|
| 874 |
+
"dependencies": {
|
| 875 |
+
"es-errors": "^1.3.0",
|
| 876 |
+
"object-inspect": "^1.13.4"
|
| 877 |
+
},
|
| 878 |
+
"engines": {
|
| 879 |
+
"node": ">= 0.4"
|
| 880 |
+
},
|
| 881 |
+
"funding": {
|
| 882 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 883 |
+
}
|
| 884 |
+
},
|
| 885 |
+
"node_modules/side-channel-map": {
|
| 886 |
+
"version": "1.0.1",
|
| 887 |
+
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
| 888 |
+
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
| 889 |
+
"license": "MIT",
|
| 890 |
+
"dependencies": {
|
| 891 |
+
"call-bound": "^1.0.2",
|
| 892 |
+
"es-errors": "^1.3.0",
|
| 893 |
+
"get-intrinsic": "^1.2.5",
|
| 894 |
+
"object-inspect": "^1.13.3"
|
| 895 |
+
},
|
| 896 |
+
"engines": {
|
| 897 |
+
"node": ">= 0.4"
|
| 898 |
+
},
|
| 899 |
+
"funding": {
|
| 900 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 901 |
+
}
|
| 902 |
+
},
|
| 903 |
+
"node_modules/side-channel-weakmap": {
|
| 904 |
+
"version": "1.0.2",
|
| 905 |
+
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
| 906 |
+
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
| 907 |
+
"license": "MIT",
|
| 908 |
+
"dependencies": {
|
| 909 |
+
"call-bound": "^1.0.2",
|
| 910 |
+
"es-errors": "^1.3.0",
|
| 911 |
+
"get-intrinsic": "^1.2.5",
|
| 912 |
+
"object-inspect": "^1.13.3",
|
| 913 |
+
"side-channel-map": "^1.0.1"
|
| 914 |
+
},
|
| 915 |
+
"engines": {
|
| 916 |
+
"node": ">= 0.4"
|
| 917 |
+
},
|
| 918 |
+
"funding": {
|
| 919 |
+
"url": "https://github.com/sponsors/ljharb"
|
| 920 |
+
}
|
| 921 |
+
},
|
| 922 |
+
"node_modules/silk-wasm": {
|
| 923 |
+
"version": "3.7.1",
|
| 924 |
+
"resolved": "https://registry.npmjs.org/silk-wasm/-/silk-wasm-3.7.1.tgz",
|
| 925 |
+
"integrity": "sha512-mXPwLRtZxrYV3TZx41jMAeKc80wvmyrcXIcs8HctFxK15Ahz2OJQENYhNgEPeCEOdI6Mbx1NxQsqxzwc3DKerw==",
|
| 926 |
+
"license": "MIT",
|
| 927 |
+
"engines": {
|
| 928 |
+
"node": ">=16.11.0"
|
| 929 |
+
}
|
| 930 |
+
},
|
| 931 |
+
"node_modules/sisteransi": {
|
| 932 |
+
"version": "1.0.5",
|
| 933 |
+
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
|
| 934 |
+
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
|
| 935 |
+
"license": "MIT"
|
| 936 |
+
},
|
| 937 |
+
"node_modules/string_decoder": {
|
| 938 |
+
"version": "1.3.0",
|
| 939 |
+
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
| 940 |
+
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
| 941 |
+
"license": "MIT",
|
| 942 |
+
"dependencies": {
|
| 943 |
+
"safe-buffer": "~5.2.0"
|
| 944 |
+
}
|
| 945 |
+
},
|
| 946 |
+
"node_modules/typedarray": {
|
| 947 |
+
"version": "0.0.6",
|
| 948 |
+
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
| 949 |
+
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
|
| 950 |
+
"license": "MIT"
|
| 951 |
+
},
|
| 952 |
+
"node_modules/undici-types": {
|
| 953 |
+
"version": "6.21.0",
|
| 954 |
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
| 955 |
+
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
| 956 |
+
"license": "MIT"
|
| 957 |
+
},
|
| 958 |
+
"node_modules/util-deprecate": {
|
| 959 |
+
"version": "1.0.2",
|
| 960 |
+
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
| 961 |
+
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
| 962 |
+
"license": "MIT"
|
| 963 |
+
},
|
| 964 |
+
"node_modules/ws": {
|
| 965 |
+
"version": "8.20.0",
|
| 966 |
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
|
| 967 |
+
"integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
|
| 968 |
+
"license": "MIT",
|
| 969 |
+
"engines": {
|
| 970 |
+
"node": ">=10.0.0"
|
| 971 |
+
},
|
| 972 |
+
"peerDependencies": {
|
| 973 |
+
"bufferutil": "^4.0.1",
|
| 974 |
+
"utf-8-validate": ">=5.0.2"
|
| 975 |
+
},
|
| 976 |
+
"peerDependenciesMeta": {
|
| 977 |
+
"bufferutil": {
|
| 978 |
+
"optional": true
|
| 979 |
+
},
|
| 980 |
+
"utf-8-validate": {
|
| 981 |
+
"optional": true
|
| 982 |
+
}
|
| 983 |
+
}
|
| 984 |
+
}
|
| 985 |
+
}
|
| 986 |
+
}
|
extensions/channels/node_modules/@clack/core/CHANGELOG.md
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @clack/core
|
| 2 |
+
|
| 3 |
+
## 1.2.0
|
| 4 |
+
|
| 5 |
+
### Minor Changes
|
| 6 |
+
|
| 7 |
+
- 9786226: Externalize `fast-string-width` and `fast-wrap-ansi` to avoid double dependencies
|
| 8 |
+
- 090902c: Adds `date` prompt with `format` support (YMD, MDY, DMY)
|
| 9 |
+
|
| 10 |
+
### Patch Changes
|
| 11 |
+
|
| 12 |
+
- bdf89a5: Adds `placeholder` option to `autocomplete`. When the placeholder is set and the input is empty, pressing `tab` will set the value to `placeholder`.
|
| 13 |
+
- 417b451: Only apply autocomplete default filter if it has been explicitly set or if options is not a getter.
|
| 14 |
+
|
| 15 |
+
## 1.1.0
|
| 16 |
+
|
| 17 |
+
### Minor Changes
|
| 18 |
+
|
| 19 |
+
- e3333fb: Replaces `picocolors` with Node.js built-in `styleText`.
|
| 20 |
+
|
| 21 |
+
## 1.0.1
|
| 22 |
+
|
| 23 |
+
### Patch Changes
|
| 24 |
+
|
| 25 |
+
- 6404dc1: Disallows selection of `disabled` options in autocomplete.
|
| 26 |
+
- 2533180: Updates the documentation to mention `userInputWithCursor` when using the `TextPrompt` primitive.
|
| 27 |
+
|
| 28 |
+
## 1.0.0
|
| 29 |
+
|
| 30 |
+
### Major Changes
|
| 31 |
+
|
| 32 |
+
- c713fd5: The package is now distributed as ESM-only. In `v0` releases, the package was dual-published as CJS and ESM.
|
| 33 |
+
|
| 34 |
+
For existing CJS projects using Node v20+, please see Node's guide on [Loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-ecmascript-modules-using-require).
|
| 35 |
+
|
| 36 |
+
### Minor Changes
|
| 37 |
+
|
| 38 |
+
- 7bc3301: Prompts now have a `userInput` stored separately from their `value`.
|
| 39 |
+
- 2837845: Adds suggestion and path prompts
|
| 40 |
+
- 729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the `updateSettings` function to support multilingual CLIs.
|
| 41 |
+
|
| 42 |
+
This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.
|
| 43 |
+
|
| 44 |
+
```ts
|
| 45 |
+
// Per-instance customization
|
| 46 |
+
const spinner = prompts.spinner({
|
| 47 |
+
cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
|
| 48 |
+
errorMessage: "Se produjo un error", // "An error occurred" in Spanish
|
| 49 |
+
});
|
| 50 |
+
|
| 51 |
+
// Global customization via updateSettings
|
| 52 |
+
prompts.updateSettings({
|
| 53 |
+
messages: {
|
| 54 |
+
cancel: "Operación cancelada", // "Operation cancelled" in Spanish
|
| 55 |
+
error: "Se produjo un error", // "An error occurred" in Spanish
|
| 56 |
+
},
|
| 57 |
+
});
|
| 58 |
+
|
| 59 |
+
// Settings can now be accessed directly
|
| 60 |
+
console.log(prompts.settings.messages.cancel); // "Operación cancelada"
|
| 61 |
+
|
| 62 |
+
// Direct options take priority over global settings
|
| 63 |
+
const spinner = prompts.spinner({
|
| 64 |
+
cancelMessage: "Cancelled", // This will be used instead of the global setting
|
| 65 |
+
});
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
- 55645c2: Support wrapping autocomplete and select prompts.
|
| 69 |
+
- f2c2b89: Adds `AutocompletePrompt` to core with comprehensive tests and implement both `autocomplete` and `autocomplete-multiselect` components in prompts package.
|
| 70 |
+
- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt.
|
| 71 |
+
- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails
|
| 72 |
+
|
| 73 |
+
### Patch Changes
|
| 74 |
+
|
| 75 |
+
- 0718b07: fix: export `*Options` types for prompts.
|
| 76 |
+
- bfe0dd3: Prevents placeholder from being used as input value in text prompts
|
| 77 |
+
- 6868c1c: Adds a new `selectableGroups` boolean to the group multi-select prompt. Using `selectableGroups: false` will disable the ability to select a top-level group, but still allow every child to be selected individually.
|
| 78 |
+
- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs.
|
| 79 |
+
- a4f5034: Fixes an edge case for placeholder values. Previously, when pressing `enter` on an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value.
|
| 80 |
+
- b103ad3: Allow disabled options in multi-select and select prompts.
|
| 81 |
+
- 71b5029: Add missing nullish checks around values.
|
| 82 |
+
- a36292b: Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals.
|
| 83 |
+
- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi
|
| 84 |
+
- 4ba2d78: Support short terminal windows when re-rendering by accounting for off-screen lines
|
| 85 |
+
- 34f52fe: Validates initial values immediately when using text prompts with initialValue and validate props.
|
| 86 |
+
- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value.
|
| 87 |
+
- 4f6b3c2: Set initial values of auto complete prompt to first option when multiple is false.
|
| 88 |
+
- 8ead5d3: Avoid passing initial values to core when using auto complete prompt
|
| 89 |
+
- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border
|
| 90 |
+
- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option
|
| 91 |
+
- 2310b43: Allow custom writables as output stream.
|
| 92 |
+
- d98e033: add invert selection for multiselect prompt
|
| 93 |
+
|
| 94 |
+
## 0.4.1
|
| 95 |
+
|
| 96 |
+
### Patch Changes
|
| 97 |
+
|
| 98 |
+
- 8093f3c: Adds `Error` support to the `validate` function
|
| 99 |
+
- e5ba09a: Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See [Issue #127](https://github.com/bombshell-dev/clack/issues/127).
|
| 100 |
+
- 8cba8e3: Fixes a rendering bug with cursor positions for `TextPrompt`
|
| 101 |
+
|
| 102 |
+
## 0.4.0
|
| 103 |
+
|
| 104 |
+
### Minor Changes
|
| 105 |
+
|
| 106 |
+
- a83d2f8: Adds a new `updateSettings()` function to support new global keybindings.
|
| 107 |
+
|
| 108 |
+
`updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`).
|
| 109 |
+
|
| 110 |
+
```ts
|
| 111 |
+
import { updateSettings } from "@clack/core";
|
| 112 |
+
|
| 113 |
+
// Support custom keybindings
|
| 114 |
+
updateSettings({
|
| 115 |
+
aliases: {
|
| 116 |
+
w: "up",
|
| 117 |
+
a: "left",
|
| 118 |
+
s: "down",
|
| 119 |
+
d: "right",
|
| 120 |
+
},
|
| 121 |
+
});
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
> [!WARNING]
|
| 125 |
+
> In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings.
|
| 126 |
+
|
| 127 |
+
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
|
| 128 |
+
|
| 129 |
+
- a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`).
|
| 130 |
+
|
| 131 |
+
| alias | action |
|
| 132 |
+
| ----- | ------ |
|
| 133 |
+
| `k` | up |
|
| 134 |
+
| `l` | right |
|
| 135 |
+
| `j` | down |
|
| 136 |
+
| `h` | left |
|
| 137 |
+
| `esc` | cancel |
|
| 138 |
+
|
| 139 |
+
### Patch Changes
|
| 140 |
+
|
| 141 |
+
- 51e12bc: Improves types for events and interaction states.
|
| 142 |
+
|
| 143 |
+
## 0.3.5
|
| 144 |
+
|
| 145 |
+
### Patch Changes
|
| 146 |
+
|
| 147 |
+
- 4845f4f: Fixes a bug which kept the terminal cursor hidden after a prompt is cancelled
|
| 148 |
+
- d7b2fb9: Adds missing `LICENSE` file. Since the `package.json` file has always included `"license": "MIT"`, please consider this a licensing clarification rather than a licensing change.
|
| 149 |
+
|
| 150 |
+
## 0.3.4
|
| 151 |
+
|
| 152 |
+
### Patch Changes
|
| 153 |
+
|
| 154 |
+
- a04e418: fix(@clack/core): keyboard input not working after await in spinner
|
| 155 |
+
- 4f6fcf5: feat(@clack/core): allow tab completion for placeholders
|
| 156 |
+
|
| 157 |
+
## 0.3.3
|
| 158 |
+
|
| 159 |
+
### Patch Changes
|
| 160 |
+
|
| 161 |
+
- cd79076: fix: restore raw mode on unblock
|
| 162 |
+
|
| 163 |
+
## 0.3.2
|
| 164 |
+
|
| 165 |
+
### Patch Changes
|
| 166 |
+
|
| 167 |
+
- c96eda5: Enable hard line-wrapping behavior for long words without spaces
|
| 168 |
+
|
| 169 |
+
## 0.3.1
|
| 170 |
+
|
| 171 |
+
### Patch Changes
|
| 172 |
+
|
| 173 |
+
- 58a1df1: Fix line duplication bug by automatically wrapping prompts to `process.stdout.columns`
|
| 174 |
+
|
| 175 |
+
## 0.3.0
|
| 176 |
+
|
| 177 |
+
### Minor Changes
|
| 178 |
+
|
| 179 |
+
- 8a4a12f: Add `GroupMultiSelect` prompt
|
| 180 |
+
|
| 181 |
+
### Patch Changes
|
| 182 |
+
|
| 183 |
+
- 8a4a12f: add `groupMultiselect` prompt
|
| 184 |
+
|
| 185 |
+
## 0.2.1
|
| 186 |
+
|
| 187 |
+
### Patch Changes
|
| 188 |
+
|
| 189 |
+
- ec812b6: fix `readline` hang on Windows
|
| 190 |
+
|
| 191 |
+
## 0.2.0
|
| 192 |
+
|
| 193 |
+
### Minor Changes
|
| 194 |
+
|
| 195 |
+
- d74dd05: Adds a `selectKey` prompt type
|
| 196 |
+
- 54c1bc3: **Breaking Change** `multiselect` has renamed `initialValue` to `initialValues`
|
| 197 |
+
|
| 198 |
+
## 0.1.9
|
| 199 |
+
|
| 200 |
+
### Patch Changes
|
| 201 |
+
|
| 202 |
+
- 1251132: Multiselect: return `Value[]` instead of `Option[]`.
|
| 203 |
+
- 8994382: Add a password prompt to `@clack/prompts`
|
| 204 |
+
|
| 205 |
+
## 0.1.8
|
| 206 |
+
|
| 207 |
+
### Patch Changes
|
| 208 |
+
|
| 209 |
+
- d96071c: Don't mutate `initialValue` in `multiselect`, fix parameter type for `validate()`.
|
| 210 |
+
|
| 211 |
+
Credits to @banjo for the bug report and initial PR!
|
| 212 |
+
|
| 213 |
+
## 0.1.7
|
| 214 |
+
|
| 215 |
+
### Patch Changes
|
| 216 |
+
|
| 217 |
+
- 6d9e675: Add support for neovim cursor motion (`hjkl`)
|
| 218 |
+
|
| 219 |
+
Thanks [@esau-morais](https://github.com/esau-morais) for the assist!
|
| 220 |
+
|
| 221 |
+
## 0.1.6
|
| 222 |
+
|
| 223 |
+
### Patch Changes
|
| 224 |
+
|
| 225 |
+
- 7fb5375: Adds a new `defaultValue` option to the text prompt, removes automatic usage of the placeholder value.
|
| 226 |
+
|
| 227 |
+
## 0.1.5
|
| 228 |
+
|
| 229 |
+
### Patch Changes
|
| 230 |
+
|
| 231 |
+
- de1314e: Support `required` option for multi-select
|
| 232 |
+
|
| 233 |
+
## 0.1.4
|
| 234 |
+
|
| 235 |
+
### Patch Changes
|
| 236 |
+
|
| 237 |
+
- ca77da1: Fix multiselect initial value logic
|
| 238 |
+
- 8aed606: Fix `MaxListenersExceededWarning` by detaching `stdin` listeners on close
|
| 239 |
+
|
| 240 |
+
## 0.1.3
|
| 241 |
+
|
| 242 |
+
### Patch Changes
|
| 243 |
+
|
| 244 |
+
- a99c458: Support `initialValue` option for text prompt
|
| 245 |
+
|
| 246 |
+
## 0.1.2
|
| 247 |
+
|
| 248 |
+
### Patch Changes
|
| 249 |
+
|
| 250 |
+
- Allow isCancel to type guard any unknown value
|
| 251 |
+
- 7dcad8f: Allow placeholder to be passed to TextPrompt
|
| 252 |
+
- 2242f13: Fix multiselect returning undefined
|
| 253 |
+
- b1341d6: Improved placeholder handling
|
| 254 |
+
|
| 255 |
+
## 0.1.1
|
| 256 |
+
|
| 257 |
+
### Patch Changes
|
| 258 |
+
|
| 259 |
+
- 4be7dbf: Ensure raw mode is unset on submit
|
| 260 |
+
- b480679: Preserve value if validation fails
|
| 261 |
+
|
| 262 |
+
## 0.1.0
|
| 263 |
+
|
| 264 |
+
### Minor Changes
|
| 265 |
+
|
| 266 |
+
- 7015ec9: Create new prompt: multi-select
|
| 267 |
+
|
| 268 |
+
## 0.0.12
|
| 269 |
+
|
| 270 |
+
### Patch Changes
|
| 271 |
+
|
| 272 |
+
- 9d371c3: Fix rendering bug when using y/n to confirm
|
| 273 |
+
|
| 274 |
+
## 0.0.11
|
| 275 |
+
|
| 276 |
+
### Patch Changes
|
| 277 |
+
|
| 278 |
+
- 441d5b7: fix select return undefined
|
| 279 |
+
- d20ef2a: Update keywords, URLs
|
| 280 |
+
- fe13c2f: fix cursor missing after submit
|
| 281 |
+
|
| 282 |
+
## 0.0.10
|
| 283 |
+
|
| 284 |
+
### Patch Changes
|
| 285 |
+
|
| 286 |
+
- a0cb382: Add `main` entrypoint
|
| 287 |
+
|
| 288 |
+
## 0.0.9
|
| 289 |
+
|
| 290 |
+
### Patch Changes
|
| 291 |
+
|
| 292 |
+
- Fix node@16 issue (cannot read "createInterface" of undefined)
|
| 293 |
+
|
| 294 |
+
## 0.0.8
|
| 295 |
+
|
| 296 |
+
### Patch Changes
|
| 297 |
+
|
| 298 |
+
- a4b5e13: Bug fixes, exposes `block` utility
|
| 299 |
+
|
| 300 |
+
## 0.0.7
|
| 301 |
+
|
| 302 |
+
### Patch Changes
|
| 303 |
+
|
| 304 |
+
- Fix cursor bug
|
| 305 |
+
|
| 306 |
+
## 0.0.6
|
| 307 |
+
|
| 308 |
+
### Patch Changes
|
| 309 |
+
|
| 310 |
+
- Fix error with character check
|
| 311 |
+
|
| 312 |
+
## 0.0.5
|
| 313 |
+
|
| 314 |
+
### Patch Changes
|
| 315 |
+
|
| 316 |
+
- 491f9e0: update readme
|
| 317 |
+
|
| 318 |
+
## 0.0.4
|
| 319 |
+
|
| 320 |
+
### Patch Changes
|
| 321 |
+
|
| 322 |
+
- 7372d5c: Fix bug with line deletion
|
| 323 |
+
|
| 324 |
+
## 0.0.3
|
| 325 |
+
|
| 326 |
+
### Patch Changes
|
| 327 |
+
|
| 328 |
+
- 5605d28: Do not bundle dependencies (take II)
|
| 329 |
+
|
| 330 |
+
## 0.0.2
|
| 331 |
+
|
| 332 |
+
### Patch Changes
|
| 333 |
+
|
| 334 |
+
- 2ee67cb: don't bundle deps
|
| 335 |
+
|
| 336 |
+
## 0.0.1
|
| 337 |
+
|
| 338 |
+
### Patch Changes
|
| 339 |
+
|
| 340 |
+
- 306598e: Initial publish, still WIP
|
extensions/channels/node_modules/@clack/core/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) Nate Moore
|
| 4 |
+
|
| 5 |
+
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:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
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.
|
extensions/channels/node_modules/@clack/core/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `@clack/core`
|
| 2 |
+
|
| 3 |
+
Clack contains low-level primitives for implementing your own command-line applications.
|
| 4 |
+
|
| 5 |
+
Currently, `TextPrompt`, `SelectPrompt`, and `ConfirmPrompt` are exposed as well as the base `Prompt` class.
|
| 6 |
+
|
| 7 |
+
Each `Prompt` accepts a `render` function.
|
| 8 |
+
|
| 9 |
+
```js
|
| 10 |
+
import { TextPrompt, isCancel } from '@clack/core';
|
| 11 |
+
|
| 12 |
+
const p = new TextPrompt({
|
| 13 |
+
render() {
|
| 14 |
+
return `What's your name?\n${this.userInputWithCursor}`;
|
| 15 |
+
},
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
const name = await p.prompt();
|
| 19 |
+
if (isCancel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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Key } from 'node:readline';
|
| 2 |
+
import { Readable, Writable } from 'node:stream';
|
| 3 |
+
|
| 4 |
+
declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
|
| 5 |
+
type Action = (typeof actions)[number];
|
| 6 |
+
/** Global settings for Clack programs, stored in memory */
|
| 7 |
+
interface InternalClackSettings {
|
| 8 |
+
actions: Set<Action>;
|
| 9 |
+
aliases: Map<string, Action>;
|
| 10 |
+
messages: {
|
| 11 |
+
cancel: string;
|
| 12 |
+
error: string;
|
| 13 |
+
};
|
| 14 |
+
withGuide: boolean;
|
| 15 |
+
date: {
|
| 16 |
+
monthNames: string[];
|
| 17 |
+
messages: {
|
| 18 |
+
invalidMonth: string;
|
| 19 |
+
required: string;
|
| 20 |
+
invalidDay: (days: number, month: string) => string;
|
| 21 |
+
afterMin: (min: Date) => string;
|
| 22 |
+
beforeMax: (max: Date) => string;
|
| 23 |
+
};
|
| 24 |
+
};
|
| 25 |
+
}
|
| 26 |
+
declare const settings: InternalClackSettings;
|
| 27 |
+
interface ClackSettings {
|
| 28 |
+
/**
|
| 29 |
+
* Set custom global aliases for the default actions.
|
| 30 |
+
* This will not overwrite existing aliases, it will only add new ones!
|
| 31 |
+
*
|
| 32 |
+
* @param aliases - An object that maps aliases to actions
|
| 33 |
+
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
|
| 34 |
+
*/
|
| 35 |
+
aliases?: Record<string, Action>;
|
| 36 |
+
/**
|
| 37 |
+
* Custom messages for prompts
|
| 38 |
+
*/
|
| 39 |
+
messages?: {
|
| 40 |
+
/**
|
| 41 |
+
* Custom message to display when a spinner is cancelled
|
| 42 |
+
* @default "Canceled"
|
| 43 |
+
*/
|
| 44 |
+
cancel?: string;
|
| 45 |
+
/**
|
| 46 |
+
* Custom message to display when a spinner encounters an error
|
| 47 |
+
* @default "Something went wrong"
|
| 48 |
+
*/
|
| 49 |
+
error?: string;
|
| 50 |
+
};
|
| 51 |
+
withGuide?: boolean;
|
| 52 |
+
/**
|
| 53 |
+
* Date prompt localization
|
| 54 |
+
*/
|
| 55 |
+
date?: {
|
| 56 |
+
/** Month names for validation messages (January, February, ...) */
|
| 57 |
+
monthNames?: string[];
|
| 58 |
+
messages?: {
|
| 59 |
+
/** Shown when date is missing */
|
| 60 |
+
required?: string;
|
| 61 |
+
/** Shown when month > 12 */
|
| 62 |
+
invalidMonth?: string;
|
| 63 |
+
/** (days, monthName) => message for invalid day */
|
| 64 |
+
invalidDay?: (days: number, month: string) => string;
|
| 65 |
+
/** (min) => message when date is before minDate */
|
| 66 |
+
afterMin?: (min: Date) => string;
|
| 67 |
+
/** (max) => message when date is after maxDate */
|
| 68 |
+
beforeMax?: (max: Date) => string;
|
| 69 |
+
};
|
| 70 |
+
};
|
| 71 |
+
}
|
| 72 |
+
declare function updateSettings(updates: ClackSettings): void;
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* The state of the prompt
|
| 76 |
+
*/
|
| 77 |
+
type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
|
| 78 |
+
/**
|
| 79 |
+
* Typed event emitter for clack
|
| 80 |
+
*/
|
| 81 |
+
interface ClackEvents<TValue> {
|
| 82 |
+
initial: (value?: any) => void;
|
| 83 |
+
active: (value?: any) => void;
|
| 84 |
+
cancel: (value?: any) => void;
|
| 85 |
+
submit: (value?: any) => void;
|
| 86 |
+
error: (value?: any) => void;
|
| 87 |
+
cursor: (key?: Action) => void;
|
| 88 |
+
key: (key: string | undefined, info: Key) => void;
|
| 89 |
+
value: (value?: TValue) => void;
|
| 90 |
+
userInput: (value: string) => void;
|
| 91 |
+
confirm: (value?: boolean) => void;
|
| 92 |
+
finalize: () => void;
|
| 93 |
+
beforePrompt: () => void;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
interface PromptOptions<TValue, Self extends Prompt<TValue>> {
|
| 97 |
+
render(this: Omit<Self, 'prompt'>): string | undefined;
|
| 98 |
+
initialValue?: any;
|
| 99 |
+
initialUserInput?: string;
|
| 100 |
+
validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
|
| 101 |
+
input?: Readable;
|
| 102 |
+
output?: Writable;
|
| 103 |
+
debug?: boolean;
|
| 104 |
+
signal?: AbortSignal;
|
| 105 |
+
}
|
| 106 |
+
declare class Prompt<TValue> {
|
| 107 |
+
protected input: Readable;
|
| 108 |
+
protected output: Writable;
|
| 109 |
+
private _abortSignal?;
|
| 110 |
+
private rl;
|
| 111 |
+
private opts;
|
| 112 |
+
private _render;
|
| 113 |
+
private _track;
|
| 114 |
+
private _prevFrame;
|
| 115 |
+
private _subscribers;
|
| 116 |
+
protected _cursor: number;
|
| 117 |
+
state: ClackState;
|
| 118 |
+
error: string;
|
| 119 |
+
value: TValue | undefined;
|
| 120 |
+
userInput: string;
|
| 121 |
+
constructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue?: boolean);
|
| 122 |
+
/**
|
| 123 |
+
* Unsubscribe all listeners
|
| 124 |
+
*/
|
| 125 |
+
protected unsubscribe(): void;
|
| 126 |
+
/**
|
| 127 |
+
* Set a subscriber with opts
|
| 128 |
+
* @param event - The event name
|
| 129 |
+
*/
|
| 130 |
+
private setSubscriber;
|
| 131 |
+
/**
|
| 132 |
+
* Subscribe to an event
|
| 133 |
+
* @param event - The event name
|
| 134 |
+
* @param cb - The callback
|
| 135 |
+
*/
|
| 136 |
+
on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
|
| 137 |
+
/**
|
| 138 |
+
* Subscribe to an event once
|
| 139 |
+
* @param event - The event name
|
| 140 |
+
* @param cb - The callback
|
| 141 |
+
*/
|
| 142 |
+
once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
|
| 143 |
+
/**
|
| 144 |
+
* Emit an event with data
|
| 145 |
+
* @param event - The event name
|
| 146 |
+
* @param data - The data to pass to the callback
|
| 147 |
+
*/
|
| 148 |
+
emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
|
| 149 |
+
prompt(): Promise<symbol | TValue | undefined>;
|
| 150 |
+
protected _isActionKey(char: string | undefined, _key: Key): boolean;
|
| 151 |
+
protected _setValue(value: TValue | undefined): void;
|
| 152 |
+
protected _setUserInput(value: string | undefined, write?: boolean): void;
|
| 153 |
+
protected _clearUserInput(): void;
|
| 154 |
+
private onKeypress;
|
| 155 |
+
protected close(): void;
|
| 156 |
+
private restoreCursor;
|
| 157 |
+
private render;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
interface OptionLike$1 {
|
| 161 |
+
value: unknown;
|
| 162 |
+
label?: string;
|
| 163 |
+
disabled?: boolean;
|
| 164 |
+
}
|
| 165 |
+
type FilterFunction<T extends OptionLike$1> = (search: string, opt: T) => boolean;
|
| 166 |
+
interface AutocompleteOptions<T extends OptionLike$1> extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {
|
| 167 |
+
options: T[] | ((this: AutocompletePrompt<T>) => T[]);
|
| 168 |
+
filter?: FilterFunction<T>;
|
| 169 |
+
multiple?: boolean;
|
| 170 |
+
/**
|
| 171 |
+
* When set (non-empty), pressing Tab with no input fills the field with this value
|
| 172 |
+
* and runs the normal filter/selection logic so the user can confirm with Enter.
|
| 173 |
+
* Tab only fills the input when the placeholder matches at least one option under
|
| 174 |
+
* the prompt's filter (so the value remains selectable).
|
| 175 |
+
*/
|
| 176 |
+
placeholder?: string;
|
| 177 |
+
}
|
| 178 |
+
declare class AutocompletePrompt<T extends OptionLike$1> extends Prompt<T['value'] | T['value'][]> {
|
| 179 |
+
#private;
|
| 180 |
+
filteredOptions: T[];
|
| 181 |
+
multiple: boolean;
|
| 182 |
+
isNavigating: boolean;
|
| 183 |
+
selectedValues: Array<T['value']>;
|
| 184 |
+
focusedValue: T['value'] | undefined;
|
| 185 |
+
get cursor(): number;
|
| 186 |
+
get userInputWithCursor(): string;
|
| 187 |
+
get options(): T[];
|
| 188 |
+
constructor(opts: AutocompleteOptions<T>);
|
| 189 |
+
protected _isActionKey(char: string | undefined, key: Key): boolean;
|
| 190 |
+
deselectAll(): void;
|
| 191 |
+
toggleSelected(value: T['value']): void;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {
|
| 195 |
+
active: string;
|
| 196 |
+
inactive: string;
|
| 197 |
+
initialValue?: boolean;
|
| 198 |
+
}
|
| 199 |
+
declare class ConfirmPrompt extends Prompt<boolean> {
|
| 200 |
+
get cursor(): 0 | 1;
|
| 201 |
+
private get _value();
|
| 202 |
+
constructor(opts: ConfirmOptions);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
interface SegmentConfig {
|
| 206 |
+
type: 'year' | 'month' | 'day';
|
| 207 |
+
len: number;
|
| 208 |
+
}
|
| 209 |
+
interface DateParts {
|
| 210 |
+
year: string;
|
| 211 |
+
month: string;
|
| 212 |
+
day: string;
|
| 213 |
+
}
|
| 214 |
+
type DateFormat = 'YMD' | 'MDY' | 'DMY';
|
| 215 |
+
interface DateOptions extends PromptOptions<Date, DatePrompt> {
|
| 216 |
+
format?: DateFormat;
|
| 217 |
+
locale?: string;
|
| 218 |
+
separator?: string;
|
| 219 |
+
defaultValue?: Date;
|
| 220 |
+
initialValue?: Date;
|
| 221 |
+
minDate?: Date;
|
| 222 |
+
maxDate?: Date;
|
| 223 |
+
}
|
| 224 |
+
declare class DatePrompt extends Prompt<Date> {
|
| 225 |
+
#private;
|
| 226 |
+
inlineError: string;
|
| 227 |
+
get segmentCursor(): {
|
| 228 |
+
segmentIndex: number;
|
| 229 |
+
positionInSegment: number;
|
| 230 |
+
};
|
| 231 |
+
get segmentValues(): DateParts;
|
| 232 |
+
get segments(): readonly SegmentConfig[];
|
| 233 |
+
get separator(): string;
|
| 234 |
+
get formattedValue(): string;
|
| 235 |
+
constructor(opts: DateOptions);
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
interface GroupMultiSelectOptions<T extends {
|
| 239 |
+
value: any;
|
| 240 |
+
}> extends PromptOptions<T['value'][], GroupMultiSelectPrompt<T>> {
|
| 241 |
+
options: Record<string, T[]>;
|
| 242 |
+
initialValues?: T['value'][];
|
| 243 |
+
required?: boolean;
|
| 244 |
+
cursorAt?: T['value'];
|
| 245 |
+
selectableGroups?: boolean;
|
| 246 |
+
}
|
| 247 |
+
declare class GroupMultiSelectPrompt<T extends {
|
| 248 |
+
value: any;
|
| 249 |
+
}> extends Prompt<T['value'][]> {
|
| 250 |
+
#private;
|
| 251 |
+
options: (T & {
|
| 252 |
+
group: string | boolean;
|
| 253 |
+
})[];
|
| 254 |
+
cursor: number;
|
| 255 |
+
getGroupItems(group: string): T[];
|
| 256 |
+
isGroupSelected(group: string): boolean;
|
| 257 |
+
private toggleValue;
|
| 258 |
+
constructor(opts: GroupMultiSelectOptions<T>);
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
interface OptionLike {
|
| 262 |
+
value: any;
|
| 263 |
+
disabled?: boolean;
|
| 264 |
+
}
|
| 265 |
+
interface MultiSelectOptions<T extends OptionLike> extends PromptOptions<T['value'][], MultiSelectPrompt<T>> {
|
| 266 |
+
options: T[];
|
| 267 |
+
initialValues?: T['value'][];
|
| 268 |
+
required?: boolean;
|
| 269 |
+
cursorAt?: T['value'];
|
| 270 |
+
}
|
| 271 |
+
declare class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {
|
| 272 |
+
options: T[];
|
| 273 |
+
cursor: number;
|
| 274 |
+
private get _value();
|
| 275 |
+
private get _enabledOptions();
|
| 276 |
+
private toggleAll;
|
| 277 |
+
private toggleInvert;
|
| 278 |
+
private toggleValue;
|
| 279 |
+
constructor(opts: MultiSelectOptions<T>);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {
|
| 283 |
+
mask?: string;
|
| 284 |
+
}
|
| 285 |
+
declare class PasswordPrompt extends Prompt<string> {
|
| 286 |
+
private _mask;
|
| 287 |
+
get cursor(): number;
|
| 288 |
+
get masked(): string;
|
| 289 |
+
get userInputWithCursor(): string;
|
| 290 |
+
clear(): void;
|
| 291 |
+
constructor({ mask, ...opts }: PasswordOptions);
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
interface SelectOptions<T extends {
|
| 295 |
+
value: any;
|
| 296 |
+
disabled?: boolean;
|
| 297 |
+
}> extends PromptOptions<T['value'], SelectPrompt<T>> {
|
| 298 |
+
options: T[];
|
| 299 |
+
initialValue?: T['value'];
|
| 300 |
+
}
|
| 301 |
+
declare class SelectPrompt<T extends {
|
| 302 |
+
value: any;
|
| 303 |
+
disabled?: boolean;
|
| 304 |
+
}> extends Prompt<T['value']> {
|
| 305 |
+
options: T[];
|
| 306 |
+
cursor: number;
|
| 307 |
+
private get _selectedValue();
|
| 308 |
+
private changeValue;
|
| 309 |
+
constructor(opts: SelectOptions<T>);
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
interface SelectKeyOptions<T extends {
|
| 313 |
+
value: string;
|
| 314 |
+
}> extends PromptOptions<T['value'], SelectKeyPrompt<T>> {
|
| 315 |
+
options: T[];
|
| 316 |
+
caseSensitive?: boolean;
|
| 317 |
+
}
|
| 318 |
+
declare class SelectKeyPrompt<T extends {
|
| 319 |
+
value: string;
|
| 320 |
+
}> extends Prompt<T['value']> {
|
| 321 |
+
options: T[];
|
| 322 |
+
cursor: number;
|
| 323 |
+
constructor(opts: SelectKeyOptions<T>);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
interface TextOptions extends PromptOptions<string, TextPrompt> {
|
| 327 |
+
placeholder?: string;
|
| 328 |
+
defaultValue?: string;
|
| 329 |
+
}
|
| 330 |
+
declare class TextPrompt extends Prompt<string> {
|
| 331 |
+
get userInputWithCursor(): string;
|
| 332 |
+
get cursor(): number;
|
| 333 |
+
constructor(opts: TextOptions);
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
declare function isCancel(value: unknown): value is symbol;
|
| 337 |
+
interface BlockOptions {
|
| 338 |
+
input?: Readable;
|
| 339 |
+
output?: Writable;
|
| 340 |
+
overwrite?: boolean;
|
| 341 |
+
hideCursor?: boolean;
|
| 342 |
+
}
|
| 343 |
+
declare function block({ input, output, overwrite, hideCursor, }?: BlockOptions): () => void;
|
| 344 |
+
declare const getColumns: (output: Writable) => number;
|
| 345 |
+
declare const getRows: (output: Writable) => number;
|
| 346 |
+
declare function wrapTextWithPrefix(output: Writable | undefined, text: string, prefix: string, startPrefix?: string): string;
|
| 347 |
+
|
| 348 |
+
export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, settings, updateSettings, wrapTextWithPrefix };
|
| 349 |
+
export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions };
|
extensions/channels/node_modules/@clack/core/dist/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{styleText as y}from"node:util";import{stdout as S,stdin as $}from"node:process";import*as _ from"node:readline";import P from"node:readline";import{wrapAnsi as x}from"fast-wrap-ansi";import{cursor as c,erase as M}from"sisteransi";import{ReadStream as D}from"node:tty";function d(r,t,e){if(!e.some(o=>!o.disabled))return r;const s=r+t,i=Math.max(e.length-1,0),n=s<0?i:s>i?0:s;return e[n].disabled?d(n,t<0?-1:1,e):n}const E=["up","down","left","right","space","enter","cancel"],G=["January","February","March","April","May","June","July","August","September","October","November","December"],u={actions:new Set(E),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...G],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(r,t)=>`There are only ${r} days in ${t}`,afterMin:r=>`Date must be on or after ${r.toISOString().slice(0,10)}`,beforeMax:r=>`Date must be on or before ${r.toISOString().slice(0,10)}`}}};function K(r){if(r.aliases!==void 0){const t=r.aliases;for(const e in t){if(!Object.hasOwn(t,e))continue;const s=t[e];u.actions.has(s)&&(u.aliases.has(e)||u.aliases.set(e,s))}}if(r.messages!==void 0){const t=r.messages;t.cancel!==void 0&&(u.messages.cancel=t.cancel),t.error!==void 0&&(u.messages.error=t.error)}if(r.withGuide!==void 0&&(u.withGuide=r.withGuide!==!1),r.date!==void 0){const t=r.date;t.monthNames!==void 0&&(u.date.monthNames=[...t.monthNames]),t.messages!==void 0&&(t.messages.required!==void 0&&(u.date.messages.required=t.messages.required),t.messages.invalidMonth!==void 0&&(u.date.messages.invalidMonth=t.messages.invalidMonth),t.messages.invalidDay!==void 0&&(u.date.messages.invalidDay=t.messages.invalidDay),t.messages.afterMin!==void 0&&(u.date.messages.afterMin=t.messages.afterMin),t.messages.beforeMax!==void 0&&(u.date.messages.beforeMax=t.messages.beforeMax))}}function V(r,t){if(typeof r=="string")return u.aliases.get(r)===t;for(const e of r)if(e!==void 0&&V(e,t))return!0;return!1}function j(r,t){if(r===t)return;const e=r.split(`
|
| 2 |
+
`),s=t.split(`
|
| 3 |
+
`),i=Math.max(e.length,s.length),n=[];for(let o=0;o<i;o++)e[o]!==s[o]&&n.push(o);return{lines:n,numLinesBefore:e.length,numLinesAfter:s.length,numLines:i}}const Y=globalThis.process.platform.startsWith("win"),C=Symbol("clack:cancel");function q(r){return r===C}function w(r,t){const e=r;e.isTTY&&e.setRawMode(t)}function z({input:r=$,output:t=S,overwrite:e=!0,hideCursor:s=!0}={}){const i=_.createInterface({input:r,output:t,prompt:"",tabSize:1});_.emitKeypressEvents(r,i),r instanceof D&&r.isTTY&&r.setRawMode(!0);const n=(o,{name:a,sequence:h})=>{const l=String(o);if(V([l,a,h],"cancel")){s&&t.write(c.show),process.exit(0);return}if(!e)return;const f=a==="return"?0:-1,v=a==="return"?-1:0;_.moveCursor(t,f,v,()=>{_.clearLine(t,1,()=>{r.once("keypress",n)})})};return s&&t.write(c.hide),r.once("keypress",n),()=>{r.off("keypress",n),s&&t.write(c.show),r instanceof D&&r.isTTY&&!Y&&r.setRawMode(!1),i.terminal=!1,i.close()}}const O=r=>"columns"in r&&typeof r.columns=="number"?r.columns:80,A=r=>"rows"in r&&typeof r.rows=="number"?r.rows:20;function R(r,t,e,s=e){const i=O(r??S);return x(t,i-e.length,{hard:!0,trim:!1}).split(`
|
| 4 |
+
`).map((n,o)=>`${o===0?s:e}${n}`).join(`
|
| 5 |
+
`)}let p=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,e=!0){const{input:s=$,output:i=S,render:n,signal:o,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=e,this._abortSignal=o,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){const s=this._subscribers.get(t)??[];s.push(e),this._subscribers.set(t,s)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){const s=this._subscribers.get(t)??[],i=[];for(const n of s)n.cb(...e),n.once&&i.push(()=>s.splice(s.indexOf(n),1));for(const n of i)n()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(C);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=P.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),w(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(c.show),this.output.off("resize",this.render),w(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(c.show),this.output.off("resize",this.render),w(this.input,!1),t(C)})})}_isActionKey(t,e){return t===" "}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,e){this.userInput=t??"",this.emit("userInput",this.userInput),e&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,e){if(this._track&&e.name!=="return"&&(e.name&&this._isActionKey(t,e)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&u.aliases.has(e.name)&&this.emit("cursor",u.aliases.get(e.name)),u.actions.has(e.name)&&this.emit("cursor",e.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t?.toLowerCase(),e),e?.name==="return"){if(this.opts.validate){const s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}V([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
| 6 |
+
`),w(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=x(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
| 7 |
+
`).length-1;this.output.write(c.move(-999,t*-1))}render(){const t=x(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(c.hide);else{const e=j(this._prevFrame,t),s=A(this.output);if(this.restoreCursor(),e){const i=Math.max(0,e.numLinesAfter-s),n=Math.max(0,e.numLinesBefore-s);let o=e.lines.find(a=>a>=i);if(o===void 0){this._prevFrame=t;return}if(e.lines.length===1){this.output.write(c.move(0,o-n)),this.output.write(M.lines(1));const a=t.split(`
|
| 8 |
+
`);this.output.write(a[o]),this._prevFrame=t,this.output.write(c.move(0,a.length-o-1));return}else if(e.lines.length>1){if(i<n)o=i;else{const h=o-n;h>0&&this.output.write(c.move(0,h))}this.output.write(M.down());const a=t.split(`
|
| 9 |
+
`).slice(o);this.output.write(a.join(`
|
| 10 |
+
`)),this._prevFrame=t;return}}this.output.write(M.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};function W(r,t){if(r===void 0||t.length===0)return 0;const e=t.findIndex(s=>s.value===r);return e!==-1?e:0}function B(r,t){return(t.label??String(t.value)).toLowerCase().includes(r.toLowerCase())}function J(r,t){if(t)return r?t:t[0]}let H=class extends p{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#e=0;#o="";#t;#n;#a;get cursor(){return this.#e}get userInputWithCursor(){if(!this.userInput)return y(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;const t=this.userInput.slice(0,this._cursor),[e,...s]=this.userInput.slice(this._cursor);return`${t}${y("inverse",e)}${s.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(t){super(t),this.#n=t.options,this.#a=t.placeholder;const e=this.options;this.filteredOptions=[...e],this.multiple=t.multiple===!0,this.#t=typeof t.options=="function"?t.filter:t.filter??B;let s;if(t.initialValue&&Array.isArray(t.initialValue)?this.multiple?s=t.initialValue:s=t.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(const i of s){const n=e.findIndex(o=>o.value===i);n!==-1&&(this.toggleSelected(i),this.#e=n)}this.focusedValue=this.options[this.#e]?.value,this.on("key",(i,n)=>this.#s(i,n)),this.on("userInput",i=>this.#i(i))}_isActionKey(t,e){return t===" "||this.multiple&&this.isNavigating&&e.name==="space"&&t!==void 0&&t!==""}#s(t,e){const s=e.name==="up",i=e.name==="down",n=e.name==="return",o=this.userInput===""||this.userInput===" ",a=this.#a,h=this.options,l=a!==void 0&&a!==""&&h.some(f=>!f.disabled&&(this.#t?this.#t(a,f):!0));if(e.name==="tab"&&o&&l){this.userInput===" "&&this._clearUserInput(),this._setUserInput(a,!0),this.isNavigating=!1;return}s||i?(this.#e=d(this.#e,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#e]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):n?this.value=J(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(e.name==="tab"||this.isNavigating&&e.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(t){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(t)?this.selectedValues=this.selectedValues.filter(e=>e!==t):this.selectedValues=[...this.selectedValues,t]:this.selectedValues=[t])}#i(t){if(t!==this.#o){this.#o=t;const e=this.options;t&&this.#t?this.filteredOptions=e.filter(n=>this.#t?.(t,n)):this.filteredOptions=[...e];const s=W(this.focusedValue,this.filteredOptions);this.#e=d(s,0,this.filteredOptions);const i=this.filteredOptions[this.#e];i&&!i.disabled?this.focusedValue=i.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};class Q extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(c.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}const X={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};function L(r){return[...r].map(t=>X[t])}function Z(r){const t=new Intl.DateTimeFormat(r,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),e=[];let s="/";for(const i of t)i.type==="literal"?s=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&e.push({type:i.type,len:i.type==="year"?4:2});return{segments:e,separator:s}}function k(r){return Number.parseInt((r||"0").replace(/_/g,"0"),10)||0}function I(r){return{year:k(r.year),month:k(r.month),day:k(r.day)}}function T(r,t){return new Date(r||2001,t||1,0).getDate()}function F(r){const{year:t,month:e,day:s}=I(r);if(!t||t<0||t>9999||!e||e<1||e>12||!s||s<1)return;const i=new Date(Date.UTC(t,e-1,s));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==e-1||i.getUTCDate()!==s))return{year:t,month:e,day:s}}function N(r){const t=F(r);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function tt(r,t,e,s){const i=e?{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate()}:null,n=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null;return r==="year"?{min:i?.year??1,max:n?.year??9999}:r==="month"?{min:i&&t.year===i.year?i.month:1,max:n&&t.year===n.year?n.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:n&&t.year===n.year&&t.month===n.month?n.day:T(t.year,t.month)}}class et extends p{#e;#o;#t;#n;#a;#s={segmentIndex:0,positionInSegment:0};#i=!0;#r=null;inlineError="";get segmentCursor(){return{...this.#s}}get segmentValues(){return{...this.#t}}get segments(){return this.#e}get separator(){return this.#o}get formattedValue(){return this.#c(this.#t)}#c(t){return this.#e.map(e=>t[e.type]).join(this.#o)}#h(){this._setUserInput(this.#c(this.#t)),this._setValue(N(this.#t)??void 0)}constructor(t){const e=t.format?{segments:L(t.format),separator:t.separator??"/"}:Z(t.locale),s=t.separator??e.separator,i=t.format?L(t.format):e.segments,n=t.initialValue??t.defaultValue,o=n?{year:String(n.getUTCFullYear()).padStart(4,"0"),month:String(n.getUTCMonth()+1).padStart(2,"0"),day:String(n.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},a=i.map(h=>o[h.type]).join(s);super({...t,initialUserInput:a},!1),this.#e=i,this.#o=s,this.#t=o,this.#n=t.minDate,this.#a=t.maxDate,this.#h(),this.on("cursor",h=>this.#d(h)),this.on("key",(h,l)=>this.#f(h,l)),this.on("finalize",()=>this.#g(t))}#u(){const t=Math.max(0,Math.min(this.#s.segmentIndex,this.#e.length-1)),e=this.#e[t];if(e)return this.#s.positionInSegment=Math.max(0,Math.min(this.#s.positionInSegment,e.len-1)),{segment:e,index:t}}#l(t){this.inlineError="",this.#r=null;const e=this.#u();e&&(this.#s.segmentIndex=Math.max(0,Math.min(this.#e.length-1,e.index+t)),this.#s.positionInSegment=0,this.#i=!0)}#p(t){const e=this.#u();if(!e)return;const{segment:s}=e,i=this.#t[s.type],n=!i||i.replace(/_/g,"")==="",o=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,a=tt(s.type,I(this.#t),this.#n,this.#a);let h;n?h=t===1?a.min:a.max:h=Math.max(Math.min(a.max,o+t),a.min),this.#t={...this.#t,[s.type]:h.toString().padStart(s.len,"0")},this.#i=!0,this.#r=null,this.#h()}#d(t){if(t)switch(t){case"right":return this.#l(1);case"left":return this.#l(-1);case"up":return this.#p(1);case"down":return this.#p(-1)}}#f(t,e){if(e?.name==="backspace"||e?.sequence==="\x7F"||e?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";const s=this.#u();if(!s)return;if(!this.#t[s.segment.type].replace(/_/g,"")){this.#l(-1);return}this.#t[s.segment.type]="_".repeat(s.segment.len),this.#i=!0,this.#s.positionInSegment=0,this.#h();return}if(e?.name==="tab"){this.inlineError="";const s=this.#u();if(!s)return;const i=e.shift?-1:1,n=s.index+i;n>=0&&n<this.#e.length&&(this.#s.segmentIndex=n,this.#s.positionInSegment=0,this.#i=!0);return}if(t&&/^[0-9]$/.test(t)){const s=this.#u();if(!s)return;const{segment:i}=s,n=!this.#t[i.type].replace(/_/g,"");if(this.#i&&this.#r!==null&&!n){const m=this.#r+t,g={...this.#t,[i.type]:m},b=this.#m(g,i);if(b){this.inlineError=b,this.#r=null,this.#i=!1;return}this.inlineError="",this.#t[i.type]=m,this.#r=null,this.#i=!1,this.#h(),s.index<this.#e.length-1&&(this.#s.segmentIndex=s.index+1,this.#s.positionInSegment=0,this.#i=!0);return}this.#i&&!n&&(this.#t[i.type]="_".repeat(i.len),this.#s.positionInSegment=0),this.#i=!1,this.#r=null;const o=this.#t[i.type],a=o.indexOf("_"),h=a>=0?a:Math.min(this.#s.positionInSegment,i.len-1);if(h<0||h>=i.len)return;let l=o.slice(0,h)+t+o.slice(h+1),f=!1;if(h===0&&o==="__"&&(i.type==="month"||i.type==="day")){const m=Number.parseInt(t,10);l=`0${t}`,f=m<=(i.type==="month"?1:2)}if(i.type==="year"&&(l=(o.replace(/_/g,"")+t).padStart(i.len,"_")),!l.includes("_")){const m={...this.#t,[i.type]:l},g=this.#m(m,i);if(g){this.inlineError=g;return}}this.inlineError="",this.#t[i.type]=l;const v=l.includes("_")?void 0:F(this.#t);if(v){const{year:m,month:g}=v,b=T(m,g);this.#t={year:String(Math.max(0,Math.min(9999,m))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,g))).padStart(2,"0"),day:String(Math.max(1,Math.min(b,v.day))).padStart(2,"0")}}this.#h();const U=l.indexOf("_");f?(this.#i=!0,this.#r=t):U>=0?this.#s.positionInSegment=U:a>=0&&s.index<this.#e.length-1?(this.#s.segmentIndex=s.index+1,this.#s.positionInSegment=0,this.#i=!0):this.#s.positionInSegment=Math.min(h+1,i.len-1)}}#m(t,e){const{month:s,day:i}=I(t);if(e.type==="month"&&(s<0||s>12))return u.date.messages.invalidMonth;if(e.type==="day"&&(i<0||i>31))return u.date.messages.invalidDay(31,"any month")}#g(t){const{year:e,month:s,day:i}=I(this.#t);if(e&&s&&i){const n=T(e,s);this.#t={...this.#t,day:String(Math.min(i,n)).padStart(2,"0")}}this.value=N(this.#t)??t.defaultValue??void 0}}class st extends p{options;cursor=0;#e;getGroupItems(t){return this.options.filter(e=>e.group===t)}isGroupSelected(t){const e=this.getGroupItems(t),s=this.value;return s===void 0?!1:e.every(i=>s.includes(i.value))}toggleValue(){const t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){const e=t.value,s=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(i=>s.findIndex(n=>n.value===i)===-1):this.value=[...this.value,...s.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{const e=this.value.includes(t.value);this.value=e?this.value.filter(s=>s!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);const{options:e}=t;this.#e=t.selectableGroups!==!1,this.options=Object.entries(e).flatMap(([s,i])=>[{value:s,group:!0,label:s},...i.map(n=>({...n,group:s}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===t.cursorAt),this.#e?0:1),this.on("cursor",s=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const i=this.options[this.cursor]?.group===!0;!this.#e&&i&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;const i=this.options[this.cursor]?.group===!0;!this.#e&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}let it=class extends p{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(t=>t.disabled!==!0)}toggleAll(){const t=this._enabledOptions,e=this.value!==void 0&&this.value.length===t.length;this.value=e?[]:t.map(s=>s.value)}toggleInvert(){const t=this.value;if(!t)return;const e=this._enabledOptions.filter(s=>!t.includes(s.value));this.value=e.map(s=>s.value)}toggleValue(){this.value===void 0&&(this.value=[]);const t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}constructor(t){super(t,!1),this.options=t.options,this.value=[...t.initialValues??[]];const e=Math.max(this.options.findIndex(({value:s})=>s===t.cursorAt),0);this.cursor=this.options[e].disabled?d(e,1,this.options):e,this.on("key",s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()}),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}};class rt extends p{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;const t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${y(["inverse","hidden"],"_")}`;const e=this.masked,s=e.slice(0,this.cursor),i=e.slice(this.cursor);return`${s}${y("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...e}){super(e),this._mask=t??"\u2022",this.on("userInput",s=>{this._setValue(s)})}}class nt extends p{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;const e=this.options.findIndex(({value:i})=>i===t.initialValue),s=e===-1?0:e;this.cursor=this.options[s].disabled?d(s,1,this.options):s,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break}this.changeValue()})}}class ot extends p{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;const e=t.caseSensitive===!0,s=this.options.map(({value:[i]})=>e?i:i?.toLowerCase());this.cursor=Math.max(s.indexOf(t.initialValue),0),this.on("key",(i,n)=>{if(!i)return;const o=e&&n.shift?i.toUpperCase():i;if(!s.includes(o))return;const a=this.options.find(({value:[h]})=>e?h===o:h?.toLowerCase()===i);a&&(this.value=a.value,this.state="submit",this.emit("submit"))})}}class at extends p{get userInputWithCursor(){if(this.state==="submit")return this.userInput;const t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;const e=t.slice(0,this.cursor),[s,...i]=t.slice(this.cursor);return`${e}${y("inverse",s)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",e=>{this._setValue(e)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}export{H as AutocompletePrompt,Q as ConfirmPrompt,et as DatePrompt,st as GroupMultiSelectPrompt,it as MultiSelectPrompt,rt as PasswordPrompt,p as Prompt,ot as SelectKeyPrompt,nt as SelectPrompt,at as TextPrompt,z as block,O as getColumns,A as getRows,q as isCancel,u as settings,K as updateSettings,R as wrapTextWithPrefix};
|
| 11 |
+
//# sourceMappingURL=index.mjs.map
|
extensions/channels/node_modules/@clack/core/dist/index.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.mjs","sources":["../src/utils/cursor.ts","../src/utils/settings.ts","../src/utils/string.ts","../src/utils/index.ts","../src/prompts/prompt.ts","../src/prompts/autocomplete.ts","../src/prompts/confirm.ts","../src/prompts/date.ts","../src/prompts/group-multiselect.ts","../src/prompts/multi-select.ts","../src/prompts/password.ts","../src/prompts/select.ts","../src/prompts/select-key.ts","../src/prompts/text.ts"],"sourcesContent":["export function findCursor<T extends { disabled?: boolean }>(\n\tcursor: number,\n\tdelta: number,\n\toptions: T[]\n) {\n\tconst hasEnabledOptions = options.some((opt) => !opt.disabled);\n\tif (!hasEnabledOptions) {\n\t\treturn cursor;\n\t}\n\tconst newCursor = cursor + delta;\n\tconst maxCursor = Math.max(options.length - 1, 0);\n\tconst clampedCursor = newCursor < 0 ? maxCursor : newCursor > maxCursor ? 0 : newCursor;\n\tconst newOption = options[clampedCursor];\n\tif (newOption.disabled) {\n\t\treturn findCursor(clampedCursor, delta < 0 ? -1 : 1, options);\n\t}\n\treturn clampedCursor;\n}\n","const actions = ['up', 'down', 'left', 'right', 'space', 'enter', 'cancel'] as const;\nexport type Action = (typeof actions)[number];\n\nconst DEFAULT_MONTH_NAMES = [\n\t'January',\n\t'February',\n\t'March',\n\t'April',\n\t'May',\n\t'June',\n\t'July',\n\t'August',\n\t'September',\n\t'October',\n\t'November',\n\t'December',\n];\n\n/** Global settings for Clack programs, stored in memory */\ninterface InternalClackSettings {\n\tactions: Set<Action>;\n\taliases: Map<string, Action>;\n\tmessages: {\n\t\tcancel: string;\n\t\terror: string;\n\t};\n\twithGuide: boolean;\n\tdate: {\n\t\tmonthNames: string[];\n\t\tmessages: {\n\t\t\tinvalidMonth: string;\n\t\t\trequired: string;\n\t\t\tinvalidDay: (days: number, month: string) => string;\n\t\t\tafterMin: (min: Date) => string;\n\t\t\tbeforeMax: (max: Date) => string;\n\t\t};\n\t};\n}\n\nexport const settings: InternalClackSettings = {\n\tactions: new Set(actions),\n\taliases: new Map<string, Action>([\n\t\t// vim support\n\t\t['k', 'up'],\n\t\t['j', 'down'],\n\t\t['h', 'left'],\n\t\t['l', 'right'],\n\t\t['\\x03', 'cancel'],\n\t\t// opinionated defaults!\n\t\t['escape', 'cancel'],\n\t]),\n\tmessages: {\n\t\tcancel: 'Canceled',\n\t\terror: 'Something went wrong',\n\t},\n\twithGuide: true,\n\tdate: {\n\t\tmonthNames: [...DEFAULT_MONTH_NAMES],\n\t\tmessages: {\n\t\t\trequired: 'Please enter a valid date',\n\t\t\tinvalidMonth: 'There are only 12 months in a year',\n\t\t\tinvalidDay: (days, month) => `There are only ${days} days in ${month}`,\n\t\t\tafterMin: (min) => `Date must be on or after ${min.toISOString().slice(0, 10)}`,\n\t\t\tbeforeMax: (max) => `Date must be on or before ${max.toISOString().slice(0, 10)}`,\n\t\t},\n\t},\n};\n\nexport interface ClackSettings {\n\t/**\n\t * Set custom global aliases for the default actions.\n\t * This will not overwrite existing aliases, it will only add new ones!\n\t *\n\t * @param aliases - An object that maps aliases to actions\n\t * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\\x03': 'cancel', 'escape': 'cancel' }\n\t */\n\taliases?: Record<string, Action>;\n\n\t/**\n\t * Custom messages for prompts\n\t */\n\tmessages?: {\n\t\t/**\n\t\t * Custom message to display when a spinner is cancelled\n\t\t * @default \"Canceled\"\n\t\t */\n\t\tcancel?: string;\n\t\t/**\n\t\t * Custom message to display when a spinner encounters an error\n\t\t * @default \"Something went wrong\"\n\t\t */\n\t\terror?: string;\n\t};\n\n\twithGuide?: boolean;\n\n\t/**\n\t * Date prompt localization\n\t */\n\tdate?: {\n\t\t/** Month names for validation messages (January, February, ...) */\n\t\tmonthNames?: string[];\n\t\tmessages?: {\n\t\t\t/** Shown when date is missing */\n\t\t\trequired?: string;\n\t\t\t/** Shown when month > 12 */\n\t\t\tinvalidMonth?: string;\n\t\t\t/** (days, monthName) => message for invalid day */\n\t\t\tinvalidDay?: (days: number, month: string) => string;\n\t\t\t/** (min) => message when date is before minDate */\n\t\t\tafterMin?: (min: Date) => string;\n\t\t\t/** (max) => message when date is after maxDate */\n\t\t\tbeforeMax?: (max: Date) => string;\n\t\t};\n\t};\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\t// Handle each property in the updates\n\tif (updates.aliases !== undefined) {\n\t\tconst aliases = updates.aliases;\n\t\tfor (const alias in aliases) {\n\t\t\tif (!Object.hasOwn(aliases, alias)) continue;\n\n\t\t\tconst action = aliases[alias];\n\t\t\tif (!settings.actions.has(action)) continue;\n\n\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\tsettings.aliases.set(alias, action);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (updates.messages !== undefined) {\n\t\tconst messages = updates.messages;\n\t\tif (messages.cancel !== undefined) {\n\t\t\tsettings.messages.cancel = messages.cancel;\n\t\t}\n\t\tif (messages.error !== undefined) {\n\t\t\tsettings.messages.error = messages.error;\n\t\t}\n\t}\n\n\tif (updates.withGuide !== undefined) {\n\t\tsettings.withGuide = updates.withGuide !== false;\n\t}\n\n\tif (updates.date !== undefined) {\n\t\tconst date = updates.date;\n\t\tif (date.monthNames !== undefined) {\n\t\t\tsettings.date.monthNames = [...date.monthNames];\n\t\t}\n\t\tif (date.messages !== undefined) {\n\t\t\tif (date.messages.required !== undefined) {\n\t\t\t\tsettings.date.messages.required = date.messages.required;\n\t\t\t}\n\t\t\tif (date.messages.invalidMonth !== undefined) {\n\t\t\t\tsettings.date.messages.invalidMonth = date.messages.invalidMonth;\n\t\t\t}\n\t\t\tif (date.messages.invalidDay !== undefined) {\n\t\t\t\tsettings.date.messages.invalidDay = date.messages.invalidDay;\n\t\t\t}\n\t\t\tif (date.messages.afterMin !== undefined) {\n\t\t\t\tsettings.date.messages.afterMin = date.messages.afterMin;\n\t\t\t}\n\t\t\tif (date.messages.beforeMax !== undefined) {\n\t\t\t\tsettings.date.messages.beforeMax = date.messages.beforeMax;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check if a key is an alias for a default action\n * @param key - The raw key which might match to an action\n * @param action - The action to match\n * @returns boolean\n */\nexport function isActionKey(key: string | Array<string | undefined>, action: Action) {\n\tif (typeof key === 'string') {\n\t\treturn settings.aliases.get(key) === action;\n\t}\n\n\tfor (const value of key) {\n\t\tif (value === undefined) continue;\n\t\tif (isActionKey(value, action)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n","export function diffLines(a: string, b: string) {\n\tif (a === b) return;\n\n\tconst aLines = a.split('\\n');\n\tconst bLines = b.split('\\n');\n\tconst numLines = Math.max(aLines.length, bLines.length);\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < numLines; i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn {\n\t\tlines: diff,\n\t\tnumLinesBefore: aLines.length,\n\t\tnumLinesAfter: bLines.length,\n\t\tnumLines,\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { ReadStream } from 'node:tty';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings.js';\n\nexport * from './settings.js';\nexport * from './string.js';\n\nconst isWindows = globalThis.process.platform.startsWith('win');\n\nexport const CANCEL_SYMBOL = Symbol('clack:cancel');\n\nexport function isCancel(value: unknown): value is symbol {\n\treturn value === CANCEL_SYMBOL;\n}\n\nexport function setRawMode(input: Readable, value: boolean) {\n\tconst i = input as typeof stdin;\n\n\tif (i.isTTY) i.setRawMode(value);\n}\n\ninterface BlockOptions {\n\tinput?: Readable;\n\toutput?: Writable;\n\toverwrite?: boolean;\n\thideCursor?: boolean;\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n}: BlockOptions = {}) {\n\tconst rl = readline.createInterface({\n\t\tinput,\n\t\toutput,\n\t\tprompt: '',\n\t\ttabSize: 1,\n\t});\n\treadline.emitKeypressEvents(input, rl);\n\n\tif (input instanceof ReadStream && input.isTTY) {\n\t\tinput.setRawMode(true);\n\t}\n\n\tconst clear = (data: Buffer, { name, sequence }: Key) => {\n\t\tconst str = String(data);\n\t\tif (isActionKey([str, name, sequence], 'cancel')) {\n\t\t\tif (hideCursor) output.write(cursor.show);\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (!overwrite) return;\n\t\tconst dx = name === 'return' ? 0 : -1;\n\t\tconst dy = name === 'return' ? -1 : 0;\n\n\t\treadline.moveCursor(output, dx, dy, () => {\n\t\t\treadline.clearLine(output, 1, () => {\n\t\t\t\tinput.once('keypress', clear);\n\t\t\t});\n\t\t});\n\t};\n\tif (hideCursor) output.write(cursor.hide);\n\tinput.once('keypress', clear);\n\n\treturn () => {\n\t\tinput.off('keypress', clear);\n\t\tif (hideCursor) output.write(cursor.show);\n\n\t\t// Prevent Windows specific issues: https://github.com/bombshell-dev/clack/issues/176\n\t\tif (input instanceof ReadStream && input.isTTY && !isWindows) {\n\t\t\tinput.setRawMode(false);\n\t\t}\n\n\t\t// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907\n\t\trl.terminal = false;\n\t\trl.close();\n\t};\n}\n\nexport const getColumns = (output: Writable): number => {\n\tif ('columns' in output && typeof output.columns === 'number') {\n\t\treturn output.columns;\n\t}\n\treturn 80;\n};\n\nexport const getRows = (output: Writable): number => {\n\tif ('rows' in output && typeof output.rows === 'number') {\n\t\treturn output.rows;\n\t}\n\treturn 20;\n};\n\nexport function wrapTextWithPrefix(\n\toutput: Writable | undefined,\n\ttext: string,\n\tprefix: string,\n\tstartPrefix: string = prefix\n): string {\n\tconst columns = getColumns(output ?? stdout);\n\tconst wrapped = wrapAnsi(text, columns - prefix.length, {\n\t\thard: true,\n\t\ttrim: false,\n\t});\n\tconst lines = wrapped\n\t\t.split('\\n')\n\t\t.map((line, index) => {\n\t\t\treturn `${index === 0 ? startPrefix : prefix}${line}`;\n\t\t})\n\t\t.join('\\n');\n\treturn lines;\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor, erase } from 'sisteransi';\nimport type { ClackEvents, ClackState } from '../types.js';\nimport type { Action } from '../utils/index.js';\nimport {\n\tCANCEL_SYMBOL,\n\tdiffLines,\n\tgetRows,\n\tisActionKey,\n\tsetRawMode,\n\tsettings,\n} from '../utils/index.js';\n\nexport interface PromptOptions<TValue, Self extends Prompt<TValue>> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tinitialValue?: any;\n\tinitialUserInput?: string;\n\tvalidate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt<TValue> {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<TValue, Prompt<TValue>>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt<TValue>, 'prompt'>) => string | undefined;\n\tprivate _track = false;\n\tprivate _prevFrame = '';\n\tprivate _subscribers = new Map<string, { cb: (...args: any) => any; once?: boolean }[]>();\n\tprotected _cursor = 0;\n\n\tpublic state: ClackState = 'initial';\n\tpublic error = '';\n\tpublic value: TValue | undefined;\n\tpublic userInput = '';\n\n\tconstructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue = true) {\n\t\tconst { input = stdin, output = stdout, render, signal, ...opts } = options;\n\n\t\tthis.opts = opts;\n\t\tthis.onKeypress = this.onKeypress.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.render = this.render.bind(this);\n\t\tthis._render = render.bind(this);\n\t\tthis._track = trackValue;\n\t\tthis._abortSignal = signal;\n\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t}\n\n\t/**\n\t * Unsubscribe all listeners\n\t */\n\tprotected unsubscribe() {\n\t\tthis._subscribers.clear();\n\t}\n\n\t/**\n\t * Set a subscriber with opts\n\t * @param event - The event name\n\t */\n\tprivate setSubscriber<T extends keyof ClackEvents<TValue>>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents<TValue>[T]; once?: boolean }\n\t) {\n\t\tconst params = this._subscribers.get(event) ?? [];\n\t\tparams.push(opts);\n\t\tthis._subscribers.set(event, params);\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]) {\n\t\tthis.setSubscriber(event, { cb });\n\t}\n\n\t/**\n\t * Subscribe to an event once\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]) {\n\t\tthis.setSubscriber(event, { cb, once: true });\n\t}\n\n\t/**\n\t * Emit an event with data\n\t * @param event - The event name\n\t * @param data - The data to pass to the callback\n\t */\n\tpublic emit<T extends keyof ClackEvents<TValue>>(\n\t\tevent: T,\n\t\t...data: Parameters<ClackEvents<TValue>[T]>\n\t) {\n\t\tconst cbs = this._subscribers.get(event) ?? [];\n\t\tconst cleanup: (() => void)[] = [];\n\n\t\tfor (const subscriber of cbs) {\n\t\t\tsubscriber.cb(...data);\n\n\t\t\tif (subscriber.once) {\n\t\t\t\tcleanup.push(() => cbs.splice(cbs.indexOf(subscriber), 1));\n\t\t\t}\n\t\t}\n\n\t\tfor (const cb of cleanup) {\n\t\t\tcb();\n\t\t}\n\t}\n\n\tpublic prompt() {\n\t\treturn new Promise<TValue | symbol | undefined>((resolve) => {\n\t\t\tif (this._abortSignal) {\n\t\t\t\tif (this._abortSignal.aborted) {\n\t\t\t\t\tthis.state = 'cancel';\n\n\t\t\t\t\tthis.close();\n\t\t\t\t\treturn resolve(CANCEL_SYMBOL);\n\t\t\t\t}\n\n\t\t\t\tthis._abortSignal.addEventListener(\n\t\t\t\t\t'abort',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.state = 'cancel';\n\t\t\t\t\t\tthis.close();\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\n\t\t\t\ttabSize: 2,\n\t\t\t\tprompt: '',\n\t\t\t\tescapeCodeTimeout: 50,\n\t\t\t\tterminal: true,\n\t\t\t});\n\t\t\tthis.rl.prompt();\n\n\t\t\tif (this.opts.initialUserInput !== undefined) {\n\t\t\t\tthis._setUserInput(this.opts.initialUserInput, true);\n\t\t\t}\n\n\t\t\tthis.input.on('keypress', this.onKeypress);\n\t\t\tsetRawMode(this.input, true);\n\t\t\tthis.output.on('resize', this.render);\n\n\t\t\tthis.render();\n\n\t\t\tthis.once('submit', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(this.value);\n\t\t\t});\n\t\t\tthis.once('cancel', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(CANCEL_SYMBOL);\n\t\t\t});\n\t\t});\n\t}\n\n\tprotected _isActionKey(char: string | undefined, _key: Key): boolean {\n\t\treturn char === '\\t';\n\t}\n\n\tprotected _setValue(value: TValue | undefined): void {\n\t\tthis.value = value;\n\t\tthis.emit('value', this.value);\n\t}\n\n\tprotected _setUserInput(value: string | undefined, write?: boolean): void {\n\t\tthis.userInput = value ?? '';\n\t\tthis.emit('userInput', this.userInput);\n\t\tif (write && this._track && this.rl) {\n\t\t\tthis.rl.write(this.userInput);\n\t\t\tthis._cursor = this.rl.cursor;\n\t\t}\n\t}\n\n\tprotected _clearUserInput(): void {\n\t\tthis.rl?.write(null, { ctrl: true, name: 'u' });\n\t\tthis._setUserInput('');\n\t}\n\n\tprivate onKeypress(char: string | undefined, key: Key) {\n\t\tif (this._track && key.name !== 'return') {\n\t\t\tif (key.name && this._isActionKey(char, key)) {\n\t\t\t\tthis.rl?.write(null, { ctrl: true, name: 'h' });\n\t\t\t}\n\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\tthis._setUserInput(this.rl?.line);\n\t\t}\n\n\t\tif (this.state === 'error') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tif (key?.name) {\n\t\t\tif (!this._track && settings.aliases.has(key.name)) {\n\t\t\t\tthis.emit('cursor', settings.aliases.get(key.name));\n\t\t\t}\n\t\t\tif (settings.actions.has(key.name as Action)) {\n\t\t\t\tthis.emit('cursor', key.name as Action);\n\t\t\t}\n\t\t}\n\t\tif (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {\n\t\t\tthis.emit('confirm', char.toLowerCase() === 'y');\n\t\t}\n\n\t\t// Call the key event handler and emit the key event\n\t\tthis.emit('key', char?.toLowerCase(), key);\n\n\t\tif (key?.name === 'return') {\n\t\t\tif (this.opts.validate) {\n\t\t\t\tconst problem = this.opts.validate(this.value);\n\t\t\t\tif (problem) {\n\t\t\t\t\tthis.error = problem instanceof Error ? problem.message : problem;\n\t\t\t\t\tthis.state = 'error';\n\t\t\t\t\tthis.rl?.write(this.userInput);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state !== 'error') {\n\t\t\t\tthis.state = 'submit';\n\t\t\t}\n\t\t}\n\n\t\tif (isActionKey([char, key?.name, key?.sequence], 'cancel')) {\n\t\t\tthis.state = 'cancel';\n\t\t}\n\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.emit('finalize');\n\t\t}\n\t\tthis.render();\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\tprotected close() {\n\t\tthis.input.unpipe();\n\t\tthis.input.removeListener('keypress', this.onKeypress);\n\t\tthis.output.write('\\n');\n\t\tsetRawMode(this.input, false);\n\t\tthis.rl?.close();\n\t\tthis.rl = undefined;\n\t\tthis.emit(`${this.state}`, this.value);\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate restoreCursor() {\n\t\tconst lines =\n\t\t\twrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split('\\n')\n\t\t\t\t.length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrapAnsi(this._render(this) ?? '', process.stdout.columns, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t});\n\t\tif (frame === this._prevFrame) return;\n\n\t\tif (this.state === 'initial') {\n\t\t\tthis.output.write(cursor.hide);\n\t\t} else {\n\t\t\tconst diff = diffLines(this._prevFrame, frame);\n\t\t\tconst rows = getRows(this.output);\n\t\t\tthis.restoreCursor();\n\t\t\tif (diff) {\n\t\t\t\tconst diffOffsetAfter = Math.max(0, diff.numLinesAfter - rows);\n\t\t\t\tconst diffOffsetBefore = Math.max(0, diff.numLinesBefore - rows);\n\t\t\t\tlet diffLine = diff.lines.find((line) => line >= diffOffsetAfter);\n\n\t\t\t\tif (diffLine === undefined) {\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a single line has changed, only update that line\n\t\t\t\tif (diff.lines.length === 1) {\n\t\t\t\t\tthis.output.write(cursor.move(0, diffLine - diffOffsetBefore));\n\t\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\t\treturn;\n\t\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t\t} else if (diff.lines.length > 1) {\n\t\t\t\t\tif (diffOffsetAfter < diffOffsetBefore) {\n\t\t\t\t\t\tdiffLine = diffOffsetAfter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst adjustedDiffLine = diffLine - diffOffsetBefore;\n\t\t\t\t\t\tif (adjustedDiffLine > 0) {\n\t\t\t\t\t\t\tthis.output.write(cursor.move(0, adjustedDiffLine));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.output.write(erase.down());\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.output.write(erase.down());\n\t\t}\n\n\t\tthis.output.write(frame);\n\t\tif (this.state === 'initial') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tthis._prevFrame = frame;\n\t}\n}\n","import type { Key } from 'node:readline';\nimport { styleText } from 'node:util';\nimport { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: unknown;\n\tlabel?: string;\n\tdisabled?: boolean;\n}\n\ntype FilterFunction<T extends OptionLike> = (search: string, opt: T) => boolean;\n\nfunction getCursorForValue<T extends OptionLike>(\n\tselected: T['value'] | undefined,\n\titems: T[]\n): number {\n\tif (selected === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst currLength = items.length;\n\n\t// If filtering changed the available options, update cursor\n\tif (currLength === 0) {\n\t\treturn 0;\n\t}\n\n\t// Try to maintain the same selected item\n\tconst index = items.findIndex((item) => item.value === selected);\n\treturn index !== -1 ? index : 0;\n}\n\nfunction defaultFilter<T extends OptionLike>(input: string, option: T): boolean {\n\tconst label = option.label ?? String(option.value);\n\treturn label.toLowerCase().includes(input.toLowerCase());\n}\n\nfunction normalisedValue<T>(multiple: boolean, values: T[] | undefined): T | T[] | undefined {\n\tif (!values) {\n\t\treturn undefined;\n\t}\n\tif (multiple) {\n\t\treturn values;\n\t}\n\treturn values[0];\n}\n\nexport interface AutocompleteOptions<T extends OptionLike>\n\textends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {\n\toptions: T[] | ((this: AutocompletePrompt<T>) => T[]);\n\tfilter?: FilterFunction<T>;\n\tmultiple?: boolean;\n\t/**\n\t * When set (non-empty), pressing Tab with no input fills the field with this value\n\t * and runs the normal filter/selection logic so the user can confirm with Enter.\n\t * Tab only fills the input when the placeholder matches at least one option under\n\t * the prompt's filter (so the value remains selectable).\n\t */\n\tplaceholder?: string;\n}\n\nexport default class AutocompletePrompt<T extends OptionLike> extends Prompt<\n\tT['value'] | T['value'][]\n> {\n\tfilteredOptions: T[];\n\tmultiple: boolean;\n\tisNavigating = false;\n\tselectedValues: Array<T['value']> = [];\n\n\tfocusedValue: T['value'] | undefined;\n\t#cursor = 0;\n\t#lastUserInput = '';\n\t#filterFn: FilterFunction<T> | undefined;\n\t#options: T[] | (() => T[]);\n\t#placeholder: string | undefined;\n\n\tget cursor(): number {\n\t\treturn this.#cursor;\n\t}\n\n\tget userInputWithCursor() {\n\t\tif (!this.userInput) {\n\t\t\treturn styleText(['inverse', 'hidden'], '_');\n\t\t}\n\t\tif (this._cursor >= this.userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = this.userInput.slice(0, this._cursor);\n\t\tconst [s2, ...s3] = this.userInput.slice(this._cursor);\n\t\treturn `${s1}${styleText('inverse', s2)}${s3.join('')}`;\n\t}\n\n\tget options(): T[] {\n\t\tif (typeof this.#options === 'function') {\n\t\t\treturn this.#options();\n\t\t}\n\t\treturn this.#options;\n\t}\n\n\tconstructor(opts: AutocompleteOptions<T>) {\n\t\tsuper(opts);\n\n\t\tthis.#options = opts.options;\n\t\tthis.#placeholder = opts.placeholder;\n\t\tconst options = this.options;\n\t\tthis.filteredOptions = [...options];\n\t\tthis.multiple = opts.multiple === true;\n\t\tthis.#filterFn =\n\t\t\ttypeof opts.options === 'function' ? opts.filter : (opts.filter ?? defaultFilter);\n\t\tlet initialValues: unknown[] | undefined;\n\t\tif (opts.initialValue && Array.isArray(opts.initialValue)) {\n\t\t\tif (this.multiple) {\n\t\t\t\tinitialValues = opts.initialValue;\n\t\t\t} else {\n\t\t\t\tinitialValues = opts.initialValue.slice(0, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.multiple && this.options.length > 0) {\n\t\t\t\tinitialValues = [this.options[0].value];\n\t\t\t}\n\t\t}\n\n\t\tif (initialValues) {\n\t\t\tfor (const selectedValue of initialValues) {\n\t\t\t\tconst selectedIndex = options.findIndex((opt) => opt.value === selectedValue);\n\t\t\t\tif (selectedIndex !== -1) {\n\t\t\t\t\tthis.toggleSelected(selectedValue);\n\t\t\t\t\tthis.#cursor = selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.focusedValue = this.options[this.#cursor]?.value;\n\n\t\tthis.on('key', (char, key) => this.#onKey(char, key));\n\t\tthis.on('userInput', (value) => this.#onUserInputChanged(value));\n\t}\n\n\tprotected override _isActionKey(char: string | undefined, key: Key): boolean {\n\t\treturn (\n\t\t\tchar === '\\t' ||\n\t\t\t(this.multiple &&\n\t\t\t\tthis.isNavigating &&\n\t\t\t\tkey.name === 'space' &&\n\t\t\t\tchar !== undefined &&\n\t\t\t\tchar !== '')\n\t\t);\n\t}\n\n\t#onKey(_char: string | undefined, key: Key): void {\n\t\tconst isUpKey = key.name === 'up';\n\t\tconst isDownKey = key.name === 'down';\n\t\tconst isReturnKey = key.name === 'return';\n\n\t\t// Tab with empty input and placeholder: fill input with placeholder to trigger autocomplete\n\t\t// Only when the placeholder matches at least one (non-disabled) option so the value remains selectable\n\t\tconst isEmptyOrOnlyTab = this.userInput === '' || this.userInput === '\\t';\n\t\tconst placeholder = this.#placeholder;\n\t\tconst options = this.options;\n\t\tconst placeholderMatchesOption =\n\t\t\tplaceholder !== undefined &&\n\t\t\tplaceholder !== '' &&\n\t\t\toptions.some(\n\t\t\t\t(opt) => !opt.disabled && (this.#filterFn ? this.#filterFn(placeholder, opt) : true)\n\t\t\t);\n\t\tif (key.name === 'tab' && isEmptyOrOnlyTab && placeholderMatchesOption) {\n\t\t\tif (this.userInput === '\\t') {\n\t\t\t\tthis._clearUserInput();\n\t\t\t}\n\t\t\tthis._setUserInput(placeholder, true);\n\t\t\tthis.isNavigating = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Start navigation mode with up/down arrows\n\t\tif (isUpKey || isDownKey) {\n\t\t\tthis.#cursor = findCursor(this.#cursor, isUpKey ? -1 : 1, this.filteredOptions);\n\t\t\tthis.focusedValue = this.filteredOptions[this.#cursor]?.value;\n\t\t\tif (!this.multiple) {\n\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t}\n\t\t\tthis.isNavigating = true;\n\t\t} else if (isReturnKey) {\n\t\t\tthis.value = normalisedValue(this.multiple, this.selectedValues);\n\t\t} else {\n\t\t\tif (this.multiple) {\n\t\t\t\tif (\n\t\t\t\t\tthis.focusedValue !== undefined &&\n\t\t\t\t\t(key.name === 'tab' || (this.isNavigating && key.name === 'space'))\n\t\t\t\t) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.isNavigating = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.focusedValue) {\n\t\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t\t}\n\t\t\t\tthis.isNavigating = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tdeselectAll() {\n\t\tthis.selectedValues = [];\n\t}\n\n\ttoggleSelected(value: T['value']) {\n\t\tif (this.filteredOptions.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.multiple) {\n\t\t\tif (this.selectedValues.includes(value)) {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter((v) => v !== value);\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value];\n\t\t\t}\n\t\t} else {\n\t\t\tthis.selectedValues = [value];\n\t\t}\n\t}\n\n\t#onUserInputChanged(value: string): void {\n\t\tif (value !== this.#lastUserInput) {\n\t\t\tthis.#lastUserInput = value;\n\n\t\t\tconst options = this.options;\n\n\t\t\tif (value && this.#filterFn) {\n\t\t\t\tthis.filteredOptions = options.filter((opt) => this.#filterFn?.(value, opt));\n\t\t\t} else {\n\t\t\t\tthis.filteredOptions = [...options];\n\t\t\t}\n\t\t\tconst valueCursor = getCursorForValue(this.focusedValue, this.filteredOptions);\n\t\t\tthis.#cursor = findCursor(valueCursor, 0, this.filteredOptions);\n\t\t\tconst focusedOption = this.filteredOptions[this.#cursor];\n\t\t\tif (focusedOption && !focusedOption.disabled) {\n\t\t\t\tthis.focusedValue = focusedOption.value;\n\t\t\t} else {\n\t\t\t\tthis.focusedValue = undefined;\n\t\t\t}\n\t\t\tif (!this.multiple) {\n\t\t\t\tif (this.focusedValue !== undefined) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deselectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\n\nexport default class ConfirmPrompt extends Prompt<boolean> {\n\tget cursor() {\n\t\treturn this.value ? 0 : 1;\n\t}\n\n\tprivate get _value() {\n\t\treturn this.cursor === 0;\n\t}\n\n\tconstructor(opts: ConfirmOptions) {\n\t\tsuper(opts, false);\n\t\tthis.value = !!opts.initialValue;\n\n\t\tthis.on('userInput', () => {\n\t\t\tthis.value = this._value;\n\t\t});\n\n\t\tthis.on('confirm', (confirm) => {\n\t\t\tthis.output.write(cursor.move(0, -1));\n\t\t\tthis.value = confirm;\n\t\t\tthis.state = 'submit';\n\t\t\tthis.close();\n\t\t});\n\n\t\tthis.on('cursor', () => {\n\t\t\tthis.value = !this.value;\n\t\t});\n\t}\n}\n","import type { Key } from 'node:readline';\nimport { settings } from '../utils/settings.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface SegmentConfig {\n\ttype: 'year' | 'month' | 'day';\n\tlen: number;\n}\n\nexport interface DateParts {\n\tyear: string;\n\tmonth: string;\n\tday: string;\n}\n\nexport type DateFormat = 'YMD' | 'MDY' | 'DMY';\n\nconst SEGMENTS: Record<string, SegmentConfig> = {\n\tY: { type: 'year', len: 4 },\n\tM: { type: 'month', len: 2 },\n\tD: { type: 'day', len: 2 },\n} as const;\n\nfunction segmentsFor(fmt: DateFormat): SegmentConfig[] {\n\treturn [...fmt].map((c) => SEGMENTS[c as keyof typeof SEGMENTS]);\n}\n\nfunction detectLocaleFormat(locale?: string): { segments: SegmentConfig[]; separator: string } {\n\tconst fmt = new Intl.DateTimeFormat(locale, {\n\t\tyear: 'numeric',\n\t\tmonth: '2-digit',\n\t\tday: '2-digit',\n\t});\n\tconst parts = fmt.formatToParts(new Date(2000, 0, 15));\n\tconst segments: SegmentConfig[] = [];\n\tlet separator = '/';\n\tfor (const p of parts) {\n\t\tif (p.type === 'literal') {\n\t\t\tseparator = p.value.trim() || p.value;\n\t\t} else if (p.type === 'year' || p.type === 'month' || p.type === 'day') {\n\t\t\tsegments.push({ type: p.type, len: p.type === 'year' ? 4 : 2 });\n\t\t}\n\t}\n\treturn { segments, separator };\n}\n\n/** Parse string segment values to numbers, treating blanks as 0 */\nfunction parseSegmentToNum(s: string): number {\n\treturn Number.parseInt((s || '0').replace(/_/g, '0'), 10) || 0;\n}\n\nfunction parse(parts: DateParts): { year: number; month: number; day: number } {\n\treturn {\n\t\tyear: parseSegmentToNum(parts.year),\n\t\tmonth: parseSegmentToNum(parts.month),\n\t\tday: parseSegmentToNum(parts.day),\n\t};\n}\n\nfunction daysInMonth(year: number, month: number): number {\n\treturn new Date(year || 2001, month || 1, 0).getDate();\n}\n\n/** Validate and return calendar parts, or undefined if invalid */\nfunction validParts(parts: DateParts): { year: number; month: number; day: number } | undefined {\n\tconst { year, month, day } = parse(parts);\n\tif (!year || year < 0 || year > 9999) return undefined;\n\tif (!month || month < 1 || month > 12) return undefined;\n\tif (!day || day < 1) return undefined;\n\tconst d = new Date(Date.UTC(year, month - 1, day));\n\tif (d.getUTCFullYear() !== year || d.getUTCMonth() !== month - 1 || d.getUTCDate() !== day)\n\t\treturn undefined;\n\treturn { year, month, day };\n}\n\nfunction toDate(parts: DateParts): Date | undefined {\n\tconst p = validParts(parts);\n\treturn p ? new Date(Date.UTC(p.year, p.month - 1, p.day)) : undefined;\n}\n\nfunction segmentBounds(\n\ttype: 'year' | 'month' | 'day',\n\tctx: { year: number; month: number },\n\tminDate: Date | undefined,\n\tmaxDate: Date | undefined\n): { min: number; max: number } {\n\tconst minP = minDate\n\t\t? {\n\t\t\t\tyear: minDate.getUTCFullYear(),\n\t\t\t\tmonth: minDate.getUTCMonth() + 1,\n\t\t\t\tday: minDate.getUTCDate(),\n\t\t\t}\n\t\t: null;\n\tconst maxP = maxDate\n\t\t? {\n\t\t\t\tyear: maxDate.getUTCFullYear(),\n\t\t\t\tmonth: maxDate.getUTCMonth() + 1,\n\t\t\t\tday: maxDate.getUTCDate(),\n\t\t\t}\n\t\t: null;\n\n\tif (type === 'year') {\n\t\treturn { min: minP?.year ?? 1, max: maxP?.year ?? 9999 };\n\t}\n\tif (type === 'month') {\n\t\treturn {\n\t\t\tmin: minP && ctx.year === minP.year ? minP.month : 1,\n\t\t\tmax: maxP && ctx.year === maxP.year ? maxP.month : 12,\n\t\t};\n\t}\n\treturn {\n\t\tmin: minP && ctx.year === minP.year && ctx.month === minP.month ? minP.day : 1,\n\t\tmax:\n\t\t\tmaxP && ctx.year === maxP.year && ctx.month === maxP.month\n\t\t\t\t? maxP.day\n\t\t\t\t: daysInMonth(ctx.year, ctx.month),\n\t};\n}\n\nexport interface DateOptions extends PromptOptions<Date, DatePrompt> {\n\tformat?: DateFormat;\n\tlocale?: string;\n\tseparator?: string;\n\tdefaultValue?: Date;\n\tinitialValue?: Date;\n\tminDate?: Date;\n\tmaxDate?: Date;\n}\n\nexport default class DatePrompt extends Prompt<Date> {\n\t#segments: SegmentConfig[];\n\t#separator: string;\n\t#segmentValues: DateParts;\n\t#minDate: Date | undefined;\n\t#maxDate: Date | undefined;\n\t#cursor = { segmentIndex: 0, positionInSegment: 0 };\n\t#segmentSelected = true;\n\t#pendingTensDigit: string | null = null;\n\n\tinlineError = '';\n\n\tget segmentCursor() {\n\t\treturn { ...this.#cursor };\n\t}\n\n\tget segmentValues(): DateParts {\n\t\treturn { ...this.#segmentValues };\n\t}\n\n\tget segments(): readonly SegmentConfig[] {\n\t\treturn this.#segments;\n\t}\n\n\tget separator(): string {\n\t\treturn this.#separator;\n\t}\n\n\tget formattedValue(): string {\n\t\treturn this.#format(this.#segmentValues);\n\t}\n\n\t#format(parts: DateParts): string {\n\t\treturn this.#segments.map((s) => parts[s.type]).join(this.#separator);\n\t}\n\n\t#refresh() {\n\t\tthis._setUserInput(this.#format(this.#segmentValues));\n\t\tthis._setValue(toDate(this.#segmentValues) ?? undefined);\n\t}\n\n\tconstructor(opts: DateOptions) {\n\t\tconst detected = opts.format\n\t\t\t? { segments: segmentsFor(opts.format), separator: opts.separator ?? '/' }\n\t\t\t: detectLocaleFormat(opts.locale);\n\t\tconst sep = opts.separator ?? detected.separator;\n\t\tconst segments = opts.format ? segmentsFor(opts.format) : detected.segments;\n\n\t\tconst initialDate = opts.initialValue ?? opts.defaultValue;\n\t\tconst segmentValues: DateParts = initialDate\n\t\t\t? {\n\t\t\t\t\tyear: String(initialDate.getUTCFullYear()).padStart(4, '0'),\n\t\t\t\t\tmonth: String(initialDate.getUTCMonth() + 1).padStart(2, '0'),\n\t\t\t\t\tday: String(initialDate.getUTCDate()).padStart(2, '0'),\n\t\t\t\t}\n\t\t\t: { year: '____', month: '__', day: '__' };\n\n\t\tconst initialDisplay = segments.map((s) => segmentValues[s.type]).join(sep);\n\n\t\tsuper({ ...opts, initialUserInput: initialDisplay }, false);\n\t\tthis.#segments = segments;\n\t\tthis.#separator = sep;\n\t\tthis.#segmentValues = segmentValues;\n\t\tthis.#minDate = opts.minDate;\n\t\tthis.#maxDate = opts.maxDate;\n\t\tthis.#refresh();\n\n\t\tthis.on('cursor', (key) => this.#onCursor(key));\n\t\tthis.on('key', (char, key) => this.#onKey(char, key));\n\t\tthis.on('finalize', () => this.#onFinalize(opts));\n\t}\n\n\t#seg(): { segment: SegmentConfig; index: number } | undefined {\n\t\tconst index = Math.max(0, Math.min(this.#cursor.segmentIndex, this.#segments.length - 1));\n\t\tconst segment = this.#segments[index];\n\t\tif (!segment) return undefined;\n\t\tthis.#cursor.positionInSegment = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.#cursor.positionInSegment, segment.len - 1)\n\t\t);\n\t\treturn { segment, index };\n\t}\n\n\t#navigate(direction: 1 | -1) {\n\t\tthis.inlineError = '';\n\t\tthis.#pendingTensDigit = null;\n\t\tconst ctx = this.#seg();\n\t\tif (!ctx) return;\n\t\tthis.#cursor.segmentIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.#segments.length - 1, ctx.index + direction)\n\t\t);\n\t\tthis.#cursor.positionInSegment = 0;\n\t\tthis.#segmentSelected = true;\n\t}\n\n\t#adjust(direction: 1 | -1) {\n\t\tconst ctx = this.#seg();\n\t\tif (!ctx) return;\n\t\tconst { segment } = ctx;\n\t\tconst raw = this.#segmentValues[segment.type];\n\t\tconst isBlank = !raw || raw.replace(/_/g, '') === '';\n\t\tconst num = Number.parseInt((raw || '0').replace(/_/g, '0'), 10) || 0;\n\t\tconst bounds = segmentBounds(\n\t\t\tsegment.type,\n\t\t\tparse(this.#segmentValues),\n\t\t\tthis.#minDate,\n\t\t\tthis.#maxDate\n\t\t);\n\n\t\tlet next: number;\n\t\tif (isBlank) {\n\t\t\tnext = direction === 1 ? bounds.min : bounds.max;\n\t\t} else {\n\t\t\tnext = Math.max(Math.min(bounds.max, num + direction), bounds.min);\n\t\t}\n\n\t\tthis.#segmentValues = {\n\t\t\t...this.#segmentValues,\n\t\t\t[segment.type]: next.toString().padStart(segment.len, '0'),\n\t\t};\n\t\tthis.#segmentSelected = true;\n\t\tthis.#pendingTensDigit = null;\n\t\tthis.#refresh();\n\t}\n\n\t#onCursor(key?: string) {\n\t\tif (!key) return;\n\t\tswitch (key) {\n\t\t\tcase 'right':\n\t\t\t\treturn this.#navigate(1);\n\t\t\tcase 'left':\n\t\t\t\treturn this.#navigate(-1);\n\t\t\tcase 'up':\n\t\t\t\treturn this.#adjust(1);\n\t\t\tcase 'down':\n\t\t\t\treturn this.#adjust(-1);\n\t\t}\n\t}\n\n\t#onKey(char: string | undefined, key: Key) {\n\t\t// Backspace\n\t\tconst isBackspace =\n\t\t\tkey?.name === 'backspace' ||\n\t\t\tkey?.sequence === '\\x7f' ||\n\t\t\tkey?.sequence === '\\b' ||\n\t\t\tchar === '\\x7f' ||\n\t\t\tchar === '\\b';\n\t\tif (isBackspace) {\n\t\t\tthis.inlineError = '';\n\t\t\tconst ctx = this.#seg();\n\t\t\tif (!ctx) return;\n\t\t\tif (!this.#segmentValues[ctx.segment.type].replace(/_/g, '')) {\n\t\t\t\tthis.#navigate(-1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#segmentValues[ctx.segment.type] = '_'.repeat(ctx.segment.len);\n\t\t\tthis.#segmentSelected = true;\n\t\t\tthis.#cursor.positionInSegment = 0;\n\t\t\tthis.#refresh();\n\t\t\treturn;\n\t\t}\n\n\t\t// Tab navigation\n\t\tif (key?.name === 'tab') {\n\t\t\tthis.inlineError = '';\n\t\t\tconst ctx = this.#seg();\n\t\t\tif (!ctx) return;\n\t\t\tconst dir = key.shift ? -1 : 1;\n\t\t\tconst next = ctx.index + dir;\n\t\t\tif (next >= 0 && next < this.#segments.length) {\n\t\t\t\tthis.#cursor.segmentIndex = next;\n\t\t\t\tthis.#cursor.positionInSegment = 0;\n\t\t\t\tthis.#segmentSelected = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Digit input\n\t\tif (char && /^[0-9]$/.test(char)) {\n\t\t\tconst ctx = this.#seg();\n\t\t\tif (!ctx) return;\n\t\t\tconst { segment } = ctx;\n\t\t\tconst isBlank = !this.#segmentValues[segment.type].replace(/_/g, '');\n\n\t\t\t// Pending tens digit: complete the two-digit entry\n\t\t\tif (this.#segmentSelected && this.#pendingTensDigit !== null && !isBlank) {\n\t\t\t\tconst newVal = this.#pendingTensDigit + char;\n\t\t\t\tconst newParts = { ...this.#segmentValues, [segment.type]: newVal };\n\t\t\t\tconst err = this.#validateSegment(newParts, segment);\n\t\t\t\tif (err) {\n\t\t\t\t\tthis.inlineError = err;\n\t\t\t\t\tthis.#pendingTensDigit = null;\n\t\t\t\t\tthis.#segmentSelected = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.inlineError = '';\n\t\t\t\tthis.#segmentValues[segment.type] = newVal;\n\t\t\t\tthis.#pendingTensDigit = null;\n\t\t\t\tthis.#segmentSelected = false;\n\t\t\t\tthis.#refresh();\n\t\t\t\tif (ctx.index < this.#segments.length - 1) {\n\t\t\t\t\tthis.#cursor.segmentIndex = ctx.index + 1;\n\t\t\t\t\tthis.#cursor.positionInSegment = 0;\n\t\t\t\t\tthis.#segmentSelected = true;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Clear-on-type: typing into a selected filled segment clears it first\n\t\t\tif (this.#segmentSelected && !isBlank) {\n\t\t\t\tthis.#segmentValues[segment.type] = '_'.repeat(segment.len);\n\t\t\t\tthis.#cursor.positionInSegment = 0;\n\t\t\t}\n\t\t\tthis.#segmentSelected = false;\n\t\t\tthis.#pendingTensDigit = null;\n\n\t\t\tconst display = this.#segmentValues[segment.type];\n\t\t\tconst firstBlank = display.indexOf('_');\n\t\t\tconst pos =\n\t\t\t\tfirstBlank >= 0 ? firstBlank : Math.min(this.#cursor.positionInSegment, segment.len - 1);\n\t\t\tif (pos < 0 || pos >= segment.len) return;\n\n\t\t\tlet newVal = display.slice(0, pos) + char + display.slice(pos + 1);\n\n\t\t\t// Smart digit placement\n\t\t\tlet shouldStaySelected = false;\n\t\t\tif (pos === 0 && display === '__' && (segment.type === 'month' || segment.type === 'day')) {\n\t\t\t\tconst digit = Number.parseInt(char, 10);\n\t\t\t\tnewVal = `0${char}`;\n\t\t\t\tshouldStaySelected = digit <= (segment.type === 'month' ? 1 : 2);\n\t\t\t}\n\t\t\tif (segment.type === 'year') {\n\t\t\t\tconst digits = display.replace(/_/g, '');\n\t\t\t\tnewVal = (digits + char).padStart(segment.len, '_');\n\t\t\t}\n\n\t\t\tif (!newVal.includes('_')) {\n\t\t\t\tconst newParts = { ...this.#segmentValues, [segment.type]: newVal };\n\t\t\t\tconst err = this.#validateSegment(newParts, segment);\n\t\t\t\tif (err) {\n\t\t\t\t\tthis.inlineError = err;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.inlineError = '';\n\n\t\t\tthis.#segmentValues[segment.type] = newVal;\n\n\t\t\t// Clamp only when the current segment is fully entered\n\t\t\tconst parsed = !newVal.includes('_') ? validParts(this.#segmentValues) : undefined;\n\t\t\tif (parsed) {\n\t\t\t\tconst { year, month } = parsed;\n\t\t\t\tconst maxDay = daysInMonth(year, month);\n\t\t\t\tthis.#segmentValues = {\n\t\t\t\t\tyear: String(Math.max(0, Math.min(9999, year))).padStart(4, '0'),\n\t\t\t\t\tmonth: String(Math.max(1, Math.min(12, month))).padStart(2, '0'),\n\t\t\t\t\tday: String(Math.max(1, Math.min(maxDay, parsed.day))).padStart(2, '0'),\n\t\t\t\t};\n\t\t\t}\n\t\t\tthis.#refresh();\n\n\t\t\t// Advance cursor\n\t\t\tconst nextBlank = newVal.indexOf('_');\n\t\t\tif (shouldStaySelected) {\n\t\t\t\tthis.#segmentSelected = true;\n\t\t\t\tthis.#pendingTensDigit = char;\n\t\t\t} else if (nextBlank >= 0) {\n\t\t\t\tthis.#cursor.positionInSegment = nextBlank;\n\t\t\t} else if (firstBlank >= 0 && ctx.index < this.#segments.length - 1) {\n\t\t\t\tthis.#cursor.segmentIndex = ctx.index + 1;\n\t\t\t\tthis.#cursor.positionInSegment = 0;\n\t\t\t\tthis.#segmentSelected = true;\n\t\t\t} else {\n\t\t\t\tthis.#cursor.positionInSegment = Math.min(pos + 1, segment.len - 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t#validateSegment(parts: DateParts, seg: SegmentConfig): string | undefined {\n\t\tconst { month, day } = parse(parts);\n\t\tif (seg.type === 'month' && (month < 0 || month > 12)) {\n\t\t\treturn settings.date.messages.invalidMonth;\n\t\t}\n\t\tif (seg.type === 'day' && (day < 0 || day > 31)) {\n\t\t\treturn settings.date.messages.invalidDay(31, 'any month');\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t#onFinalize(opts: DateOptions) {\n\t\tconst { year, month, day } = parse(this.#segmentValues);\n\t\tif (year && month && day) {\n\t\t\tconst maxDay = daysInMonth(year, month);\n\t\t\tthis.#segmentValues = {\n\t\t\t\t...this.#segmentValues,\n\t\t\t\tday: String(Math.min(day, maxDay)).padStart(2, '0'),\n\t\t\t};\n\t\t}\n\t\tthis.value = toDate(this.#segmentValues) ?? opts.defaultValue ?? undefined;\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<T['value'][], GroupMultiSelectPrompt<T>> {\n\toptions: Record<string, T[]>;\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n\tselectableGroups?: boolean;\n}\nexport default class GroupMultiSelectPrompt<T extends { value: any }> extends Prompt<T['value'][]> {\n\toptions: (T & { group: string | boolean })[];\n\tcursor = 0;\n\t#selectableGroups: boolean;\n\n\tgetGroupItems(group: string): T[] {\n\t\treturn this.options.filter((o) => o.group === group);\n\t}\n\n\tisGroupSelected(group: string) {\n\t\tconst items = this.getGroupItems(group);\n\t\tconst value = this.value;\n\t\tif (value === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn items.every((i) => value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\n\t\tif (item.group === true) {\n\t\t\tconst group = item.value;\n\t\t\tconst groupedItems = this.getGroupItems(group);\n\t\t\tif (this.isGroupSelected(group)) {\n\t\t\t\tthis.value = this.value.filter(\n\t\t\t\t\t(v: string) => groupedItems.findIndex((i) => i.value === v) === -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.value = [...this.value, ...groupedItems.map((i) => i.value)];\n\t\t\t}\n\t\t\tthis.value = Array.from(new Set(this.value));\n\t\t} else {\n\t\t\tconst selected = this.value.includes(item.value);\n\t\t\tthis.value = selected\n\t\t\t\t? this.value.filter((v: T['value']) => v !== item.value)\n\t\t\t\t: [...this.value, item.value];\n\t\t}\n\t}\n\n\tconstructor(opts: GroupMultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\t\tconst { options } = opts;\n\t\tthis.#selectableGroups = opts.selectableGroups !== false;\n\t\tthis.options = Object.entries(options).flatMap(([key, option]) => [\n\t\t\t{ value: key, group: true, label: key },\n\t\t\t...option.map((opt) => ({ ...opt, group: key })),\n\t\t]) as any;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\tthis.#selectableGroups ? 0 : 1\n\t\t);\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up': {\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tconst currentIsGroup = this.options[this.cursor]?.group === true;\n\t\t\t\t\tif (!this.#selectableGroups && currentIsGroup) {\n\t\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right': {\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tconst currentIsGroup = this.options[this.cursor]?.group === true;\n\t\t\t\t\tif (!this.#selectableGroups && currentIsGroup) {\n\t\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: any;\n\tdisabled?: boolean;\n}\n\nexport interface MultiSelectOptions<T extends OptionLike>\n\textends PromptOptions<T['value'][], MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value(): T['value'] {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate get _enabledOptions(): T[] {\n\t\treturn this.options.filter((option) => option.disabled !== true);\n\t}\n\n\tprivate toggleAll() {\n\t\tconst enabledOptions = this._enabledOptions;\n\t\tconst allSelected = this.value !== undefined && this.value.length === enabledOptions.length;\n\t\tthis.value = allSelected ? [] : enabledOptions.map((v) => v.value);\n\t}\n\n\tprivate toggleInvert() {\n\t\tconst value = this.value;\n\t\tif (!value) {\n\t\t\treturn;\n\t\t}\n\t\tconst notSelected = this._enabledOptions.filter((v) => !value.includes(v.value));\n\t\tthis.value = notSelected.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((value) => value !== this._value)\n\t\t\t: [...this.value, this._value];\n\t}\n\n\tconstructor(opts: MultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tconst cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\n\t\tthis.on('key', (char) => {\n\t\t\tif (char === 'a') {\n\t\t\t\tthis.toggleAll();\n\t\t\t}\n\t\t\tif (char === 'i') {\n\t\t\t\tthis.toggleInvert();\n\t\t\t}\n\t\t});\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = findCursor<T>(this.cursor, -1, this.options);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = findCursor<T>(this.cursor, 1, this.options);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n","import { styleText } from 'node:util';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt<string> {\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.userInput.replaceAll(/./g, this._mask);\n\t}\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\treturn this.masked;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.masked}${styleText(['inverse', 'hidden'], '_')}`;\n\t\t}\n\t\tconst masked = this.masked;\n\t\tconst s1 = masked.slice(0, this.cursor);\n\t\tconst s2 = masked.slice(this.cursor);\n\t\treturn `${s1}${styleText('inverse', s2[0])}${s2.slice(1)}`;\n\t}\n\tclear() {\n\t\tthis._clearUserInput();\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\n\t}\n}\n","import { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface SelectOptions<T extends { value: any; disabled?: boolean }>\n\textends PromptOptions<T['value'], SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any; disabled?: boolean }> extends Prompt<\n\tT['value']\n> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _selectedValue() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._selectedValue.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\n\t\tconst initialCursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tconst cursor = initialCursor === -1 ? 0 : initialCursor;\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\n\t\tthis.changeValue();\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = findCursor<T>(this.cursor, -1, this.options);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = findCursor<T>(this.cursor, 1, this.options);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.changeValue();\n\t\t});\n\t}\n}\n","import Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface SelectKeyOptions<T extends { value: string }>\n\textends PromptOptions<T['value'], SelectKeyPrompt<T>> {\n\toptions: T[];\n\tcaseSensitive?: boolean;\n}\nexport default class SelectKeyPrompt<T extends { value: string }> extends Prompt<T['value']> {\n\toptions: T[];\n\tcursor = 0;\n\n\tconstructor(opts: SelectKeyOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tconst caseSensitive = opts.caseSensitive === true;\n\t\tconst keys = this.options.map(({ value: [initial] }) => {\n\t\t\treturn caseSensitive ? initial : initial?.toLowerCase();\n\t\t});\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key, keyInfo) => {\n\t\t\tif (!key) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst casedKey = caseSensitive && keyInfo.shift ? key.toUpperCase() : key;\n\t\t\tif (!keys.includes(casedKey)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst value = this.options.find(({ value: [initial] }) => {\n\t\t\t\treturn caseSensitive ? initial === casedKey : initial?.toLowerCase() === key;\n\t\t\t});\n\t\t\tif (value) {\n\t\t\t\tthis.value = value.value;\n\t\t\t\tthis.state = 'submit';\n\t\t\t\tthis.emit('submit');\n\t\t\t}\n\t\t});\n\t}\n}\n","import { styleText } from 'node:util';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface TextOptions extends PromptOptions<string, TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt<string> {\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.userInput;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = userInput.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = userInput.slice(this.cursor);\n\t\treturn `${s1}${styleText('inverse', s2)}${s3.join('')}`;\n\t}\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tconstructor(opts: TextOptions) {\n\t\tsuper({\n\t\t\t...opts,\n\t\t\tinitialUserInput: opts.initialUserInput ?? opts.initialValue,\n\t\t});\n\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\n\t\tthis.on('finalize', () => {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.value = opts.defaultValue;\n\t\t\t}\n\t\t\tif (this.value === undefined) {\n\t\t\t\tthis.value = '';\n\t\t\t}\n\t\t});\n\t}\n}\n"],"names":["findCursor","cursor","delta","options","opt","newCursor","maxCursor","clampedCursor","actions","DEFAULT_MONTH_NAMES","settings","days","month","min","max","updateSettings","updates","aliases","alias","action","messages","date","isActionKey","key","value","diffLines","a","b","aLines","bLines","numLines","diff","i","isWindows","CANCEL_SYMBOL","isCancel","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","ReadStream","clear","data","name","sequence","str","dx","dy","getColumns","getRows","wrapTextWithPrefix","text","prefix","startPrefix","columns","wrapAnsi","line","index","g$1","trackValue","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","char","_key","write","problem","lines","frame","rows","diffOffsetAfter","diffOffsetBefore","diffLine","erase","adjustedDiffLine","newLines","getCursorForValue","selected","items","item","defaultFilter","option","normalisedValue","multiple","values","T$1","Prompt","#cursor","#lastUserInput","#filterFn","#options","#placeholder","styleText","s1","s2","s3","initialValues","selectedValue","selectedIndex","#onKey","#onUserInputChanged","_char","isUpKey","isDownKey","isReturnKey","isEmptyOrOnlyTab","placeholder","placeholderMatchesOption","v","valueCursor","focusedOption","ConfirmPrompt","confirm","SEGMENTS","segmentsFor","fmt","c","detectLocaleFormat","locale","parts","segments","separator","p","parseSegmentToNum","s","parse","daysInMonth","year","validParts","day","d","toDate","segmentBounds","type","ctx","minDate","maxDate","minP","maxP","DatePrompt","#segments","#separator","#segmentValues","#minDate","#maxDate","#segmentSelected","#pendingTensDigit","#format","#refresh","detected","sep","initialDate","segmentValues","initialDisplay","#onCursor","#onFinalize","#seg","segment","#navigate","direction","#adjust","raw","isBlank","num","bounds","next","dir","newVal","newParts","err","#validateSegment","display","firstBlank","pos","shouldStaySelected","digit","parsed","maxDay","nextBlank","seg","GroupMultiSelectPrompt","#selectableGroups","group","o","groupedItems","currentIsGroup","enabledOptions","allSelected","notSelected","PasswordPrompt","userInput","masked","mask","SelectPrompt","initialCursor","SelectKeyPrompt","caseSensit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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@clack/core",
|
| 3 |
+
"version": "1.2.0",
|
| 4 |
+
"type": "module",
|
| 5 |
+
"main": "./dist/index.mjs",
|
| 6 |
+
"module": "./dist/index.mjs",
|
| 7 |
+
"exports": {
|
| 8 |
+
".": {
|
| 9 |
+
"types": "./dist/index.d.mts",
|
| 10 |
+
"default": "./dist/index.mjs"
|
| 11 |
+
},
|
| 12 |
+
"./package.json": "./package.json"
|
| 13 |
+
},
|
| 14 |
+
"types": "./dist/index.d.mts",
|
| 15 |
+
"repository": {
|
| 16 |
+
"type": "git",
|
| 17 |
+
"url": "git+https://github.com/bombshell-dev/clack.git",
|
| 18 |
+
"directory": "packages/core"
|
| 19 |
+
},
|
| 20 |
+
"bugs": {
|
| 21 |
+
"url": "https://github.com/bombshell-dev/clack/issues"
|
| 22 |
+
},
|
| 23 |
+
"homepage": "https://github.com/bombshell-dev/clack/tree/main/packages/core#readme",
|
| 24 |
+
"files": [
|
| 25 |
+
"dist",
|
| 26 |
+
"CHANGELOG.md"
|
| 27 |
+
],
|
| 28 |
+
"keywords": [
|
| 29 |
+
"ask",
|
| 30 |
+
"clack",
|
| 31 |
+
"cli",
|
| 32 |
+
"command-line",
|
| 33 |
+
"command",
|
| 34 |
+
"input",
|
| 35 |
+
"interact",
|
| 36 |
+
"interface",
|
| 37 |
+
"menu",
|
| 38 |
+
"prompt",
|
| 39 |
+
"prompts",
|
| 40 |
+
"stdin",
|
| 41 |
+
"ui"
|
| 42 |
+
],
|
| 43 |
+
"author": {
|
| 44 |
+
"name": "Nate Moore",
|
| 45 |
+
"email": "nate@natemoo.re",
|
| 46 |
+
"url": "https://twitter.com/n_moore"
|
| 47 |
+
},
|
| 48 |
+
"license": "MIT",
|
| 49 |
+
"dependencies": {
|
| 50 |
+
"fast-wrap-ansi": "^0.1.3",
|
| 51 |
+
"sisteransi": "^1.0.5"
|
| 52 |
+
},
|
| 53 |
+
"devDependencies": {
|
| 54 |
+
"vitest": "^3.2.4"
|
| 55 |
+
},
|
| 56 |
+
"scripts": {
|
| 57 |
+
"build": "unbuild",
|
| 58 |
+
"test": "vitest run"
|
| 59 |
+
}
|
| 60 |
+
}
|
extensions/channels/node_modules/@clack/prompts/CHANGELOG.md
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @clack/prompts
|
| 2 |
+
|
| 3 |
+
## 1.2.0
|
| 4 |
+
|
| 5 |
+
### Minor Changes
|
| 6 |
+
|
| 7 |
+
- 9786226: Externalize `fast-string-width` and `fast-wrap-ansi` to avoid double dependencies
|
| 8 |
+
- 090902c: Adds `date` prompt with `format` support (YMD, MDY, DMY)
|
| 9 |
+
|
| 10 |
+
### Patch Changes
|
| 11 |
+
|
| 12 |
+
- 134a1a1: Fix the `path` prompt so `directory: true` correctly enforces directory-only selection while still allowing directory navigation, and add regression tests for both directory and default file selection behavior.
|
| 13 |
+
- bdf89a5: Adds `placeholder` option to `autocomplete`. When the placeholder is set and the input is empty, pressing `tab` will set the value to `placeholder`.
|
| 14 |
+
- 336495a: Apply guide to wrapped multi-line messages in confirm prompt.
|
| 15 |
+
- 9fe8de6: Respect `withGuide: false` in autocomplete and multiselect prompts.
|
| 16 |
+
- 29a50cb: Fix `path` directory mode so pressing Enter with an existing directory `initialValue` submits that current directory instead of the first child option, and add regression coverage for immediate submit and child-directory navigation.
|
| 17 |
+
- Updated dependencies [9786226]
|
| 18 |
+
- Updated dependencies [bdf89a5]
|
| 19 |
+
- Updated dependencies [417b451]
|
| 20 |
+
- Updated dependencies [090902c]
|
| 21 |
+
- @clack/core@1.2.0
|
| 22 |
+
|
| 23 |
+
## 1.1.0
|
| 24 |
+
|
| 25 |
+
### Minor Changes
|
| 26 |
+
|
| 27 |
+
- e3333fb: Replaces `picocolors` with Node.js built-in `styleText`.
|
| 28 |
+
|
| 29 |
+
### Patch Changes
|
| 30 |
+
|
| 31 |
+
- c3666e2: destruct `limitOption` param for better code readability, tweak types definitions
|
| 32 |
+
- ba3df8e: Fixes withGuide support in intro, outro, and cancel messages.
|
| 33 |
+
- Updated dependencies [e3333fb]
|
| 34 |
+
- @clack/core@1.1.0
|
| 35 |
+
|
| 36 |
+
## 1.0.1
|
| 37 |
+
|
| 38 |
+
### Patch Changes
|
| 39 |
+
|
| 40 |
+
- 6404dc1: Disallows selection of `disabled` options in autocomplete.
|
| 41 |
+
- 86e36d8: Adds `withGuide` support to select prompt.
|
| 42 |
+
- c697439: Fixes line wrapping behavior in autocomplete.
|
| 43 |
+
- 0ded19c: Simplifies `withGuide` option checks.
|
| 44 |
+
- 0e4ddc9: Fixes `withGuide` support in password and path prompts.
|
| 45 |
+
- 76550d6: Adds `withGuide` support to selectKey prompt.
|
| 46 |
+
- f9b9953: Adds `withGuide` support to password prompt.
|
| 47 |
+
- 0e93ccb: Adds `vertical` arrangement option to `confirm` prompt.
|
| 48 |
+
- 4e9ae13: Adds `withGuide` support to confirm prompt.
|
| 49 |
+
- 0256238: Adds `withGuide` support to spinner prompt.
|
| 50 |
+
- Updated dependencies [6404dc1]
|
| 51 |
+
- Updated dependencies [2533180]
|
| 52 |
+
- @clack/core@1.0.1
|
| 53 |
+
|
| 54 |
+
## 1.0.0
|
| 55 |
+
|
| 56 |
+
### Major Changes
|
| 57 |
+
|
| 58 |
+
- c713fd5: The package is now distributed as ESM-only. In `v0` releases, the package was dual-published as CJS and ESM.
|
| 59 |
+
|
| 60 |
+
For existing CJS projects using Node v20+, please see Node's guide on [Loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-ecmascript-modules-using-require).
|
| 61 |
+
|
| 62 |
+
### Minor Changes
|
| 63 |
+
|
| 64 |
+
- 415410b: This adds a custom filter function to autocompleteMultiselect. It could be used, for example, to support fuzzy searching logic.
|
| 65 |
+
- 7bc3301: Prompts now have a `userInput` stored separately from their `value`.
|
| 66 |
+
- 8409f2c: feat: add styleFrame option for spinner
|
| 67 |
+
- 2837845: Adds suggestion and path prompts
|
| 68 |
+
- 99c3530: Adds `format` option to the note prompt to allow formatting of individual lines
|
| 69 |
+
- 0aaee4c: Added new `taskLog` prompt for log output which is cleared on success
|
| 70 |
+
- 729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the `updateSettings` function to support multilingual CLIs.
|
| 71 |
+
|
| 72 |
+
This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.
|
| 73 |
+
|
| 74 |
+
```ts
|
| 75 |
+
// Per-instance customization
|
| 76 |
+
const spinner = prompts.spinner({
|
| 77 |
+
cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
|
| 78 |
+
errorMessage: "Se produjo un error", // "An error occurred" in Spanish
|
| 79 |
+
});
|
| 80 |
+
|
| 81 |
+
// Global customization via updateSettings
|
| 82 |
+
prompts.updateSettings({
|
| 83 |
+
messages: {
|
| 84 |
+
cancel: "Operación cancelada", // "Operation cancelled" in Spanish
|
| 85 |
+
error: "Se produjo un error", // "An error occurred" in Spanish
|
| 86 |
+
},
|
| 87 |
+
});
|
| 88 |
+
|
| 89 |
+
// Settings can now be accessed directly
|
| 90 |
+
console.log(prompts.settings.messages.cancel); // "Operación cancelada"
|
| 91 |
+
|
| 92 |
+
// Direct options take priority over global settings
|
| 93 |
+
const spinner = prompts.spinner({
|
| 94 |
+
cancelMessage: "Cancelled", // This will be used instead of the global setting
|
| 95 |
+
});
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
- 44df9af: Adds a new `groupSpacing` option to grouped multi-select prompts. If set to an integer greater than 0, it will add that number of new lines between each group.
|
| 99 |
+
- 55645c2: Support wrapping autocomplete and select prompts.
|
| 100 |
+
- 9e5bc6c: Add support for signals in prompts, allowing them to be aborted.
|
| 101 |
+
- f2c2b89: Adds `AutocompletePrompt` to core with comprehensive tests and implement both `autocomplete` and `autocomplete-multiselect` components in prompts package.
|
| 102 |
+
- 38019c7: Updates the API for stopping spinners and progress bars to be clearer
|
| 103 |
+
|
| 104 |
+
Previously, both the spinner and progress bar components used a single `stop` method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: `stop()`, `cancel()`, and `error()`:
|
| 105 |
+
|
| 106 |
+
```diff
|
| 107 |
+
const spinner = prompts.spinner();
|
| 108 |
+
spinner.start();
|
| 109 |
+
|
| 110 |
+
// Cancelling a spinner
|
| 111 |
+
- spinner.stop(undefined, 1);
|
| 112 |
+
+ spinner.cancel();
|
| 113 |
+
|
| 114 |
+
// Stopping with an error
|
| 115 |
+
- spinner.stop(undefined, 2);
|
| 116 |
+
+ spinner.error();
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
As before, you can pass a message to each method to customize the output displayed:
|
| 120 |
+
|
| 121 |
+
```js
|
| 122 |
+
spinner.cancel("Operation cancelled by user");
|
| 123 |
+
progressBar.error("An error occurred during processing");
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
- c45b9fb: Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations.
|
| 127 |
+
- f10071e: Using the `group` method, task logs can now have groups which themselves can have scrolling windows of logs.
|
| 128 |
+
- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt.
|
| 129 |
+
- 76fd17f: Added new `box` prompt for rendering boxed text, similar a note.
|
| 130 |
+
- 9a09318: Adds new `progress` prompt to display a progess-bar
|
| 131 |
+
- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails
|
| 132 |
+
- 9bd8072: Add a `required` option to autocomplete multiselect.
|
| 133 |
+
- 19558b9: Added support for custom frames in spinner prompt
|
| 134 |
+
|
| 135 |
+
### Patch Changes
|
| 136 |
+
|
| 137 |
+
- 46dc0a4: Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property.
|
| 138 |
+
- aea4573: Clamp scrolling windows to 5 rows.
|
| 139 |
+
- bfe0dd3: Prevents placeholder from being used as input value in text prompts
|
| 140 |
+
- 55eb280: Fix placeholder rendering when using autocomplete.
|
| 141 |
+
- 4d1d83b: Fixes rendering of multi-line messages and options in select prompt.
|
| 142 |
+
- 6176ced: Add withGuide support to note prompt
|
| 143 |
+
- 7b009df: Fix spinner clearing too many lines upwards when non-wrapping.
|
| 144 |
+
- 43aed55: Change styling of disabled multi-select options to have strikethrough.
|
| 145 |
+
- 17342d2: Exposes a new `SpinnerResult` type to describe the return type of `spinner`
|
| 146 |
+
- 282b39e: Wrap spinner output to allow for multi-line/wrapped messages.
|
| 147 |
+
- 2feaebb: Fix duplicated logs when scrolling through options with multiline messages by calculating `rowPadding` dynamically based on actual rendered lines instead of using a hardcoded value.
|
| 148 |
+
- 69681ea: Strip destructive ANSI codes from task log messages.
|
| 149 |
+
- b0fa7d8: Add support for wrapped messages in multi line prompts
|
| 150 |
+
- 9999adf: fix note component overflow bug
|
| 151 |
+
- 6868c1c: Adds a new `selectableGroups` boolean to the group multi-select prompt. Using `selectableGroups: false` will disable the ability to select a top-level group, but still allow every child to be selected individually.
|
| 152 |
+
- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs.
|
| 153 |
+
- 2839c66: fix(note): hard wrap text to column limit
|
| 154 |
+
- 7a556ad: Updates all prompts to accept a custom `output` and `input` stream
|
| 155 |
+
- 17d3650: Use a default import for picocolors to avoid run time errors in some environments.
|
| 156 |
+
- 7cc8a55: Messages passed to the `stop` method of a spinner no longer have dots stripped.
|
| 157 |
+
- b103ad3: Allow disabled options in multi-select and select prompts.
|
| 158 |
+
- 71b5029: Add missing nullish checks around values.
|
| 159 |
+
- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi
|
| 160 |
+
- f952592: Fixes missing guide when rendering empty log lines.
|
| 161 |
+
- 372b526: Add `clear` method to spinner for stopping and clearing.
|
| 162 |
+
- d25f6d0: fix(note, box): handle CJK correctly
|
| 163 |
+
- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value.
|
| 164 |
+
- 7530af0: Fixes wrapping of cancelled and success messages of select prompt
|
| 165 |
+
- 4c89dd7: chore: use more accurate type to replace any in group select
|
| 166 |
+
- 0b852e1: Handle `stop` calls on spinners which have not yet been started.
|
| 167 |
+
- 42adff8: fix: add missing guide line in autocomplete-multiselect
|
| 168 |
+
- 8e2e30a: fix: fix autocomplete bar color when validate
|
| 169 |
+
- 2048eb1: Fix spinner's dots behavior with custom frames
|
| 170 |
+
- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border
|
| 171 |
+
- 9b92161: Show symbol when withGuide is true for log messages
|
| 172 |
+
- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option
|
| 173 |
+
- 09e596c: refactor(progress): remove unnecessary return statement in start function
|
| 174 |
+
- 2310b43: Allow custom writables as output stream.
|
| 175 |
+
- ae84dd0: Update key binding text to show tab/space when navigating, and tab otherwise.
|
| 176 |
+
- Updated dependency on `@clack/core` to `1.0.0`
|
| 177 |
+
|
| 178 |
+
## 0.10.0
|
| 179 |
+
|
| 180 |
+
### Minor Changes
|
| 181 |
+
|
| 182 |
+
- 613179d: Adds a new `indicator` option to `spinner`, which supports the original `"dots"` loading animation or a new `"timer"` loading animation.
|
| 183 |
+
|
| 184 |
+
```ts
|
| 185 |
+
import * as p from "@clack/prompts";
|
| 186 |
+
|
| 187 |
+
const spin = p.spinner({ indicator: "timer" });
|
| 188 |
+
spin.start("Loading");
|
| 189 |
+
await sleep(3000);
|
| 190 |
+
spin.stop("Loaded");
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
- a38b2bc: Adds `stream` API which provides the same methods as `log`, but for iterable (even async) message streams. This is particularly useful for AI responses which are dynamically generated by LLMs.
|
| 194 |
+
|
| 195 |
+
```ts
|
| 196 |
+
import * as p from "@clack/prompts";
|
| 197 |
+
|
| 198 |
+
await p.stream.step(
|
| 199 |
+
(async function* () {
|
| 200 |
+
yield* generateLLMResponse(question);
|
| 201 |
+
})()
|
| 202 |
+
);
|
| 203 |
+
```
|
| 204 |
+
|
| 205 |
+
## 0.9.1
|
| 206 |
+
|
| 207 |
+
### Patch Changes
|
| 208 |
+
|
| 209 |
+
- 8093f3c: Adds `Error` support to the `validate` function
|
| 210 |
+
- 98925e3: Exports the `Option` type and improves JSDocannotations
|
| 211 |
+
- 1904e57: Replace custom utility for stripping ANSI control sequences with Node's built-in [`stripVTControlCharacters`](https://nodejs.org/docs/latest/api/util.html#utilstripvtcontrolcharactersstr) utility.
|
| 212 |
+
- Updated dependencies [8093f3c]
|
| 213 |
+
- Updated dependencies [e5ba09a]
|
| 214 |
+
- Updated dependencies [8cba8e3]
|
| 215 |
+
- @clack/core@0.4.1
|
| 216 |
+
|
| 217 |
+
## 0.9.0
|
| 218 |
+
|
| 219 |
+
### Minor Changes
|
| 220 |
+
|
| 221 |
+
- a83d2f8: Adds a new `updateSettings()` function to support new global keybindings.
|
| 222 |
+
|
| 223 |
+
`updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`).
|
| 224 |
+
|
| 225 |
+
```ts
|
| 226 |
+
import { updateSettings } from "@clack/prompts";
|
| 227 |
+
|
| 228 |
+
// Support custom keybindings
|
| 229 |
+
updateSettings({
|
| 230 |
+
aliases: {
|
| 231 |
+
w: "up",
|
| 232 |
+
a: "left",
|
| 233 |
+
s: "down",
|
| 234 |
+
d: "right",
|
| 235 |
+
},
|
| 236 |
+
});
|
| 237 |
+
```
|
| 238 |
+
|
| 239 |
+
> [!WARNING]
|
| 240 |
+
> In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings.
|
| 241 |
+
|
| 242 |
+
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
|
| 243 |
+
|
| 244 |
+
One example use case is automatically cancelling a prompt after a timeout.
|
| 245 |
+
|
| 246 |
+
```ts
|
| 247 |
+
const shouldContinue = await confirm({
|
| 248 |
+
message: "This message will self destruct in 5 seconds",
|
| 249 |
+
signal: AbortSignal.timeout(5000),
|
| 250 |
+
});
|
| 251 |
+
```
|
| 252 |
+
|
| 253 |
+
Another use case is racing a long running task with a manual prompt.
|
| 254 |
+
|
| 255 |
+
```ts
|
| 256 |
+
const abortController = new AbortController();
|
| 257 |
+
|
| 258 |
+
const projectType = await Promise.race([
|
| 259 |
+
detectProjectType({
|
| 260 |
+
signal: abortController.signal,
|
| 261 |
+
}),
|
| 262 |
+
select({
|
| 263 |
+
message: "Pick a project type.",
|
| 264 |
+
options: [
|
| 265 |
+
{ value: "ts", label: "TypeScript" },
|
| 266 |
+
{ value: "js", label: "JavaScript" },
|
| 267 |
+
{ value: "coffee", label: "CoffeeScript", hint: "oh no" },
|
| 268 |
+
],
|
| 269 |
+
signal: abortController.signal,
|
| 270 |
+
}),
|
| 271 |
+
]);
|
| 272 |
+
|
| 273 |
+
abortController.abort();
|
| 274 |
+
```
|
| 275 |
+
|
| 276 |
+
- a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`).
|
| 277 |
+
|
| 278 |
+
| alias | action |
|
| 279 |
+
| ----- | ------ |
|
| 280 |
+
| `k` | up |
|
| 281 |
+
| `l` | right |
|
| 282 |
+
| `j` | down |
|
| 283 |
+
| `h` | left |
|
| 284 |
+
| `esc` | cancel |
|
| 285 |
+
|
| 286 |
+
### Patch Changes
|
| 287 |
+
|
| 288 |
+
- f9f139d: Adapts `spinner` output for static CI environments
|
| 289 |
+
- Updated dependencies [a83d2f8]
|
| 290 |
+
- Updated dependencies [801246b]
|
| 291 |
+
- Updated dependencies [a83d2f8]
|
| 292 |
+
- Updated dependencies [51e12bc]
|
| 293 |
+
- @clack/core@0.4.0
|
| 294 |
+
|
| 295 |
+
## 0.8.2
|
| 296 |
+
|
| 297 |
+
### Patch Changes
|
| 298 |
+
|
| 299 |
+
- Updated dependencies [4845f4f]
|
| 300 |
+
- Updated dependencies [d7b2fb9]
|
| 301 |
+
- @clack/core@0.3.5
|
| 302 |
+
|
| 303 |
+
## 0.8.1
|
| 304 |
+
|
| 305 |
+
### Patch Changes
|
| 306 |
+
|
| 307 |
+
- 360afeb: feat: adaptative max items
|
| 308 |
+
|
| 309 |
+
## 0.8.0
|
| 310 |
+
|
| 311 |
+
### Minor Changes
|
| 312 |
+
|
| 313 |
+
- 9acccde: Add tasks function for executing tasks in spinners
|
| 314 |
+
|
| 315 |
+
### Patch Changes
|
| 316 |
+
|
| 317 |
+
- b5c6b9b: Feat multiselect maxItems option
|
| 318 |
+
- 50ed94a: fix: clear `spinner` hooks on `spinner.stop`
|
| 319 |
+
- Updated dependencies [a04e418]
|
| 320 |
+
- Updated dependencies [4f6fcf5]
|
| 321 |
+
- @clack/core@0.3.4
|
| 322 |
+
|
| 323 |
+
## 0.7.0
|
| 324 |
+
|
| 325 |
+
### Minor Changes
|
| 326 |
+
|
| 327 |
+
- b27a701: add maxItems option to select prompt
|
| 328 |
+
- 89371be: added a new method called `spinner.message(msg: string)`
|
| 329 |
+
|
| 330 |
+
### Patch Changes
|
| 331 |
+
|
| 332 |
+
- 52183c4: Fix `spinner` conflict with terminal on error between `spinner.start()` and `spinner.stop()`
|
| 333 |
+
- ab51d29: Fixes cases where the note title length was miscalculated due to ansi characters
|
| 334 |
+
- Updated dependencies [cd79076]
|
| 335 |
+
- @clack/core@0.3.3
|
| 336 |
+
|
| 337 |
+
## 0.6.3
|
| 338 |
+
|
| 339 |
+
### Patch Changes
|
| 340 |
+
|
| 341 |
+
- c96eda5: Enable hard line-wrapping behavior for long words without spaces
|
| 342 |
+
- Updated dependencies [c96eda5]
|
| 343 |
+
- @clack/core@0.3.2
|
| 344 |
+
|
| 345 |
+
## 0.6.2
|
| 346 |
+
|
| 347 |
+
### Patch Changes
|
| 348 |
+
|
| 349 |
+
- 58a1df1: Fix line duplication bug by automatically wrapping prompts to `process.stdout.columns`
|
| 350 |
+
- Updated dependencies [58a1df1]
|
| 351 |
+
- @clack/core@0.3.1
|
| 352 |
+
|
| 353 |
+
## 0.6.1
|
| 354 |
+
|
| 355 |
+
### Patch Changes
|
| 356 |
+
|
| 357 |
+
- ca08fb6: Support complex value types for `select`, `multiselect` and `groupMultiselect`.
|
| 358 |
+
|
| 359 |
+
## 0.6.0
|
| 360 |
+
|
| 361 |
+
### Minor Changes
|
| 362 |
+
|
| 363 |
+
- 8a4a12f: add `groupMultiselect` prompt
|
| 364 |
+
- 165a1b3: Add `log` APIs. Supports `log.info`, `log.success`, `log.warn`, and `log.error`. For low-level control, `log.message` is also exposed.
|
| 365 |
+
|
| 366 |
+
### Patch Changes
|
| 367 |
+
|
| 368 |
+
- Updated dependencies [8a4a12f]
|
| 369 |
+
- Updated dependencies [8a4a12f]
|
| 370 |
+
- @clack/core@0.3.0
|
| 371 |
+
|
| 372 |
+
## 0.5.1
|
| 373 |
+
|
| 374 |
+
### Patch Changes
|
| 375 |
+
|
| 376 |
+
- cc11917: Update default `password` mask
|
| 377 |
+
- Updated dependencies [ec812b6]
|
| 378 |
+
- @clack/core@0.2.1
|
| 379 |
+
|
| 380 |
+
## 0.5.0
|
| 381 |
+
|
| 382 |
+
### Minor Changes
|
| 383 |
+
|
| 384 |
+
- d74dd05: Adds a `selectKey` prompt type
|
| 385 |
+
- 54c1bc3: **Breaking Change** `multiselect` has renamed `initialValue` to `initialValues`
|
| 386 |
+
|
| 387 |
+
### Patch Changes
|
| 388 |
+
|
| 389 |
+
- Updated dependencies [d74dd05]
|
| 390 |
+
- Updated dependencies [54c1bc3]
|
| 391 |
+
- @clack/core@0.2.0
|
| 392 |
+
|
| 393 |
+
## 0.4.5
|
| 394 |
+
|
| 395 |
+
### Patch Changes
|
| 396 |
+
|
| 397 |
+
- 1251132: Multiselect: return `Value[]` instead of `Option[]`.
|
| 398 |
+
- 8994382: Add a password prompt to `@clack/prompts`
|
| 399 |
+
- Updated dependencies [1251132]
|
| 400 |
+
- Updated dependencies [8994382]
|
| 401 |
+
- @clack/core@0.1.9
|
| 402 |
+
|
| 403 |
+
## 0.4.4
|
| 404 |
+
|
| 405 |
+
### Patch Changes
|
| 406 |
+
|
| 407 |
+
- d96071c: Don't mutate `initialValue` in `multiselect`, fix parameter type for `validate()`.
|
| 408 |
+
|
| 409 |
+
Credits to @banjo for the bug report and initial PR!
|
| 410 |
+
|
| 411 |
+
- Updated dependencies [d96071c]
|
| 412 |
+
- @clack/core@0.1.8
|
| 413 |
+
|
| 414 |
+
## 0.4.3
|
| 415 |
+
|
| 416 |
+
### Patch Changes
|
| 417 |
+
|
| 418 |
+
- 83d890e: Fix text cancel display bug
|
| 419 |
+
|
| 420 |
+
## 0.4.2
|
| 421 |
+
|
| 422 |
+
### Patch Changes
|
| 423 |
+
|
| 424 |
+
- Update README
|
| 425 |
+
|
| 426 |
+
## 0.4.1
|
| 427 |
+
|
| 428 |
+
### Patch Changes
|
| 429 |
+
|
| 430 |
+
- 7fb5375: Adds a new `defaultValue` option to the text prompt, removes automatic usage of the placeholder value.
|
| 431 |
+
- Updated dependencies [7fb5375]
|
| 432 |
+
- @clack/core@0.1.6
|
| 433 |
+
|
| 434 |
+
## 0.4.0
|
| 435 |
+
|
| 436 |
+
### Minor Changes
|
| 437 |
+
|
| 438 |
+
- 61b88b6: Add `group` construct to group many prompts together
|
| 439 |
+
|
| 440 |
+
### Patch Changes
|
| 441 |
+
|
| 442 |
+
- de1314e: Support `required` option for multi-select
|
| 443 |
+
- Updated dependencies [de1314e]
|
| 444 |
+
- @clack/core@0.1.5
|
| 445 |
+
|
| 446 |
+
## 0.3.0
|
| 447 |
+
|
| 448 |
+
### Minor Changes
|
| 449 |
+
|
| 450 |
+
- 493c592: Improve types for select/multiselect prompts. Numbers and booleans are now supported as the `value` option.
|
| 451 |
+
- 15558e3: Improved Windows/non-unicode support
|
| 452 |
+
|
| 453 |
+
### Patch Changes
|
| 454 |
+
|
| 455 |
+
- ca77da1: Fix multiselect initial value logic
|
| 456 |
+
- Updated dependencies [ca77da1]
|
| 457 |
+
- Updated dependencies [8aed606]
|
| 458 |
+
- @clack/core@0.1.4
|
| 459 |
+
|
| 460 |
+
## 0.2.2
|
| 461 |
+
|
| 462 |
+
### Patch Changes
|
| 463 |
+
|
| 464 |
+
- 94b24d9: Fix CJS `ansi-regex` interop
|
| 465 |
+
|
| 466 |
+
## 0.2.1
|
| 467 |
+
|
| 468 |
+
### Patch Changes
|
| 469 |
+
|
| 470 |
+
- a99c458: Support `initialValue` option for text prompt
|
| 471 |
+
- Updated dependencies [a99c458]
|
| 472 |
+
- @clack/core@0.1.3
|
| 473 |
+
|
| 474 |
+
## 0.2.0
|
| 475 |
+
|
| 476 |
+
### Minor Changes
|
| 477 |
+
|
| 478 |
+
- Improved type safety
|
| 479 |
+
- b1341d6: Updated styles, new note component
|
| 480 |
+
|
| 481 |
+
### Patch Changes
|
| 482 |
+
|
| 483 |
+
- Updated dependencies [7dcad8f]
|
| 484 |
+
- Updated dependencies [2242f13]
|
| 485 |
+
- Updated dependencies [b1341d6]
|
| 486 |
+
- @clack/core@0.1.2
|
| 487 |
+
|
| 488 |
+
## 0.1.1
|
| 489 |
+
|
| 490 |
+
### Patch Changes
|
| 491 |
+
|
| 492 |
+
- fa09bf5: Use circle for radio, square for checkbox
|
| 493 |
+
- Updated dependencies [4be7dbf]
|
| 494 |
+
- Updated dependencies [b480679]
|
| 495 |
+
- @clack/core@0.1.1
|
| 496 |
+
|
| 497 |
+
## 0.1.0
|
| 498 |
+
|
| 499 |
+
### Minor Changes
|
| 500 |
+
|
| 501 |
+
- 7015ec9: Create new prompt: multi-select
|
| 502 |
+
|
| 503 |
+
### Patch Changes
|
| 504 |
+
|
| 505 |
+
- Updated dependencies [7015ec9]
|
| 506 |
+
- @clack/core@0.1.0
|
| 507 |
+
|
| 508 |
+
## 0.0.10
|
| 509 |
+
|
| 510 |
+
### Patch Changes
|
| 511 |
+
|
| 512 |
+
- e0b49e5: Update spinner so it actually spins
|
| 513 |
+
|
| 514 |
+
## 0.0.9
|
| 515 |
+
|
| 516 |
+
### Patch Changes
|
| 517 |
+
|
| 518 |
+
- Update README
|
| 519 |
+
|
| 520 |
+
## 0.0.8
|
| 521 |
+
|
| 522 |
+
### Patch Changes
|
| 523 |
+
|
| 524 |
+
- Updated dependencies [9d371c3]
|
| 525 |
+
- @clack/core@0.0.12
|
| 526 |
+
|
| 527 |
+
## 0.0.7
|
| 528 |
+
|
| 529 |
+
### Patch Changes
|
| 530 |
+
|
| 531 |
+
- Update README
|
| 532 |
+
|
| 533 |
+
## 0.0.6
|
| 534 |
+
|
| 535 |
+
### Patch Changes
|
| 536 |
+
|
| 537 |
+
- d20ef2a: Update keywords, URLs
|
| 538 |
+
- Updated dependencies [441d5b7]
|
| 539 |
+
- Updated dependencies [d20ef2a]
|
| 540 |
+
- Updated dependencies [fe13c2f]
|
| 541 |
+
- @clack/core@0.0.11
|
| 542 |
+
|
| 543 |
+
## 0.0.5
|
| 544 |
+
|
| 545 |
+
### Patch Changes
|
| 546 |
+
|
| 547 |
+
- Update README
|
| 548 |
+
|
| 549 |
+
## 0.0.4
|
| 550 |
+
|
| 551 |
+
### Patch Changes
|
| 552 |
+
|
| 553 |
+
- 80404ab: Update README
|
| 554 |
+
|
| 555 |
+
## 0.0.3
|
| 556 |
+
|
| 557 |
+
### Patch Changes
|
| 558 |
+
|
| 559 |
+
- a0cb382: Add `main` entrypoint
|
| 560 |
+
- Updated dependencies [a0cb382]
|
| 561 |
+
- @clack/core@0.0.10
|
| 562 |
+
|
| 563 |
+
## 0.0.2
|
| 564 |
+
|
| 565 |
+
### Patch Changes
|
| 566 |
+
|
| 567 |
+
- Updated dependencies
|
| 568 |
+
- @clack/core@0.0.9
|
| 569 |
+
|
| 570 |
+
## 0.0.1
|
| 571 |
+
|
| 572 |
+
### Patch Changes
|
| 573 |
+
|
| 574 |
+
- a4b5e13: Initial release
|
| 575 |
+
- Updated dependencies [a4b5e13]
|
| 576 |
+
- @clack/core@0.0.8
|
extensions/channels/node_modules/@clack/prompts/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) Nate Moore
|
| 4 |
+
|
| 5 |
+
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:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
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, TOR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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `@clack/prompts`
|
| 2 |
+
|
| 3 |
+
Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)
|
| 4 |
+
|
| 5 |
+

|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
`@clack/prompts` is an opinionated, pre-styled wrapper around [`@clack/core`](https://www.npmjs.com/package/@clack/core).
|
| 10 |
+
|
| 11 |
+
- 🤏 80% smaller than other options
|
| 12 |
+
- 💎 Beautiful, minimal UI
|
| 13 |
+
- ✅ Simple API
|
| 14 |
+
- 🧱 Comes with `text`, `confirm`, `select`, `multiselect`, and `spinner` components
|
| 15 |
+
|
| 16 |
+
## Basics
|
| 17 |
+
|
| 18 |
+
### Setup
|
| 19 |
+
|
| 20 |
+
The `intro` and `outro` functions will print a message to begin or end a prompt session, respectively.
|
| 21 |
+
|
| 22 |
+
```js
|
| 23 |
+
import { intro, outro } from '@clack/prompts';
|
| 24 |
+
|
| 25 |
+
intro(`create-my-app`);
|
| 26 |
+
// Do stuff
|
| 27 |
+
outro(`You're all set!`);
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
### Cancellation
|
| 31 |
+
|
| 32 |
+
The `isCancel` function is a guard that detects when a user cancels a question with `CTRL + C`. You should handle this situation for each prompt, optionally providing a nice cancellation message with the `cancel` utility.
|
| 33 |
+
|
| 34 |
+
```js
|
| 35 |
+
import { isCancel, cancel, text } from '@clack/prompts';
|
| 36 |
+
|
| 37 |
+
const value = await text({
|
| 38 |
+
message: 'What is the meaning of life?',
|
| 39 |
+
});
|
| 40 |
+
|
| 41 |
+
if (isCancel(value)) {
|
| 42 |
+
cancel('Operation cancelled.');
|
| 43 |
+
process.exit(0);
|
| 44 |
+
}
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Components
|
| 48 |
+
|
| 49 |
+
### Text
|
| 50 |
+
|
| 51 |
+
The text component accepts a single line of text.
|
| 52 |
+
|
| 53 |
+
```js
|
| 54 |
+
import { text } from '@clack/prompts';
|
| 55 |
+
|
| 56 |
+
const meaning = await text({
|
| 57 |
+
message: 'What is the meaning of life?',
|
| 58 |
+
placeholder: 'Not sure',
|
| 59 |
+
initialValue: '42',
|
| 60 |
+
validate(value) {
|
| 61 |
+
if (value.length === 0) return `Value is required!`;
|
| 62 |
+
},
|
| 63 |
+
});
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### Confirm
|
| 67 |
+
|
| 68 |
+
The confirm component accepts a yes or no answer. The result is a boolean value of `true` or `false`.
|
| 69 |
+
|
| 70 |
+
```js
|
| 71 |
+
import { confirm } from '@clack/prompts';
|
| 72 |
+
|
| 73 |
+
const shouldContinue = await confirm({
|
| 74 |
+
message: 'Do you want to continue?',
|
| 75 |
+
});
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### Select
|
| 79 |
+
|
| 80 |
+
The select component allows a user to choose one value from a list of options. The result is the `value` prop of a given option.
|
| 81 |
+
|
| 82 |
+
```js
|
| 83 |
+
import { select } from '@clack/prompts';
|
| 84 |
+
|
| 85 |
+
const projectType = await select({
|
| 86 |
+
message: 'Pick a project type.',
|
| 87 |
+
options: [
|
| 88 |
+
{ value: 'ts', label: 'TypeScript' },
|
| 89 |
+
{ value: 'js', label: 'JavaScript', disabled: true },
|
| 90 |
+
{ value: 'coffee', label: 'CoffeeScript', hint: 'oh no' },
|
| 91 |
+
],
|
| 92 |
+
});
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Multi-Select
|
| 96 |
+
|
| 97 |
+
The `multiselect` component allows a user to choose many values from a list of options. The result is an array with all selected `value` props.
|
| 98 |
+
|
| 99 |
+
```js
|
| 100 |
+
import { multiselect } from '@clack/prompts';
|
| 101 |
+
|
| 102 |
+
const additionalTools = await multiselect({
|
| 103 |
+
message: 'Select additional tools.',
|
| 104 |
+
options: [
|
| 105 |
+
{ value: 'eslint', label: 'ESLint', hint: 'recommended' },
|
| 106 |
+
{ value: 'prettier', label: 'Prettier', disabled: true },
|
| 107 |
+
{ value: 'gh-action', label: 'GitHub Action' },
|
| 108 |
+
],
|
| 109 |
+
required: false,
|
| 110 |
+
});
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
It is also possible to select multiple items arranged into hierarchy by using `groupMultiselect`:
|
| 114 |
+
|
| 115 |
+
```js
|
| 116 |
+
import { groupMultiselect } from '@clack/prompts';
|
| 117 |
+
|
| 118 |
+
const basket = await groupMultiselect({
|
| 119 |
+
message: 'Select your favorite fruits and vegetables:',
|
| 120 |
+
options: {
|
| 121 |
+
fruits: [
|
| 122 |
+
{ value: 'apple', label: 'apple' },
|
| 123 |
+
{ value: 'banana', label: 'banana' },
|
| 124 |
+
{ value: 'cherry', label: 'cherry' },
|
| 125 |
+
],
|
| 126 |
+
vegetables: [
|
| 127 |
+
{ value: 'carrot', label: 'carrot' },
|
| 128 |
+
{ value: 'spinach', label: 'spinach' },
|
| 129 |
+
{ value: 'potato', label: 'potato' },
|
| 130 |
+
]
|
| 131 |
+
}
|
| 132 |
+
});
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
### Spinner
|
| 136 |
+
|
| 137 |
+
The spinner component surfaces a pending action, such as a long-running download or dependency installation.
|
| 138 |
+
|
| 139 |
+
```js
|
| 140 |
+
import { spinner } from '@clack/prompts';
|
| 141 |
+
|
| 142 |
+
const s = spinner();
|
| 143 |
+
s.start('Installing via npm');
|
| 144 |
+
// Do installation here
|
| 145 |
+
s.stop('Installed via npm');
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
### Progress
|
| 149 |
+
|
| 150 |
+
The progress component extends the spinner component to add a progress bar to visualize the progression of an action.
|
| 151 |
+
|
| 152 |
+
```js
|
| 153 |
+
import { progress } from '@clack/prompts';
|
| 154 |
+
|
| 155 |
+
const p = progress({ max: 10 });
|
| 156 |
+
p.start('Downloading archive');
|
| 157 |
+
// Do download here
|
| 158 |
+
p.advance(3, 'Downloading (30%)');
|
| 159 |
+
// ...
|
| 160 |
+
p.advance(8, 'Downloading (80%)');
|
| 161 |
+
// ...
|
| 162 |
+
p.stop('Archive downloaded');
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
## Utilities
|
| 166 |
+
|
| 167 |
+
### Grouping
|
| 168 |
+
|
| 169 |
+
Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
|
| 170 |
+
|
| 171 |
+
```js
|
| 172 |
+
import * as p from '@clack/prompts';
|
| 173 |
+
|
| 174 |
+
const group = await p.group(
|
| 175 |
+
{
|
| 176 |
+
name: () => p.text({ message: 'What is your name?' }),
|
| 177 |
+
age: () => p.text({ message: 'What is your age?' }),
|
| 178 |
+
color: ({ results }) =>
|
| 179 |
+
p.multiselect({
|
| 180 |
+
message: `What is your favorite color ${results.name}?`,
|
| 181 |
+
options: [
|
| 182 |
+
{ value: 'red', label: 'Red' },
|
| 183 |
+
{ value: 'green', label: 'Green' },
|
| 184 |
+
{ value: 'blue', label: 'Blue' },
|
| 185 |
+
],
|
| 186 |
+
}),
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
// On Cancel callback that wraps the group
|
| 190 |
+
// So if the user cancels one of the prompts in the group this function will be called
|
| 191 |
+
onCancel: ({ results }) => {
|
| 192 |
+
p.cancel('Operation cancelled.');
|
| 193 |
+
process.exit(0);
|
| 194 |
+
},
|
| 195 |
+
}
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
console.log(group.name, group.age, group.color);
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
### Tasks
|
| 202 |
+
|
| 203 |
+
Execute multiple tasks in spinners.
|
| 204 |
+
|
| 205 |
+
```js
|
| 206 |
+
import { tasks } from '@clack/prompts';
|
| 207 |
+
|
| 208 |
+
await tasks([
|
| 209 |
+
{
|
| 210 |
+
title: 'Installing via npm',
|
| 211 |
+
task: async (message) => {
|
| 212 |
+
// Do installation here
|
| 213 |
+
return 'Installed via npm';
|
| 214 |
+
},
|
| 215 |
+
},
|
| 216 |
+
]);
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
### Logs
|
| 220 |
+
|
| 221 |
+
```js
|
| 222 |
+
import { log } from '@clack/prompts';
|
| 223 |
+
|
| 224 |
+
log.info('Info!');
|
| 225 |
+
log.success('Success!');
|
| 226 |
+
log.step('Step!');
|
| 227 |
+
log.warn('Warn!');
|
| 228 |
+
log.error('Error!');
|
| 229 |
+
log.message('Hello, World', { symbol: color.cyan('~') });
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
### Stream
|
| 234 |
+
|
| 235 |
+
When interacting with dynamic LLMs or other streaming message providers, use the `stream` APIs to log messages from an iterable, even an async one.
|
| 236 |
+
|
| 237 |
+
```js
|
| 238 |
+
import { stream } from '@clack/prompts';
|
| 239 |
+
|
| 240 |
+
stream.info((function *() { yield 'Info!'; })());
|
| 241 |
+
stream.success((function *() { yield 'Success!'; })());
|
| 242 |
+
stream.step((function *() { yield 'Step!'; })());
|
| 243 |
+
stream.warn((function *() { yield 'Warn!'; })());
|
| 244 |
+
stream.error((function *() { yield 'Error!'; })());
|
| 245 |
+
stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') });
|
| 246 |
+
```
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
|
| 250 |
+
### Task Log
|
| 251 |
+
|
| 252 |
+
When executing a sub-process or a similar sub-task, `taskLog` can be used to render the output continuously and clear it at the end if it was successful.
|
| 253 |
+
|
| 254 |
+
```js
|
| 255 |
+
import { taskLog } from '@clack/prompts';
|
| 256 |
+
|
| 257 |
+
const log = taskLog({
|
| 258 |
+
title: 'Running npm install'
|
| 259 |
+
});
|
| 260 |
+
|
| 261 |
+
for await (const line of npmInstall()) {
|
| 262 |
+
log.message(line);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
if (success) {
|
| 266 |
+
log.success('Done!');
|
| 267 |
+
} else {
|
| 268 |
+
log.error('Failed!');
|
| 269 |
+
}
|
| 270 |
+
```
|
extensions/channels/node_modules/@clack/prompts/dist/index.d.mts
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { State, AutocompletePrompt, DateFormat } from '@clack/core';
|
| 2 |
+
export { ClackSettings, DateFormat, isCancel, settings, updateSettings } from '@clack/core';
|
| 3 |
+
import { Readable, Writable } from 'node:stream';
|
| 4 |
+
|
| 5 |
+
declare const unicode: boolean;
|
| 6 |
+
declare const isCI: () => boolean;
|
| 7 |
+
declare const isTTY: (output: Writable) => boolean;
|
| 8 |
+
declare const unicodeOr: (c: string, fallback: string) => string;
|
| 9 |
+
declare const S_STEP_ACTIVE: string;
|
| 10 |
+
declare const S_STEP_CANCEL: string;
|
| 11 |
+
declare const S_STEP_ERROR: string;
|
| 12 |
+
declare const S_STEP_SUBMIT: string;
|
| 13 |
+
declare const S_BAR_START: string;
|
| 14 |
+
declare const S_BAR: string;
|
| 15 |
+
declare const S_BAR_END: string;
|
| 16 |
+
declare const S_BAR_START_RIGHT: string;
|
| 17 |
+
declare const S_BAR_END_RIGHT: string;
|
| 18 |
+
declare const S_RADIO_ACTIVE: string;
|
| 19 |
+
declare const S_RADIO_INACTIVE: string;
|
| 20 |
+
declare const S_CHECKBOX_ACTIVE: string;
|
| 21 |
+
declare const S_CHECKBOX_SELECTED: string;
|
| 22 |
+
declare const S_CHECKBOX_INACTIVE: string;
|
| 23 |
+
declare const S_PASSWORD_MASK: string;
|
| 24 |
+
declare const S_BAR_H: string;
|
| 25 |
+
declare const S_CORNER_TOP_RIGHT: string;
|
| 26 |
+
declare const S_CONNECT_LEFT: string;
|
| 27 |
+
declare const S_CORNER_BOTTOM_RIGHT: string;
|
| 28 |
+
declare const S_CORNER_BOTTOM_LEFT: string;
|
| 29 |
+
declare const S_CORNER_TOP_LEFT: string;
|
| 30 |
+
declare const S_INFO: string;
|
| 31 |
+
declare const S_SUCCESS: string;
|
| 32 |
+
declare const S_WARN: string;
|
| 33 |
+
declare const S_ERROR: string;
|
| 34 |
+
declare const symbol: (state: State) => string;
|
| 35 |
+
declare const symbolBar: (state: State) => string;
|
| 36 |
+
interface CommonOptions {
|
| 37 |
+
input?: Readable;
|
| 38 |
+
output?: Writable;
|
| 39 |
+
signal?: AbortSignal;
|
| 40 |
+
withGuide?: boolean;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
type Primitive = Readonly<string | boolean | number>;
|
| 44 |
+
type Option<Value> = Value extends Primitive ? {
|
| 45 |
+
/**
|
| 46 |
+
* Internal data for this option.
|
| 47 |
+
*/
|
| 48 |
+
value: Value;
|
| 49 |
+
/**
|
| 50 |
+
* The optional, user-facing text for this option.
|
| 51 |
+
*
|
| 52 |
+
* By default, the `value` is converted to a string.
|
| 53 |
+
*/
|
| 54 |
+
label?: string;
|
| 55 |
+
/**
|
| 56 |
+
* An optional hint to display to the user when
|
| 57 |
+
* this option might be selected.
|
| 58 |
+
*
|
| 59 |
+
* By default, no `hint` is displayed.
|
| 60 |
+
*/
|
| 61 |
+
hint?: string;
|
| 62 |
+
/**
|
| 63 |
+
* Whether this option is disabled.
|
| 64 |
+
* Disabled options are visible but cannot be selected.
|
| 65 |
+
*
|
| 66 |
+
* By default, options are not disabled.
|
| 67 |
+
*/
|
| 68 |
+
disabled?: boolean;
|
| 69 |
+
} : {
|
| 70 |
+
/**
|
| 71 |
+
* Internal data for this option.
|
| 72 |
+
*/
|
| 73 |
+
value: Value;
|
| 74 |
+
/**
|
| 75 |
+
* Required. The user-facing text for this option.
|
| 76 |
+
*/
|
| 77 |
+
label: string;
|
| 78 |
+
/**
|
| 79 |
+
* An optional hint to display to the user when
|
| 80 |
+
* this option might be selected.
|
| 81 |
+
*
|
| 82 |
+
* By default, no `hint` is displayed.
|
| 83 |
+
*/
|
| 84 |
+
hint?: string;
|
| 85 |
+
/**
|
| 86 |
+
* Whether this option is disabled.
|
| 87 |
+
* Disabled options are visible but cannot be selected.
|
| 88 |
+
*
|
| 89 |
+
* By default, options are not disabled.
|
| 90 |
+
*/
|
| 91 |
+
disabled?: boolean;
|
| 92 |
+
};
|
| 93 |
+
interface SelectOptions<Value> extends CommonOptions {
|
| 94 |
+
message: string;
|
| 95 |
+
options: Option<Value>[];
|
| 96 |
+
initialValue?: Value;
|
| 97 |
+
maxItems?: number;
|
| 98 |
+
}
|
| 99 |
+
declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
|
| 100 |
+
|
| 101 |
+
interface AutocompleteSharedOptions<Value> extends CommonOptions {
|
| 102 |
+
/**
|
| 103 |
+
* The message to display to the user.
|
| 104 |
+
*/
|
| 105 |
+
message: string;
|
| 106 |
+
/**
|
| 107 |
+
* Available options for the autocomplete prompt.
|
| 108 |
+
*/
|
| 109 |
+
options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
|
| 110 |
+
/**
|
| 111 |
+
* Maximum number of items to display at once.
|
| 112 |
+
*/
|
| 113 |
+
maxItems?: number;
|
| 114 |
+
/**
|
| 115 |
+
* Placeholder text to display when no input is provided.
|
| 116 |
+
*/
|
| 117 |
+
placeholder?: string;
|
| 118 |
+
/**
|
| 119 |
+
* Validates the value
|
| 120 |
+
*/
|
| 121 |
+
validate?: (value: Value | Value[] | undefined) => string | Error | undefined;
|
| 122 |
+
/**
|
| 123 |
+
* Custom filter function to match options against search input.
|
| 124 |
+
* If not provided, a default filter that matches label, hint, and value is used.
|
| 125 |
+
*/
|
| 126 |
+
filter?: (search: string, option: Option<Value>) => boolean;
|
| 127 |
+
}
|
| 128 |
+
interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
|
| 129 |
+
/**
|
| 130 |
+
* The initial selected value.
|
| 131 |
+
*/
|
| 132 |
+
initialValue?: Value;
|
| 133 |
+
/**
|
| 134 |
+
* The initial user input
|
| 135 |
+
*/
|
| 136 |
+
initialUserInput?: string;
|
| 137 |
+
}
|
| 138 |
+
declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | symbol>;
|
| 139 |
+
interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
|
| 140 |
+
/**
|
| 141 |
+
* The initial selected values
|
| 142 |
+
*/
|
| 143 |
+
initialValues?: Value[];
|
| 144 |
+
/**
|
| 145 |
+
* If true, at least one option must be selected
|
| 146 |
+
*/
|
| 147 |
+
required?: boolean;
|
| 148 |
+
}
|
| 149 |
+
/**
|
| 150 |
+
* Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI
|
| 151 |
+
*/
|
| 152 |
+
declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
| 153 |
+
|
| 154 |
+
type BoxAlignment = 'left' | 'center' | 'right';
|
| 155 |
+
interface BoxOptions extends CommonOptions {
|
| 156 |
+
contentAlign?: BoxAlignment;
|
| 157 |
+
titleAlign?: BoxAlignment;
|
| 158 |
+
width?: number | 'auto';
|
| 159 |
+
titlePadding?: number;
|
| 160 |
+
contentPadding?: number;
|
| 161 |
+
rounded?: boolean;
|
| 162 |
+
formatBorder?: (text: string) => string;
|
| 163 |
+
}
|
| 164 |
+
declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
|
| 165 |
+
|
| 166 |
+
interface ConfirmOptions extends CommonOptions {
|
| 167 |
+
message: string;
|
| 168 |
+
active?: string;
|
| 169 |
+
inactive?: string;
|
| 170 |
+
initialValue?: boolean;
|
| 171 |
+
vertical?: boolean;
|
| 172 |
+
}
|
| 173 |
+
declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>;
|
| 174 |
+
|
| 175 |
+
interface DateOptions extends CommonOptions {
|
| 176 |
+
message: string;
|
| 177 |
+
format?: DateFormat;
|
| 178 |
+
locale?: string;
|
| 179 |
+
defaultValue?: Date;
|
| 180 |
+
initialValue?: Date;
|
| 181 |
+
minDate?: Date;
|
| 182 |
+
maxDate?: Date;
|
| 183 |
+
validate?: (value: Date | undefined) => string | Error | undefined;
|
| 184 |
+
}
|
| 185 |
+
declare const date: (opts: DateOptions) => Promise<Date | symbol>;
|
| 186 |
+
|
| 187 |
+
type Prettify<T> = {
|
| 188 |
+
[P in keyof T]: T[P];
|
| 189 |
+
} & {};
|
| 190 |
+
type PromptGroupAwaitedReturn<T> = {
|
| 191 |
+
[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;
|
| 192 |
+
};
|
| 193 |
+
interface PromptGroupOptions<T> {
|
| 194 |
+
/**
|
| 195 |
+
* Control how the group can be canceled
|
| 196 |
+
* if one of the prompts is canceled.
|
| 197 |
+
*/
|
| 198 |
+
onCancel?: (opts: {
|
| 199 |
+
results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
|
| 200 |
+
}) => void;
|
| 201 |
+
}
|
| 202 |
+
type PromptGroup<T> = {
|
| 203 |
+
[P in keyof T]: (opts: {
|
| 204 |
+
results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
|
| 205 |
+
}) => undefined | Promise<T[P] | undefined>;
|
| 206 |
+
};
|
| 207 |
+
/**
|
| 208 |
+
* Define a group of prompts to be displayed
|
| 209 |
+
* and return a results of objects within the group
|
| 210 |
+
*/
|
| 211 |
+
declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
|
| 212 |
+
|
| 213 |
+
interface GroupMultiSelectOptions<Value> extends CommonOptions {
|
| 214 |
+
message: string;
|
| 215 |
+
options: Record<string, Option<Value>[]>;
|
| 216 |
+
initialValues?: Value[];
|
| 217 |
+
required?: boolean;
|
| 218 |
+
cursorAt?: Value;
|
| 219 |
+
selectableGroups?: boolean;
|
| 220 |
+
groupSpacing?: number;
|
| 221 |
+
}
|
| 222 |
+
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
| 223 |
+
|
| 224 |
+
interface LimitOptionsParams<TOption> extends CommonOptions {
|
| 225 |
+
options: TOption[];
|
| 226 |
+
cursor: number;
|
| 227 |
+
style: (option: TOption, active: boolean) => string;
|
| 228 |
+
maxItems?: number;
|
| 229 |
+
columnPadding?: number;
|
| 230 |
+
rowPadding?: number;
|
| 231 |
+
}
|
| 232 |
+
declare const limitOptions: <TOption>({ cursor, options, style, output, maxItems, columnPadding, rowPadding, }: LimitOptionsParams<TOption>) => string[];
|
| 233 |
+
|
| 234 |
+
interface LogMessageOptions extends CommonOptions {
|
| 235 |
+
symbol?: string;
|
| 236 |
+
spacing?: number;
|
| 237 |
+
secondarySymbol?: string;
|
| 238 |
+
}
|
| 239 |
+
declare const log: {
|
| 240 |
+
message: (message?: string | string[], { symbol, secondarySymbol, output, spacing, withGuide, }?: LogMessageOptions) => void;
|
| 241 |
+
info: (message: string, opts?: LogMessageOptions) => void;
|
| 242 |
+
success: (message: string, opts?: LogMessageOptions) => void;
|
| 243 |
+
step: (message: string, opts?: LogMessageOptions) => void;
|
| 244 |
+
warn: (message: string, opts?: LogMessageOptions) => void;
|
| 245 |
+
/** alias for `log.warn()`. */
|
| 246 |
+
warning: (message: string, opts?: LogMessageOptions) => void;
|
| 247 |
+
error: (message: string, opts?: LogMessageOptions) => void;
|
| 248 |
+
};
|
| 249 |
+
|
| 250 |
+
declare const cancel: (message?: string, opts?: CommonOptions) => void;
|
| 251 |
+
declare const intro: (title?: string, opts?: CommonOptions) => void;
|
| 252 |
+
declare const outro: (message?: string, opts?: CommonOptions) => void;
|
| 253 |
+
|
| 254 |
+
interface MultiSelectOptions<Value> extends CommonOptions {
|
| 255 |
+
message: string;
|
| 256 |
+
options: Option<Value>[];
|
| 257 |
+
initialValues?: Value[];
|
| 258 |
+
maxItems?: number;
|
| 259 |
+
required?: boolean;
|
| 260 |
+
cursorAt?: Value;
|
| 261 |
+
}
|
| 262 |
+
declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
| 263 |
+
|
| 264 |
+
type FormatFn = (line: string) => string;
|
| 265 |
+
interface NoteOptions extends CommonOptions {
|
| 266 |
+
format?: FormatFn;
|
| 267 |
+
}
|
| 268 |
+
declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
|
| 269 |
+
|
| 270 |
+
interface PasswordOptions extends CommonOptions {
|
| 271 |
+
message: string;
|
| 272 |
+
mask?: string;
|
| 273 |
+
validate?: (value: string | undefined) => string | Error | undefined;
|
| 274 |
+
clearOnError?: boolean;
|
| 275 |
+
}
|
| 276 |
+
declare const password: (opts: PasswordOptions) => Promise<string | symbol>;
|
| 277 |
+
|
| 278 |
+
interface PathOptions extends CommonOptions {
|
| 279 |
+
root?: string;
|
| 280 |
+
directory?: boolean;
|
| 281 |
+
initialValue?: string;
|
| 282 |
+
message: string;
|
| 283 |
+
validate?: (value: string | undefined) => string | Error | undefined;
|
| 284 |
+
}
|
| 285 |
+
declare const path: (opts: PathOptions) => Promise<string | symbol>;
|
| 286 |
+
|
| 287 |
+
interface SpinnerOptions extends CommonOptions {
|
| 288 |
+
indicator?: 'dots' | 'timer';
|
| 289 |
+
onCancel?: () => void;
|
| 290 |
+
cancelMessage?: string;
|
| 291 |
+
errorMessage?: string;
|
| 292 |
+
frames?: string[];
|
| 293 |
+
delay?: number;
|
| 294 |
+
styleFrame?: (frame: string) => string;
|
| 295 |
+
}
|
| 296 |
+
interface SpinnerResult {
|
| 297 |
+
start(msg?: string): void;
|
| 298 |
+
stop(msg?: string): void;
|
| 299 |
+
cancel(msg?: string): void;
|
| 300 |
+
error(msg?: string): void;
|
| 301 |
+
message(msg?: string): void;
|
| 302 |
+
clear(): void;
|
| 303 |
+
readonly isCancelled: boolean;
|
| 304 |
+
}
|
| 305 |
+
declare const spinner: ({ indicator, onCancel, output, cancelMessage, errorMessage, frames, delay, signal, ...opts }?: SpinnerOptions) => SpinnerResult;
|
| 306 |
+
|
| 307 |
+
interface ProgressOptions extends SpinnerOptions {
|
| 308 |
+
style?: 'light' | 'heavy' | 'block';
|
| 309 |
+
max?: number;
|
| 310 |
+
size?: number;
|
| 311 |
+
}
|
| 312 |
+
interface ProgressResult extends SpinnerResult {
|
| 313 |
+
advance(step?: number, msg?: string): void;
|
| 314 |
+
}
|
| 315 |
+
declare function progress({ style, max: userMax, size: userSize, ...spinnerOptions }?: ProgressOptions): ProgressResult;
|
| 316 |
+
|
| 317 |
+
interface SelectKeyOptions<Value extends string> extends CommonOptions {
|
| 318 |
+
message: string;
|
| 319 |
+
options: Option<Value>[];
|
| 320 |
+
initialValue?: Value;
|
| 321 |
+
caseSensitive?: boolean;
|
| 322 |
+
}
|
| 323 |
+
declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | symbol>;
|
| 324 |
+
|
| 325 |
+
declare const stream: {
|
| 326 |
+
message: (iterable: Iterable<string> | AsyncIterable<string>, { symbol }?: LogMessageOptions) => Promise<void>;
|
| 327 |
+
info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 328 |
+
success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 329 |
+
step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 330 |
+
warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 331 |
+
/** alias for `log.warn()`. */
|
| 332 |
+
warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 333 |
+
error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
| 334 |
+
};
|
| 335 |
+
|
| 336 |
+
type Task = {
|
| 337 |
+
/**
|
| 338 |
+
* Task title
|
| 339 |
+
*/
|
| 340 |
+
title: string;
|
| 341 |
+
/**
|
| 342 |
+
* Task function
|
| 343 |
+
*/
|
| 344 |
+
task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
|
| 345 |
+
/**
|
| 346 |
+
* If enabled === false the task will be skipped
|
| 347 |
+
*/
|
| 348 |
+
enabled?: boolean;
|
| 349 |
+
};
|
| 350 |
+
/**
|
| 351 |
+
* Define a group of tasks to be executed
|
| 352 |
+
*/
|
| 353 |
+
declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
|
| 354 |
+
|
| 355 |
+
interface TaskLogOptions extends CommonOptions {
|
| 356 |
+
title: string;
|
| 357 |
+
limit?: number;
|
| 358 |
+
spacing?: number;
|
| 359 |
+
retainLog?: boolean;
|
| 360 |
+
}
|
| 361 |
+
interface TaskLogMessageOptions {
|
| 362 |
+
raw?: boolean;
|
| 363 |
+
}
|
| 364 |
+
interface TaskLogCompletionOptions {
|
| 365 |
+
showLog?: boolean;
|
| 366 |
+
}
|
| 367 |
+
/**
|
| 368 |
+
* Renders a log which clears on success and remains on failure
|
| 369 |
+
*/
|
| 370 |
+
declare const taskLog: (opts: TaskLogOptions) => {
|
| 371 |
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
| 372 |
+
group(name: string): {
|
| 373 |
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
| 374 |
+
error(message: string): void;
|
| 375 |
+
success(message: string): void;
|
| 376 |
+
};
|
| 377 |
+
error(message: string, opts?: TaskLogCompletionOptions): void;
|
| 378 |
+
success(message: string, opts?: TaskLogCompletionOptions): void;
|
| 379 |
+
};
|
| 380 |
+
|
| 381 |
+
interface TextOptions extends CommonOptions {
|
| 382 |
+
message: string;
|
| 383 |
+
placeholder?: string;
|
| 384 |
+
defaultValue?: string;
|
| 385 |
+
initialValue?: string;
|
| 386 |
+
validate?: (value: string | undefined) => string | Error | undefined;
|
| 387 |
+
}
|
| 388 |
+
declare const text: (opts: TextOptions) => Promise<string | symbol>;
|
| 389 |
+
|
| 390 |
+
export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
|
| 391 |
+
export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };
|
extensions/channels/node_modules/@clack/prompts/dist/index.mjs
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{getColumns as X,getRows as ke,AutocompletePrompt as ve,settings as I,ConfirmPrompt as Le,wrapTextWithPrefix as N,DatePrompt as De,isCancel as We,GroupMultiSelectPrompt as Fe,MultiSelectPrompt as He,PasswordPrompt as Ue,block as Ke,SelectPrompt as qe,SelectKeyPrompt as Je,TextPrompt as Ye}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as t,stripVTControlCharacters as ne}from"node:util";import P from"node:process";import{wrapAnsi as q}from"fast-wrap-ansi";import B from"fast-string-width";import{existsSync as Xe,lstatSync as we,readdirSync as ze}from"node:fs";import{dirname as be,join as Qe}from"node:path";import{cursor as Se,erase as Ce}from"sisteransi";function Ze(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ee=Ze(),ae=()=>process.env.CI==="true",Te=e=>e.isTTY===!0,w=(e,i)=>ee?e:i,_e=w("\u25C6","*"),oe=w("\u25A0","x"),ue=w("\u25B2","x"),F=w("\u25C7","o"),le=w("\u250C","T"),d=w("\u2502","|"),E=w("\u2514","\u2014"),Ie=w("\u2510","T"),Ee=w("\u2518","\u2014"),z=w("\u25CF",">"),H=w("\u25CB"," "),te=w("\u25FB","[\u2022]"),U=w("\u25FC","[+]"),J=w("\u25FB","[ ]"),xe=w("\u25AA","\u2022"),se=w("\u2500","-"),ce=w("\u256E","+"),Ge=w("\u251C","+"),$e=w("\u256F","+"),de=w("\u2570","+"),Oe=w("\u256D","+"),he=w("\u25CF","\u2022"),pe=w("\u25C6","*"),me=w("\u25B2","!"),ge=w("\u25A0","x"),V=e=>{switch(e){case"initial":case"active":return t("cyan",_e);case"cancel":return t("red",oe);case"error":return t("yellow",ue);case"submit":return t("green",F)}},ye=e=>{switch(e){case"initial":case"active":return t("cyan",d);case"cancel":return t("red",d);case"error":return t("yellow",d);case"submit":return t("green",d)}},et=(e,i,s,r,u)=>{let n=i,o=0;for(let c=s;c<r;c++){const a=e[c];if(n=n-a.length,o++,n<=u)break}return{lineCount:n,removals:o}},Y=({cursor:e,options:i,style:s,output:r=process.stdout,maxItems:u=Number.POSITIVE_INFINITY,columnPadding:n=0,rowPadding:o=4})=>{const c=X(r)-n,a=ke(r),l=t("dim","..."),$=Math.max(a-o,0),y=Math.max(Math.min(u,$),5);let p=0;e>=y-3&&(p=Math.max(Math.min(e-y+3,i.length-y),0));let m=y<i.length&&p>0,g=y<i.length&&p+y<i.length;const S=Math.min(p+y,i.length),h=[];let f=0;m&&f++,g&&f++;const v=p+(m?1:0),T=S-(g?1:0);for(let b=v;b<T;b++){const x=q(s(i[b],b===e),c,{hard:!0,trim:!1}).split(`
|
| 2 |
+
`);h.push(x),f+=x.length}if(f>$){let b=0,x=0,G=f;const M=e-v,R=(j,D)=>et(h,G,j,D,$);m?({lineCount:G,removals:b}=R(0,M),G>$&&({lineCount:G,removals:x}=R(M+1,h.length))):({lineCount:G,removals:x}=R(M+1,h.length),G>$&&({lineCount:G,removals:b}=R(0,M))),b>0&&(m=!0,h.splice(0,b)),x>0&&(g=!0,h.splice(h.length-x,x))}const C=[];m&&C.push(l);for(const b of h)for(const x of b)C.push(x);return g&&C.push(l),C};function Me(e){return e.label??String(e.value??"")}function Re(e,i){if(!e)return!0;const s=(i.label??String(i.value??"")).toLowerCase(),r=(i.hint??"").toLowerCase(),u=String(i.value).toLowerCase(),n=e.toLowerCase();return s.includes(n)||r.includes(n)||u.includes(n)}function tt(e,i){const s=[];for(const r of i)e.includes(r.value)&&s.push(r);return s}const Ae=e=>new ve({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((i,s)=>Re(i,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){const i=e.withGuide??I.withGuide,s=i?[`${t("gray",d)}`,`${V(this.state)} ${e.message}`]:[`${V(this.state)} ${e.message}`],r=this.userInput,u=this.options,n=e.placeholder,o=r===""&&n!==void 0,c=(a,l)=>{const $=Me(a),y=a.hint&&a.value===this.focusedValue?t("dim",` (${a.hint})`):"";switch(l){case"active":return`${t("green",z)} ${$}${y}`;case"inactive":return`${t("dim",H)} ${t("dim",$)}`;case"disabled":return`${t("gray",H)} ${t(["strikethrough","gray"],$)}`}};switch(this.state){case"submit":{const a=tt(this.selectedValues,u),l=a.length>0?` ${t("dim",a.map(Me).join(", "))}`:"",$=i?t("gray",d):"";return`${s.join(`
|
| 3 |
+
`)}
|
| 4 |
+
${$}${l}`}case"cancel":{const a=r?` ${t(["strikethrough","dim"],r)}`:"",l=i?t("gray",d):"";return`${s.join(`
|
| 5 |
+
`)}
|
| 6 |
+
${l}${a}`}default:{const a=this.state==="error"?"yellow":"cyan",l=i?`${t(a,d)} `:"",$=i?t(a,E):"";let y="";if(this.isNavigating||o){const v=o?n:r;y=v!==""?` ${t("dim",v)}`:""}else y=` ${this.userInputWithCursor}`;const p=this.filteredOptions.length!==u.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",m=this.filteredOptions.length===0&&r?[`${l}${t("yellow","No matches found")}`]:[],g=this.state==="error"?[`${l}${t("yellow",this.error)}`]:[];i&&s.push(`${l.trimEnd()}`),s.push(`${l}${t("dim","Search:")}${y}${p}`,...m,...g);const S=[`${t("dim","\u2191/\u2193")} to select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],h=[`${l}${S.join(" \u2022 ")}`,$],f=this.filteredOptions.length===0?[]:Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:i?3:0,rowPadding:s.length+h.length,style:(v,T)=>c(v,v.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...f.map(v=>`${l}${v}`),...h].join(`
|
| 7 |
+
`)}}}}).prompt(),st=e=>{const i=(r,u,n,o)=>{const c=n.includes(r.value),a=r.label??String(r.value??""),l=r.hint&&o!==void 0&&r.value===o?t("dim",` (${r.hint})`):"",$=c?t("green",U):t("dim",J);return r.disabled?`${t("gray",J)} ${t(["strikethrough","gray"],a)}`:u?`${$} ${a}${l}`:`${$} ${t("dim",a)}`},s=new ve({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,u)=>Re(r,u)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){const r=e.withGuide??I.withGuide,u=`${r?`${t("gray",d)}
|
| 8 |
+
`:""}${V(this.state)} ${e.message}
|
| 9 |
+
`,n=this.userInput,o=e.placeholder,c=n===""&&o!==void 0,a=this.isNavigating||c?t("dim",c?o:n):this.userInputWithCursor,l=this.options,$=this.filteredOptions.length!==l.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${r?`${t("gray",d)} `:""}${t("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${r?`${t("gray",d)} `:""}${t(["strikethrough","dim"],n)}`;default:{const y=this.state==="error"?"yellow":"cyan",p=r?`${t(y,d)} `:"",m=r?t(y,E):"",g=[`${t("dim","\u2191/\u2193")} to navigate`,`${t("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],S=this.filteredOptions.length===0&&n?[`${p}${t("yellow","No matches found")}`]:[],h=this.state==="error"?[`${p}${t("yellow",this.error)}`]:[],f=[...`${u}${r?t(y,d):""}`.split(`
|
| 10 |
+
`),`${p}${t("dim","Search:")} ${a}${$}`,...S,...h],v=[`${p}${g.join(" \u2022 ")}`,m],T=Y({cursor:this.cursor,options:this.filteredOptions,style:(C,b)=>i(C,b,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:f.length+v.length});return[...f,...T.map(C=>`${p}${C}`),...v].join(`
|
| 11 |
+
`)}}}});return s.prompt()},rt=[Oe,ce,de,$e],it=[le,Ie,E,Ee];function Pe(e,i,s,r){let u=s,n=s;return r==="center"?u=Math.floor((i-e)/2):r==="right"&&(u=i-e-s),n=i-u-e,[u,n]}const nt=e=>e,at=(e="",i="",s)=>{const r=s?.output??process.stdout,u=X(r),n=2,o=s?.titlePadding??1,c=s?.contentPadding??2,a=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??I.withGuide?`${d} `:"",$=s?.formatBorder??nt,y=(s?.rounded?rt:it).map($),p=$(se),m=$(d),g=B(l),S=B(i),h=u-g;let f=Math.floor(u*a)-g;if(s?.width==="auto"){const R=e.split(`
|
| 12 |
+
`);let j=S+o*2;for(const ie of R){const W=B(ie)+c*2;W>j&&(j=W)}const D=j+n;D<f&&(f=D)}f%2!==0&&(f<h?f++:f--);const v=f-n,T=v-o*2,C=S>T?`${i.slice(0,T-3)}...`:i,[b,x]=Pe(B(C),v,o,s?.titleAlign),G=q(e,v-c*2,{hard:!0,trim:!1});r.write(`${l}${y[0]}${p.repeat(b)}${C}${p.repeat(x)}${y[1]}
|
| 13 |
+
`);const M=G.split(`
|
| 14 |
+
`);for(const R of M){const[j,D]=Pe(B(R),v,c,s?.contentAlign);r.write(`${l}${m}${" ".repeat(j)}${R}${" ".repeat(D)}${m}
|
| 15 |
+
`)}r.write(`${l}${y[2]}${p.repeat(v)}${y[3]}
|
| 16 |
+
`)},ot=e=>{const i=e.active??"Yes",s=e.inactive??"No";return new Le({active:i,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const r=e.withGuide??I.withGuide,u=`${V(this.state)} `,n=r?`${t("gray",d)} `:"",o=N(e.output,e.message,n,u),c=`${r?`${t("gray",d)}
|
| 17 |
+
`:""}${o}
|
| 18 |
+
`,a=this.value?i:s;switch(this.state){case"submit":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t("dim",a)}`}case"cancel":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t(["strikethrough","dim"],a)}${r?`
|
| 19 |
+
${t("gray",d)}`:""}`}default:{const l=r?`${t("cyan",d)} `:"",$=r?t("cyan",E):"";return`${c}${l}${this.value?`${t("green",z)} ${i}`:`${t("dim",H)} ${t("dim",i)}`}${e.vertical?r?`
|
| 20 |
+
${t("cyan",d)} `:`
|
| 21 |
+
`:` ${t("dim","/")} `}${this.value?`${t("dim",H)} ${t("dim",s)}`:`${t("green",z)} ${s}`}
|
| 22 |
+
${$}
|
| 23 |
+
`}}}}).prompt()},ut=e=>{const i=e.validate;return new De({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:i?i(s):I.date.messages.required;const r=u=>u.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(i)return i(s)},render(){const s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${t("gray",d)}
|
| 24 |
+
`:""}${V(this.state)} `}${e.message}
|
| 25 |
+
`,u=this.state!=="initial"?this.state:"active",n=lt(this,u),o=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const c=this.error?` ${t("yellow",this.error)}`:"",a=s?`${t("yellow",d)} `:"",l=s?t("yellow",E):"";return`${r.trim()}
|
| 26 |
+
${a}${n}
|
| 27 |
+
${l}${c}
|
| 28 |
+
`}case"submit":{const c=o?` ${t("dim",o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}`}case"cancel":{const c=o?` ${t(["strikethrough","dim"],o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}${o.trim()?`
|
| 29 |
+
${a}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=s?`${t("cyan",d)} `:"",$=this.inlineError?`
|
| 30 |
+
${l}${t("yellow",this.inlineError)}`:"";return`${r}${c}${n}${$}
|
| 31 |
+
${a}
|
| 32 |
+
`}}}}).prompt()};function lt(e,i){const s=e.segmentValues,r=e.segmentCursor;if(i==="submit"||i==="cancel")return e.formattedValue;const u=t("gray",e.separator);return e.segments.map((n,o)=>{const c=o===r.segmentIndex&&!["submit","cancel"].includes(i),a=$t[n.type];return ct(s[n.type],{isActive:c,label:a})}).join(u)}function ct(e,i){const s=!e||e.replace(/_/g,"")==="";return i.isActive?t("inverse",s?i.label:e.replace(/_/g," ")):s?t("dim",i.label):e.replace(/_/g,t("dim"," "))}const $t={year:"yyyy",month:"mm",day:"dd"},dt=async(e,i)=>{const s={},r=Object.keys(e);for(const u of r){const n=e[u],o=await n({results:s})?.catch(c=>{throw c});if(typeof i?.onCancel=="function"&&We(o)){s[u]="canceled",i.onCancel({results:s});continue}s[u]=o}return s},ht=e=>{const{selectableGroups:i=!0,groupSpacing:s=0}=e,r=(n,o,c=[])=>{const a=n.label??String(n.value),l=typeof n.group=="string",$=l&&(c[c.indexOf(n)+1]??{group:!0}),y=l&&$&&$.group===!0,p=l?i?`${y?E:d} `:" ":"";let m="";if(s>0&&!l){const S=`
|
| 33 |
+
${t("cyan",d)}`;m=`${S.repeat(s-1)}${S} `}if(o==="active")return`${m}${t("dim",p)}${t("cyan",te)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="group-active")return`${m}${p}${t("cyan",te)} ${t("dim",a)}`;if(o==="group-active-selected")return`${m}${p}${t("green",U)} ${t("dim",a)}`;if(o==="selected"){const S=l||i?t("green",U):"";return`${m}${t("dim",p)}${S} ${t("dim",a)}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`}if(o==="cancelled")return`${t(["strikethrough","dim"],a)}`;if(o==="active-selected")return`${m}${t("dim",p)}${t("green",U)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="submitted")return`${t("dim",a)}`;const g=l||i?t("dim",J):"";return`${m}${t("dim",p)}${g} ${t("dim",a)}`},u=e.required??!0;return new Fe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:u,cursorAt:e.cursorAt,selectableGroups:i,validate(n){if(u&&(n===void 0||n.length===0))return`Please select at least one option.
|
| 34 |
+
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const n=e.withGuide??I.withGuide,o=`${n?`${t("gray",d)}
|
| 35 |
+
`:""}${V(this.state)} ${e.message}
|
| 36 |
+
`,c=this.value??[];switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>c.includes($)).map($=>r($,"submitted")),l=a.length===0?"":` ${a.join(t("dim",", "))}`;return`${o}${n?t("gray",d):""}${l}`}case"cancel":{const a=this.options.filter(({value:l})=>c.includes(l)).map(l=>r(l,"cancelled")).join(t("dim",", "));return`${o}${n?`${t("gray",d)} `:""}${a.trim()?`${a}${n?`
|
| 37 |
+
${t("gray",d)}`:""}`:""}`}case"error":{const a=this.error.split(`
|
| 38 |
+
`).map((l,$)=>$===0?`${n?`${t("yellow",E)} `:""}${t("yellow",l)}`:` ${l}`).join(`
|
| 39 |
+
`);return`${o}${n?`${t("yellow",d)} `:""}${this.options.map((l,$,y)=>{const p=c.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`),m=$===this.cursor;return!m&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?r(l,p?"group-active-selected":"group-active",y):m&&p?r(l,"active-selected",y):p?r(l,"selected",y):r(l,m?"active":"inactive",y)}).join(`
|
| 40 |
+
${n?`${t("yellow",d)} `:""}`)}
|
| 41 |
+
${a}
|
| 42 |
+
`}default:{const a=this.options.map(($,y,p)=>{const m=c.includes($.value)||$.group===!0&&this.isGroupSelected(`${$.value}`),g=y===this.cursor,S=!g&&typeof $.group=="string"&&this.options[this.cursor].value===$.group;let h="";return S?h=r($,m?"group-active-selected":"group-active",p):g&&m?h=r($,"active-selected",p):m?h=r($,"selected",p):h=r($,g?"active":"inactive",p),`${y!==0&&!h.startsWith(`
|
| 43 |
+
`)?" ":""}${h}`}).join(`
|
| 44 |
+
${n?t("cyan",d):""}`),l=a.startsWith(`
|
| 45 |
+
`)?"":" ";return`${o}${n?t("cyan",d):""}${l}${a}
|
| 46 |
+
${n?t("cyan",E):""}
|
| 47 |
+
`}}}}).prompt()},O={message:(e=[],{symbol:i=t("gray",d),secondarySymbol:s=t("gray",d),output:r=process.stdout,spacing:u=1,withGuide:n}={})=>{const o=[],c=n??I.withGuide,a=c?s:"",l=c?`${i} `:"",$=c?`${s} `:"";for(let p=0;p<u;p++)o.push(a);const y=Array.isArray(e)?e:e.split(`
|
| 48 |
+
`);if(y.length>0){const[p,...m]=y;p.length>0?o.push(`${l}${p}`):o.push(c?i:"");for(const g of m)g.length>0?o.push(`${$}${g}`):o.push(c?s:"")}r.write(`${o.join(`
|
| 49 |
+
`)}
|
| 50 |
+
`)},info:(e,i)=>{O.message(e,{...i,symbol:t("blue",he)})},success:(e,i)=>{O.message(e,{...i,symbol:t("green",pe)})},step:(e,i)=>{O.message(e,{...i,symbol:t("green",F)})},warn:(e,i)=>{O.message(e,{...i,symbol:t("yellow",me)})},warning:(e,i)=>{O.warn(e,i)},error:(e,i)=>{O.message(e,{...i,symbol:t("red",ge)})}},pt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",E)} `:"";s.write(`${r}${t("red",e)}
|
| 51 |
+
|
| 52 |
+
`)},mt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",le)} `:"";s.write(`${r}${e}
|
| 53 |
+
`)},gt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",d)}
|
| 54 |
+
${t("gray",E)} `:"";s.write(`${r}${e}
|
| 55 |
+
|
| 56 |
+
`)},Q=(e,i)=>e.split(`
|
| 57 |
+
`).map(s=>i(s)).join(`
|
| 58 |
+
`),yt=e=>{const i=(r,u)=>{const n=r.label??String(r.value);return u==="disabled"?`${t("gray",J)} ${Q(n,o=>t(["strikethrough","gray"],o))}${r.hint?` ${t("dim",`(${r.hint??"disabled"})`)}`:""}`:u==="active"?`${t("cyan",te)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="selected"?`${t("green",U)} ${Q(n,o=>t("dim",o))}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="cancelled"?`${Q(n,o=>t(["strikethrough","dim"],o))}`:u==="active-selected"?`${t("green",U)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="submitted"?`${Q(n,o=>t("dim",o))}`:`${t("dim",J)} ${Q(n,o=>t("dim",o))}`},s=e.required??!0;return new He({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
|
| 59 |
+
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t("bgWhite",t("inverse"," enter ")))} to submit`))}`},render(){const r=e.withGuide??I.withGuide,u=N(e.output,e.message,r?`${ye(this.state)} `:"",`${V(this.state)} `),n=`${r?`${t("gray",d)}
|
| 60 |
+
`:""}${u}
|
| 61 |
+
`,o=this.value??[],c=(a,l)=>{if(a.disabled)return i(a,"disabled");const $=o.includes(a.value);return l&&$?i(a,"active-selected"):$?i(a,"selected"):i(a,l?"active":"inactive")};switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"submitted")).join(t("dim",", "))||t("dim","none"),l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}`}case"cancel":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"cancelled")).join(t("dim",", "));if(a.trim()==="")return`${n}${t("gray",d)}`;const l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}${r?`
|
| 62 |
+
${t("gray",d)}`:""}`}case"error":{const a=r?`${t("yellow",d)} `:"",l=this.error.split(`
|
| 63 |
+
`).map((p,m)=>m===0?`${r?`${t("yellow",E)} `:""}${t("yellow",p)}`:` ${p}`).join(`
|
| 64 |
+
`),$=n.split(`
|
| 65 |
+
`).length,y=l.split(`
|
| 66 |
+
`).length+1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:$+y,style:c}).join(`
|
| 67 |
+
${a}`)}
|
| 68 |
+
${l}
|
| 69 |
+
`}default:{const a=r?`${t("cyan",d)} `:"",l=n.split(`
|
| 70 |
+
`).length,$=r?2:1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+$,style:c}).join(`
|
| 71 |
+
${a}`)}
|
| 72 |
+
${r?t("cyan",E):""}
|
| 73 |
+
`}}}}).prompt()},ft=e=>t("dim",e),vt=(e,i,s)=>{const r={hard:!0,trim:!1},u=q(e,i,r).split(`
|
| 74 |
+
`),n=u.reduce((a,l)=>Math.max(B(l),a),0),o=u.map(s).reduce((a,l)=>Math.max(B(l),a),0),c=i-(o-n);return q(e,c,r)},wt=(e="",i="",s)=>{const r=s?.output??P.stdout,u=s?.withGuide??I.withGuide,n=s?.format??ft,o=["",...vt(e,X(r)-6,n).split(`
|
| 75 |
+
`).map(n),""],c=B(i),a=Math.max(o.reduce((p,m)=>{const g=B(m);return g>p?g:p},0),c)+2,l=o.map(p=>`${t("gray",d)} ${p}${" ".repeat(a-B(p))}${t("gray",d)}`).join(`
|
| 76 |
+
`),$=u?`${t("gray",d)}
|
| 77 |
+
`:"",y=u?Ge:de;r.write(`${$}${t("green",F)} ${t("reset",i)} ${t("gray",se.repeat(Math.max(a-c-1,1))+ce)}
|
| 78 |
+
${l}
|
| 79 |
+
${t("gray",y+se.repeat(a+2)+$e)}
|
| 80 |
+
`)},bt=e=>new Ue({validate:e.validate,mask:e.mask??xe,signal:e.signal,input:e.input,output:e.output,render(){const i=e.withGuide??I.withGuide,s=`${i?`${t("gray",d)}
|
| 81 |
+
`:""}${V(this.state)} ${e.message}
|
| 82 |
+
`,r=this.userInputWithCursor,u=this.masked;switch(this.state){case"error":{const n=i?`${t("yellow",d)} `:"",o=i?`${t("yellow",E)} `:"",c=u??"";return e.clearOnError&&this.clear(),`${s.trim()}
|
| 83 |
+
${n}${c}
|
| 84 |
+
${o}${t("yellow",this.error)}
|
| 85 |
+
`}case"submit":{const n=i?`${t("gray",d)} `:"",o=u?t("dim",u):"";return`${s}${n}${o}`}case"cancel":{const n=i?`${t("gray",d)} `:"",o=u?t(["strikethrough","dim"],u):"";return`${s}${n}${o}${u&&i?`
|
| 86 |
+
${t("gray",d)}`:""}`}default:{const n=i?`${t("cyan",d)} `:"",o=i?t("cyan",E):"";return`${s}${n}${r}
|
| 87 |
+
${o}
|
| 88 |
+
`}}}}).prompt(),St=e=>{const i=e.validate;return Ae({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(i)return i(s)}},options(){const s=this.userInput;if(s==="")return[];try{let r;Xe(s)?we(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=be(s):r=be(s);const u=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return ze(r).map(n=>{const o=Qe(r,n),c=we(o);return{name:n,path:o,isDirectory:c.isDirectory()}}).filter(({path:n,isDirectory:o})=>n.startsWith(u)&&(o||!e.directory)).map(n=>({value:n.path}))}catch{return[]}}})},Ct=e=>t("magenta",e),fe=({indicator:e="dots",onCancel:i,output:s=process.stdout,cancelMessage:r,errorMessage:u,frames:n=ee?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=ee?80:120,signal:c,...a}={})=>{const l=ae();let $,y,p=!1,m=!1,g="",S,h=performance.now();const f=X(s),v=a?.styleFrame??Ct,T=_=>{const A=_>1?u??I.messages.error:r??I.messages.cancel;m=_===1,p&&(W(A,_),m&&typeof i=="function"&&i())},C=()=>T(2),b=()=>T(1),x=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),c&&c.addEventListener("abort",b)},G=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),c&&c.removeEventListener("abort",b)},M=()=>{if(S===void 0)return;l&&s.write(`
|
| 89 |
+
`);const _=q(S,f,{hard:!0,trim:!1}).split(`
|
| 90 |
+
`);_.length>1&&s.write(Se.up(_.length-1)),s.write(Se.to(0)),s.write(Ce.down())},R=_=>_.replace(/\.+$/,""),j=_=>{const A=(performance.now()-_)/1e3,k=Math.floor(A/60),L=Math.floor(A%60);return k>0?`[${k}m ${L}s]`:`[${L}s]`},D=a.withGuide??I.withGuide,ie=(_="")=>{p=!0,$=Ke({output:s}),g=R(_),h=performance.now(),D&&s.write(`${t("gray",d)}
|
| 91 |
+
`);let A=0,k=0;x(),y=setInterval(()=>{if(l&&g===S)return;M(),S=g;const L=v(n[A]);let Z;if(l)Z=`${L} ${g}...`;else if(e==="timer")Z=`${L} ${g} ${j(h)}`;else{const Be=".".repeat(Math.floor(k)).slice(0,3);Z=`${L} ${g}${Be}`}const Ne=q(Z,f,{hard:!0,trim:!1});s.write(Ne),A=A+1<n.length?A+1:0,k=k<4?k+.125:0},o)},W=(_="",A=0,k=!1)=>{if(!p)return;p=!1,clearInterval(y),M();const L=A===0?t("green",F):A===1?t("red",oe):t("red",ue);g=_??g,k||(e==="timer"?s.write(`${L} ${g} ${j(h)}
|
| 92 |
+
`):s.write(`${L} ${g}
|
| 93 |
+
`)),G(),$()};return{start:ie,stop:(_="")=>W(_,0),message:(_="")=>{g=R(_??g)},cancel:(_="")=>W(_,1),error:(_="")=>W(_,2),clear:()=>W("",0,!0),get isCancelled(){return m}}},Ve={light:w("\u2500","-"),heavy:w("\u2501","="),block:w("\u2588","#")};function Tt({style:e="heavy",max:i=100,size:s=40,...r}={}){const u=fe(r);let n=0,o="";const c=Math.max(1,i),a=Math.max(1,s),l=m=>{switch(m){case"initial":case"active":return g=>t("magenta",g);case"error":case"cancel":return g=>t("red",g);case"submit":return g=>t("green",g);default:return g=>t("magenta",g)}},$=(m,g)=>{const S=Math.floor(n/c*a);return`${l(m)(Ve[e].repeat(S))}${t("dim",Ve[e].repeat(a-S))} ${g}`},y=(m="")=>{o=m,u.start($("initial",m))},p=(m=1,g)=>{n=Math.min(c,m+n),u.message($("active",g??o)),o=g??o};return{start:y,stop:u.stop,cancel:u.cancel,error:u.error,clear:u.clear,advance:p,isCancelled:u.isCancelled,message:m=>p(0,m)}}const re=(e,i)=>e.includes(`
|
| 94 |
+
`)?e.split(`
|
| 95 |
+
`).map(s=>i(s)).join(`
|
| 96 |
+
`):i(e),_t=e=>{const i=(s,r)=>{const u=s.label??String(s.value);switch(r){case"disabled":return`${t("gray",H)} ${re(u,n=>t("gray",n))}${s.hint?` ${t("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${re(u,n=>t("dim",n))}`;case"active":return`${t("green",z)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${re(u,n=>t(["strikethrough","dim"],n))}`;default:return`${t("dim",H)} ${re(u,n=>t("dim",n))}`}};return new qe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const s=e.withGuide??I.withGuide,r=`${V(this.state)} `,u=`${ye(this.state)} `,n=N(e.output,e.message,u,r),o=`${s?`${t("gray",d)}
|
| 97 |
+
`:""}${n}
|
| 98 |
+
`;switch(this.state){case"submit":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"selected"),c);return`${o}${a}`}case"cancel":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"cancelled"),c);return`${o}${a}${s?`
|
| 99 |
+
${t("gray",d)}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=o.split(`
|
| 100 |
+
`).length,$=s?2:1;return`${o}${c}${Y({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:c.length,rowPadding:l+$,style:(y,p)=>i(y,y.disabled?"disabled":p?"active":"inactive")}).join(`
|
| 101 |
+
${c}`)}
|
| 102 |
+
${a}
|
| 103 |
+
`}}}}).prompt()},It=e=>{const i=(s,r="inactive")=>{const u=s.label??String(s.value);return r==="selected"?`${t("dim",u)}`:r==="cancelled"?`${t(["strikethrough","dim"],u)}`:r==="active"?`${t(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:`${t(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`};return new Je({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){const s=e.withGuide??I.withGuide,r=`${s?`${t("gray",d)}
|
| 104 |
+
`:""}${V(this.state)} ${e.message}
|
| 105 |
+
`;switch(this.state){case"submit":{const u=s?`${t("gray",d)} `:"",n=this.options.find(c=>c.value===this.value)??e.options[0],o=N(e.output,i(n,"selected"),u);return`${r}${o}`}case"cancel":{const u=s?`${t("gray",d)} `:"",n=N(e.output,i(this.options[0],"cancelled"),u);return`${r}${n}${s?`
|
| 106 |
+
${t("gray",d)}`:""}`}default:{const u=s?`${t("cyan",d)} `:"",n=s?t("cyan",E):"",o=this.options.map((c,a)=>N(e.output,i(c,a===this.cursor?"active":"inactive"),u)).join(`
|
| 107 |
+
`);return`${r}${o}
|
| 108 |
+
${n}
|
| 109 |
+
`}}}}).prompt()},je=`${t("gray",d)} `,K={message:async(e,{symbol:i=t("gray",d)}={})=>{process.stdout.write(`${t("gray",d)}
|
| 110 |
+
${i} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
|
| 111 |
+
${je}`),r.includes(`
|
| 112 |
+
`)&&(s=3+ne(r.slice(r.lastIndexOf(`
|
| 113 |
+
`))).length);const u=ne(r).length;s+u<process.stdout.columns?(s+=u,process.stdout.write(r)):(process.stdout.write(`
|
| 114 |
+
${je}${r.trimStart()}`),s=3+ne(r.trimStart()).length)}process.stdout.write(`
|
| 115 |
+
`)},info:e=>K.message(e,{symbol:t("blue",he)}),success:e=>K.message(e,{symbol:t("green",pe)}),step:e=>K.message(e,{symbol:t("green",F)}),warn:e=>K.message(e,{symbol:t("yellow",me)}),warning:e=>K.warn(e),error:e=>K.message(e,{symbol:t("red",ge)})},Et=async(e,i)=>{for(const s of e){if(s.enabled===!1)continue;const r=fe(i);r.start(s.title);const u=await s.task(r.message);r.stop(u||s.title)}},xt=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Gt=e=>{const i=e.output??process.stdout,s=X(i),r=t("gray",d),u=e.spacing??1,n=3,o=e.retainLog===!0,c=!ae()&&Te(i);i.write(`${r}
|
| 116 |
+
`),i.write(`${t("green",F)} ${e.title}
|
| 117 |
+
`);for(let h=0;h<u;h++)i.write(`${r}
|
| 118 |
+
`);const a=[{value:"",full:""}];let l=!1;const $=h=>{if(a.length===0)return;let f=0;h&&(f+=u+2);for(const v of a){const{value:T,result:C}=v;let b=C?.message??T;if(b.length===0)continue;C===void 0&&v.header!==void 0&&v.header!==""&&(b+=`
|
| 119 |
+
${v.header}`);const x=b.split(`
|
| 120 |
+
`).reduce((G,M)=>M===""?G+1:G+Math.ceil((M.length+n)/s),0);f+=x}f>0&&(f+=1,i.write(Ce.lines(f)))},y=(h,f,v)=>{const T=v?`${h.full}
|
| 121 |
+
${h.value}`:h.value;h.header!==void 0&&h.header!==""&&O.message(h.header.split(`
|
| 122 |
+
`).map(C=>t("bold",C)),{output:i,secondarySymbol:r,symbol:r,spacing:0}),O.message(T.split(`
|
| 123 |
+
`).map(C=>t("dim",C)),{output:i,secondarySymbol:r,symbol:r,spacing:f??u})},p=()=>{for(const h of a){const{header:f,value:v,full:T}=h;(f===void 0||f.length===0)&&v.length===0||y(h,void 0,o===!0&&T.length>0)}},m=(h,f,v)=>{if($(!1),(v?.raw!==!0||!l)&&h.value!==""&&(h.value+=`
|
| 124 |
+
`),h.value+=xt(f),l=v?.raw===!0,e.limit!==void 0){const T=h.value.split(`
|
| 125 |
+
`),C=T.length-e.limit;if(C>0){const b=T.splice(0,C);o&&(h.full+=(h.full===""?"":`
|
| 126 |
+
`)+b.join(`
|
| 127 |
+
`))}h.value=T.join(`
|
| 128 |
+
`)}c&&g()},g=()=>{for(const h of a)h.result?h.result.status==="error"?O.error(h.result.message,{output:i,secondarySymbol:r,spacing:0}):O.success(h.result.message,{output:i,secondarySymbol:r,spacing:0}):h.value!==""&&y(h,0)},S=(h,f)=>{$(!1),h.result=f,c&&g()};return{message(h,f){m(a[0],h,f)},group(h){const f={header:h,value:"",full:""};return a.push(f),{message(v,T){m(f,v,T)},error(v){S(f,{status:"error",message:v})},success(v){S(f,{status:"success",message:v})}}},error(h,f){$(!0),O.error(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog!==!1&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(h,f){$(!0),O.success(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog===!0&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""}}},Ot=e=>new Ye({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){const i=e?.withGuide??I.withGuide,s=`${`${i?`${t("gray",d)}
|
| 129 |
+
`:""}${V(this.state)} `}${e.message}
|
| 130 |
+
`,r=e.placeholder?t("inverse",e.placeholder[0])+t("dim",e.placeholder.slice(1)):t(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:r,n=this.value??"";switch(this.state){case"error":{const o=this.error?` ${t("yellow",this.error)}`:"",c=i?`${t("yellow",d)} `:"",a=i?t("yellow",E):"";return`${s.trim()}
|
| 131 |
+
${c}${u}
|
| 132 |
+
${a}${o}
|
| 133 |
+
`}case"submit":{const o=n?` ${t("dim",n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}`}case"cancel":{const o=n?` ${t(["strikethrough","dim"],n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}${n.trim()?`
|
| 134 |
+
${c}`:""}`}default:{const o=i?`${t("cyan",d)} `:"",c=i?t("cyan",E):"";return`${s}${o}${u}
|
| 135 |
+
${c}
|
| 136 |
+
`}}}}).prompt();export{d as S_BAR,E as S_BAR_END,Ee as S_BAR_END_RIGHT,se as S_BAR_H,le as S_BAR_START,Ie as S_BAR_START_RIGHT,te as S_CHECKBOX_ACTIVE,J as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,Ge as S_CONNECT_LEFT,de as S_CORNER_BOTTOM_LEFT,$e as S_CORNER_BOTTOM_RIGHT,Oe as S_CORNER_TOP_LEFT,ce as S_CORNER_TOP_RIGHT,ge as S_ERROR,he as S_INFO,xe as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,_e as S_STEP_ACTIVE,oe as S_STEP_CANCEL,ue as S_STEP_ERROR,F as S_STEP_SUBMIT,pe as S_SUCCESS,me as S_WARN,Ae as autocomplete,st as autocompleteMultiselect,at as box,pt as cancel,ot as confirm,ut as date,dt as group,ht as groupMultiselect,mt as intro,ae as isCI,Te as isTTY,Y as limitOptions,O as log,yt as multiselect,wt as note,gt as outro,bt as password,St as path,Tt as progress,_t as select,It as selectKey,fe as spinner,K as stream,V as symbol,ye as symbolBar,Gt as taskLog,Et as tasks,Ot as text,ee as unicode,w as unicodeOr};
|
| 137 |
+
//# sourceMappingURL=index.mjs.map
|
extensions/channels/node_modules/@clack/prompts/dist/index.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
extensions/channels/node_modules/@clack/prompts/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@clack/prompts",
|
| 3 |
+
"version": "1.2.0",
|
| 4 |
+
"type": "module",
|
| 5 |
+
"main": "./dist/index.mjs",
|
| 6 |
+
"module": "./dist/index.mjs",
|
| 7 |
+
"exports": {
|
| 8 |
+
".": {
|
| 9 |
+
"types": "./dist/index.d.mts",
|
| 10 |
+
"default": "./dist/index.mjs"
|
| 11 |
+
},
|
| 12 |
+
"./package.json": "./package.json"
|
| 13 |
+
},
|
| 14 |
+
"types": "./dist/index.d.mts",
|
| 15 |
+
"repository": {
|
| 16 |
+
"type": "git",
|
| 17 |
+
"url": "git+https://github.com/bombshell-dev/clack.git",
|
| 18 |
+
"directory": "packages/prompts"
|
| 19 |
+
},
|
| 20 |
+
"bugs": {
|
| 21 |
+
"url": "https://github.com/bombshell-dev/clack/issues"
|
| 22 |
+
},
|
| 23 |
+
"homepage": "https://github.com/bombshell-dev/clack/tree/main/packages/prompts#readme",
|
| 24 |
+
"files": [
|
| 25 |
+
"dist",
|
| 26 |
+
"CHANGELOG.md"
|
| 27 |
+
],
|
| 28 |
+
"author": {
|
| 29 |
+
"name": "Nate Moore",
|
| 30 |
+
"email": "nate@natemoo.re",
|
| 31 |
+
"url": "https://twitter.com/n_moore"
|
| 32 |
+
},
|
| 33 |
+
"license": "MIT",
|
| 34 |
+
"keywords": [
|
| 35 |
+
"ask",
|
| 36 |
+
"clack",
|
| 37 |
+
"cli",
|
| 38 |
+
"command-line",
|
| 39 |
+
"command",
|
| 40 |
+
"input",
|
| 41 |
+
"interact",
|
| 42 |
+
"interface",
|
| 43 |
+
"menu",
|
| 44 |
+
"prompt",
|
| 45 |
+
"prompts",
|
| 46 |
+
"stdin",
|
| 47 |
+
"ui"
|
| 48 |
+
],
|
| 49 |
+
"dependencies": {
|
| 50 |
+
"fast-string-width": "^1.1.0",
|
| 51 |
+
"fast-wrap-ansi": "^0.1.3",
|
| 52 |
+
"sisteransi": "^1.0.5",
|
| 53 |
+
"@clack/core": "1.2.0"
|
| 54 |
+
},
|
| 55 |
+
"devDependencies": {
|
| 56 |
+
"is-unicode-supported": "^1.3.0",
|
| 57 |
+
"memfs": "^4.17.2",
|
| 58 |
+
"vitest": "^3.2.4",
|
| 59 |
+
"vitest-ansi-serializer": "^0.1.2"
|
| 60 |
+
},
|
| 61 |
+
"scripts": {
|
| 62 |
+
"build": "unbuild",
|
| 63 |
+
"test": "vitest run"
|
| 64 |
+
}
|
| 65 |
+
}
|
extensions/channels/node_modules/@derhuerst/http-basic/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2022 Forbes Lindesay & Jannis R
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 5 |
+
in the Software without restriction, including without limitation the rights
|
| 6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
furnished to do so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in
|
| 11 |
+
all copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 19 |
+
THE SOFTWARE.
|
extensions/channels/node_modules/@derhuerst/http-basic/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# http-basic
|
| 2 |
+
|
| 3 |
+
**This is a temporary fork of [`ForbesLindesay/http-basic`](https://github.com/ForbesLindesay/http-basic).**
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
Simple wrapper arround http.request/https.request
|
| 8 |
+
|
| 9 |
+
[](https://travis-ci.org/ForbesLindesay/http-basic)
|
| 10 |
+
[](https://david-dm.org/ForbesLindesay/http-basic)
|
| 11 |
+
[](https://www.npmjs.org/package/http-basic)
|
| 12 |
+
|
| 13 |
+
## Installation
|
| 14 |
+
|
| 15 |
+
npm install http-basic
|
| 16 |
+
|
| 17 |
+
## Usage
|
| 18 |
+
|
| 19 |
+
```js
|
| 20 |
+
var request = require('http-basic');
|
| 21 |
+
|
| 22 |
+
var options = {followRedirects: true, gzip: true, cache: 'memory'};
|
| 23 |
+
|
| 24 |
+
var req = request('GET', 'http://example.com', options, function (err, res) {
|
| 25 |
+
if (err) throw err;
|
| 26 |
+
console.dir(res.statusCode);
|
| 27 |
+
res.body.resume();
|
| 28 |
+
});
|
| 29 |
+
req.end();
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
**method:**
|
| 33 |
+
|
| 34 |
+
The http method (e.g. `GET`, `POST`, `PUT`, `DELETE` etc.)
|
| 35 |
+
|
| 36 |
+
**url:**
|
| 37 |
+
|
| 38 |
+
The url as a string (e.g. `http://example.com`). It must be fully qualified and either http or https.
|
| 39 |
+
|
| 40 |
+
**options:**
|
| 41 |
+
|
| 42 |
+
- `headers` - (default `{}`) http headers
|
| 43 |
+
- `agent` - (default: `false`) controlls keep-alive (see http://nodejs.org/api/http.html#http_http_request_options_callback)
|
| 44 |
+
- `duplex` - (default: `true` except for `GET`, `OPTIONS` and `HEAD` requests) allows you to explicitly set a body on a request that uses a method that normally would not have a body
|
| 45 |
+
- `followRedirects` - (default: `false`) - if true, redirects are followed (note that this only affects the result in the callback)
|
| 46 |
+
- `maxRedirects` - (default: `Infinity`) - limit the number of redirects allowed.
|
| 47 |
+
- `allowRedirectHeaders` (default: `null`) - an array of headers allowed for redirects (none if `null`).
|
| 48 |
+
- `gzip` (default: `false`) - automatically accept gzip and deflate encodings. This is kept completely transparent to the user.
|
| 49 |
+
- `cache` - (default: `null`) - `'memory'` or `'file'` to use the default built in caches or you can pass your own cache implementation.
|
| 50 |
+
- `timeout` (default: `false`) - times out if no response is returned within the given number of milliseconds.
|
| 51 |
+
- `socketTimeout` (default: `false`) - calls `req.setTimeout` internally which causes the request to timeout if no new data is seen for the given number of milliseconds.
|
| 52 |
+
- `retry` (default: `false`) - retry GET requests. Set this to `true` to retry when the request errors or returns a status code greater than or equal to 400 (can also be a function that takes `(err, req, attemptNo) => shouldRetry`)
|
| 53 |
+
- `retryDelay` (default: `200`) - the delay between retries (can also be set to a function that takes `(err, res, attemptNo) => delay`)
|
| 54 |
+
- `maxRetries` (default: `5`) - the number of times to retry before giving up.
|
| 55 |
+
- `ignoreFailedInvalidation` (default: `false`) - whether the cache should swallow errors if there is a problem removing a cached response. Note that enabling this setting may result in incorrect, cached data being returned to the user.
|
| 56 |
+
- `isMatch` - `(requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a cached response matches a request.
|
| 57 |
+
- `isExpired` - `(cachedResponse: CachedResponse, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a cached response has expired
|
| 58 |
+
- `canCache` - `(res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a response can be cached
|
| 59 |
+
|
| 60 |
+
**callback:**
|
| 61 |
+
|
| 62 |
+
The callback is called with `err` as the first argument and `res` as the second argument. `res` is an [http-response-object](https://github.com/ForbesLindesay/http-response-object). It has the following properties:
|
| 63 |
+
|
| 64 |
+
- `statusCode` - a number representing the HTTP Status Code
|
| 65 |
+
- `headers` - an object representing the HTTP headers
|
| 66 |
+
- `body` - a readable stream respresenting the request body.
|
| 67 |
+
- `url` - the URL that was requested (in the case of redirects, this is the final url that was requested)
|
| 68 |
+
|
| 69 |
+
**returns:**
|
| 70 |
+
|
| 71 |
+
If the method is `GET`, `DELETE` or `HEAD`, it returns `undefined`.
|
| 72 |
+
|
| 73 |
+
Otherwise, it returns a writable stream for the body of the request.
|
| 74 |
+
|
| 75 |
+
## Implementing a Cache
|
| 76 |
+
|
| 77 |
+
A `Cache` is an object with three methods:
|
| 78 |
+
|
| 79 |
+
- `getResponse(url, callback)` - retrieve a cached response object
|
| 80 |
+
- `setResponse(url, response)` - cache a response object
|
| 81 |
+
- `invalidateResponse(url, callback)` - remove a response which is no longer valid
|
| 82 |
+
|
| 83 |
+
A cached response object is an object with the following properties:
|
| 84 |
+
|
| 85 |
+
- `statusCode` - Number
|
| 86 |
+
- `headers` - Object (key value pairs of strings)
|
| 87 |
+
- `body` - Stream (a stream of binary data)
|
| 88 |
+
- `requestHeaders` - Object (key value pairs of strings)
|
| 89 |
+
- `requestTimestamp` - Number
|
| 90 |
+
|
| 91 |
+
`getResponse` should call the callback with an optional error and either `null` or a cached response object, depending on whether the url can be found in the cache. Only `GET`s are cached.
|
| 92 |
+
|
| 93 |
+
`setResponse` should just swallow any errors it has (or resport them using `console.warn`).
|
| 94 |
+
|
| 95 |
+
`invalidateResponse` should call the callback with an optional error if it is unable to invalidate a response.
|
| 96 |
+
|
| 97 |
+
A cache may also define any of the methods from `lib/cache-utils.js` to override behaviour for what gets cached. It is currently still only possible to cache "get" requests, although this could be changed.
|
| 98 |
+
|
| 99 |
+
## License
|
| 100 |
+
|
| 101 |
+
MIT
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import { Headers } from './Headers';
|
| 3 |
+
interface CachedResponse {
|
| 4 |
+
statusCode: number;
|
| 5 |
+
headers: Headers;
|
| 6 |
+
body: NodeJS.ReadableStream;
|
| 7 |
+
requestHeaders: Headers;
|
| 8 |
+
requestTimestamp: number;
|
| 9 |
+
}
|
| 10 |
+
export { CachedResponse };
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/CachedResponse.js.flow
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import type {Headers} from './Headers';
|
| 5 |
+
|
| 6 |
+
interface CachedResponse {
|
| 7 |
+
statusCode: number;
|
| 8 |
+
headers: Headers;
|
| 9 |
+
body: stream$Readable;
|
| 10 |
+
requestHeaders: Headers;
|
| 11 |
+
requestTimestamp: number;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
export type {CachedResponse};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import Response = require('http-response-object');
|
| 3 |
+
declare type Callback = (err: NodeJS.ErrnoException | null, response?: Response<NodeJS.ReadableStream>) => void;
|
| 4 |
+
export { Callback };
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Callback.js.flow
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
const Response = require('http-response-object');
|
| 5 |
+
|
| 6 |
+
type Callback = (
|
| 7 |
+
err: ErrnoError | null,
|
| 8 |
+
response?: Response<stream$Readable>,
|
| 9 |
+
) => void;
|
| 10 |
+
|
| 11 |
+
export type {Callback};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import { ICache } from './ICache';
|
| 3 |
+
import { CachedResponse } from './CachedResponse';
|
| 4 |
+
export default class FileCache implements ICache {
|
| 5 |
+
private readonly _location;
|
| 6 |
+
constructor(location: string);
|
| 7 |
+
getResponse(url: string, callback: (err: null | Error, response: null | CachedResponse) => void): void;
|
| 8 |
+
setResponse(url: string, response: CachedResponse): void;
|
| 9 |
+
updateResponseHeaders(url: string, response: Pick<CachedResponse, 'headers' | 'requestTimestamp'>): void;
|
| 10 |
+
invalidateResponse(url: string, callback: (err: NodeJS.ErrnoException | null) => void): void;
|
| 11 |
+
getCacheKey(url: string): string;
|
| 12 |
+
}
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
exports.__esModule = true;
|
| 3 |
+
var fs = require("fs");
|
| 4 |
+
var path_1 = require("path");
|
| 5 |
+
var crypto_1 = require("crypto");
|
| 6 |
+
function jsonParse(data, cb) {
|
| 7 |
+
var result = null;
|
| 8 |
+
try {
|
| 9 |
+
result = JSON.parse(data);
|
| 10 |
+
}
|
| 11 |
+
catch (ex) {
|
| 12 |
+
if (ex instanceof Error) {
|
| 13 |
+
return cb(ex);
|
| 14 |
+
}
|
| 15 |
+
return cb(new Error(ex + ''));
|
| 16 |
+
}
|
| 17 |
+
cb(null, result);
|
| 18 |
+
}
|
| 19 |
+
var FileCache = /** @class */ (function () {
|
| 20 |
+
function FileCache(location) {
|
| 21 |
+
this._location = location;
|
| 22 |
+
}
|
| 23 |
+
FileCache.prototype.getResponse = function (url, callback) {
|
| 24 |
+
var key = (0, path_1.resolve)(this._location, this.getCacheKey(url));
|
| 25 |
+
fs.readFile(key + '.json', 'utf8', function (err, data) {
|
| 26 |
+
if (err && err.code === 'ENOENT')
|
| 27 |
+
return callback(null, null);
|
| 28 |
+
else if (err)
|
| 29 |
+
return callback(err, null);
|
| 30 |
+
jsonParse(data, function (err, response) {
|
| 31 |
+
if (err) {
|
| 32 |
+
return callback(err, null);
|
| 33 |
+
}
|
| 34 |
+
var body = fs.createReadStream(key + '.body');
|
| 35 |
+
response.body = body;
|
| 36 |
+
callback(null, response);
|
| 37 |
+
});
|
| 38 |
+
});
|
| 39 |
+
};
|
| 40 |
+
FileCache.prototype.setResponse = function (url, response) {
|
| 41 |
+
var key = (0, path_1.resolve)(this._location, this.getCacheKey(url));
|
| 42 |
+
var errored = false;
|
| 43 |
+
fs.mkdir(this._location, { recursive: true }, function (err) {
|
| 44 |
+
if (err && err.code !== 'EEXIST') {
|
| 45 |
+
console.warn('Error creating cache: ' + err.message);
|
| 46 |
+
return;
|
| 47 |
+
}
|
| 48 |
+
response.body.pipe(fs.createWriteStream(key + '.body')).on('error', function (err) {
|
| 49 |
+
errored = true;
|
| 50 |
+
console.warn('Error writing to cache: ' + err.message);
|
| 51 |
+
}).on('close', function () {
|
| 52 |
+
if (!errored) {
|
| 53 |
+
fs.writeFile(key + '.json', JSON.stringify({
|
| 54 |
+
statusCode: response.statusCode,
|
| 55 |
+
headers: response.headers,
|
| 56 |
+
requestHeaders: response.requestHeaders,
|
| 57 |
+
requestTimestamp: response.requestTimestamp
|
| 58 |
+
}, null, ' '), function (err) {
|
| 59 |
+
if (err) {
|
| 60 |
+
console.warn('Error writing to cache: ' + err.message);
|
| 61 |
+
}
|
| 62 |
+
});
|
| 63 |
+
}
|
| 64 |
+
});
|
| 65 |
+
});
|
| 66 |
+
};
|
| 67 |
+
FileCache.prototype.updateResponseHeaders = function (url, response) {
|
| 68 |
+
var key = (0, path_1.resolve)(this._location, this.getCacheKey(url));
|
| 69 |
+
fs.readFile(key + '.json', 'utf8', function (err, data) {
|
| 70 |
+
if (err) {
|
| 71 |
+
console.warn('Error writing to cache: ' + err.message);
|
| 72 |
+
return;
|
| 73 |
+
}
|
| 74 |
+
var parsed = null;
|
| 75 |
+
try {
|
| 76 |
+
parsed = JSON.parse(data);
|
| 77 |
+
}
|
| 78 |
+
catch (ex) {
|
| 79 |
+
if (ex instanceof Error) {
|
| 80 |
+
console.warn('Error writing to cache: ' + ex.message);
|
| 81 |
+
}
|
| 82 |
+
return;
|
| 83 |
+
}
|
| 84 |
+
fs.writeFile(key + '.json', JSON.stringify({
|
| 85 |
+
statusCode: parsed.statusCode,
|
| 86 |
+
headers: response.headers,
|
| 87 |
+
requestHeaders: parsed.requestHeaders,
|
| 88 |
+
requestTimestamp: response.requestTimestamp
|
| 89 |
+
}, null, ' '), function (err) {
|
| 90 |
+
if (err) {
|
| 91 |
+
console.warn('Error writing to cache: ' + err.message);
|
| 92 |
+
}
|
| 93 |
+
});
|
| 94 |
+
});
|
| 95 |
+
};
|
| 96 |
+
FileCache.prototype.invalidateResponse = function (url, callback) {
|
| 97 |
+
var key = (0, path_1.resolve)(this._location, this.getCacheKey(url));
|
| 98 |
+
fs.unlink(key + '.json', function (err) {
|
| 99 |
+
if (err && err.code === 'ENOENT')
|
| 100 |
+
return callback(null);
|
| 101 |
+
else
|
| 102 |
+
callback(err || null);
|
| 103 |
+
});
|
| 104 |
+
};
|
| 105 |
+
FileCache.prototype.getCacheKey = function (url) {
|
| 106 |
+
var hash = (0, crypto_1.createHash)('sha512');
|
| 107 |
+
hash.update(url);
|
| 108 |
+
return hash.digest('hex');
|
| 109 |
+
};
|
| 110 |
+
return FileCache;
|
| 111 |
+
}());
|
| 112 |
+
exports["default"] = FileCache;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/FileCache.js.flow
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import type {ICache} from './ICache';
|
| 5 |
+
import type {CachedResponse} from './CachedResponse';
|
| 6 |
+
|
| 7 |
+
declare class FileCache {
|
| 8 |
+
constructor(location: string): void;
|
| 9 |
+
getResponse(
|
| 10 |
+
url: string,
|
| 11 |
+
callback: (err: null | Error, response: null | CachedResponse) => void,
|
| 12 |
+
): void;
|
| 13 |
+
setResponse(url: string, response: CachedResponse): void;
|
| 14 |
+
updateResponseHeaders(
|
| 15 |
+
url: string,
|
| 16 |
+
response: {[key: 'headers' | 'requestTimestamp']: any},
|
| 17 |
+
): void;
|
| 18 |
+
invalidateResponse(
|
| 19 |
+
url: string,
|
| 20 |
+
callback: (err: ErrnoError | null) => void,
|
| 21 |
+
): void;
|
| 22 |
+
getCacheKey(url: string): string;
|
| 23 |
+
}
|
| 24 |
+
export default FileCache;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import { IncomingHttpHeaders } from 'http';
|
| 3 |
+
export declare type Headers = IncomingHttpHeaders;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Headers.js.flow
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
type IncomingHttpHeaders = Object;
|
| 5 |
+
|
| 6 |
+
type Headers = IncomingHttpHeaders;
|
| 7 |
+
export type {Headers};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare type HttpVerb = ('GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH');
|
| 2 |
+
export { HttpVerb };
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/HttpVerb.js.flow
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
type HttpVerb =
|
| 5 |
+
| 'GET'
|
| 6 |
+
| 'HEAD'
|
| 7 |
+
| 'POST'
|
| 8 |
+
| 'PUT'
|
| 9 |
+
| 'DELETE'
|
| 10 |
+
| 'CONNECT'
|
| 11 |
+
| 'OPTIONS'
|
| 12 |
+
| 'TRACE'
|
| 13 |
+
| 'PATCH';
|
| 14 |
+
|
| 15 |
+
export type {HttpVerb};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { CachedResponse } from './CachedResponse';
|
| 2 |
+
interface ICache {
|
| 3 |
+
getResponse(url: string, cb: (err: Error | null, response: CachedResponse | null) => void): void;
|
| 4 |
+
setResponse(url: string, response: CachedResponse | null): void;
|
| 5 |
+
updateResponseHeaders?: (url: string, response: Pick<CachedResponse, 'headers' | 'requestTimestamp'>) => void;
|
| 6 |
+
invalidateResponse(url: string, cb: (err: Error | null) => void): void;
|
| 7 |
+
}
|
| 8 |
+
export { ICache };
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/ICache.js.flow
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import type {CachedResponse} from './CachedResponse';
|
| 5 |
+
|
| 6 |
+
interface ICache {
|
| 7 |
+
getResponse(
|
| 8 |
+
url: string,
|
| 9 |
+
cb: (err: Error | null, response: CachedResponse | null) => void,
|
| 10 |
+
): void;
|
| 11 |
+
setResponse(url: string, response: CachedResponse | null): void;
|
| 12 |
+
updateResponseHeaders?: (
|
| 13 |
+
url: string,
|
| 14 |
+
response: {[key: 'headers' | 'requestTimestamp']: any},
|
| 15 |
+
) => void;
|
| 16 |
+
invalidateResponse(url: string, cb: (err: Error | null) => void): void;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export type {ICache};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import { CachedResponse } from './CachedResponse';
|
| 3 |
+
export default class MemoryCache {
|
| 4 |
+
private readonly _cache;
|
| 5 |
+
getResponse(url: string, callback: (err: null | Error, response: null | CachedResponse) => void): void;
|
| 6 |
+
updateResponseHeaders(url: string, response: Pick<CachedResponse, 'headers' | 'requestTimestamp'>): void;
|
| 7 |
+
setResponse(url: string, response: CachedResponse): void;
|
| 8 |
+
invalidateResponse(url: string, callback: (err: NodeJS.ErrnoException | null) => void): void;
|
| 9 |
+
}
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
var __assign = (this && this.__assign) || function () {
|
| 3 |
+
__assign = Object.assign || function(t) {
|
| 4 |
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
| 5 |
+
s = arguments[i];
|
| 6 |
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
| 7 |
+
t[p] = s[p];
|
| 8 |
+
}
|
| 9 |
+
return t;
|
| 10 |
+
};
|
| 11 |
+
return __assign.apply(this, arguments);
|
| 12 |
+
};
|
| 13 |
+
exports.__esModule = true;
|
| 14 |
+
var stream_1 = require("stream");
|
| 15 |
+
var concat = require("concat-stream");
|
| 16 |
+
var MemoryCache = /** @class */ (function () {
|
| 17 |
+
function MemoryCache() {
|
| 18 |
+
this._cache = {};
|
| 19 |
+
}
|
| 20 |
+
MemoryCache.prototype.getResponse = function (url, callback) {
|
| 21 |
+
var cache = this._cache;
|
| 22 |
+
if (cache[url]) {
|
| 23 |
+
var body = new stream_1.PassThrough();
|
| 24 |
+
body.end(cache[url].body);
|
| 25 |
+
callback(null, {
|
| 26 |
+
statusCode: cache[url].statusCode,
|
| 27 |
+
headers: cache[url].headers,
|
| 28 |
+
body: body,
|
| 29 |
+
requestHeaders: cache[url].requestHeaders,
|
| 30 |
+
requestTimestamp: cache[url].requestTimestamp
|
| 31 |
+
});
|
| 32 |
+
}
|
| 33 |
+
else {
|
| 34 |
+
callback(null, null);
|
| 35 |
+
}
|
| 36 |
+
};
|
| 37 |
+
MemoryCache.prototype.updateResponseHeaders = function (url, response) {
|
| 38 |
+
this._cache[url] = __assign(__assign({}, this._cache[url]), { headers: response.headers, requestTimestamp: response.requestTimestamp });
|
| 39 |
+
};
|
| 40 |
+
MemoryCache.prototype.setResponse = function (url, response) {
|
| 41 |
+
var cache = this._cache;
|
| 42 |
+
response.body.pipe(concat(function (body) {
|
| 43 |
+
cache[url] = {
|
| 44 |
+
statusCode: response.statusCode,
|
| 45 |
+
headers: response.headers,
|
| 46 |
+
body: body,
|
| 47 |
+
requestHeaders: response.requestHeaders,
|
| 48 |
+
requestTimestamp: response.requestTimestamp
|
| 49 |
+
};
|
| 50 |
+
}));
|
| 51 |
+
};
|
| 52 |
+
MemoryCache.prototype.invalidateResponse = function (url, callback) {
|
| 53 |
+
var cache = this._cache;
|
| 54 |
+
delete cache[url];
|
| 55 |
+
callback(null);
|
| 56 |
+
};
|
| 57 |
+
return MemoryCache;
|
| 58 |
+
}());
|
| 59 |
+
exports["default"] = MemoryCache;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/MemoryCache.js.flow
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import type {CachedResponse} from './CachedResponse';
|
| 5 |
+
|
| 6 |
+
declare class MemoryCache {
|
| 7 |
+
getResponse(
|
| 8 |
+
url: string,
|
| 9 |
+
callback: (err: null | Error, response: null | CachedResponse) => void,
|
| 10 |
+
): void;
|
| 11 |
+
updateResponseHeaders(
|
| 12 |
+
url: string,
|
| 13 |
+
response: {[key: 'headers' | 'requestTimestamp']: any},
|
| 14 |
+
): void;
|
| 15 |
+
setResponse(url: string, response: CachedResponse): void;
|
| 16 |
+
invalidateResponse(
|
| 17 |
+
url: string,
|
| 18 |
+
callback: (err: ErrnoError | null) => void,
|
| 19 |
+
): void;
|
| 20 |
+
}
|
| 21 |
+
export default MemoryCache;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
/// <reference types="node" />
|
| 3 |
+
import { Agent } from 'http';
|
| 4 |
+
import { Headers } from './Headers';
|
| 5 |
+
import { ICache } from './ICache';
|
| 6 |
+
import Response = require('http-response-object');
|
| 7 |
+
import { CachedResponse } from './CachedResponse';
|
| 8 |
+
interface Options {
|
| 9 |
+
agent?: Agent | boolean;
|
| 10 |
+
allowRedirectHeaders?: string[];
|
| 11 |
+
cache?: 'file' | 'memory' | ICache;
|
| 12 |
+
duplex?: boolean;
|
| 13 |
+
followRedirects?: boolean;
|
| 14 |
+
gzip?: boolean;
|
| 15 |
+
headers?: Headers;
|
| 16 |
+
ignoreFailedInvalidation?: boolean;
|
| 17 |
+
maxRedirects?: number;
|
| 18 |
+
maxRetries?: number;
|
| 19 |
+
retry?: boolean | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number) => boolean);
|
| 20 |
+
retryDelay?: number | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number) => number);
|
| 21 |
+
socketTimeout?: number;
|
| 22 |
+
timeout?: number;
|
| 23 |
+
isMatch?: (requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
|
| 24 |
+
isExpired?: (cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
|
| 25 |
+
canCache?: (res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean;
|
| 26 |
+
}
|
| 27 |
+
export { Options };
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/Options.js.flow
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import {Agent} from 'http';
|
| 5 |
+
import type {Headers} from './Headers';
|
| 6 |
+
import type {ICache} from './ICache';
|
| 7 |
+
const Response = require('http-response-object');
|
| 8 |
+
import type {CachedResponse} from './CachedResponse';
|
| 9 |
+
|
| 10 |
+
interface Options {
|
| 11 |
+
agent?: Agent | boolean;
|
| 12 |
+
allowRedirectHeaders?: Array<string>;
|
| 13 |
+
cache?: 'file' | 'memory' | ICache;
|
| 14 |
+
duplex?: boolean;
|
| 15 |
+
followRedirects?: boolean;
|
| 16 |
+
gzip?: boolean;
|
| 17 |
+
headers?: Headers;
|
| 18 |
+
ignoreFailedInvalidation?: boolean;
|
| 19 |
+
maxRedirects?: number;
|
| 20 |
+
maxRetries?: number;
|
| 21 |
+
retry?:
|
| 22 |
+
| boolean
|
| 23 |
+
| ((
|
| 24 |
+
err: ErrnoError | null,
|
| 25 |
+
res: Response<stream$Readable> | void,
|
| 26 |
+
attemptNumber: number,
|
| 27 |
+
) => boolean);
|
| 28 |
+
retryDelay?:
|
| 29 |
+
| number
|
| 30 |
+
| ((
|
| 31 |
+
err: ErrnoError | null,
|
| 32 |
+
res: Response<stream$Readable> | void,
|
| 33 |
+
attemptNumber: number,
|
| 34 |
+
) => number);
|
| 35 |
+
socketTimeout?: number;
|
| 36 |
+
timeout?: number;
|
| 37 |
+
isMatch?: (
|
| 38 |
+
requestHeaders: Headers,
|
| 39 |
+
cachedResponse: CachedResponse,
|
| 40 |
+
defaultValue: boolean,
|
| 41 |
+
) => boolean;
|
| 42 |
+
isExpired?: (
|
| 43 |
+
cachedResponse: CachedResponse,
|
| 44 |
+
defaultValue: boolean,
|
| 45 |
+
) => boolean;
|
| 46 |
+
canCache?: (res: Response<stream$Readable>, defaultValue: boolean) => boolean;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export type {Options};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { CachedResponse } from './CachedResponse';
|
| 2 |
+
import Response = require('http-response-object');
|
| 3 |
+
export declare type Policy = {
|
| 4 |
+
maxage: number | null;
|
| 5 |
+
};
|
| 6 |
+
/**
|
| 7 |
+
* returns true if this response is cacheable (according to cache-control headers)
|
| 8 |
+
*/
|
| 9 |
+
export declare function isCacheable<T>(res: Response<T> | CachedResponse): boolean;
|
| 10 |
+
/**
|
| 11 |
+
* if the response is cacheable, returns an object detailing the maxage of the cache
|
| 12 |
+
* otherwise returns null
|
| 13 |
+
*/
|
| 14 |
+
export declare function cachePolicy<T>(res: Response<T> | CachedResponse): Policy | null;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
| 3 |
+
exports.cachePolicy = exports.isCacheable = void 0;
|
| 4 |
+
var parseCacheControl = require('parse-cache-control');
|
| 5 |
+
function parseCacheControlHeader(res) {
|
| 6 |
+
var cacheControl = res.headers['cache-control'];
|
| 7 |
+
var normalisedCacheControl = typeof cacheControl === 'string' ? cacheControl.trim() : ''; // must be normalised for parsing (e.g. parseCacheControl)
|
| 8 |
+
if (!cacheControl) {
|
| 9 |
+
return null;
|
| 10 |
+
}
|
| 11 |
+
return parseCacheControl(cacheControl);
|
| 12 |
+
}
|
| 13 |
+
// for the purposes of this library, we err on the side of caution and do not cache anything except public (or implicit public)
|
| 14 |
+
var nonCaching = ['private', 'no-cache', 'no-store', 'no-transform', 'must-revalidate', 'proxy-revalidate'];
|
| 15 |
+
function isCacheControlCacheable(parsedCacheControl) {
|
| 16 |
+
if (!parsedCacheControl) {
|
| 17 |
+
return false;
|
| 18 |
+
}
|
| 19 |
+
if (parsedCacheControl.public) {
|
| 20 |
+
return true;
|
| 21 |
+
}
|
| 22 |
+
// note that the library does not currently support s-maxage
|
| 23 |
+
if (parsedCacheControl["max-age"]) {
|
| 24 |
+
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3
|
| 25 |
+
// The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present.
|
| 26 |
+
for (var i = 0; i < nonCaching.length; i++) {
|
| 27 |
+
if (parsedCacheControl[nonCaching[i]]) {
|
| 28 |
+
return false;
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
return true;
|
| 32 |
+
}
|
| 33 |
+
return false;
|
| 34 |
+
}
|
| 35 |
+
/**
|
| 36 |
+
* returns true if this response is cacheable (according to cache-control headers)
|
| 37 |
+
*/
|
| 38 |
+
function isCacheable(res) {
|
| 39 |
+
return isCacheControlCacheable(parseCacheControlHeader(res));
|
| 40 |
+
}
|
| 41 |
+
exports.isCacheable = isCacheable;
|
| 42 |
+
function buildPolicy(parsedCacheControl) {
|
| 43 |
+
// note that the library does not currently support s-maxage
|
| 44 |
+
return { maxage: parsedCacheControl['max-age'] || null };
|
| 45 |
+
}
|
| 46 |
+
/**
|
| 47 |
+
* if the response is cacheable, returns an object detailing the maxage of the cache
|
| 48 |
+
* otherwise returns null
|
| 49 |
+
*/
|
| 50 |
+
function cachePolicy(res) {
|
| 51 |
+
var parsed = parseCacheControlHeader(res);
|
| 52 |
+
return parsed && isCacheControlCacheable(parsed) ? buildPolicy(parsed) : null;
|
| 53 |
+
}
|
| 54 |
+
exports.cachePolicy = cachePolicy;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-control-utils.js.flow
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// @flow
|
| 2 |
+
// Generated using flowgen2
|
| 3 |
+
|
| 4 |
+
import type {CachedResponse} from './CachedResponse';
|
| 5 |
+
const Response = require('http-response-object');
|
| 6 |
+
|
| 7 |
+
type Policy = {maxage: number | null};
|
| 8 |
+
export type {Policy};
|
| 9 |
+
|
| 10 |
+
declare function isCacheable<T>(res: Response<T> | CachedResponse): boolean;
|
| 11 |
+
export {isCacheable};
|
| 12 |
+
|
| 13 |
+
declare function cachePolicy<T>(
|
| 14 |
+
res: Response<T> | CachedResponse,
|
| 15 |
+
): Policy | null;
|
| 16 |
+
export {cachePolicy};
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import Response = require('http-response-object');
|
| 2 |
+
import { Headers } from './Headers';
|
| 3 |
+
import { CachedResponse } from './CachedResponse';
|
| 4 |
+
export declare function isMatch(requestHeaders: Headers, cachedResponse: CachedResponse): boolean;
|
| 5 |
+
export declare function isExpired(cachedResponse: CachedResponse): boolean;
|
| 6 |
+
export declare function canCache<T>(res: Response<T>): boolean;
|
extensions/channels/node_modules/@derhuerst/http-basic/lib/cache-utils.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
exports.__esModule = true;
|
| 3 |
+
exports.canCache = exports.isExpired = exports.isMatch = void 0;
|
| 4 |
+
var cache_control_utils_1 = require("./cache-control-utils");
|
| 5 |
+
function isMatch(requestHeaders, cachedResponse) {
|
| 6 |
+
var vary = cachedResponse.headers['vary'];
|
| 7 |
+
if (vary && cachedResponse.requestHeaders) {
|
| 8 |
+
vary = '' + vary;
|
| 9 |
+
return vary.split(',').map(function (header) { return header.trim().toLowerCase(); }).every(function (header) {
|
| 10 |
+
return requestHeaders[header] === cachedResponse.requestHeaders[header];
|
| 11 |
+
});
|
| 12 |
+
}
|
| 13 |
+
else {
|
| 14 |
+
return true;
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
exports.isMatch = isMatch;
|
| 18 |
+
;
|
| 19 |
+
function isExpired(cachedResponse) {
|
| 20 |
+
var policy = (0, cache_control_utils_1.cachePolicy)(cachedResponse);
|
| 21 |
+
if (policy) {
|
| 22 |
+
var time = (Date.now() - cachedResponse.requestTimestamp) / 1000;
|
| 23 |
+
if (policy.maxage !== null && policy.maxage > time) {
|
| 24 |
+
return false;
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
if (cachedResponse.statusCode === 301 || cachedResponse.statusCode === 308)
|
| 28 |
+
return false;
|
| 29 |
+
return true;
|
| 30 |
+
}
|
| 31 |
+
exports.isExpired = isExpired;
|
| 32 |
+
;
|
| 33 |
+
function canCache(res) {
|
| 34 |
+
if (res.headers['etag'])
|
| 35 |
+
return true;
|
| 36 |
+
if (res.headers['last-modified'])
|
| 37 |
+
return true;
|
| 38 |
+
if ((0, cache_control_utils_1.isCacheable)(res))
|
| 39 |
+
return true;
|
| 40 |
+
if (res.statusCode === 301 || res.statusCode === 308)
|
| 41 |
+
return true;
|
| 42 |
+
return false;
|
| 43 |
+
}
|
| 44 |
+
exports.canCache = canCache;
|
| 45 |
+
;
|