Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions .github/workflows/dataeyesai-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: dataeyesai desktop packages

on:
push:
tags:
- "dataeyesai-v*"
pull_request:
paths:
- ".github/workflows/dataeyesai-desktop.yml"
- "tools/channel-key-importer/**"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
workflow_dispatch:
inputs:
version:
description: "Release version without the v prefix"
required: true
default: "0.7.0"

permissions:
contents: write

jobs:
build:
name: Build ${{ matrix.label }}
strategy:
fail-fast: false
matrix:
include:
- label: macOS Apple Silicon
os: macos-15
command: --mac dmg --arm64
artifact: mac-arm64
- label: macOS Intel
os: macos-15-intel
command: --mac dmg --x64
artifact: mac-x64
- label: Windows x64
os: windows-2025
command: --win nsis --x64
artifact: windows-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11.7.0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test:channel-importer
- name: Build installer
run: pnpm --filter dataeyesai exec electron-builder ${{ matrix.command }} --publish never
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
- uses: actions/upload-artifact@v4
with:
name: dataeyesai-${{ matrix.artifact }}
path: |
tools/channel-key-importer/dist/*.dmg
tools/channel-key-importer/dist/*.exe
if-no-files-found: error

release:
name: Publish GitHub release
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/dataeyesai-v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: dataeyesai-*
path: release-assets
merge-multiple: true
- name: Write release notes
run: |
cat > release-notes.md <<'EOF'
dataeyesai 桌面安装包。

- 单页长表单拆分为导入渠道、定时任务、用量监测、上 Key 记录和站点设置五个工作区
- 顶部标题、说明和站点状态会随当前工作区切换,减少无关信息干扰
- 视觉改为平面运营工具风格,统一无衬线字体、克制圆角和清晰数据层级
- 导入首页加入本地生成的渠道操作插画,不使用外部图片和第三方资源
- 手机端导航在自身区域横向滚动,不再撑宽整个页面
- 服务器版支持独立系统访问密钥、12 小时登录态和连续输错限流
- 多设备通过服务器 SQLite 共享站点、定时任务、用量和导入记录
- 记住的 New API 系统令牌使用 AES-256-GCM 加密后写入共享数据库
- 定时任务可把失败 Key 单独重新入队,不重复已经成功的 Key
- AWS Bedrock 自动识别 Key 类型和来源地区
- Global 模式使用一个来源地区并生成 `global.*` 模型映射
- 渠道名称和预览明确显示 AWS 来源地区
- 定时上 Key 支持精确到秒,并按最近任务动态唤醒
- 等待中或已暂停的定时任务可修改下一次执行时间、每批数量和时间间隔
- 批量独立建渠道可按 Key 原始顺序自动递减优先级,定时跨批次也不重置顺序
- 上 Key 记录按写入批次汇总时间、数量、额度、消耗和请求数,明细按需展开
- 金额、数量、日期等数据统一使用清晰的无衬线阿拉伯数字
- Key 和额度默认明文显示,可分别手动隐藏
- 批量 Key 可选择统一额度,只需填写一次金额;也可切换为逐条额度
- 创建、复制和更新渠道时可设置优先级与权重
- 优先级与权重位于批量写入方式下方,录入时无需返回上方查找
- 用量监测使用 New API 数据库汇总接口校准消费金额

- macOS Apple Silicon:`mac-arm64.dmg`
- macOS Intel:`mac-x64.dmg`
- Windows x64:`.exe`

当前预览版尚未购买 Apple 和 Microsoft 代码签名证书。macOS 首次启动可能需要在“系统设置 → 隐私与安全性”中选择“仍要打开”;Windows 可能显示 SmartScreen 提示。
EOF
- name: Create prerelease
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
TAG="dataeyesai-v${VERSION}"
else
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#dataeyesai-v}"
fi
gh release create "${TAG}" release-assets/* \
--repo "${{ github.repository }}" \
--target "${{ github.sha }}" \
--title "dataeyesai v${VERSION}" \
--notes-file release-notes.md \
--prerelease
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ web-ext.config.ts

.env
.env.*
tools/channel-key-importer/server.env
tools/channel-key-importer/server-data/
src/public/react-devtools*
.ace-tool/
/All API Hub – AI Relay & New API Manager/
82 changes: 51 additions & 31 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,58 @@
import type { KnipConfig } from "knip"

const config: KnipConfig = {
const rootEntry = [
// WXT entrypoints are referenced via extension conventions and HTML files,
// so declare them explicitly instead of relying on Knip defaults.
entry: [
"wxt.config.ts",
"i18next.config.ts",
"vitest.config.ts",
"scripts/diagnostics/collect-extension-memory.mjs",
"scripts/diagnostics/compare-extension-memory.mjs",
"scripts/diagnostics/compare-lazy-loading.mjs",
"scripts/diagnostics/render-extension-memory-report.mjs",
"scripts/diagnostics/render-lazy-loading-report.mjs",
"src/entrypoints/background/index.ts",
"src/entrypoints/content/index.ts",
"src/entrypoints/options/main.tsx",
"src/entrypoints/popup/main.tsx",
"src/entrypoints/sidepanel/main.tsx",
"tests/**/*.test.{ts,tsx}",
"tests/setup.ts",
"tests/setup.node.ts",
"tests/setup.shared.ts",
// Playwright runs this through the build dependency project in
// playwright.config.ts, which Knip does not discover as a static import.
"e2e/setup/build.setup.ts",
],
project: [
"src/**/*.{ts,tsx}",
"tests/**/*.{ts,tsx}",
"e2e/**/*.{ts,tsx}",
"scripts/**/*.{js,mjs}",
"plugins/**/*.ts",
"*.{js,mjs,ts}",
],
"wxt.config.ts",
"i18next.config.ts",
"vitest.config.ts",
"scripts/diagnostics/collect-extension-memory.mjs",
"scripts/diagnostics/compare-extension-memory.mjs",
"scripts/diagnostics/compare-lazy-loading.mjs",
"scripts/diagnostics/render-extension-memory-report.mjs",
"scripts/diagnostics/render-lazy-loading-report.mjs",
"src/entrypoints/background/index.ts",
"src/entrypoints/content/index.ts",
"src/entrypoints/options/main.tsx",
"src/entrypoints/popup/main.tsx",
"src/entrypoints/sidepanel/main.tsx",
"tests/**/*.test.{ts,tsx}",
"tests/setup.ts",
"tests/setup.node.ts",
"tests/setup.shared.ts",
// Playwright runs this through the build dependency project in
// playwright.config.ts, which Knip does not discover as a static import.
"e2e/setup/build.setup.ts",
]

const rootProject = [
"src/**/*.{ts,tsx}",
"tests/**/*.{ts,tsx}",
"e2e/**/*.{ts,tsx}",
"scripts/**/*.{js,mjs}",
"plugins/**/*.ts",
"*.{js,mjs,ts}",
]

const config: KnipConfig = {
workspaces: {
".": {
entry: rootEntry,
project: rootProject,
},
"tools/channel-key-importer": {
entry: [
"public/index.html",
"public/app.js",
"public/styles.css",
"public/login.html",
"public/login.js",
"public/login.css",
"tests/*.test.js",
],
project: ["**/*.{js,html,css}"],
},
},
ignoreDependencies: [
// Ambient extension/browser types are consumed globally by TypeScript.
"@types/chrome",
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"dev": "wxt",
"dev:firefox": "wxt -b firefox",
"dev:mobile:firefox": "node scripts/android-dev.js",
"channel-importer": "node tools/channel-key-importer/src/server.js",
"channel-importer:desktop": "pnpm --filter dataeyesai desktop",
"channel-importer:package": "pnpm --filter dataeyesai package:current",
"test:channel-importer": "node --test tools/channel-key-importer/tests/*.test.js",
"build": "wxt build",
"build:e2e": "node scripts/e2e-build.mjs",
"build:firefox": "wxt build -b firefox",
Expand Down Expand Up @@ -159,10 +163,5 @@
"web-ext": "^9.0.0",
"whatwg-fetch": "^3.6.20",
"wxt": "^0.20.16"
},
"pnpm": {
"onlyBuiltDependencies": [
"electron"
]
}
}
Loading