Compare commits

...
13 Commits
Author SHA1 Message Date
手瓜一十雪 04b507d749 Add debug output for OpenRouter request body
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / Download-QNX64 (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Prints the OpenRouter API request body in the workflow using jq for easier debugging and inspection of outgoing requests.
2025-11-13 19:59:36 +08:00
手瓜一十雪 5638127813 Add default prompt and update release workflow
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / Download-QNX64 (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Added .github/prompt/default.md with deployment instructions and download links. Updated auto-release.yml to copy NapCat.Shell directory contents instead of unzipping the archive.
2025-11-13 19:58:10 +08:00
手瓜一十雪 30a7797ba9 Reduce aria2c parallelism in auto-release workflow
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / Download-QNX64 (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Changed aria2c download options from 16 connections to 1 in the auto-release workflow. This may help avoid issues with rate limiting or unstable downloads from the Node.js distribution server.
2025-11-13 19:53:05 +08:00
手瓜一十雪 d09a82b1b8 Add Windows packaging workflow and NapCat entry files
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / Download-QNX64 (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Introduces a new GitHub Actions job to automate packaging NapCat for Windows, including downloading dependencies and assembling artifacts. Adds napcat.bat and index.js entry files for Windows distribution in packages/napcat-develop.
2025-11-13 19:48:15 +08:00
手瓜一十雪 85b5c881ba Add napcat-develop package and update scripts
Introduces the napcat-develop package with its own package.json and tsconfig.json. Updates build and dev scripts in the root package.json, modifies loadNapCat.cjs to adjust paths and output directories, and updates nodeTest.ps1 to use the correct script path.
2025-11-13 19:30:33 +08:00
手瓜一十雪 eebce222cf Update release note prompt formatting and examples
Changed the commit id placement in update items for clarity and added more example update entries to guide contributors in writing release notes.
2025-11-13 19:20:13 +08:00
手瓜一十雪 ec5ca5d89a Improve tag handling in auto-release workflow
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Switches tag retrieval to use the GitHub API and sorts tags with jq for more reliable ordering. Adds explicit GITHUB_OWNER and GITHUB_REPO variables, improves previous tag selection logic, and ensures tags are fetched before generating release notes. Also adds more informative logging for debugging.
2025-11-13 19:16:12 +08:00
手瓜一十雪 31a7767ae4 Improve previous tag detection in auto-release workflow
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Replaces 'git describe' with logic to find the previous tag by sorting all tags by creation date. This ensures accurate detection of the previous tag for release note generation and adds error handling if no previous tag is found.
2025-11-13 19:06:06 +08:00
手瓜一十雪 fec024334a Update release note prompt formatting instructions
Clarified that output must strictly follow the NapCat release note format and example. Updated constraints and replaced the example section with a real example for better guidance.
2025-11-13 19:03:28 +08:00
手瓜一十雪 2ad2af4d7c Trigger release workflow on tag push
AI RELEASE NapCat / Build-LiteLoader (push) Canceled after 0s
AI RELEASE NapCat / Build-Shell (push) Canceled after 0s
AI RELEASE NapCat / release-napcat (push) Canceled after 0s
Changed the workflow trigger from pushes to the main branch to pushes of any tag. This enables releases to be automatically created when a new tag is pushed.
2025-11-13 18:57:37 +08:00
手瓜一十雪 2a160d296f Remove tag trigger from auto-release workflow
The workflow will no longer be triggered by tag pushes, only by pushes to the main branch.
2025-11-13 18:57:20 +08:00
手瓜一十雪 e43f229e04 Update import paths to use direct module references
Changed import statements from alias-based paths (e.g., '@/napcat-common/store') to direct module references (e.g., 'napcat-common/src/store') in Proxy.ts, Status.ts, Data.ts, and SignToken.ts for improved compatibility and clarity.
2025-11-13 18:56:51 +08:00
手瓜一十雪 9158ebc136 Update workflow name to AI RELEASE NapCat
Renamed the GitHub Actions workflow from 'Build Action' to 'AI RELEASE NapCat' for improved clarity and identification.
2025-11-13 18:55:01 +08:00
15 changed files with 262 additions and 24 deletions

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# V?.?.?
[使用文档](https://napneko.github.io/)
## Windows 一键包
我们为提供了的轻量化一键部署方案
相对于普通需要安装QQ的方案,下面已内置QQ和Napcat 阅读使用文档参考
你可以下载
NapCat.Shell.Windows.OneKey.zip (无头)
启动后可自动化部署一键包,教程参考使用文档安装部分
## 警告
**注意QQ版本推荐使用 40768+ 版本 最低可以使用40768版本**
**默认WebUi密钥为随机密码 控制台查看**
**[9.9.22-40990 X64 Win](https://dldir1v6.qq.com/qqfile/qq/QQNT/2c9d3f6c/QQ9.9.22.40990_x64.exe)**
[LinuxX64 DEB 40990 ](https://dldir1.qq.com/qqfile/qq/QQNT/ec800879/linuxqq_3.2.20-40990_amd64.deb)
[LinuxX64 RPM 40990 ](https://dldir1.qq.com/qqfile/qq/QQNT/ec800879/linuxqq_3.2.20-40990_x86_64.rpm)
[LinuxArm64 DEB 40990 ](https://dldir1.qq.com/qqfile/qq/QQNT/ec800879/linuxqq_3.2.20-40990_arm64.deb)
[LinuxArm64 RPM 40990 ](https://dldir1.qq.com/qqfile/qq/QQNT/ec800879/linuxqq_3.2.20-40990_aarch64.rpm)
[MAC DMG 40990 ](https://dldir1v6.qq.com/qqfile/qq/QQNT/c6cb0f5d/QQ_v6.9.82.40990.dmg)
## 如果WinX64缺少运行库或者xxx.dll?
[安装运行库](https://aka.ms/vs/17/release/vc_redist.x64.exe)
## 更新
+6 -7
View File
@@ -1,4 +1,4 @@
注意:输出必须严格使用 NapCat 的发布说明格式,并用简体中文。
注意:输出必须严格使用 NapCat 的发布说明格式,严格保证示例格式,并用简体中文。
格式规则:
1. 第一行:# V{TAG}
@@ -17,7 +17,7 @@
## 更新
按数字序列列出主要变更项,每条尽量一句话
- 前缀短 commit id,例如:1. a1b2c3d 修复 get_essence_msg_list 崩溃
- 前缀短 commit id,例如:1. 修复 get_essence_msg_list 崩溃 (a1b2c3d)
- 保持 4-18 条要点
## 开发者注意
@@ -25,11 +25,8 @@
额外约束:
- 语言简体中文,面向最终用户
- 不输出 stack trace、密钥、敏感信息
- 只列文件名作为 assets,不写链接
- 若提交为空,输出简短默认说明
下面为示例
下面为真实示例,请完全参考
# V?.?.?
[使用文档](https://napneko.github.io/)
@@ -58,4 +55,6 @@ NapCat.Shell.Windows.OneKey.zip (无头)
[安装运行库](https://aka.ms/vs/17/release/vc_redist.x64.exe)
## 更新
1. xxxx
1. 修改了XXXXX
2. 新增了XXXX
3. 重构了XXXX
+127 -7
View File
@@ -1,12 +1,10 @@
name: "Build Action"
name: AI RELEASE NapCat
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*' # 任意 tag push 时触发
- '*'
permissions: write-all
@@ -65,6 +63,98 @@ jobs:
with:
name: NapCat.Shell
path: shell-dist
Download-QNX64:
needs: Build-Shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Setup tools
run: |
sudo apt update
sudo apt install -y aria2 unzip zip p7zip-full curl jq
- name: Download QQ x64, Node.js and Assemble NapCat.Shell.Windows.Node.zip
run: |
set -euo pipefail
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
# -----------------------------
# 1) 下载 QQ x64
# -----------------------------
JS_URL="https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/windowsConfig.js"
NT_URL=$(curl -fsSL "$JS_URL" | grep -oP '"ntDownloadX64Url"\s*:\s*"\K[^"]+')
QQ_ZIP="$(basename "$NT_URL")"
aria2c -x16 -s16 -k1M -o "$QQ_ZIP" "$NT_URL"
QQ_EXTRACT="$TMPDIR/qq_extracted"
mkdir -p "$QQ_EXTRACT"
7z x -y -o"$QQ_EXTRACT" "$QQ_ZIP" >/dev/null
# -----------------------------
# 2) 下载 Node.js Windows x64 zip 22.11.0
# -----------------------------
NODE_VER="22.11.0"
NODE_URL="https://nodejs.org/dist/v$NODE_VER/node-v$NODE_VER-win-x64.zip"
NODE_ZIP="node-v$NODE_VER-win-x64.zip"
aria2c -x1 -s1 -k1M -o "$NODE_ZIP" "$NODE_URL"
NODE_EXTRACT="$TMPDIR/node_extracted"
mkdir -p "$NODE_EXTRACT"
unzip -q "$NODE_ZIP" -d "$NODE_EXTRACT"
# -----------------------------
# 3) 创建输出目录
# -----------------------------
OUT_DIR="$GITHUB_WORKSPACE/napcat"
mkdir -p "$OUT_DIR/napcat"
# -----------------------------
# 4) 解压 NapCat.Shell.zip 到 napcat
# -----------------------------
cp -a "$GITHUB_WORKSPACE/artifacts/NapCat.Shell/." "$OUT_DIR/napcat/"
# -----------------------------
# 5) 拷贝 QQ 文件到 napcat
# -----------------------------
QQ_TARGETS=("avif_convert.dll" "broadcast_ipc.dll" "config.json" "libglib-2.0-0.dll" "libgobject-2.0-0.dll" "libvips-42.dll" "ncnn.dll" "opencv.dll" "package.json" "QBar.dll" "wrapper.node")
for name in "${QQ_TARGETS[@]}"; do
find "$QQ_EXTRACT" -iname "$name" -exec cp -a {} "$OUT_DIR/napcat" \; || true
done
# -----------------------------
# 6) 拷贝仓库文件 napcat.bat 和 index.js
# -----------------------------
cp -a "$GITHUB_WORKSPACE/packages/napcat-develop/napcat.bat" "$OUT_DIR/napcat/" || true
cp -a "$GITHUB_WORKSPACE/packages/napcat-develop/index.js" "$OUT_DIR/napcat/" || true
# -----------------------------
# 7) 拷贝 Node.exe 到 napcat
# -----------------------------
cp -a "$NODE_EXTRACT/node-v$NODE_VER-win-x64/node.exe" "$OUT_DIR/napcat/" || true
# -----------------------------
# 8) 生成 index.txt
# -----------------------------
echo "NapCat Files Collected on $(date)" > "$GITHUB_WORKSPACE/index.txt"
# -----------------------------
# 9) 打包 napcat,命名为 NapCat.Shell.Windows.Node.zip
# -----------------------------
cd "$OUT_DIR"
zip -qr "$GITHUB_WORKSPACE/NapCat.Shell.Windows.Node.zip" napcat
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.Shell.Windows.Node
path: NapCat.Shell.Windows.Node.zip
release-napcat:
needs: [Build-LiteLoader, Build-Shell]
@@ -90,20 +180,47 @@ jobs:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENROUTER_API_URL: ${{ env.OPENROUTER_API_URL }}
OPENROUTER_MODEL: ${{ env.OPENROUTER_MODEL }}
GITHUB_OWNER: "NapNeKo" # 替换成你的 repo owner
GITHUB_REPO: "NapCatQQ" # 替换成你的 repo 名
run: |
set -euo pipefail
# 当前 tag
CURRENT_TAG="${GITHUB_REF#refs/tags/}"
echo "Current tag: $CURRENT_TAG"
# 上一个 tag
PREV_TAG=$(git describe --tags --abbrev=0 "$CURRENT_TAG^")
# 从 GitHub API 获取 tag 列表
TAGS_JSON=$(curl -s "https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/tags?per_page=100")
TAGS=( $(echo "$TAGS_JSON" | jq -r '.[].name' | sort -V) )
echo "Generating release note from $PREV_TAG to $CURRENT_TAG"
# 找到上一个 tag
PREV_TAG=""
for i in "${!TAGS[@]}"; do
if [ "${TAGS[$i]}" = "$CURRENT_TAG" ]; then
if [ $i -gt 0 ]; then
PREV_TAG="${TAGS[$((i-1))]}"
fi
break
fi
done
if [ -z "$PREV_TAG" ]; then
echo "❌ Could not find previous tag for $CURRENT_TAG, aborting."
exit 1
fi
echo "Previous tag: $PREV_TAG"
# 强制拉取上一个 tag 和当前 tag
git fetch origin "refs/tags/$PREV_TAG:refs/tags/$PREV_TAG" --force
git fetch origin "refs/tags/$CURRENT_TAG:refs/tags/$CURRENT_TAG" --force
# 获取 commit title + body + 作者,保留换行
COMMITS=$(git log --pretty=format:'%h %B (%an)' "$PREV_TAG".."$CURRENT_TAG" | sed 's/$/\\n/')
echo "Commit list from $PREV_TAG to $CURRENT_TAG:"
echo -e "$COMMITS"
# 读取 prompt
PROMPT_FILE=".github/prompt/release_note_prompt.txt"
SYSTEM_PROMPT=$(<"$PROMPT_FILE")
@@ -117,6 +234,9 @@ jobs:
--arg user "$USER_CONTENT" \
'{model: env.OPENROUTER_MODEL, messages:[{role:"system", content:$system},{role:"user", content:$user}], temperature:0.2, max_tokens:800}')
echo "=== OpenRouter request body ==="
echo "$BODY" | jq .
# 调用 OpenRouter
RESPONSE=$(curl -s -X POST "$OPENROUTER_API_URL" \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
+1 -1
View File
@@ -16,4 +16,4 @@ checkVersion.sh
bun.lockb
tests/run/
guild1.db-wal
guild1.db-shm
guild1.db-shm
+2 -1
View File
@@ -6,7 +6,8 @@
"scripts": {
"build:shell": "pnpm --filter napcat-shell run build || exit 1",
"build:framework": "pnpm --filter napcat-framework run build || exit 1",
"build:webui": "pnpm --filter napcat-webui-frontend run build || exit 1"
"build:webui": "pnpm --filter napcat-webui-frontend run build || exit 1",
"dev:shell": "pnpm --filter napcat-develop run dev || exit 1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.3",
+14
View File
@@ -0,0 +1,14 @@
const path = require('path');
const { pathToFileURL } = require('url');
// 公共目录变量
const BASE_DIR = __dirname;
const WRAPPER_NODE_PATH = path.join(BASE_DIR, 'wrapper.node');
const PACKAGE_JSON_PATH = path.join(BASE_DIR, 'package.json');
const CONFIG_JSON_PATH = path.join(BASE_DIR, 'config.json');
const NAPCAT_MJS_PATH = path.join(BASE_DIR, 'napcat', 'napcat.mjs');
process.env.NAPCAT_WRAPPER_PATH = WRAPPER_NODE_PATH;
process.env.NAPCAT_QQ_PACKAGE_INFO_PATH = PACKAGE_JSON_PATH;
process.env.NAPCAT_QQ_VERSION_CONFIG_PATH = CONFIG_JSON_PATH;
process.env.NAPCAT_DISABLE_PIPE = '1';
import(pathToFileURL(NAPCAT_MJS_PATH).href);
+3 -3
View File
@@ -18,9 +18,9 @@ if (versionFolders.length !== 1) {
}
const BASE_DIR = path.join(versionsDir, versionFolders[0], 'resources', 'app');
const TARGET_DIR = path.join(__dirname, 'run');
const TARGET_DIR = path.join(__dirname, 'dist');
const QQNT_FILE = path.join(__dirname, 'QQNT.dll');
const NAPCAT_MJS_PATH = path.join(__dirname, '..', 'dist', 'napcat.mjs');
const NAPCAT_MJS_PATH = path.join(__dirname, '..', 'napcat-shell','dist', 'napcat.mjs');
const itemsToCopy = [
'avif_convert.dll',
@@ -60,7 +60,7 @@ async function copyAll () {
process.env.NAPCAT_QQ_PACKAGE_INFO_PATH = path.join(TARGET_DIR, 'package.json');
process.env.NAPCAT_QQ_VERSION_CONFIG_PATH = path.join(TARGET_DIR, 'config.json');
process.env.NAPCAT_DISABLE_PIPE = '1';
process.env.NAPCAT_WORKDIR = path.join(__dirname, 'run');
process.env.NAPCAT_WORKDIR = TARGET_DIR;
console.log('Loading NapCat module...');
await import(pathToFileURL(NAPCAT_MJS_PATH).href);
+1
View File
@@ -0,0 +1 @@
node.exe ./index.js
+1 -1
View File
@@ -5,4 +5,4 @@ $uninstall = $uninstall.Trim('"')
$qqPath = Split-Path $uninstall -Parent
Write-Host "QQPath: $qqPath"
node.exe "tests/loadNapCat.cjs" "$qqPath"
node.exe "./loadNapCat.cjs" "$qqPath"
+27
View File
@@ -0,0 +1,27 @@
{
"name": "napcat-develop",
"version": "0.0.1",
"private": true,
"type": "module",
"main": "index.cjs",
"scripts": {
"dev": "powershell ./nodeTest.ps1"
},
"exports": {
".": {
"require": "./index.cjs"
},
"./*": {
"require": "./*"
}
},
"dependencies": {
"fs-extra": "^11.3.2"
},
"devDependencies": {
"@types/node": "^22.0.1"
},
"engines": {
"node": ">=18.0.0"
}
}
+49
View File
@@ -0,0 +1,49 @@
{
"compilerOptions": {
"target": "ES2021",
"module": "ESNext",
"moduleResolution": "Node",
"lib": [
"ES2021"
],
"typeRoots": [
"./node_modules/@types"
],
"esModuleInterop": true,
"outDir": "dist",
"rootDir": "./",
"noEmit": false,
"sourceMap": true,
"strict": true,
"noImplicitAny": false,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"alwaysStrict": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": false,
"forceConsistentCasingInFileNames": true,
"useUnknownInCatchVariables": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"useDefineForClassFields": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": "./",
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"allowJs": true
},
"include": [
"**/*.cjs"
],
"exclude": [
"node_modules",
"dist"
]
}
@@ -1,5 +1,5 @@
import { RequestHandler } from 'express';
import { RequestUtil } from '@/napcat-common/request';
import { RequestUtil } from 'napcat-common/src/request';
import { sendError, sendSuccess } from '../utils/response';
export const GetProxyHandler: RequestHandler = async (req, res) => {
@@ -1,5 +1,5 @@
import { RequestHandler } from 'express';
import { SystemStatus, statusHelperSubscription } from '@/napcat-core/helper/status';
import { SystemStatus, statusHelperSubscription } from 'napcat-core/helper/status';
export const StatusRealTimeHandler: RequestHandler = async (req, res) => {
res.setHeader('Content-Type', 'text/event-stream');
@@ -1,6 +1,6 @@
import type { LoginRuntimeType } from '../types/data';
import packageJson from '../../../../package.json';
import store from '@/napcat-common/store';
import store from 'napcat-common/src/store';
const LoginRuntime: LoginRuntimeType = {
LoginCurrentTime: Date.now(),
@@ -1,5 +1,5 @@
import crypto from 'crypto';
import store from '@/napcat-common/store';
import store from 'napcat-common/src/store';
export class AuthHelper {
private static readonly secretKey = Math.random().toString(36).slice(2);