This commit is contained in:
zyc404 2023-10-05 17:22:54 +08:00
commit 8aec804179
15 changed files with 95707 additions and 60916 deletions

View file

@ -1,7 +1,7 @@
![chatgpt-plugin](https://user-images.githubusercontent.com/21212372/232115814-de9a0633-371f-4733-8da0-dd6e912c8a1e.png)
<div align=center> <h1>云崽QQ机器人的ChatGPT插件</h1> </div>
<div align=center>
<img src ="https://img.shields.io/github/issues/ikechan8370/chatgpt-plugin?logo=github"/>
<img src ="https://img.shields.io/github/license/ikechan8370/chatgpt-plugin"/>
<img src ="https://img.shields.io/github/v/tag/ikechan8370/chatgpt-plugin?label=latest%20version&logo=github"/>
@ -19,9 +19,9 @@
### 推荐的相关文档和参考资料
本README
[手册](https://chatgptplugin.ikechan8370.com/)
[文档1建设中](https://chatgpt-docs.err0r.top/)
[插件常见问题(鹤望兰版)](https://www.wolai.com/4FCxxWAdjbrHF29MCJmAQK)
[Yunzai常见问题LUCK小运版](https://www.wolai.com/oA43vuW71aBnv7UsEysn4T)
[文档1建设中](https://chatgpt-docs.err0r.top/)
[插件常见问题(鹤望兰版)](https://www.wolai.com/4FCxxWAdjbrHF29MCJmAQK)
[Yunzai常见问题LUCK小运版](https://www.wolai.com/oA43vuW71aBnv7UsEysn4T)
[憨憨博客](https://blog.hanhanz.top/)
## 特点
@ -40,7 +40,7 @@
* 2023-05-12 支持星火大模型
* 2023-05-29 支持gpt-4 API.必应无需cookie即可对话Sydney和自定义模式
* 2023-07 支持智能模式,机器人可以实现禁言、群名片/头衔(需给机器人管理员/群主、分享音乐视频、主动发音频、对接ap,sr和喵喵等插件、联网搜索等需api模式0613系列模型。智能模式所需的额外api和搜索api分别可以参考[chatgpt-plugin-extras](https://github.com/ikechan8370/chatgpt-plugin-extras) 和 [search-api](https://github.com/ikechan8370/search-api) 自行搭建,其中后者提供了一个公益版本,前者可使用[huggingface](https://huggingface.co/spaces/ikechan8370/cp-extra)部署
* 2023-09-10 支持来自claude.ai的claude-2模型
### 如果觉得这个插件有趣或者对你有帮助请点一个star吧
## 版本要求
@ -97,7 +97,7 @@ pnpm i
用户同样可私聊机器人 `#设置用户密码` 进行账号注册和密码设置
用户设置密码后,所有聊天信息将记录在用户缓存数据下,同时用户可通过私聊机器人 `#chatgpt用户配置` 登录后台用户配置面板,查看自己的聊天数据和自定义机器人对自己的回复参数
如果后台面板访问出现 time out 请检查机器人启动时是否有报错服务器端口是否开放可尝试ping一下服务器ip看能否直接ping通。
5. 重启Yunzai-Bot
@ -263,9 +263,9 @@ pnpm i
> 原因:没装依赖
>
> 解决方式:请参考文档在本插件目录下用`pnpm install`安装依赖,安装完就不报错了
4. 反代能自己搭吗?
能。参考[这里](https://ikechan8370.com/archives/da-jian-chatgpt-guan-fang-fan-xiang-dai-li)
必应可以用[azure](https://ikechan8370.com/archives/ji-yu-azure-container-web-applicationda-jian-mian-fei-bi-ying-fan-dai)或~cloudflare workers~的serverless服务
@ -279,7 +279,7 @@ pnpm i
7. 系统后台无法进入怎么办?
多数情况下是由于服务器未开放3321端口导致请根据服务器系统和服务器供应商配置开放3321端口后再试。
## 交流群
* QQ 559567232 [问题交流]

View file

@ -67,9 +67,10 @@ import { SendDiceTool } from '../utils/tools/SendDiceTool.js'
import { SendAvatarTool } from '../utils/tools/SendAvatarTool.js'
import { SendMessageToSpecificGroupOrUserTool } from '../utils/tools/SendMessageToSpecificGroupOrUserTool.js'
import { SetTitleTool } from '../utils/tools/SetTitleTool.js'
import { createCaptcha, solveCaptcha, solveCaptchaOneShot } from '../utils/bingCaptcha.js'
import { solveCaptchaOneShot } from '../utils/bingCaptcha.js'
import { ClaudeAIClient } from '../utils/claude.ai/index.js'
import fs from 'fs'
import { getProxy } from '../utils/proxy.js'
try {
await import('@azure/openai')
@ -88,14 +89,7 @@ try {
logger.warn('【ChatGPT-Plugin】依赖keyv未安装可能影响Sydney模式下Bing对话建议执行pnpm install keyv安装')
}
let version = Config.version
let proxy
if (Config.proxy) {
try {
proxy = (await import('https-proxy-agent')).default
} catch (e) {
console.warn('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
let proxy = getProxy()
/**
* 每个对话保留的时长单个对话内ai是保留上下文的超时后销毁对话再次对话创建新的对话
* 单位
@ -108,8 +102,8 @@ const defaultPropmtPrefix = ', a large language model trained by OpenAI. You ans
const newFetch = (url, options = {}) => {
const defaultOptions = Config.proxy
? {
agent: proxy(Config.proxy)
}
agent: proxy(Config.proxy)
}
: {}
const mergedOptions = {
...defaultOptions,
@ -119,7 +113,7 @@ const newFetch = (url, options = {}) => {
return fetch(url, mergedOptions)
}
export class chatgpt extends plugin {
constructor() {
constructor () {
let toggleMode = Config.toggleMode
super({
/** 功能名称 */
@ -267,7 +261,7 @@ export class chatgpt extends plugin {
* @param e
* @returns {Promise<void>}
*/
async getConversations(e) {
async getConversations (e) {
// todo 根据use返回不同的对话列表
let keys = await redis.keys('CHATGPT:CONVERSATIONS:*')
if (!keys || keys.length === 0) {
@ -290,7 +284,7 @@ export class chatgpt extends plugin {
* @param e
* @returns {Promise<void>}
*/
async destroyConversations(e) {
async destroyConversations (e) {
const userData = await getUserData(e.user_id)
const use = (userData.mode === 'default' ? null : userData.mode) || await redis.get('CHATGPT:USE')
await redis.del(`CHATGPT:WRONG_EMOTION:${(e.isGroup && Config.groupMerge) ? e.group_id.toString() : e.sender.user_id}`)
@ -452,7 +446,7 @@ export class chatgpt extends plugin {
}
}
async endAllConversations(e) {
async endAllConversations (e) {
let use = await redis.get('CHATGPT:USE') || 'api'
let deleted = 0
switch (use) {
@ -547,7 +541,7 @@ export class chatgpt extends plugin {
await this.reply(`结束了${deleted}个用户的对话。`, true)
}
async deleteConversation(e) {
async deleteConversation (e) {
let ats = e.message.filter(m => m.type === 'at')
let use = await redis.get('CHATGPT:USE') || 'api'
if (use !== 'api3') {
@ -605,7 +599,7 @@ export class chatgpt extends plugin {
}
}
async switch2Picture(e) {
async switch2Picture (e) {
let userReplySetting = await redis.get(`CHATGPT:USER:${e.sender.user_id}`)
if (!userReplySetting) {
userReplySetting = getDefaultReplySetting()
@ -618,7 +612,7 @@ export class chatgpt extends plugin {
await this.reply('ChatGPT回复已转换为图片模式')
}
async switch2Text(e) {
async switch2Text (e) {
let userSetting = await getUserReplySetting(this.e)
userSetting.usePicture = false
userSetting.useTTS = false
@ -626,7 +620,7 @@ export class chatgpt extends plugin {
await this.reply('ChatGPT回复已转换为文字模式')
}
async switch2Audio(e) {
async switch2Audio (e) {
switch (Config.ttsMode) {
case 'vits-uma-genshin-honkai':
if (!Config.ttsSpace) {
@ -654,7 +648,7 @@ export class chatgpt extends plugin {
await this.reply('ChatGPT回复已转换为语音模式')
}
async switchTTSSource(e) {
async switchTTSSource (e) {
let target = e.msg.replace(/^#chatgpt语音换源/, '')
switch (target.trim()) {
case '1': {
@ -677,7 +671,7 @@ export class chatgpt extends plugin {
await e.reply('语音转换源已切换为' + Config.ttsMode)
}
async setDefaultRole(e) {
async setDefaultRole (e) {
if (Config.ttsMode === 'vits-uma-genshin-honkai' && !Config.ttsSpace) {
await this.reply('您没有配置vits-uma-genshin-honkai API请前往后台管理或锅巴面板进行配置')
return
@ -761,7 +755,7 @@ export class chatgpt extends plugin {
/**
* #chatgpt
*/
async chatgpt(e) {
async chatgpt (e) {
let prompt
if (this.toggleMode === 'at') {
if (!e.raw_message || e.msg?.startsWith('#')) {
@ -827,7 +821,7 @@ export class chatgpt extends plugin {
await this.abstractChat(e, prompt, use)
}
async abstractChat(e, prompt, use) {
async abstractChat (e, prompt, use) {
// 关闭私聊通道后不回复
if (!e.isMaster && e.isPrivate && !Config.enablePrivateChat) {
return false
@ -1133,9 +1127,9 @@ export class chatgpt extends plugin {
response.length / 2 < endIndex
? [response.substring(startIndex), response.substring(0, startIndex)]
: [
response.substring(0, endIndex + 1),
response.substring(endIndex + 1)
]
response.substring(0, endIndex + 1),
response.substring(endIndex + 1)
]
const match = ttsArr[0].match(emotionReg)
response = ttsArr[1].replace(/\n/, '').trim()
if (match) {
@ -1325,7 +1319,7 @@ export class chatgpt extends plugin {
}
}
async chatgpt1(e) {
async chatgpt1 (e) {
if (!Config.allowOtherMode) {
return false
}
@ -1344,7 +1338,7 @@ export class chatgpt extends plugin {
return true
}
async chatgpt3(e) {
async chatgpt3 (e) {
if (!Config.allowOtherMode) {
return false
}
@ -1363,7 +1357,7 @@ export class chatgpt extends plugin {
return true
}
async chatglm(e) {
async chatglm (e) {
if (!Config.allowOtherMode) {
return false
}
@ -1382,7 +1376,7 @@ export class chatgpt extends plugin {
return true
}
async bing(e) {
async bing (e) {
if (!Config.allowOtherMode) {
return false
}
@ -1439,7 +1433,7 @@ export class chatgpt extends plugin {
return true
}
async xh(e) {
async xh (e) {
if (!Config.allowOtherMode) {
return false
}
@ -1458,7 +1452,7 @@ export class chatgpt extends plugin {
return true
}
async cacheContent(e, use, content, prompt, quote = [], mood = '', suggest = '', imgUrls = []) {
async cacheContent (e, use, content, prompt, quote = [], mood = '', suggest = '', imgUrls = []) {
let cacheData = { file: '', status: '' }
cacheData.file = randomString()
const cacheresOption = {
@ -1498,13 +1492,13 @@ export class chatgpt extends plugin {
return cacheData
}
async renderImage(e, use, content, prompt, quote = [], mood = '', suggest = '', imgUrls = []) {
async renderImage (e, use, content, prompt, quote = [], mood = '', suggest = '', imgUrls = []) {
let cacheData = await this.cacheContent(e, use, content, prompt, quote, mood, suggest, imgUrls)
const template = use !== 'bing' ? 'content/ChatGPT/index' : 'content/Bing/index'
if (cacheData.error || cacheData.status != 200) { await this.reply(`出现错误:${cacheData.error || 'server error ' + cacheData.status}`, true) } else { await e.reply(await renderUrl(e, (Config.viewHost ? `${Config.viewHost}/` : `http://127.0.0.1:${Config.serverPort || 3321}/`) + `page/${cacheData.file}?qr=${Config.showQRCode ? 'true' : 'false'}`, { retType: Config.quoteReply ? 'base64' : '', Viewport: { width: parseInt(Config.chatViewWidth), height: parseInt(parseInt(Config.chatViewWidth) * 0.56) }, func: (parseFloat(Config.live2d) && !Config.viewHost) ? 'window.Live2d == true' : '', deviceScaleFactor: parseFloat(Config.cloudDPR) }), e.isGroup && Config.quoteReply) }
}
async sendMessage(prompt, conversation = {}, use, e) {
async sendMessage (prompt, conversation = {}, use, e) {
if (!conversation) {
conversation = {
timeoutMs: Config.defaultTimeoutMs
@ -1732,25 +1726,30 @@ export class chatgpt extends plugin {
bingTokens[badBingToken].State = '受限'
bingTokens[badBingToken].DisactivationTime = now
await redis.set('CHATGPT:BING_TOKENS', JSON.stringify(bingTokens))
// 不减次数
// 不减次数
} else if (message && typeof message === 'string' && message.indexOf('UnauthorizedRequest') > -1) {
// token过期了
// let bingTokens = JSON.parse(await redis.get('CHATGPT:BING_TOKENS'))
// const badBingToken = bingTokens.findIndex(element => element.Token === bingToken)
// // 可能是微软抽风,给三次机会
// if (bingTokens[badBingToken].exception) {
// if (bingTokens[badBingToken].exception <= 3) {
// bingTokens[badBingToken].exception += 1
// } else {
// bingTokens[badBingToken].exception = 0
// bingTokens[badBingToken].State = '过期'
// }
// } else {
// bingTokens[badBingToken].exception = 1
// }
// await redis.set('CHATGPT:BING_TOKENS', JSON.stringify(bingTokens))
logger.warn(`token${bingToken}疑似不存在或已过期,再试试`)
retry = retry - 0.1
// token过期了
let bingTokens = JSON.parse(await redis.get('CHATGPT:BING_TOKENS'))
const badBingToken = bingTokens.findIndex(element => element.Token === bingToken)
if (badBingToken > 0) {
// 可能是微软抽风,给三次机会
if (bingTokens[badBingToken]?.exception) {
if (bingTokens[badBingToken].exception <= 3) {
bingTokens[badBingToken].exception += 1
} else {
bingTokens[badBingToken].exception = 0
bingTokens[badBingToken].State = '过期'
}
} else {
bingTokens[badBingToken].exception = 1
}
await redis.set('CHATGPT:BING_TOKENS', JSON.stringify(bingTokens))
} else {
retry = retry - 1
}
errorMessage = 'UnauthorizedRequest必应token不正确或已过期'
// logger.warn(`token${bingToken}疑似不存在或已过期,再试试`)
// retry = retry - 1
} else {
retry--
errorMessage = message === 'Timed out waiting for response. Try enabling debug mode to see more information.' ? (reply ? `${reply}\n不行了,我的大脑过载了,处理不过来了!` : '必应的小脑瓜不好使了,不知道怎么回答!') : message
@ -1772,7 +1771,7 @@ export class chatgpt extends plugin {
}
} else {
return {
text: response.response,
text: response?.response,
quote: response.quote,
suggestedResponses: response.suggestedResponses,
conversationId: response.conversationId,
@ -1919,8 +1918,8 @@ export class chatgpt extends plugin {
}
const ssoSessionId = Config.xinghuoToken
if (!ssoSessionId) {
//throw new Error('未绑定星火token请使用#chatgpt设置星火token命令绑定token。获取对话页面的ssoSessionId cookie值')
logger.warn(`未绑定星火token请使用#chatgpt设置星火token命令绑定token。获取对话页面的ssoSessionId cookie值`)
// throw new Error('未绑定星火token请使用#chatgpt设置星火token命令绑定token。获取对话页面的ssoSessionId cookie值')
logger.warn('未绑定星火token请使用#chatgpt设置星火token命令绑定token。获取对话页面的ssoSessionId cookie值')
}
let client = new XinghuoClient({
ssoSessionId,
@ -1950,8 +1949,8 @@ export class chatgpt extends plugin {
const client = new OpenAIClient(Config.azureUrl, new AzureKeyCredential(Config.azApiKey))
const deploymentName = Config.azureDeploymentName
const { choices } = await client.getChatCompletions(deploymentName, msg)
let completion = choices[0].message;
return {'text' : completion.content, 'message': completion}
let completion = choices[0].message
return { text: completion.content, message: completion }
}
case 'bard': {
// 处理cookie
@ -1979,15 +1978,17 @@ export class chatgpt extends plugin {
}
// 发送数据
let bot = new Bard(cookie, {
fetch: fetch,
fetch,
bardURL: Config.bardForceUseReverse ? Config.bardReverseProxy : 'https://bard.google.com'
})
let chat = await bot.createChat(conversation?.conversationId ? {
conversationID: conversation.conversationId,
responseID: conversation.parentMessageId,
choiceID: conversation.clientId,
_reqID: conversation.invocationId
} : {})
let chat = await bot.createChat(conversation?.conversationId
? {
conversationID: conversation.conversationId,
responseID: conversation.parentMessageId,
choiceID: conversation.clientId,
_reqID: conversation.invocationId
}
: {})
let response = await chat.ask(prompt, {
image: imageBuff,
format: Bard.JSON
@ -2231,7 +2232,7 @@ export class chatgpt extends plugin {
} else {
tools.push(new SerpImageTool())
tools.push(...[new SearchVideoTool(),
new SendVideoTool()])
new SendVideoTool()])
}
let funcMap = {}
let fullFuncMap = {}
@ -2314,7 +2315,7 @@ export class chatgpt extends plugin {
}
}
async newClaudeConversation(e) {
async newClaudeConversation (e) {
let presetName = e.msg.replace(/^#claude开启新对话/, '').trim()
let client = new SlackClaudeClient({
slackUserToken: Config.slackUserToken,
@ -2352,7 +2353,7 @@ export class chatgpt extends plugin {
return true
}
async newxhBotConversation(e) {
async newxhBotConversation (e) {
let botId = e.msg.replace(/^#星火助手/, '').trim()
if (Config.xhmode != 'web') {
await e.reply('星火助手仅支持体验版使用', true)
@ -2363,7 +2364,7 @@ export class chatgpt extends plugin {
} else {
const ssoSessionId = Config.xinghuoToken
if (!ssoSessionId) {
await e.reply(`未绑定星火token请使用#chatgpt设置星火token命令绑定token`, true)
await e.reply('未绑定星火token请使用#chatgpt设置星火token命令绑定token', true)
return true
}
let client = new XinghuoClient({
@ -2377,7 +2378,7 @@ export class chatgpt extends plugin {
headers: {
'Content-Type': 'application/json',
Cookie: 'ssoSessionId=' + ssoSessionId + ';',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/113.0.5672.69 Mobile/15E148 Safari/604.1',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/113.0.5672.69 Mobile/15E148 Safari/604.1'
}
})
if (botInfoRes.ok) {
@ -2405,7 +2406,7 @@ export class chatgpt extends plugin {
await e.reply(`创建助手对话失败,${botInfo.desc}`, true)
}
} else {
await e.reply(`创建助手对话失败,服务器异常`, true)
await e.reply('创建助手对话失败,服务器异常', true)
}
} catch (error) {
await e.reply(`创建助手对话失败 ${error}`, true)
@ -2414,11 +2415,11 @@ export class chatgpt extends plugin {
return true
}
async searchxhBot(e) {
async searchxhBot (e) {
let searchBot = e.msg.replace(/^#星火(搜索|查找)助手/, '').trim()
const ssoSessionId = Config.xinghuoToken
if (!ssoSessionId) {
await e.reply(`未绑定星火token请使用#chatgpt设置星火token命令绑定token`, true)
await e.reply('未绑定星火token请使用#chatgpt设置星火token命令绑定token', true)
return true
}
const cacheresOption = {
@ -2426,7 +2427,7 @@ export class chatgpt extends plugin {
headers: {
'Content-Type': 'application/json',
Cookie: 'ssoSessionId=' + ssoSessionId + ';',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/113.0.5672.69 Mobile/15E148 Safari/604.1',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/113.0.5672.69 Mobile/15E148 Safari/604.1'
},
body: JSON.stringify({
botType: '',
@ -2444,19 +2445,19 @@ export class chatgpt extends plugin {
if (bots.data.pageList.length > 0) {
this.reply(await makeForwardMsg(this.e, bots.data.pageList.map(msg => `${msg.bot.botId} - ${msg.bot.botName}`)))
} else {
await e.reply(`未查到相关助手`, true)
await e.reply('未查到相关助手', true)
}
} else {
await e.reply(`搜索助手失败`, true)
await e.reply('搜索助手失败', true)
}
}
async emptyQueue(e) {
async emptyQueue (e) {
await redis.lTrim('CHATGPT:CHAT_QUEUE', 1, 0)
await this.reply('已清空当前等待队列')
}
async removeQueueFirst(e) {
async removeQueueFirst (e) {
let uid = await redis.lPop('CHATGPT:CHAT_QUEUE', 0)
if (!uid) {
await this.reply('当前等待队列为空')
@ -2465,7 +2466,7 @@ export class chatgpt extends plugin {
}
}
async getAllConversations(e) {
async getAllConversations (e) {
const use = await redis.get('CHATGPT:USE')
if (use === 'api3') {
let conversations = await getConversations(e.sender.user_id, newFetch)
@ -2486,7 +2487,7 @@ export class chatgpt extends plugin {
}
}
async joinConversation(e) {
async joinConversation (e) {
let ats = e.message.filter(m => m.type === 'at')
let use = await redis.get('CHATGPT:USE') || 'api'
// if (use !== 'api3') {
@ -2517,7 +2518,7 @@ export class chatgpt extends plugin {
}
}
async attachConversation(e) {
async attachConversation (e) {
const use = await redis.get('CHATGPT:USE')
if (use !== 'api3') {
await this.reply('该功能目前仅支持API3模式')
@ -2534,7 +2535,7 @@ export class chatgpt extends plugin {
}
}
async totalAvailable(e) {
async totalAvailable (e) {
// 查询OpenAI API剩余试用额度
let subscriptionRes = await newFetch(`${Config.openAiBaseUrl}/dashboard/billing/subscription`, {
method: 'GET',
@ -2543,7 +2544,7 @@ export class chatgpt extends plugin {
}
})
function getDates() {
function getDates () {
const today = new Date()
const tomorrow = new Date(today)
tomorrow.setDate(tomorrow.getDate() + 1)
@ -2580,7 +2581,7 @@ export class chatgpt extends plugin {
* @param prompt 问题
* @param conversation 对话
*/
async chatgptBrowserBased(prompt, conversation) {
async chatgptBrowserBased (prompt, conversation) {
let option = { markdown: true }
if (Config['2captchaToken']) {
option.captchaToken = Config['2captchaToken']
@ -2600,7 +2601,7 @@ export class chatgpt extends plugin {
}
}
async function getAvailableBingToken(conversation, throttled = []) {
async function getAvailableBingToken (conversation, throttled = []) {
let allThrottled = false
if (!await redis.get('CHATGPT:BING_TOKENS')) {
return {

View file

@ -217,7 +217,7 @@ ${translateLangLabels}
const match = e.msg.trim().match(regExp)
const duration = !match[1] ? 12 : parseInt(match[1]) // default 12h
if(duration > 24) {
if (duration > 24) {
await e.reply('最多只能统计24小时内的记录哦')
return false
}

View file

@ -1,316 +1,323 @@
// modified from StarRail-plugin | 已经过StarRail-plugin作者本人同意
import plugin from '../../../lib/plugins/plugin.js'
import { createRequire } from 'module'
import _ from 'lodash'
import { Restart } from '../../other/restart.js'
import fs from 'fs'
import {} from "../utils/common.js";
const _path = process.cwd()
const require = createRequire(import.meta.url)
const { exec, execSync } = require('child_process')
const checkAuth = async function (e) {
if (!e.isMaster) {
e.reply(`只有主人才能命令ChatGPT哦~(*/ω\*)`)
return false
}
return true
}
// 是否在更新中
let uping = false
/**
* 处理插件更新
*/
export class Update extends plugin {
constructor () {
super({
name: 'chatgpt更新插件',
event: 'message',
priority: 1000,
rule: [
{
reg: '^#?(chatgpt|柴特寄批踢|GPT|ChatGPT|柴特鸡批踢|Chat|CHAT|CHATGPT|柴特|ChatGPT-Plugin|ChatGPT-plugin|chatgpt-plugin)(插件)?(强制)?更新$',
fnc: 'update'
}
]
})
}
/**
* rule - 更新chatgpt插件
* @returns
*/
async update () {
if (!this.e.isMaster) return false
/** 检查是否正在更新中 */
if (uping) {
await this.reply('已有命令更新中..请勿重复操作')
return
}
/** 检查git安装 */
if (!(await this.checkGit())) return
const isForce = this.e.msg.includes('强制')
/** 执行更新 */
await this.runUpdate(isForce)
/** 是否需要重启 */
if (this.isUp) {
// await this.reply("更新完毕,请重启云崽后生效")
setTimeout(() => this.restart(), 2000)
}
}
restart () {
new Restart(this.e).restart()
}
/**
* chatgpt插件更新函数
* @param {boolean} isForce 是否为强制更新
* @returns
*/
async runUpdate (isForce) {
let command = 'git -C ./plugins/chatgpt-plugin/ pull --no-rebase'
if (isForce) {
command = `git -C ./plugins/chatgpt-plugin/ checkout . && ${command}`
this.e.reply('正在执行强制更新操作,请稍等')
} else {
this.e.reply('正在执行更新操作,请稍等')
}
/** 获取上次提交的commitId用于获取日志时判断新增的更新日志 */
this.oldCommitId = await this.getcommitId('chatgpt-plugin')
uping = true
let ret = await this.execSync(command)
uping = false
if (ret.error) {
logger.mark(`${this.e.logFnc} 更新失败chatgpt-plugin`)
this.gitErr(ret.error, ret.stdout)
return false
}
/** 获取插件提交的最新时间 */
let time = await this.getTime('chatgpt-plugin')
if (/(Already up[ -]to[ -]date|已经是最新的)/.test(ret.stdout)) {
await this.reply(`chatgpt-plugin已经是最新版本\n最后更新时间:${time}`)
} else {
await this.reply(`chatgpt-plugin\n最后更新时间:${time}`)
this.isUp = true
/** 获取chatgpt组件的更新日志 */
let log = await this.getLog('chatgpt-plugin')
await this.reply(log)
}
logger.mark(`${this.e.logFnc} 最后更新时间:${time}`)
return true
}
/**
* 获取chatgpt插件的更新日志
* @param {string} plugin 插件名称
* @returns
*/
async getLog (plugin = '') {
let cm = `cd ./plugins/${plugin}/ && git log -20 --oneline --pretty=format:"%h||[%cd] %s" --date=format:"%m-%d %H:%M"`
let logAll
try {
logAll = await execSync(cm, { encoding: 'utf-8' })
} catch (error) {
logger.error(error.toString())
this.reply(error.toString())
}
if (!logAll) return false
logAll = logAll.split('\n')
let log = []
for (let str of logAll) {
str = str.split('||')
if (str[0] == this.oldCommitId) break
if (str[1].includes('Merge branch')) continue
log.push(str[1])
}
let line = log.length
log = log.join('\n\n')
if (log.length <= 0) return ''
let end = ''
end =
'更多详细信息请前往github查看\nhttps://github.com/ikechan8370/chatgpt-plugin'
log = await this.makeForwardMsg(`chatgpt-plugin更新日志${line}`, log, end)
return log
}
/**
* 获取上次提交的commitId
* @param {string} plugin 插件名称
* @returns
*/
async getcommitId (plugin = '') {
let cm = `git -C ./plugins/${plugin}/ rev-parse --short HEAD`
let commitId = await execSync(cm, { encoding: 'utf-8' })
commitId = _.trim(commitId)
return commitId
}
/**
* 获取本次更新插件的最后一次提交时间
* @param {string} plugin 插件名称
* @returns
*/
async getTime (plugin = '') {
let cm = `cd ./plugins/${plugin}/ && git log -1 --oneline --pretty=format:"%cd" --date=format:"%m-%d %H:%M"`
let time = ''
try {
time = await execSync(cm, { encoding: 'utf-8' })
time = _.trim(time)
} catch (error) {
logger.error(error.toString())
time = '获取时间失败'
}
return time
}
/**
* 制作转发消息
* @param {string} title 标题 - 首条消息
* @param {string} msg 日志信息
* @param {string} end 最后一条信息
* @returns
*/
async makeForwardMsg (title, msg, end) {
let nickname = (this.e.bot ?? Bot).nickname
if (this.e.isGroup) {
let info = await (this.e.bot ?? Bot).getGroupMemberInfo(this.e.group_id, (this.e.bot ?? Bot).uin)
nickname = info.card || info.nickname
}
let userInfo = {
user_id: (this.e.bot ?? Bot).uin,
nickname
}
let forwardMsg = [
{
...userInfo,
message: title
},
{
...userInfo,
message: msg
}
]
if (end) {
forwardMsg.push({
...userInfo,
message: end
})
}
/** 制作转发内容 */
if (this.e.isGroup) {
forwardMsg = await this.e.group.makeForwardMsg(forwardMsg)
} else {
forwardMsg = await this.e.friend.makeForwardMsg(forwardMsg)
}
/** 处理描述 */
forwardMsg.data = forwardMsg.data
.replace(/\n/g, '')
.replace(/<title color="#777777" size="26">(.+?)<\/title>/g, '___')
.replace(/___+/, `<title color="#777777" size="26">${title}</title>`)
return forwardMsg
}
/**
* 处理更新失败的相关函数
* @param {string} err
* @param {string} stdout
* @returns
*/
async gitErr (err, stdout) {
let msg = '更新失败!'
let errMsg = err.toString()
stdout = stdout.toString()
if (errMsg.includes('Timed out')) {
let remote = errMsg.match(/'(.+?)'/g)[0].replace(/'/g, '')
await this.reply(msg + `\n连接超时:${remote}`)
return
}
if (/Failed to connect|unable to access/g.test(errMsg)) {
let remote = errMsg.match(/'(.+?)'/g)[0].replace(/'/g, '')
await this.reply(msg + `\n连接失败:${remote}`)
return
}
if (errMsg.includes('be overwritten by merge')) {
await this.reply(
msg +
`存在冲突:\n${errMsg}\n` +
'请解决冲突后再更新,或者执行#强制更新,放弃本地修改'
)
return
}
if (stdout.includes('CONFLICT')) {
await this.reply([
msg + '存在冲突\n',
errMsg,
stdout,
'\n请解决冲突后再更新或者执行#强制更新,放弃本地修改'
])
return
}
await this.reply([errMsg, stdout])
}
/**
* 异步执行git相关命令
* @param {string} cmd git命令
* @returns
*/
async execSync (cmd) {
return new Promise((resolve, reject) => {
exec(cmd, { windowsHide: true }, (error, stdout, stderr) => {
resolve({ error, stdout, stderr })
})
})
}
/**
* 检查git是否安装
* @returns
*/
async checkGit () {
let ret = await execSync('git --version', { encoding: 'utf-8' })
if (!ret || !ret.includes('git version')) {
await this.reply('请先安装git')
return false
}
return true
}
}
// modified from StarRail-plugin | 已经过StarRail-plugin作者本人同意
import plugin from '../../../lib/plugins/plugin.js'
import { createRequire } from 'module'
import _ from 'lodash'
import { Restart } from '../../other/restart.js'
import fs from 'fs'
import {} from '../utils/common.js'
const _path = process.cwd()
const require = createRequire(import.meta.url)
const { exec, execSync } = require('child_process')
const checkAuth = async function (e) {
if (!e.isMaster) {
e.reply('只有主人才能命令ChatGPT哦~(*/ω\*)')
return false
}
return true
}
// 是否在更新中
let uping = false
/**
* 处理插件更新
*/
export class Update extends plugin {
constructor () {
super({
name: 'chatgpt更新插件',
event: 'message',
priority: 1000,
rule: [
{
reg: '^#?(chatgpt|柴特寄批踢|GPT|ChatGPT|柴特鸡批踢|Chat|CHAT|CHATGPT|柴特|ChatGPT-Plugin|ChatGPT-plugin|chatgpt-plugin)(插件)?(强制)?更新$',
fnc: 'update'
}
]
})
}
/**
* rule - 更新chatgpt插件
* @returns
*/
async update () {
if (!this.e.isMaster) return false
/** 检查是否正在更新中 */
if (uping) {
await this.reply('已有命令更新中..请勿重复操作')
return
}
/** 检查git安装 */
if (!(await this.checkGit())) return
const isForce = this.e.msg.includes('强制')
/** 执行更新 */
await this.runUpdate(isForce)
/** 是否需要重启 */
if (this.isUp) {
// await this.reply("更新完毕,请重启云崽后生效")
setTimeout(() => this.restart(), 2000)
}
}
restart () {
new Restart(this.e).restart()
}
/**
* chatgpt插件更新函数
* @param {boolean} isForce 是否为强制更新
* @returns
*/
async runUpdate (isForce) {
let command = 'git -C ./plugins/chatgpt-plugin/ pull --no-rebase'
if (isForce) {
command = `git -C ./plugins/chatgpt-plugin/ checkout . && ${command}`
this.e.reply('正在执行强制更新操作,请稍等')
} else {
this.e.reply('正在执行更新操作,请稍等')
}
/** 获取上次提交的commitId用于获取日志时判断新增的更新日志 */
this.oldCommitId = await this.getcommitId('chatgpt-plugin')
uping = true
let ret = await this.execSync(command)
uping = false
if (ret.error) {
logger.mark(`${this.e.logFnc} 更新失败chatgpt-plugin`)
this.gitErr(ret.error, ret.stdout)
return false
}
/** 获取插件提交的最新时间 */
let time = await this.getTime('chatgpt-plugin')
if (/(Already up[ -]to[ -]date|已经是最新的)/.test(ret.stdout)) {
await this.reply(`chatgpt-plugin已经是最新版本\n最后更新时间:${time}`)
} else {
await this.reply(`chatgpt-plugin\n最后更新时间:${time}`)
this.isUp = true
/** 获取chatgpt组件的更新日志 */
let log = await this.getLog('chatgpt-plugin')
await this.reply(log)
}
logger.mark(`${this.e.logFnc} 最后更新时间:${time}`)
return true
}
/**
* 获取chatgpt插件的更新日志
* @param {string} plugin 插件名称
* @returns
*/
async getLog (plugin = '') {
let cm = `cd ./plugins/${plugin}/ && git log -20 --oneline --pretty=format:"%h||[%cd] %s" --date=format:"%m-%d %H:%M"`
let logAll
try {
logAll = await execSync(cm, { encoding: 'utf-8' })
} catch (error) {
logger.error(error.toString())
this.reply(error.toString())
}
if (!logAll) return false
logAll = logAll.split('\n')
let log = []
for (let str of logAll) {
str = str.split('||')
if (str[0] == this.oldCommitId) break
if (str[1].includes('Merge branch')) continue
log.push(str[1])
}
let line = log.length
log = log.join('\n\n')
if (log.length <= 0) return ''
let end = ''
end =
'更多详细信息请前往github查看\nhttps://github.com/ikechan8370/chatgpt-plugin'
log = await this.makeForwardMsg(`chatgpt-plugin更新日志${line}`, log, end)
return log
}
/**
* 获取上次提交的commitId
* @param {string} plugin 插件名称
* @returns
*/
async getcommitId (plugin = '') {
let cm = `git -C ./plugins/${plugin}/ rev-parse --short HEAD`
let commitId = await execSync(cm, { encoding: 'utf-8' })
commitId = _.trim(commitId)
return commitId
}
/**
* 获取本次更新插件的最后一次提交时间
* @param {string} plugin 插件名称
* @returns
*/
async getTime (plugin = '') {
let cm = `cd ./plugins/${plugin}/ && git log -1 --oneline --pretty=format:"%cd" --date=format:"%m-%d %H:%M"`
let time = ''
try {
time = await execSync(cm, { encoding: 'utf-8' })
time = _.trim(time)
} catch (error) {
logger.error(error.toString())
time = '获取时间失败'
}
return time
}
/**
* 制作转发消息
* @param {string} title 标题 - 首条消息
* @param {string} msg 日志信息
* @param {string} end 最后一条信息
* @returns
*/
async makeForwardMsg (title, msg, end) {
let nickname = (this.e.bot ?? Bot).nickname
if (this.e.isGroup) {
let info = await (this.e.bot ?? Bot).getGroupMemberInfo(this.e.group_id, (this.e.bot ?? Bot).uin)
nickname = info.card || info.nickname
}
let userInfo = {
user_id: (this.e.bot ?? Bot).uin,
nickname
}
let forwardMsg = [
{
...userInfo,
message: title
},
{
...userInfo,
message: msg
}
]
if (end) {
forwardMsg.push({
...userInfo,
message: end
})
}
/** 制作转发内容 */
if (this.e.group?.makeForwardMsg) {
forwardMsg = await this.e.group.makeForwardMsg(forwardMsg)
} else if (this.e?.friend?.makeForwardMsg) {
forwardMsg = await this.e.friend.makeForwardMsg(forwardMsg)
} else {
return msg.join('\n')
}
let dec = 'chatgpt-plugin 更新日志'
/** 处理描述 */
if (typeof (forwardMsg.data) === 'object') {
let detail = forwardMsg.data?.meta?.detail
if (detail) {
detail.news = [{ text: dec }]
}
} else {
forwardMsg.data = forwardMsg.data
.replace(/\n/g, '')
.replace(/<title color="#777777" size="26">(.+?)<\/title>/g, '___')
.replace(/___+/, `<title color="#777777" size="26">${dec}</title>`)
}
return forwardMsg
}
/**
* 处理更新失败的相关函数
* @param {string} err
* @param {string} stdout
* @returns
*/
async gitErr (err, stdout) {
let msg = '更新失败!'
let errMsg = err.toString()
stdout = stdout.toString()
if (errMsg.includes('Timed out')) {
let remote = errMsg.match(/'(.+?)'/g)[0].replace(/'/g, '')
await this.reply(msg + `\n连接超时:${remote}`)
return
}
if (/Failed to connect|unable to access/g.test(errMsg)) {
let remote = errMsg.match(/'(.+?)'/g)[0].replace(/'/g, '')
await this.reply(msg + `\n连接失败:${remote}`)
return
}
if (errMsg.includes('be overwritten by merge')) {
await this.reply(
msg +
`存在冲突:\n${errMsg}\n` +
'请解决冲突后再更新,或者执行#强制更新,放弃本地修改'
)
return
}
if (stdout.includes('CONFLICT')) {
await this.reply([
msg + '存在冲突\n',
errMsg,
stdout,
'\n请解决冲突后再更新或者执行#强制更新,放弃本地修改'
])
return
}
await this.reply([errMsg, stdout])
}
/**
* 异步执行git相关命令
* @param {string} cmd git命令
* @returns
*/
async execSync (cmd) {
return new Promise((resolve, reject) => {
exec(cmd, { windowsHide: true }, (error, stdout, stderr) => {
resolve({ error, stdout, stderr })
})
})
}
/**
* 检查git是否安装
* @returns
*/
async checkGit () {
let ret = await execSync('git --version', { encoding: 'utf-8' })
if (!ret || !ret.includes('git version')) {
await this.reply('请先安装git')
return false
}
return true
}
}

View file

@ -601,6 +601,30 @@ export function supportGuoba () {
bottomHelpMessage: 'claude.ai Cookie中的SessionKey',
component: 'Input'
},
{
field: 'claudeAIReverseProxy',
label: 'claude2 反代',
bottomHelpMessage: 'claude.ai 的反代。或许可以参考https://github.com/ikechan8370/sydney-ws-proxy/tree/claude.ai搭建',
component: 'Input'
},
{
field: 'claudeAIJA3',
label: 'claude2浏览器指纹',
bottomHelpMessage: 'claude.ai使用的浏览器TLS指纹去https://scrapfly.io/web-scraping-tools/ja3-fingerprint或https://ja3.zone/check查看。如果用了反代就不用管',
component: 'Input'
},
{
field: 'claudeAIUA',
label: 'claude2浏览器UA',
bottomHelpMessage: 'claude.ai使用的浏览器UAhttps://scrapfly.io/web-scraping-tools/http2-fingerprint或https://ja3.zone/check查看。如果用了反代就不用管',
component: 'Input'
},
{
field: 'claudeAITimeout',
label: 'claude2超时时间',
bottomHelpMessage: '等待响应的超时时间单位为秒默认为120。如果不使用反代而是使用代理可以适当调低。',
component: 'InputNumber'
},
{
label: '以下为ChatGLM方式的配置',
component: 'Divider'

390
package-lock.json generated
View file

@ -6,6 +6,7 @@
"": {
"name": "chatgpt-plugin",
"dependencies": {
"@azure/openai": "^1.0.0-beta.1",
"@fastify/cookie": "^8.3.0",
"@fastify/cors": "^8.2.0",
"@fastify/static": "^6.9.0",
@ -14,6 +15,7 @@
"@waylaidwanderer/chatgpt-api": "^1.37.1",
"asn1.js": "^5.0.0",
"chatgpt": "^5.2.4",
"crypto": "^1.0.1",
"delay": "^6.0.0",
"diff": "^5.1.0",
"emoji-strip": "^1.0.1",
@ -21,7 +23,7 @@
"eventsource-parser": "^1.0.0",
"fastify": "^4.18.0",
"form-data": "^4.0.0",
"https-proxy-agent": "5.0.1",
"https-proxy-agent": "7.0.1",
"js-tiktoken": "^1.0.5",
"keyv": "^4.5.3",
"keyv-file": "^0.2.0",
@ -41,6 +43,7 @@
},
"optionalDependencies": {
"@node-rs/jieba": "^1.6.2",
"cycletls": "^1.0.21",
"jimp": "^0.22.7",
"node-silk": "^0.1.0",
"puppeteer-extra": "^3.3.6",
@ -64,6 +67,207 @@
"../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid": {
"extraneous": true
},
"node_modules/@azure-rest/core-client": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.1.4.tgz",
"integrity": "sha512-RUIQOA8T0WcbNlddr8hjl2MuC5GVRqmMwPXqBVsgvdKesLy+eg3y/6nf3qe2fvcJMI1gF6VtgU5U4hRaR4w4ag==",
"dependencies": {
"@azure/abort-controller": "^1.1.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/core-tracing": "^1.0.1",
"@azure/core-util": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure-rest/core-client/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/abort-controller": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
"integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@azure/abort-controller/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/core-auth": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz",
"integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-util": "^1.1.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-auth/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/core-lro": {
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz",
"integrity": "sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-util": "^1.2.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-lro/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/core-rest-pipeline": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.1.tgz",
"integrity": "sha512-SsyWQ+T5MFQRX+M8H/66AlaI6HyCbQStGfFngx2fuiW+vKI2DkhtOvbYodPyf9fOe/ARLWWc3ohX54lQ5Kmaog==",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.4.0",
"@azure/core-tracing": "^1.0.1",
"@azure/core-util": "^1.3.0",
"@azure/logger": "^1.0.0",
"form-data": "^4.0.0",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-rest-pipeline/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/@azure/core-rest-pipeline/node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
"dependencies": {
"agent-base": "6",
"debug": "4"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@azure/core-rest-pipeline/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/@azure/core-rest-pipeline/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/core-tracing": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz",
"integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@azure/core-tracing/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/core-util": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.4.0.tgz",
"integrity": "sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-util/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/logger": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz",
"integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/logger/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@azure/openai": {
"version": "1.0.0-beta.5",
"resolved": "https://registry.npmjs.org/@azure/openai/-/openai-1.0.0-beta.5.tgz",
"integrity": "sha512-Qjb6eXun6OUGwbHMRYtmjojn8wZf5ATGQHFzxPc+/dWFeLdSj5ahs/yWRAgqff3oL6GmgQFhjCPhAnAbVv5Q3w==",
"dependencies": {
"@azure-rest/core-client": "^1.1.3",
"@azure/core-auth": "^1.4.0",
"@azure/core-lro": "^2.5.3",
"@azure/core-rest-pipeline": "^1.10.2",
"@azure/logger": "^1.0.3",
"tslib": "^2.4.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/openai/node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/@babel/code-frame": {
"version": "7.22.5",
"resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.5.tgz",
@ -730,6 +934,42 @@
"node-pre-gyp": "bin/node-pre-gyp"
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"optional": true,
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
"optional": true,
"dependencies": {
"agent-base": "6",
"debug": "4"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@mapbox/node-pre-gyp/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"optional": true
},
"node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": {
"version": "2.6.11",
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.11.tgz",
@ -1152,6 +1392,14 @@
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==",
"optional": true
},
"node_modules/@tootallnate/once": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
"integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==",
"engines": {
"node": ">= 10"
}
},
"node_modules/@tsconfig/node10": {
"version": "1.0.9",
"resolved": "https://registry.npmmirror.com/@tsconfig/node10/-/node10-1.0.9.tgz",
@ -1346,50 +1594,6 @@
"chatgpt-cli": "bin/cli.js"
}
},
"node_modules/@waylaidwanderer/chatgpt-api/node_modules/agent-base": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
"dependencies": {
"debug": "^4.3.4"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/@waylaidwanderer/chatgpt-api/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/@waylaidwanderer/chatgpt-api/node_modules/https-proxy-agent": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz",
"integrity": "sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==",
"dependencies": {
"agent-base": "^7.0.2",
"debug": "4"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/@waylaidwanderer/chatgpt-api/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/@waylaidwanderer/fastify-sse-v2": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/@waylaidwanderer/fastify-sse-v2/-/fastify-sse-v2-3.1.0.tgz",
@ -2224,6 +2428,49 @@
"node": ">= 8"
}
},
"node_modules/crypto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
"deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in."
},
"node_modules/cycletls": {
"version": "1.0.21",
"resolved": "https://registry.npmjs.org/cycletls/-/cycletls-1.0.21.tgz",
"integrity": "sha512-Ccox1s+3mhoc/SOlzAXH2EqyKPc3PlJ6WVvshgzBn99ihDSmp/GQJqPw7TKBLO5pJMZtrl9B7s8cMdrwOoORbQ==",
"optional": true,
"dependencies": {
"@types/node": "^17.0.24",
"ws": "^7.5.7"
}
},
"node_modules/cycletls/node_modules/@types/node": {
"version": "17.0.45",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz",
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
"optional": true
},
"node_modules/cycletls/node_modules/ws": {
"version": "7.5.9",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz",
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
"optional": true,
"engines": {
"node": ">=8.3.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmmirror.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
@ -3268,11 +3515,12 @@
"node": ">= 0.8"
}
},
"node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
"node_modules/http-proxy-agent": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
"integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==",
"dependencies": {
"@tootallnate/once": "2",
"agent-base": "6",
"debug": "4"
},
@ -3280,6 +3528,50 @@
"node": ">= 6"
}
},
"node_modules/http-proxy-agent/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/http-proxy-agent/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/https-proxy-agent": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz",
"integrity": "sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==",
"dependencies": {
"agent-base": "^7.0.2",
"debug": "4"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/https-proxy-agent/node_modules/agent-base": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
"dependencies": {
"debug": "^4.3.4"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/https-proxy-agent/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",

File diff suppressed because it is too large Load diff

View file

@ -1,17 +1,11 @@
import fetch, { FormData } from 'node-fetch'
import { makeForwardMsg } from './common.js'
import { Config } from './config.js'
import { getProxy } from './proxy.js'
let proxy
if (Config.proxy) {
try {
proxy = (await import('https-proxy-agent')).default
} catch (e) {
console.warn('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
let proxy = getProxy()
export default class BingDrawClient {
constructor(opts) {
constructor (opts) {
this.opts = opts
if (Config.proxy && !Config.sydneyForceUseReverse) {
// 如果设置代理,走代理
@ -19,7 +13,7 @@ export default class BingDrawClient {
}
}
async getImages(prompt, e) {
async getImages (prompt, e) {
let urlEncodedPrompt = encodeURIComponent(prompt)
let url = `${this.opts.baseUrl}/images/create?q=${urlEncodedPrompt}&rt=4&FORM=GENCRE`
// let d = Math.ceil(Math.random() * 255)
@ -82,7 +76,7 @@ export default class BingDrawClient {
}
}
if (!success) {
//最后尝试使用https://cn.bing.com进行一次绘图
// 最后尝试使用https://cn.bing.com进行一次绘图
logger.info('尝试使用https://cn.bing.com进行绘图')
url = `https://cn.bing.com/images/create?q=${urlEncodedPrompt}&rt=3&FORM=GENCRE`
fetchOptions.referrer = 'https://cn.bing.com/images/create/'

View file

@ -6,11 +6,11 @@ import fetch, {
} from 'node-fetch'
import crypto from 'crypto'
import WebSocket from 'ws'
import HttpsProxyAgent from 'https-proxy-agent'
import { Config, pureSydneyInstruction } from './config.js'
import { formatDate, getMasterQQ, isCN, getUserData } from './common.js'
import delay from 'delay'
import moment from 'moment'
import { getProxy } from './proxy.js'
if (!globalThis.fetch) {
globalThis.fetch = fetch
@ -19,12 +19,7 @@ if (!globalThis.fetch) {
globalThis.Response = Response
}
// workaround for ver 7.x and ver 5.x
let proxy = HttpsProxyAgent
if (typeof proxy !== 'function') {
proxy = (p) => {
return new HttpsProxyAgent.HttpsProxyAgent(p)
}
}
let proxy = getProxy()
async function getKeyv () {
let Keyv
@ -105,7 +100,7 @@ export default class SydneyAIClient {
this.opts.host = 'https://edgeservices.bing.com/edgesvc'
}
logger.mark('使用host' + this.opts.host)
let response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions)
let response = await fetch(`${this.opts.host}/turing/conversation/create?bundleVersion=1.1055.6`, fetchOptions)
let text = await response.text()
let retry = 10
while (retry >= 0 && response.status === 200 && !text) {
@ -120,7 +115,11 @@ export default class SydneyAIClient {
throw new Error('创建sydney对话失败: status code: ' + response.status + response.statusText)
}
try {
return JSON.parse(text)
let r = JSON.parse(text)
if (!r.conversationSignature) {
r.encryptedconversationsignature = response.headers.get('x-sydney-encryptedconversationsignature')
}
return r
} catch (err) {
logger.error('创建sydney对话失败: status code: ' + response.status + response.statusText)
logger.error(text)
@ -128,7 +127,7 @@ export default class SydneyAIClient {
}
}
async createWebSocketConnection () {
async createWebSocketConnection (encryptedconversationsignature = '') {
await this.initCache()
// let WebSocket = await getWebSocket()
return new Promise((resolve, reject) => {
@ -141,7 +140,11 @@ export default class SydneyAIClient {
sydneyHost = Config.sydneyReverseProxy.replace('https://', 'wss://').replace('http://', 'ws://')
}
logger.mark(`use sydney websocket host: ${sydneyHost}`)
let ws = new WebSocket(sydneyHost + '/sydney/ChatHub', undefined, { agent, origin: 'https://edgeservices.bing.com' })
let host = sydneyHost + '/sydney/ChatHub'
if (encryptedconversationsignature) {
host += `?sec_access_token=${encodeURIComponent(encryptedconversationsignature)}`
}
let ws = new WebSocket(host, undefined, { agent, origin: 'https://edgeservices.bing.com' })
ws.on('error', (err) => {
console.error(err)
reject(err)
@ -224,6 +227,7 @@ export default class SydneyAIClient {
// if (messageType === 'Chat') {
// logger.warn('该Bing账户token已被限流降级至使用非搜索模式。本次对话AI将无法使用Bing搜索返回的内容')
// }
let encryptedconversationsignature = ''
if (typeof onProgress !== 'function') {
onProgress = () => { }
}
@ -236,7 +240,7 @@ export default class SydneyAIClient {
if (createNewConversationResponse.result?.value === 'UnauthorizedRequest') {
throw new Error(`UnauthorizedRequest: ${createNewConversationResponse.result.message}`)
}
if (!createNewConversationResponse.conversationSignature || !createNewConversationResponse.conversationId || !createNewConversationResponse.clientId) {
if (!createNewConversationResponse.conversationId || !createNewConversationResponse.clientId) {
const resultValue = createNewConversationResponse.result?.value
if (resultValue) {
throw new Error(`${resultValue}: ${createNewConversationResponse.result.message}`)
@ -246,7 +250,8 @@ export default class SydneyAIClient {
({
conversationSignature,
conversationId,
clientId
clientId,
encryptedconversationsignature
} = createNewConversationResponse)
}
let pureSydney = Config.toneStyle === 'Sydney'
@ -336,7 +341,7 @@ export default class SydneyAIClient {
role: 'User',
message
}
const ws = await this.createWebSocketConnection()
const ws = await this.createWebSocketConnection(encryptedconversationsignature)
if (Config.debug) {
logger.mark('sydney websocket constructed successful')
}
@ -366,62 +371,67 @@ export default class SydneyAIClient {
let maxConv = Config.maxNumUserMessagesInConversation
const currentDate = moment().format('YYYY-MM-DDTHH:mm:ssZ')
const imageDate = await this.kblobImage(opts.imageUrl)
let argument0 = {
source: 'cib',
optionsSets,
allowedMessageTypes: ['ActionRequest', 'Chat', 'Context',
// 'InternalSearchQuery', 'InternalSearchResult', 'Disengaged', 'InternalLoaderMessage', 'Progress', 'RenderCardRequest', 'AdsQuery',
'SemanticSerp', 'GenerateContentQuery', 'SearchQuery'],
sliceIds: [
],
requestId: crypto.randomUUID(),
traceId: genRanHex(32),
scenario: 'Underside',
verbosity: 'verbose',
isStartOfSession: invocationId === 0,
message: {
locale: 'zh-CN',
market: 'zh-CN',
region: 'WW',
location: 'lat:47.639557;long:-122.128159;re=1000m;',
locationHints: [
{
country: 'Macedonia',
state: 'Centar',
city: 'Skopje',
zipcode: '1004',
timezoneoffset: 1,
countryConfidence: 8,
cityConfidence: 5,
Center: {
Latitude: 41.9961,
Longitude: 21.4317
},
RegionType: 2,
SourceType: 1
}
],
author: 'user',
inputMethod: 'Keyboard',
imageUrl: imageDate.blobId ? `https://www.bing.com/images/blob?bcid=${imageDate.blobId}` : undefined,
originalImageUrl: imageDate.processedBlobId ? `https://www.bing.com/images/blob?bcid=${imageDate.processedBlobId}` : undefined,
text: message,
messageType,
userIpAddress: await generateRandomIP(),
timestamp: currentDate
// messageType: 'SearchQuery'
},
tone: 'Creative',
conversationSignature,
participant: {
id: clientId
},
spokenTextMode: 'None',
conversationId,
previousMessages
}
if (encryptedconversationsignature) {
delete argument0.conversationSignature
}
const obj = {
arguments: [
{
source: 'cib',
optionsSets,
allowedMessageTypes: ['ActionRequest', 'Chat', 'Context',
// 'InternalSearchQuery', 'InternalSearchResult', 'Disengaged', 'InternalLoaderMessage', 'Progress', 'RenderCardRequest', 'AdsQuery',
'SemanticSerp', 'GenerateContentQuery', 'SearchQuery'],
sliceIds: [
],
traceId: genRanHex(32),
scenario: 'Underside',
verbosity: 'verbose',
isStartOfSession: invocationId === 0,
message: {
locale: 'zh-CN',
market: 'zh-CN',
region: 'WW',
location: 'lat:47.639557;long:-122.128159;re=1000m;',
locationHints: [
{
country: 'Macedonia',
state: 'Centar',
city: 'Skopje',
zipcode: '1004',
timezoneoffset: 1,
countryConfidence: 8,
cityConfidence: 5,
Center: {
Latitude: 41.9961,
Longitude: 21.4317
},
RegionType: 2,
SourceType: 1
}
],
author: 'user',
inputMethod: 'Keyboard',
imageUrl: imageDate.blobId ? `https://www.bing.com/images/blob?bcid=${imageDate.blobId}` : undefined,
originalImageUrl: imageDate.processedBlobId ? `https://www.bing.com/images/blob?bcid=${imageDate.processedBlobId}` : undefined,
text: message,
messageType,
userIpAddress: await generateRandomIP(),
timestamp: currentDate
// messageType: 'SearchQuery'
},
tone: 'Creative',
conversationSignature,
participant: {
id: clientId
},
spokenTextMode: 'None',
conversationId,
previousMessages
}
argument0
],
invocationId: invocationId.toString(),
target: 'chat',

View file

@ -1,6 +1,7 @@
import { File, FormData, Headers } from 'node-fetch'
import fs from 'fs'
import crypto from 'crypto'
import { Config } from '../config.js'
// import initCycleTLS from 'cycletls'
let initCycleTLS
try {
@ -22,7 +23,7 @@ export class ClaudeAIClient {
headers.append('referrer', 'https://claude.ai/chat')
headers.append('origin', 'https://claude.ai')
headers.append('Content-Type', 'application/json')
headers.append('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36')
headers.append('User-Agent', Config.claudeAIUA || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36')
// headers.append('sec-ch-ua', '"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"')
// headers.append('Sec-Ch-Ua-Mobile', '?0')
// headers.append('Sec-Ch-Ua-Platform', '"Windows"')
@ -39,7 +40,7 @@ export class ClaudeAIClient {
// headers.append('anthropic-client-sha', 'cab849b55d41c73804c1b2b87a7a7fdb84263dc9')
// headers.append('anthropic-client-version', '1')
// headers.append('baggage', 'sentry-environment=production,sentry-release=cab849b55d41c73804c1b2b87a7a7fdb84263dc9,sentry-public_key=58e9b9d0fc244061a1b54fe288b0e483,sentry-trace_id=d1c13c8e760c4e9e969a5e1aed6a38cf')
this.JA3 = '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,5-27-45-35-65281-16-18-10-17513-43-13-23-51-0-11,29-23-24,0'
this.JA3 = Config.claudeAIJA3 || '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-5-65281-13-35-0-51-18-16-43-10-45-11-17513-23,29-23-24,0'
this.headers = headers
this.rawHeaders = {}
@ -102,8 +103,9 @@ export class ClaudeAIClient {
// redirect: 'manual'
// // referrer: 'https://claude.ai/chat/bba5a67d-ee59-4196-a371-ece8a35db1f2'
// })
let host = Config.claudeAIReverseProxy || 'https://claude.ai'
const cycleTLS = await initCycleTLS()
let result = await cycleTLS(`https://claude.ai/api/organizations/${this.organizationId}/chat_conversations`, {
let result = await cycleTLS(`${host}/api/organizations/${this.organizationId}/chat_conversations`, {
ja3: this.JA3,
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
proxy: this.proxy,
@ -139,7 +141,8 @@ export class ClaudeAIClient {
timezone: 'Asia/Hong_Kong'
}
}
let url = 'https://claude.ai/api/append_message'
let host = Config.claudeAIReverseProxy || 'https://claude.ai'
let url = host + '/api/append_message'
const cycleTLS = await initCycleTLS()
let streamDataRes = await cycleTLS(url, {
ja3: this.JA3,
@ -147,36 +150,43 @@ export class ClaudeAIClient {
proxy: this.proxy,
body: JSON.stringify(body),
headers: this.rawHeaders,
disableRedirect: true
disableRedirect: true,
timeout: Config.claudeAITimeout || 120
}, 'post')
if (streamDataRes.status === 307) {
throw new Error('claude.ai目前不支持你所在的地区')
}
let streamData = streamDataRes.body
// console.log(streamData)
let responseText = ''
let streams = streamData.split('\n\n')
for (let s of streams) {
let jsonStr = s.replace('data: ', '').trim()
try {
let jsonObj = JSON.parse(jsonStr)
if (jsonObj && jsonObj.completion) {
responseText += jsonObj.completion
}
if (this.debug) {
console.log(jsonObj)
}
// console.log(responseText)
} catch (err) {
// ignore error
if (this.debug) {
console.log(jsonStr)
if (streamDataRes.status === 200) {
let streamData = streamDataRes.body
// console.log(streamData)
let responseText = ''
let streams = streamData.split('\n\n')
for (let s of streams) {
let jsonStr = s.replace('data: ', '').trim()
try {
let jsonObj = JSON.parse(jsonStr)
if (jsonObj && jsonObj.completion) {
responseText += jsonObj.completion
}
if (this.debug) {
console.log(jsonObj)
}
// console.log(responseText)
} catch (err) {
// ignore error
if (this.debug) {
console.log(jsonStr)
}
}
}
}
return {
text: responseText.trim(),
conversationId
return {
text: responseText.trim(),
conversationId
}
} else if (streamDataRes.status === 408) {
throw new Error('claude.ai响应超时可能是回复文本太多请调高超时时间重试')
} else {
throw new Error('unknown error')
}
}
}

View file

@ -147,7 +147,11 @@ const defaultConfig = {
// claude2
claudeAIOrganizationId: '',
claudeAISessionKey: '',
version: 'v2.7.4'
claudeAIReverseProxy: '',
claudeAITimeout: 120,
claudeAIJA3: '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-5-65281-13-35-0-51-18-16-43-10-45-11-17513-23,29-23-24,0',
claudeAIUA: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
version: 'v2.7.5'
}
const _path = process.cwd()
let config = {}

View file

@ -2,21 +2,8 @@ import { Configuration, OpenAIApi } from 'openai'
import { Config, defaultOpenAIAPI, defaultOpenAIReverseProxy } from './config.js'
import fs from 'fs'
import { isCN, mkdirs } from './common.js'
let proxy
if (Config.proxy) {
try {
proxy = (await import('https-proxy-agent')).default
} catch (e) {
console.warn('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
function getProxy () {
if (!Config.proxy || proxy) {
return proxy
} else {
throw new Error('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
import { getProxy } from './proxy.js'
let proxy = getProxy()
export async function createImage (prompt, n = 1, size = '512x512') {
let basePath = Config.openAiBaseUrl
if (Config.openAiBaseUrl && Config.proxy && !Config.openAiForceUseReverse) {
@ -34,7 +21,7 @@ export async function createImage (prompt, n = 1, size = '512x512') {
if (Config.debug) {
logger.info({ prompt, n, size })
}
let proxyFn = getProxy()
let proxyFn = proxy
const response = await openai.createImage({
prompt,
n,

17
utils/proxy.js Normal file
View file

@ -0,0 +1,17 @@
// workaround for ver 7.x and ver 5.x
import HttpsProxyAgent from 'https-proxy-agent'
let proxy = HttpsProxyAgent
if (typeof proxy !== 'function') {
proxy = (p) => {
return new HttpsProxyAgent.HttpsProxyAgent(p)
}
}
/**
* return a proxy function
* @returns {*|createHttpsProxyAgent|((opts: (string | createHttpsProxyAgent.HttpsProxyAgentOptions)) => HttpsProxyAgent)}
*/
export function getProxy () {
return proxy
}

View file

@ -1,14 +1,8 @@
import { Config } from './config.js'
import { ChatGPTAPI } from 'chatgpt'
import fetch from 'node-fetch'
let proxy
if (Config.proxy) {
try {
proxy = (await import('https-proxy-agent')).default
} catch (e) {
console.warn('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
import { getProxy } from './proxy.js'
let proxy = getProxy()
const newFetch = (url, options = {}) => {
const defaultOptions = Config.proxy
? {

438
yarn.lock
View file

@ -2,6 +2,93 @@
# yarn lockfile v1
"@azure-rest/core-client@^1.1.3":
version "1.1.4"
resolved "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.1.4.tgz"
integrity sha512-RUIQOA8T0WcbNlddr8hjl2MuC5GVRqmMwPXqBVsgvdKesLy+eg3y/6nf3qe2fvcJMI1gF6VtgU5U4hRaR4w4ag==
dependencies:
"@azure/abort-controller" "^1.1.0"
"@azure/core-auth" "^1.3.0"
"@azure/core-rest-pipeline" "^1.5.0"
"@azure/core-tracing" "^1.0.1"
"@azure/core-util" "^1.0.0"
tslib "^2.2.0"
"@azure/abort-controller@^1.0.0", "@azure/abort-controller@^1.1.0":
version "1.1.0"
resolved "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz"
integrity sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==
dependencies:
tslib "^2.2.0"
"@azure/core-auth@^1.3.0", "@azure/core-auth@^1.4.0":
version "1.5.0"
resolved "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz"
integrity sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==
dependencies:
"@azure/abort-controller" "^1.0.0"
"@azure/core-util" "^1.1.0"
tslib "^2.2.0"
"@azure/core-lro@^2.5.3":
version "2.5.4"
resolved "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz"
integrity sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==
dependencies:
"@azure/abort-controller" "^1.0.0"
"@azure/core-util" "^1.2.0"
"@azure/logger" "^1.0.0"
tslib "^2.2.0"
"@azure/core-rest-pipeline@^1.10.2", "@azure/core-rest-pipeline@^1.5.0":
version "1.12.1"
resolved "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.1.tgz"
integrity sha512-SsyWQ+T5MFQRX+M8H/66AlaI6HyCbQStGfFngx2fuiW+vKI2DkhtOvbYodPyf9fOe/ARLWWc3ohX54lQ5Kmaog==
dependencies:
"@azure/abort-controller" "^1.0.0"
"@azure/core-auth" "^1.4.0"
"@azure/core-tracing" "^1.0.1"
"@azure/core-util" "^1.3.0"
"@azure/logger" "^1.0.0"
form-data "^4.0.0"
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"
tslib "^2.2.0"
"@azure/core-tracing@^1.0.1":
version "1.0.1"
resolved "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz"
integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==
dependencies:
tslib "^2.2.0"
"@azure/core-util@^1.0.0", "@azure/core-util@^1.1.0", "@azure/core-util@^1.2.0", "@azure/core-util@^1.3.0":
version "1.4.0"
resolved "https://registry.npmjs.org/@azure/core-util/-/core-util-1.4.0.tgz"
integrity sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==
dependencies:
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"
"@azure/logger@^1.0.0", "@azure/logger@^1.0.3":
version "1.0.4"
resolved "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz"
integrity sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==
dependencies:
tslib "^2.2.0"
"@azure/openai@^1.0.0-beta.1":
version "1.0.0-beta.5"
resolved "https://registry.npmjs.org/@azure/openai/-/openai-1.0.0-beta.5.tgz"
integrity sha512-Qjb6eXun6OUGwbHMRYtmjojn8wZf5ATGQHFzxPc+/dWFeLdSj5ahs/yWRAgqff3oL6GmgQFhjCPhAnAbVv5Q3w==
dependencies:
"@azure-rest/core-client" "^1.1.3"
"@azure/core-auth" "^1.4.0"
"@azure/core-lro" "^2.5.3"
"@azure/core-rest-pipeline" "^1.10.2"
"@azure/logger" "^1.0.3"
tslib "^2.4.0"
"@babel/code-frame@^7.0.0":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.5.tgz"
@ -137,7 +224,7 @@
pixelmatch "^4.0.2"
tinycolor2 "^1.6.0"
"@jimp/custom@^0.22.8":
"@jimp/custom@^0.22.8", "@jimp/custom@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/custom/-/custom-0.22.8.tgz"
integrity sha512-u6lP9x/HNeGHB0Oojv4c2mhuDvn7G0ikzYbK4IKLsH4HzHxt62faMjBzQMcFhKJhR6UiiKE/jiHrhGvBT/fMkw==
@ -161,14 +248,14 @@
"@jimp/utils" "^0.22.8"
jpeg-js "^0.4.4"
"@jimp/plugin-blit@^0.22.8":
"@jimp/plugin-blit@^0.22.8", "@jimp/plugin-blit@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-blit/-/plugin-blit-0.22.8.tgz"
integrity sha512-rQ19txVCKIwo74HtgFodFt4//0ATPCJK+f24riqzb+nx+1JaOo1xRvpJqg4moirHwKR2fhwdDxmY7KX20kCeYA==
dependencies:
"@jimp/utils" "^0.22.8"
"@jimp/plugin-blur@^0.22.8":
"@jimp/plugin-blur@^0.22.8", "@jimp/plugin-blur@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-blur/-/plugin-blur-0.22.8.tgz"
integrity sha512-GWbNK3YW6k2EKiGJdpAFEr0jezPBtiVxj2wG/lCPuWJz7KmzSSN99hQjIy73xQxoBCRdALfJlkhe3leFNRueSQ==
@ -182,7 +269,7 @@
dependencies:
"@jimp/utils" "^0.22.8"
"@jimp/plugin-color@^0.22.8":
"@jimp/plugin-color@^0.22.8", "@jimp/plugin-color@>=0.8.0":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-color/-/plugin-color-0.22.8.tgz"
integrity sha512-ogkbg6rpDVH/mMLgAQKg17z3oZE0VN7ZWxNoH12fUHchqKz1I57zpa65fxZe2I8T5Xz97HR3x+7V7oI8qQGdSA==
@ -204,7 +291,7 @@
dependencies:
"@jimp/utils" "^0.22.8"
"@jimp/plugin-crop@^0.22.8":
"@jimp/plugin-crop@^0.22.8", "@jimp/plugin-crop@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-crop/-/plugin-crop-0.22.8.tgz"
integrity sha512-ns4oH0h0gezYsbuH8RThcMLY5uTLk/vnqOVjWCehMHEzxi0DHMWCmpcb6bC//vJ+XFNhtVGn1ALN7+ROmPrj+A==
@ -275,21 +362,21 @@
"@jimp/utils" "^0.22.8"
load-bmfont "^1.4.1"
"@jimp/plugin-resize@^0.22.8":
"@jimp/plugin-resize@^0.22.8", "@jimp/plugin-resize@>=0.3.5", "@jimp/plugin-resize@>=0.8.0":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-resize/-/plugin-resize-0.22.8.tgz"
integrity sha512-kg8ArQRPqv/iU3DWNXCa8kcVIhoq64Ze0aGCAeFLKlAq/59f5pzAci6m6vV4L/uOVdYmUa9/kYwIFY6RWKpfzQ==
dependencies:
"@jimp/utils" "^0.22.8"
"@jimp/plugin-rotate@^0.22.8":
"@jimp/plugin-rotate@^0.22.8", "@jimp/plugin-rotate@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-rotate/-/plugin-rotate-0.22.8.tgz"
integrity sha512-9a+VPZWMN/Cks76wf8LjM5RVA3ntP9+NAdsS1SZhhXel7U3Re/dWMouIEbo3QTt6K+igRo4txUCdZiw4ZucvkQ==
dependencies:
"@jimp/utils" "^0.22.8"
"@jimp/plugin-scale@^0.22.8":
"@jimp/plugin-scale@^0.22.8", "@jimp/plugin-scale@>=0.3.5":
version "0.22.8"
resolved "https://registry.npmmirror.com/@jimp/plugin-scale/-/plugin-scale-0.22.8.tgz"
integrity sha512-dQS4pG6DX6endu8zUpvBBOEtGC+ljDDDNw0scSXY71TxyQdNo5Ro0apfsppjmuAr8rNotRkfyxbITKkXQDRUDQ==
@ -410,66 +497,6 @@
semver "^7.3.5"
tar "^6.1.11"
"@node-rs/jieba-android-arm-eabi@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-android-arm-eabi/-/jieba-android-arm-eabi-1.7.0.tgz#50b9921c6feb44755584963e8e00e425e557965a"
integrity sha512-XF4OYcZCyDiBK+jm1Zmt2o+xEO7K2K5OvUC3MTc9jd3Lwvy3EdHp8tpGvEp8PxfVFe2/JxNzX4OQQQP3Dhmk9A==
"@node-rs/jieba-android-arm64@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-android-arm64/-/jieba-android-arm64-1.7.0.tgz#3778790451e5664b7d658bdb66cc1013448b4ee2"
integrity sha512-9oWwFVr/37T89WC+jjiI9A6u0zUJNTJl5ZC4CMxX45MVMokWI7bBXU7t7qBmMdFBzj+OFwDd3sm1fh4vl7NSWA==
"@node-rs/jieba-darwin-arm64@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.7.0.tgz#a2b4941ba3f738538cd2c432411408d52d8dba85"
integrity sha512-9gBuxJCNITNI/gU5l8eeVGQ9MAf0BV86lfeo9TeU61vJCy6sqyx26wFMLODQgLNdiMP+q/fZme/G0hfZUjfPVA==
"@node-rs/jieba-darwin-x64@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-darwin-x64/-/jieba-darwin-x64-1.7.0.tgz#360bf8d1bbf580b538b93f66f5364b743ca4370f"
integrity sha512-FFUSMY4tl0Prpxa1SHy7Yzze2KfV/bZzccpO5nd+a8zCKbiX6gVkJ89FfxSAD2QrXUGkZvJYiPmu5nkZItqRZQ==
"@node-rs/jieba-freebsd-x64@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-freebsd-x64/-/jieba-freebsd-x64-1.7.0.tgz#f397ea7552121deb8f583ab51e96c198a0f88e38"
integrity sha512-QFz2pz0Br+621QbKkgQPqTn90j1kcCD9jaI++qTLNHJGlWLRn6sFoAjb+jQEQEy9aE7VqfIV56eaVcCoU5VO2w==
"@node-rs/jieba-linux-arm-gnueabihf@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-linux-arm-gnueabihf/-/jieba-linux-arm-gnueabihf-1.7.0.tgz#e8914e8ad38b412edd78674d10381153bf6ac8b7"
integrity sha512-kHJxO2sd7gMKqI1YS5DjABEcRwRemaCtgbKSuUqEaHGmUz9nAaUF6FSY8U4rXwr7HXt+kQa4NgyYDjgz+Pscrw==
"@node-rs/jieba-linux-arm64-gnu@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-linux-arm64-gnu/-/jieba-linux-arm64-gnu-1.7.0.tgz#987d7db0e1ffe30aff23abd5c3bb664aff88152f"
integrity sha512-3qoCV9pF6llPBGDMu7K8JdHjI10WPkrq6P2gpZESqekcE4DatV6DcU9FWR+QL7MK/7meoE3/Zhjm7OK+qBd8gg==
"@node-rs/jieba-linux-arm64-musl@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-linux-arm64-musl/-/jieba-linux-arm64-musl-1.7.0.tgz#e32d20f1ba346e5e0e8c7cc4c5d9c5970dc7e6e7"
integrity sha512-xv6hvzOV7iTCq7mM8SWhC3zEk6CqmBwhOSlfbb3gvPkc4U1UA1hmvcrD7oO5Qn+U+nuswysGCdVU6Z5AypLDfg==
"@node-rs/jieba-linux-x64-gnu@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.7.0.tgz#e39cf21d5220565542f1478571aa899ac4574411"
integrity sha512-NpelWidMSNLoFTw+ov3y5jhJZjapHwEnh0Fyfm/7mvqkdwzVyedqNj22etRGum+nsAosMotCUWUznIMAD075gQ==
"@node-rs/jieba-linux-x64-musl@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.7.0.tgz#01f756bccc4f7b683317665d606e4384b47361ee"
integrity sha512-yG4F8sy+fW4RbhyKXmEMT/JGuQuKH0TGymCEGYgT0km2I60iys63jWf2VTzCtrx583wxN5XoHv5HN60nhtIBtw==
"@node-rs/jieba-win32-arm64-msvc@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-win32-arm64-msvc/-/jieba-win32-arm64-msvc-1.7.0.tgz#71806504eea7390c3edd3579956d1f7e55f69c2e"
integrity sha512-R6l/BSMs6R6BwpZS6DIDZuAEjUIPdAHgyi+xptP3mICjm6U+GMsvsRTeZkIJ7a/yzYUfqvz54VpQsfE5f0psBQ==
"@node-rs/jieba-win32-ia32-msvc@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@node-rs/jieba-win32-ia32-msvc/-/jieba-win32-ia32-msvc-1.7.0.tgz#9c1c3f5aca2144cc2c8a14c0707a494e7ce79209"
integrity sha512-FwibbuizEjzom02K2JM2T8tL0VlxW5xGDDy3L3dgx46xIGE85PwGYjgju+eDt4UODgxDsxGC4DUMMZf3XvCc7A==
"@node-rs/jieba-win32-x64-msvc@1.7.0":
version "1.7.0"
resolved "https://registry.npmmirror.com/@node-rs/jieba-win32-x64-msvc/-/jieba-win32-x64-msvc-1.7.0.tgz"
@ -585,6 +612,11 @@
resolved "https://registry.npmmirror.com/@tokenizer/token/-/token-0.3.0.tgz"
integrity sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==
"@tootallnate/once@2":
version "2.0.0"
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==
"@tsconfig/node10@^1.0.7":
version "1.0.9"
resolved "https://registry.npmmirror.com/@tsconfig/node10/-/node10-1.0.9.tgz"
@ -676,6 +708,11 @@
resolved "https://registry.npmmirror.com/@types/node/-/node-18.16.0.tgz"
integrity sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==
"@types/node@^17.0.24":
version "17.0.45"
resolved "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz"
integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==
"@types/node@16.9.1":
version "16.9.1"
resolved "https://registry.npmmirror.com/@types/node/-/node-16.9.1.tgz"
@ -812,12 +849,7 @@ acorn@^8.4.1:
resolved "https://registry.npmmirror.com/acorn/-/acorn-8.9.0.tgz"
integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==
agent-base@5:
version "5.1.1"
resolved "https://registry.npmmirror.com/agent-base/-/agent-base-5.1.1.tgz"
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
agent-base@6, agent-base@^6.0.1:
agent-base@^6.0.1, agent-base@6:
version "6.0.2"
resolved "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz"
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
@ -831,6 +863,11 @@ agent-base@^7.0.2:
dependencies:
debug "^4.3.4"
agent-base@5:
version "5.1.1"
resolved "https://registry.npmmirror.com/agent-base/-/agent-base-5.1.1.tgz"
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
ajv-formats@^2.1.1:
version "2.1.1"
resolved "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-2.1.1.tgz"
@ -1041,7 +1078,16 @@ bent@^7.3.12:
caseless "~0.12.0"
is-stream "^2.0.0"
bl@^4.0.3, bl@^4.1.0:
bl@^4.0.3:
version "4.1.0"
resolved "https://registry.npmmirror.com/bl/-/bl-4.1.0.tgz"
integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
dependencies:
buffer "^5.5.0"
inherits "^2.0.4"
readable-stream "^3.4.0"
bl@^4.1.0:
version "4.1.0"
resolved "https://registry.npmmirror.com/bl/-/bl-4.1.0.tgz"
integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
@ -1126,7 +1172,15 @@ buffer-equal@0.0.1:
resolved "https://registry.npmmirror.com/buffer-equal/-/buffer-equal-0.0.1.tgz"
integrity sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==
buffer@^5.2.0, buffer@^5.5.0:
buffer@^5.2.0:
version "5.7.1"
resolved "https://registry.npmmirror.com/buffer/-/buffer-5.7.1.tgz"
integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
dependencies:
base64-js "^1.3.1"
ieee754 "^1.1.13"
buffer@^5.5.0:
version "5.7.1"
resolved "https://registry.npmmirror.com/buffer/-/buffer-5.7.1.tgz"
integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
@ -1302,16 +1356,16 @@ color-convert@^2.0.1:
dependencies:
color-name "~1.1.4"
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz"
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
color-name@^1.0.0, color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz"
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
color-string@^1.9.0:
version "1.9.1"
resolved "https://registry.npmmirror.com/color-string/-/color-string-1.9.1.tgz"
@ -1364,7 +1418,7 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0:
resolved "https://registry.npmmirror.com/console-control-strings/-/console-control-strings-1.1.0.tgz"
integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==
content-disposition@0.5.4, content-disposition@^0.5.3:
content-disposition@^0.5.3, content-disposition@0.5.4:
version "0.5.4"
resolved "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
@ -1381,7 +1435,7 @@ cookie-signature@1.0.6:
resolved "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==
cookie@0.5.0, cookie@^0.5.0:
cookie@^0.5.0, cookie@0.5.0:
version "0.5.0"
resolved "https://registry.npmmirror.com/cookie/-/cookie-0.5.0.tgz"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
@ -1402,9 +1456,17 @@ cross-spawn@^7.0.3:
crypto@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037"
resolved "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz"
integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==
cycletls@^1.0.21:
version "1.0.21"
resolved "https://registry.npmjs.org/cycletls/-/cycletls-1.0.21.tgz"
integrity sha512-Ccox1s+3mhoc/SOlzAXH2EqyKPc3PlJ6WVvshgzBn99ihDSmp/GQJqPw7TKBLO5pJMZtrl9B7s8cMdrwOoORbQ==
dependencies:
"@types/node" "^17.0.24"
ws "^7.5.7"
data-uri-to-buffer@^4.0.0:
version "4.0.1"
resolved "https://registry.npmmirror.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz"
@ -1417,6 +1479,27 @@ debounce-fn@^5.1.2:
dependencies:
mimic-fn "^4.0.0"
debug@^4.0.0:
version "4.3.4"
resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
debug@^4.1.1:
version "4.3.4"
resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
debug@^4.3.4, debug@4:
version "4.3.4"
resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
debug@2.6.9:
version "2.6.9"
resolved "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz"
@ -1424,13 +1507,6 @@ debug@2.6.9:
dependencies:
ms "2.0.0"
debug@4, debug@^4.0.0, debug@^4.1.1, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
decompress-response@^6.0.0:
version "6.0.0"
resolved "https://registry.npmmirror.com/decompress-response/-/decompress-response-6.0.0.tgz"
@ -1797,16 +1873,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-fifo@^1.0.0:
fast-fifo@^1.0.0, fast-fifo@^1.1.0, fast-fifo@^1.2.0:
version "1.2.0"
resolved "https://registry.npmmirror.com/fast-fifo/-/fast-fifo-1.2.0.tgz"
integrity sha512-NcvQXt7Cky1cNau15FWy64IjuO8X0JijhTBBrJj1YlxlDfRkJXNaK9RFUjwpfDPzMdv7wB38jr53l9tkNLxnWg==
fast-fifo@^1.1.0, fast-fifo@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.0.tgz#03e381bcbfb29932d7c3afde6e15e83e05ab4d8b"
integrity sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==
fast-json-stringify@^5.7.0:
version "5.7.0"
resolved "https://registry.npmmirror.com/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz"
@ -1841,7 +1912,7 @@ fastify-plugin@^4.0.0, fastify-plugin@^4.3.0:
resolved "https://registry.npmmirror.com/fastify-plugin/-/fastify-plugin-4.5.0.tgz"
integrity sha512-79ak0JxddO0utAXAQ5ccKhvs6vX2MGyHHMMsmZkBANrq3hXc1CHzvNPHOcvTsVMEPl5I+NT+RO4YKMGehOfSIg==
fastify@^4.11.0:
fastify@^4.11.0, fastify@^4.18.0, fastify@>=4:
version "4.18.0"
resolved "https://registry.npmmirror.com/fastify/-/fastify-4.18.0.tgz"
integrity sha512-L5o/2GEkBastQ3HV0dtKo7SUZ497Z1+q4fcqAoPyq6JCQ/8zdk1JQEoTQwnBWCp+EmA7AQa6mxNqSAEhzP0RwQ==
@ -1863,28 +1934,6 @@ fastify@^4.11.0:
semver "^7.5.0"
tiny-lru "^11.0.1"
fastify@^4.18.0:
version "4.20.0"
resolved "https://registry.yarnpkg.com/fastify/-/fastify-4.20.0.tgz#d796c7433ac64b83a666350dc8b57e1b2517c116"
integrity sha512-zWWi5KGAb1YZ6fyrnFnA1CA1EZHkGM6YuELgB3QpS3l4lLRy14W1cc16b4KGPH/zQ98WCSdS+T41JkHY3eq1oA==
dependencies:
"@fastify/ajv-compiler" "^3.5.0"
"@fastify/error" "^3.2.0"
"@fastify/fast-json-stringify-compiler" "^4.3.0"
abstract-logging "^2.0.1"
avvio "^8.2.1"
fast-content-type-parse "^1.0.0"
fast-json-stringify "^5.7.0"
find-my-way "^7.6.0"
light-my-request "^5.9.1"
pino "^8.12.0"
process-warning "^2.2.0"
proxy-addr "^2.0.7"
rfdc "^1.3.0"
secure-json-parse "^2.5.0"
semver "^7.5.0"
tiny-lru "^11.0.1"
fastq@^1.6.1:
version "1.15.0"
resolved "https://registry.npmmirror.com/fastq/-/fastq-1.15.0.tgz"
@ -2253,12 +2302,13 @@ http-errors@2.0.0:
statuses "2.0.1"
toidentifier "1.0.1"
https-proxy-agent@7.0.1, https-proxy-agent@^7.0.0:
version "7.0.1"
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz"
integrity sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==
http-proxy-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz"
integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==
dependencies:
agent-base "^7.0.2"
"@tootallnate/once" "2"
agent-base "6"
debug "4"
https-proxy-agent@^4.0.0:
@ -2277,12 +2327,20 @@ https-proxy-agent@^5.0.0:
agent-base "6"
debug "4"
https-proxy-agent@^7.0.0, https-proxy-agent@7.0.1:
version "7.0.1"
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz"
integrity sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==
dependencies:
agent-base "^7.0.2"
debug "4"
human-signals@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/human-signals/-/human-signals-2.1.0.tgz"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
iconv-lite@0.4.24, iconv-lite@^0.4.24:
iconv-lite@^0.4.24, iconv-lite@0.4.24:
version "0.4.24"
resolved "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
@ -2309,7 +2367,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4:
inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@2, inherits@2.0.4:
version "2.0.4"
resolved "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@ -2330,7 +2388,7 @@ inquirer-autocomplete-prompt@^3.0.0:
run-async "^2.4.1"
rxjs "^7.5.6"
inquirer@^9.1.4:
inquirer@^9.1.0, inquirer@^9.1.4:
version "9.2.7"
resolved "https://registry.npmmirror.com/inquirer/-/inquirer-9.2.7.tgz"
integrity sha512-Bf52lnfvNxGPJPltiNO2tLBp3zC339KNlGMqOkW+dsvNikBhcVDK5kqU2lVX2FTPzuXUFX5WJDlsw//w3ZwoTw==
@ -2886,7 +2944,7 @@ mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34:
dependencies:
mime-db "1.52.0"
mime@1.6.0, mime@^1.3.4:
mime@^1.3.4:
version "1.6.0"
resolved "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
@ -2896,6 +2954,11 @@ mime@^3.0.0:
resolved "https://registry.npmmirror.com/mime/-/mime-3.0.0.tgz"
integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==
mime@1.6.0:
version "1.6.0"
resolved "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz"
@ -2992,6 +3055,11 @@ mnemonist@0.39.5:
dependencies:
obliterator "^2.0.1"
ms@^2.1.1:
version "2.1.3"
resolved "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
ms@2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz"
@ -3002,7 +3070,7 @@ ms@2.1.2:
resolved "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
ms@2.1.3, ms@^2.1.1:
ms@2.1.3:
version "2.1.3"
resolved "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
@ -3044,7 +3112,14 @@ node-domexception@^1.0.0:
resolved "https://registry.npmmirror.com/node-domexception/-/node-domexception-1.0.0.tgz"
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
node-fetch@^2.6.1, node-fetch@^2.6.7:
node-fetch@^2.6.1:
version "2.6.11"
resolved "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.11.tgz"
integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==
dependencies:
whatwg-url "^5.0.0"
node-fetch@^2.6.7:
version "2.6.11"
resolved "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.11.tgz"
integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==
@ -3341,16 +3416,16 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==
path-to-regexp@^6.2.1:
version "6.2.1"
resolved "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz"
integrity sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==
path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==
peek-readable@^4.1.0:
version "4.1.0"
resolved "https://registry.npmmirror.com/peek-readable/-/peek-readable-4.1.0.tgz"
@ -3528,7 +3603,7 @@ puppeteer-extra-plugin@^3.2.3:
debug "^4.1.1"
merge-deep "^3.0.1"
puppeteer-extra@^3.3.6:
puppeteer-extra@*, puppeteer-extra@^3.3.6:
version "3.3.6"
resolved "https://registry.npmmirror.com/puppeteer-extra/-/puppeteer-extra-3.3.6.tgz"
integrity sha512-rsLBE/6mMxAjlLd06LuGacrukP2bqbzKCLzV1vrhHFavqQE/taQ2UXv3H5P0Ls7nsrASa+6x3bDbXHpqMwq+7A==
@ -3554,7 +3629,7 @@ quick-format-unescaped@^4.0.3:
resolved "https://registry.npmmirror.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz"
integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==
quick-lru@6.1.1, quick-lru@^6.1.1:
quick-lru@^6.1.1, quick-lru@6.1.1:
version "6.1.1"
resolved "https://registry.npmmirror.com/quick-lru/-/quick-lru-6.1.1.tgz"
integrity sha512-S27GBT+F0NTRiehtbrgaSE1idUAJ5bX8dPAQTdylEyNlrdcH5X4Lz7Edz3DYzecbsCluD5zO8ZNEe04z3D3u6Q==
@ -3571,20 +3646,20 @@ range-parser@~1.2.1:
resolved "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
raw-body@2.5.1:
version "2.5.1"
resolved "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.1.tgz"
integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==
raw-body@^2.3.3:
version "2.5.2"
resolved "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.2.tgz"
integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
dependencies:
bytes "3.1.2"
http-errors "2.0.0"
iconv-lite "0.4.24"
unpipe "1.0.0"
raw-body@^2.3.3:
version "2.5.2"
resolved "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.2.tgz"
integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
raw-body@2.5.1:
version "2.5.1"
resolved "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.1.tgz"
integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==
dependencies:
bytes "3.1.2"
http-errors "2.0.0"
@ -3620,7 +3695,16 @@ read-pkg@^7.1.0:
parse-json "^5.2.0"
type-fest "^2.0.0"
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
readable-stream@^3.1.1, readable-stream@^3.4.0:
version "3.6.2"
resolved "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
readable-stream@^3.6.0:
version "3.6.2"
resolved "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
@ -3730,7 +3814,7 @@ rxjs@^7.5.6, rxjs@^7.8.1:
dependencies:
tslib "^2.1.0"
safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@~5.2.0:
safe-buffer@^5.0.1, safe-buffer@~5.2.0, safe-buffer@5.2.1:
version "5.2.1"
resolved "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@ -3756,7 +3840,7 @@ safe-stable-stringify@^2.3.1:
resolved "https://registry.npmmirror.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz"
integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==
"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.1.0:
safer-buffer@^2.1.0, "safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
@ -3978,7 +4062,23 @@ streamx@^2.15.0:
fast-fifo "^1.1.0"
queue-tick "^1.0.1"
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.3:
string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
"string-width@^1.0.2 || 2 || 3 || 4":
version "4.2.3"
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
string-width@^4.1.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@ -4023,13 +4123,6 @@ string.prototype.trimstart@^1.0.6:
define-properties "^1.1.4"
es-abstract "^1.20.4"
string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz"
@ -4191,7 +4284,7 @@ ts-node-register@^1.0.0:
dependencies:
ts-node ">=0.9.0"
ts-node@>=0.9.0, ts-node@^10.9.1:
ts-node@^10.9.1, ts-node@>=0.9.0:
version "10.9.1"
resolved "https://registry.npmmirror.com/ts-node/-/ts-node-10.9.1.tgz"
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
@ -4220,6 +4313,16 @@ tslib@^2.1.0:
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.5.3.tgz"
integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==
tslib@^2.2.0:
version "2.6.2"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
tslib@^2.4.0:
version "2.6.2"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
tsscmp@^1.0.6:
version "1.0.6"
resolved "https://registry.npmmirror.com/tsscmp/-/tsscmp-1.0.6.tgz"
@ -4264,6 +4367,11 @@ typed-array-length@^1.0.4:
for-each "^0.3.3"
is-typed-array "^1.1.9"
typescript@>=2.7:
version "5.1.3"
resolved "https://registry.npmmirror.com/typescript/-/typescript-5.1.3.tgz"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
unbox-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz"
@ -4291,7 +4399,7 @@ universalify@^2.0.0:
resolved "https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
unpipe@1.0.0, unpipe@~1.0.0:
unpipe@~1.0.0, unpipe@1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz"
integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==
@ -4445,11 +4553,21 @@ wrappy@1:
resolved "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
ws@^7.5.3, ws@^7.5.6:
ws@^7.5.3:
version "7.5.9"
resolved "https://registry.npmmirror.com/ws/-/ws-7.5.9.tgz"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
ws@^7.5.6:
version "7.5.9"
resolved "https://registry.npmmirror.com/ws/-/ws-7.5.9.tgz"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
ws@^7.5.7:
version "7.5.9"
resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
ws@^8.0.0, ws@^8.12.0, ws@^8.13.0:
version "8.13.0"
resolved "https://registry.npmmirror.com/ws/-/ws-8.13.0.tgz"