refactor: streamline build packaging and Easy Mode guidance

This commit is contained in:
lzt404 committed 2026-08-30 16:55:25 +08:00
1 parent 97fbd19f6c
commit 7e217a8186
5 files changed
+77 -56

No files matched your search

+2 -23
View File
@@ -12,9 +12,7 @@ $ErrorActionPreference = 'Stop'
$RootDir = $PSScriptRoot
$AppBin = Join-Path $RootDir 'src-tauri\target\release\cpa-gui.exe'
$BinDir = Join-Path $RootDir 'bin-work'
$BinOut = Join-Path $BinDir 'EasyCLIProxyAPI.exe'
$PortableScript = Join-Path $RootDir 'scripts\portable.mjs'
$CopyScript = Join-Path $RootDir 'copy.ps1'
Set-Location -LiteralPath $RootDir
@@ -86,24 +84,5 @@ if (-not (Test-Path -LiteralPath $AppBin -PathType Leaf)) {
throw "Build finished, but executable not found: $AppBin"
}
& bun $PortableScript --binary $AppBin --output $BinDir --download true --preserve-runtime-config true
if ($LASTEXITCODE -ne 0) {
throw "Portable preparation failed with exit code $LASTEXITCODE."
}
if (-not (Test-Path -LiteralPath $BinOut -PathType Leaf)) {
throw "Portable preparation finished, but executable not found: $BinOut"
}
$CoreOut = Join-Path $BinDir 'cpa-core'
$CoreArchives = @(
Get-ChildItem -LiteralPath $CoreOut -File |
Where-Object { $_.Name -match '^CLIProxyAPI_.+_windows_.+\.zip$' }
)
if ($CoreArchives.Count -ne 1) {
throw "Portable core output must contain exactly one Windows core archive: $CoreOut"
}
Write-Host "Built: $AppBin"
Write-Host "Copied: $BinOut"
Write-Host "Bundled core archive: $($CoreArchives[0].FullName)"
& $CopyScript
+42
View File
@@ -0,0 +1,42 @@
[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$RootDir = $PSScriptRoot
$AppBin = Join-Path $RootDir 'src-tauri\target\release\cpa-gui.exe'
$BinDir = Join-Path $RootDir 'bin-work'
$BinOut = Join-Path $BinDir 'EasyCLIProxyAPI.exe'
$PortableScript = Join-Path $RootDir 'scripts\portable.mjs'
Set-Location -LiteralPath $RootDir
if (-not (Get-Command bun -ErrorAction SilentlyContinue)) {
throw 'bun is not installed or not in PATH.'
}
if (-not (Test-Path -LiteralPath $AppBin -PathType Leaf)) {
throw "Executable not found: $AppBin. Run .\build.ps1 first."
}
& bun $PortableScript --binary $AppBin --output $BinDir --download true --preserve-runtime-config true
if ($LASTEXITCODE -ne 0) {
throw "Portable preparation failed with exit code $LASTEXITCODE."
}
if (-not (Test-Path -LiteralPath $BinOut -PathType Leaf)) {
throw "Portable preparation finished, but executable not found: $BinOut"
}
$CoreOut = Join-Path $BinDir 'cpa-core'
$CoreArchives = @(
Get-ChildItem -LiteralPath $CoreOut -File |
Where-Object { $_.Name -match '^CLIProxyAPI_.+_windows_.+\.zip$' }
)
if ($CoreArchives.Count -ne 1) {
throw "Portable core output must contain exactly one Windows core archive: $CoreOut"
}
Write-Host "Copied: $BinOut"
Write-Host "Bundled core archive: $($CoreArchives[0].FullName)"
+11 -11
View File
@@ -45,19 +45,19 @@ export const jaOverrides = {
'easyMode.oauth.description': 'API キーを手動でコピーせず、ブラウザーで認証します。',
'easyMode.api.title': 'API 接続',
'easyMode.api.description': 'サードパーティプラットフォームから提供された Base URL と API キーを入力します。',
'easyMode.step3.cardTitle': 'CPA をエージェントクライアントに接続',
'easyMode.step3.cardDescription': 'インストール済みのクライアントとモデルを選び、CPA の接続設定を書き込みます。',
'easyMode.step3.step1': 'エージェント設定を開き、インストール済みのクライアントを選びます。',
'easyMode.step3.step2': '利用するモデルを選びます。',
'easyMode.step3.step3': '「設定変更を適用」をクリックし、CLI またはアプリを起動します。',
'easyMode.step3.cardTitle': 'モデルを選んでエージェントに接続',
'easyMode.step3.cardDescription': '「利用可能なモデル」一覧からモデルを選び、利用するエージェントクライアントを選択します。',
'easyMode.step3.step1': '「利用可能なモデル」一覧から利用するモデルを選びます。',
'easyMode.step3.step2': 'インストール済みのエージェントクライアントを選びます。',
'easyMode.step3.step3': '設定を適用して、クライアントを起動します。',
'easyMode.guide.title': '使い方',
'easyMode.guide.description': 'OAuth ログインまたは API 接続を選び、モデルを接続してから、利用可能なモデルをエージェントクライアントに適用します。',
'easyMode.guide.step1Title': 'モデル接続方法を選ぶ',
'easyMode.guide.step1Description': 'ログイン可能なアカウントがある場合は OAuth、サードパーティプラットフォームの Base URL と API キーがある場合は API 接続を利用できます。',
'easyMode.guide.description': 'OAuth ログインまたは API 接続を選び、「利用可能なモデル」一覧からモデルを選んでエージェントに接続します。',
'easyMode.guide.step1Title': '接続方法を選ぶ',
'easyMode.guide.step1Description': 'OAuth で自分のアカウントにログインしてアカウントの利用枠を使うことも、API 接続で任意のプラットフォームに接続することもできます。',
'easyMode.guide.step2Title': 'モデルを接続',
'easyMode.guide.step2Description': 'OAuth ではアカウント認証を行います。API 接続ではサードパーティプラットフォームの Base URL と API キーを入力します。保存後はエージェント設定へ進めます。',
'easyMode.guide.step3Title': 'エージェントクライアントに接続',
'easyMode.guide.step3Description': 'インストール済みのエージェントクライアントと利用可能なモデルを選び、設定を適用すると利用を開始できます。',
'easyMode.guide.step2Description': 'アカウント認証を行うか、サードパーティプラットフォームの Base URL と API キーを入力して保存します。',
'easyMode.guide.step3Title': 'モデルを選んでエージェントに接続',
'easyMode.guide.step3Description': '「利用可能なモデル」一覧からモデルを選び、インストール済みのエージェントクライアントを選択して設定を適用します。',
'easyMode.navigation.back': '前へ',
'easyMode.navigation.next': '次へ',
'error.render.title': 'ページの描画中にエラーが発生しました',
+11 -11
View File
@@ -45,19 +45,19 @@ export const en: Record<MessageKey, string> = {
'easyMode.oauth.description': 'Authorize in your browser without copying an API key manually.',
'easyMode.api.title': 'API Access',
'easyMode.api.description': 'Enter the Base URL and API key provided by a third-party platform.',
'easyMode.step3.cardTitle': 'Connect CPA to an agent client',
'easyMode.step3.cardDescription': 'Choose an installed client and model here, then write the CPA connection settings.',
'easyMode.step3.step1': 'Open Agent Configuration and choose an installed client.',
'easyMode.step3.step2': 'Choose the model you want to use.',
'easyMode.step3.step3': 'Click “Apply Configuration Changes”, then launch the CLI or App.',
'easyMode.step3.cardTitle': 'Choose a model and connect an agent',
'easyMode.step3.cardDescription': 'Choose a model from the “Available models” list, then choose the agent client you want to use.',
'easyMode.step3.step1': 'Choose the model you want to use from “Available models”.',
'easyMode.step3.step2': 'Choose an installed agent client.',
'easyMode.step3.step3': 'Apply the configuration, then launch the client.',
'easyMode.guide.title': 'How to use',
'easyMode.guide.description': 'Choose OAuth sign-in or API Access first. After the model is connected, apply an available model to an agent client.',
'easyMode.guide.step1Title': 'Choose a model connection',
'easyMode.guide.step1Description': 'Use OAuth when an account can sign in, or API Access when you have a Base URL and API key from a third-party platform.',
'easyMode.guide.description': 'Choose OAuth sign-in or API Access first, then choose a model from “Available models” for an agent client.',
'easyMode.guide.step1Title': 'Choose a connection method',
'easyMode.guide.step1Description': 'You can use OAuth to sign in to your own account and use its quota, or use API Access to connect to any platform.',
'easyMode.guide.step2Title': 'Connect the model',
'easyMode.guide.step2Description': 'OAuth opens the account authorization flow. API Access asks for the Base URL and API key from the third-party platform. After saving, continue to agent configuration.',
'easyMode.guide.step3Title': 'Connect an agent client',
'easyMode.guide.step3Description': 'Choose an installed agent client and an available model, then apply the configuration to start using it.',
'easyMode.guide.step2Description': 'Complete account authorization, or enter and save the Base URL and API key provided by the third-party platform.',
'easyMode.guide.step3Title': 'Choose a model and connect an agent',
'easyMode.guide.step3Description': 'Choose a model from “Available models”, select an installed agent client, and apply the configuration.',
'easyMode.navigation.back': 'Previous',
'easyMode.navigation.next': 'Next',
'error.render.title': 'Something went wrong while rendering this page',
+11 -11
View File
@@ -43,19 +43,19 @@ export const zhCN = {
'easyMode.oauth.description': '通过浏览器授权,不需要手动复制 API 密钥。',
'easyMode.api.title': 'API 接入',
'easyMode.api.description': '填写第三方平台提供的 Base URL 和 API 密钥。',
'easyMode.step3.cardTitle': '将 CPA 连接到智能体客户端',
'easyMode.step3.cardDescription': '在这里可以选择已安装的客户端和模型,并写入 CPA 所需的连接配置。',
'easyMode.step3.step1': '打开智能体配置,选择一个已安装的客户端。',
'easyMode.step3.step2': '选择要使用的模型。',
'easyMode.step3.step3': '点击“应用配置修改”,然后启动 CLI 或 App。',
'easyMode.step3.cardTitle': '选择模型并连接智能体',
'easyMode.step3.cardDescription': '先在“可用模型”列表中选一个模型,再选择要使用的智能体客户端。',
'easyMode.step3.step1': '在“可用模型”列表中选择要使用的模型。',
'easyMode.step3.step2': '选择一个已安装的智能体客户端。',
'easyMode.step3.step3': '应用配置修改,然后启动对应的客户端。',
'easyMode.guide.title': '使用指导',
'easyMode.guide.description': '先确定使用 OAuth 登录还是 API 接入,模型接入后,再把可用模型应用到智能体客户端。',
'easyMode.guide.step1Title': '选择模型接入方式',
'easyMode.guide.step1Description': '已有可登录账号时可以使用 OAuth;持有第三方平台提供的 Base URL 和 API 密钥时,可以使用 API 接入。',
'easyMode.guide.description': '先选择 OAuth 或 API 接入模型,再从“可用模型”列表中选一个模型连接智能体。',
'easyMode.guide.step1Title': '选择接入方式',
'easyMode.guide.step1Description': '可以选择 OAuth 方式登录自己的账号,使用自己账号的额度;也可以通过 API 接入方式,接入任意平台。',
'easyMode.guide.step2Title': '接入模型',
'easyMode.guide.step2Description': 'OAuth 会打开账号授权流程;API 接入需要填写第三方平台提供的 Base URL 和 API 密钥。保存后即可继续配置智能体。',
'easyMode.guide.step3Title': '连接智能体客户端',
'easyMode.guide.step3Description': '从已安装的智能体客户端中选择一个客户端和模型,应用配置后即可开始使用。',
'easyMode.guide.step2Description': '完成账号授权,或填写第三方平台提供的 Base URL 和 API 密钥并保存。',
'easyMode.guide.step3Title': '选择模型并连接智能体',
'easyMode.guide.step3Description': '在“可用模型”列表中选择模型,再选择已安装的智能体客户端并应用配置。',
'easyMode.navigation.back': '上一步',
'easyMode.navigation.next': '下一步',
'error.render.title': '页面渲染出现异常',