codexmate 0.1.37 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -128,7 +128,7 @@ Codex Mate manages existing tools and local records. It is not a new AI model or
128
128
  - **Usage Analytics**: Visualize message trends and top projects
129
129
  - **Prompt Templates**: Variable-fill dialog on invocation, one-template JSON sharing, and versioned plugin template configuration with history Diff and rollback. `git_diff` is pasted text, not an executed command.
130
130
  - **MCP Integration**: Expose local tools and resources via MCP stdio
131
- - **Auto Update**: Click the Web UI update notice to view versions and copy `codexmate update`. Run it on the service host, then restart the service after a successful update. Clicking or copying does not run updates
131
+ - **Updates**: Use the update notice to download the matching Windows, macOS, or Linux desktop installer from GitHub without leaving the app. Install it manually. For CLI + Web installs, copy `codexmate update`, run it on the service host, then restart the service.
132
132
 
133
133
  </details>
134
134
 
package/README.vi.md CHANGED
@@ -124,7 +124,7 @@ Codex Mate quản lý công cụ và dữ liệu cục bộ đã có. Đây khô
124
124
  - **Phân tích sử dụng**: Trực quan hóa xu hướng tin nhắn và dự án nổi bật
125
125
  - **Mẫu Prompt**: Hộp thoại điền biến khi gọi, chia sẻ một mẫu bằng JSON, lịch sử Diff và khôi phục cấu hình mẫu plugin. `git_diff` là văn bản được dán, không thực thi lệnh.
126
126
  - **Tích hợp MCP**: Expose tool và resource cục bộ qua MCP stdio
127
- - **Tự động cập nhật**: Nhấp thông báo phiên bản mới trong Web UI để xem phiên bản và sao chép `codexmate update`. Chạy trên máy chủ dịch vụ rồi khởi động lại dịch vụ sau khi cập nhật thành công. Nhấp hoặc sao chép không thực thi cập nhật
127
+ - **Cập nhật**: Với bản desktop Windows, macOS hoặc Linux, tải bộ cài tương ứng từ GitHub ngay trong hộp thoại cập nhật rồi cài thủ công. Với bản CLI + Web, sao chép `codexmate update`, chạy trên máy chủ dịch vụ rồi khởi động lại dịch vụ.
128
128
  - **Trình sửa tệp prompt**: Chỉnh sửa CLAUDE.md / AGENTS.md toàn cục và theo dự án với kho preset chung. Điền biến trước khi áp dụng preset; cần lưu thủ công để ghi tệp. Lịch sử hiển thị Diff; xác nhận khôi phục sẽ ghi phiên bản đã chọn với bản sao lưu nguyên tử và kiểm tra thay đổi bên ngoài. Tab và lựa chọn tệp đích được lưu và khôi phục sau khi tải lại. Pi giữ tệp đã chọn nếu còn trong danh sách; chỉ chuyển về mục đầu khi tệp không còn và không có bản nháp chưa lưu. Tab Pi liệt kê tệp `.md` trực tiếp trong `~/.pi/agent/` hoặc `<cwd>/.pi/`, cập nhật khi mở tab hoặc danh sách tệp; không tự động nạp prompt. Trang sửa prompt không thêm khoảng trống tải cấu hình, tránh nhảy vị trí cuộn khi quá trình tải hoàn tất. Tự động phát hiện đường dẫn dự án; tệp prompt toàn cục của OpenCode nằm tại `~/.config/opencode/AGENTS.md`.
129
129
  - **Bridge Provider Claude**: Kết nối Claude Code với provider tương thích OpenAI Chat Completions và Ollama qua proxy tương thích Claude cục bộ tích hợp.
130
130
  - **Kho Provider OpenCode**: Lưu nhiều provider trong kho riêng của CodexMate tại `~/.codexmate`, chỉ đưa provider đang chọn vào cấu hình OpenCode gốc, giữ nguyên thiết lập do người dùng quản lý.
package/README.zh.md CHANGED
@@ -127,7 +127,7 @@ Codex Mate 管理已有工具和本地记录,不是新的 AI 模型,也不
127
127
  - **Usage 统计**: 可视化消息趋势与热门项目统计
128
128
  - **提示词模板**: 调用时弹窗填写变量,支持单模板 JSON 分享、插件模板配置历史 Diff 与回滚。`git_diff` 需粘贴差异文本,不执行命令。
129
129
  - **MCP 集成**: 通过 MCP stdio 暴露本地工具与资源
130
- - **自动更新**: 点击 Web UI 的新版本提示,弹窗查看版本与复制 `codexmate update`;在服务主机终端执行,更新成功后重启服务。点击与复制不执行更新
130
+ - **版本更新**: Windows、macOS、Linux 桌面安装版可在更新弹窗下载对应的 GitHub 安装包,再手动安装。CLI + Web 版仍可复制 `codexmate update`,在服务主机执行,更新成功后重启服务。
131
131
  - **KiloCode 配置桥接**: 在 CLI 或 Web UI 配置 KiloCode Provider,写入 `~/.config/kilo/kilo.jsonc`,保留已存储的 API key。
132
132
 
133
133
  </details>
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ const https = require('https');
4
+
5
+ const REPOSITORY = 'SakuraByteCore/codexmate';
6
+ const RELEASE_API = `https://api.github.com/repos/${REPOSITORY}/releases/latest`;
7
+ const DOWNLOAD_BASE = `https://github.com/${REPOSITORY}/releases/download/`;
8
+ const RELEASE_TAG = /^v\d+\.\d+\.\d+$/;
9
+ const METADATA_LIMIT = 1024 * 1024;
10
+ const PACKAGE_NAMES = {
11
+ win32: { stem: 'codexmate-setup', extension: '.exe', defaultArch: 'x64' },
12
+ darwin: { stem: 'Codex.Mate', extension: '.dmg', defaultArch: 'x64' },
13
+ linux: { stem: 'codexmate', extension: '.AppImage', defaultArch: 'x64' }
14
+ };
15
+
16
+ function getDesktopUpdateTarget(env = process.env) {
17
+ const match = /^(win32|darwin|linux)-(x64|arm64|ia32|armv7l)$/.exec(env.CODEXMATE_DESKTOP_PACKAGE || '');
18
+ return match ? { platform: match[1], arch: match[2] } : null;
19
+ }
20
+
21
+ function selectDesktopAsset(release, { platform, arch }) {
22
+ const policy = Object.prototype.hasOwnProperty.call(PACKAGE_NAMES, platform) ? PACKAGE_NAMES[platform] : null;
23
+ if (!policy || !RELEASE_TAG.test(release?.tag_name) || !Array.isArray(release.assets)) return null;
24
+ const tag = release.tag_name;
25
+ const prefix = `${policy.stem}-${tag.slice(1)}`;
26
+ const qualified = `${prefix}-${arch}${policy.extension}`;
27
+ const defaultName = `${prefix}${policy.extension}`;
28
+ // The release workflow builds unqualified Windows/Linux assets on x64 runners.
29
+ // electron-builder's default macOS DMG name omits the suffix for x64.
30
+ const matches = release.assets.filter(asset => {
31
+ if (asset?.state !== 'uploaded' || !Number.isSafeInteger(asset.size) || asset.size <= 0) return false;
32
+ if (asset.name !== qualified && !(arch === policy.defaultArch && asset.name === defaultName)) return false;
33
+ return asset.browser_download_url === `${DOWNLOAD_BASE}${tag}/${asset.name}`;
34
+ });
35
+ if (matches.length !== 1) return null;
36
+ const { name, size, browser_download_url: url } = matches[0];
37
+ return { name, size, url };
38
+ }
39
+
40
+ function fetchDesktopRelease(timeoutMs = 5000) {
41
+ return new Promise((resolve, reject) => {
42
+ const req = https.get(RELEASE_API, { headers: { 'User-Agent': 'CodexMate', Accept: 'application/vnd.github+json' } }, (res) => {
43
+ if (res.statusCode !== 200) {
44
+ res.resume();
45
+ reject(new Error(`GitHub Release API returned ${res.statusCode}`));
46
+ return;
47
+ }
48
+ let body = '';
49
+ res.setEncoding('utf8');
50
+ res.on('data', chunk => {
51
+ body += chunk;
52
+ if (body.length > METADATA_LIMIT) req.destroy(new Error('GitHub Release metadata exceeds limit'));
53
+ });
54
+ res.on('error', reject);
55
+ res.on('end', () => {
56
+ try {
57
+ const release = JSON.parse(body);
58
+ if (!RELEASE_TAG.test(release?.tag_name) || release.draft || release.prerelease || !Array.isArray(release.assets)) {
59
+ throw new Error('Invalid GitHub Release metadata');
60
+ }
61
+ resolve(release);
62
+ } catch (err) {
63
+ reject(err);
64
+ }
65
+ });
66
+ });
67
+ const deadline = setTimeout(() => req.destroy(new Error('GitHub Release check timed out')), timeoutMs);
68
+ req.once('close', () => clearTimeout(deadline));
69
+ req.on('error', reject);
70
+ });
71
+ }
72
+
73
+ module.exports = { getDesktopUpdateTarget, fetchDesktopRelease, selectDesktopAsset };
package/cli/update.js CHANGED
@@ -3,6 +3,7 @@ const path = require('path');
3
3
  const os = require('os');
4
4
  const https = require('https');
5
5
  const { execSync, spawn } = require('child_process');
6
+ const { fetchDesktopRelease, selectDesktopAsset } = require('./desktop-release');
6
7
 
7
8
  /**
8
9
  * 快速更新命令实现
@@ -125,29 +126,40 @@ function comparePackageVersions(left, right) {
125
126
  return 0;
126
127
  }
127
128
 
128
- let latestVersionStatusCache = null;
129
+ const latestVersionStatusCache = new Map();
129
130
 
130
131
  async function fetchLatestVersionStatus(options = {}) {
132
+ const { desktopTarget } = options;
131
133
  const currentVersion = normalizePackageVersion(options.currentVersion) || String(options.currentVersion || '');
132
134
  const timeoutMs = Number.isFinite(Number(options.timeoutMs)) ? Number(options.timeoutMs) : 5000;
133
135
  const cacheTtlMs = Number.isFinite(Number(options.cacheTtlMs)) ? Math.max(0, Number(options.cacheTtlMs)) : 10 * 60 * 1000;
134
136
  const now = typeof options.now === 'function' ? options.now() : Date.now();
135
- if (latestVersionStatusCache && cacheTtlMs > 0 && now - latestVersionStatusCache.checkedAtMs < cacheTtlMs) {
136
- return { ...latestVersionStatusCache.payload, cached: true };
137
+ const source = desktopTarget ? 'github' : 'npm';
138
+ const cacheKey = desktopTarget ? `${source}:${desktopTarget.platform}:${desktopTarget.arch}` : source;
139
+ const cached = latestVersionStatusCache.get(cacheKey);
140
+ const useCache = cached && cacheTtlMs > 0 && now - cached.checkedAtMs < cacheTtlMs;
141
+ if (!useCache) latestVersionStatusCache.delete(cacheKey);
142
+
143
+ let metadata;
144
+ if (useCache) {
145
+ metadata = cached.metadata;
146
+ } else if (desktopTarget) {
147
+ const release = await fetchDesktopRelease(timeoutMs);
148
+ metadata = { latestVersion: normalizePackageVersion(release.tag_name), asset: selectDesktopAsset(release, desktopTarget) };
149
+ } else {
150
+ const raw = await fetchLatestVersion({ timeoutMs });
151
+ metadata = { latestVersion: normalizePackageVersion(raw) || String(raw || '') };
137
152
  }
138
-
139
- const latestVersionRaw = await fetchLatestVersion({ timeoutMs });
140
- const latestVersion = normalizePackageVersion(latestVersionRaw) || String(latestVersionRaw || '');
141
- const payload = {
142
- currentVersion,
143
- latestVersion,
144
- updateAvailable: !!currentVersion && !!latestVersion && comparePackageVersions(currentVersion, latestVersion) < 0,
145
- source: 'npm',
146
- checkedAt: new Date(now).toISOString(),
147
- cached: false
153
+ const { latestVersion, asset } = metadata;
154
+ const checkedAtMs = useCache ? cached.checkedAtMs : now;
155
+ latestVersionStatusCache.set(cacheKey, { checkedAtMs, metadata });
156
+ const updateAvailable = !!currentVersion && !!latestVersion && comparePackageVersions(currentVersion, latestVersion) < 0;
157
+ return {
158
+ currentVersion, latestVersion, updateAvailable, source,
159
+ checkedAt: new Date(checkedAtMs).toISOString(),
160
+ cached: !!useCache,
161
+ ...(desktopTarget ? { updateAction: 'download', asset: updateAvailable ? asset : null } : {})
148
162
  };
149
- latestVersionStatusCache = { checkedAtMs: now, payload };
150
- return payload;
151
163
  }
152
164
 
153
165
  function detectInstallMethod() {
package/cli.js CHANGED
@@ -182,6 +182,7 @@ const {
182
182
  } = require('./cli/skills');
183
183
  const { cmdImportSkills: cmdImportSkillsFromUrl } = require('./cli/import-skills-url');
184
184
  const { cmdToolUpdate, fetchLatestVersionStatus } = require('./cli/update');
185
+ const { getDesktopUpdateTarget } = require('./cli/desktop-release');
185
186
  const {
186
187
  getFileStatSafe,
187
188
  isBootstrapLikeText,
@@ -14718,15 +14719,17 @@ function createWebServer({ htmlPath, assetsDir, webDir, host, port, openBrowser
14718
14719
  return '';
14719
14720
  }
14720
14721
  })();
14722
+ const desktopTarget = getDesktopUpdateTarget();
14721
14723
  try {
14722
14724
  const force = !!(params && params.force);
14723
- result = await fetchLatestVersionStatus({ currentVersion, timeoutMs: 2000, cacheTtlMs: force ? 0 : undefined });
14725
+ result = await fetchLatestVersionStatus({ currentVersion, desktopTarget, timeoutMs: desktopTarget ? 5000 : 2000, cacheTtlMs: force ? 0 : undefined });
14724
14726
  } catch (e) {
14725
14727
  result = {
14726
14728
  currentVersion,
14727
14729
  latestVersion: '',
14728
14730
  updateAvailable: false,
14729
- source: 'npm',
14731
+ source: desktopTarget ? 'github' : 'npm',
14732
+ ...(desktopTarget ? { updateAction: 'download', asset: null } : {}),
14730
14733
  checkedAt: new Date().toISOString(),
14731
14734
  cached: false,
14732
14735
  error: e && e.message ? e.message : '获取最新版本失败'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexmate",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Codex/Claude Code/OpenClaw 配置、会话与任务编排 CLI + Web 工具",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -23,6 +23,7 @@
23
23
  ".": "./cli.js",
24
24
  "./lib/*": "./lib/*.js",
25
25
  "./web-ui/*": "./web-ui/*",
26
+ "./desktop-release": "./cli/desktop-release.js",
26
27
  "./res/*": "./web-ui/res/*"
27
28
  },
28
29
  "scripts": {
package/web-ui/app.js CHANGED
@@ -146,6 +146,7 @@ document.addEventListener('DOMContentLoaded', () => {
146
146
  showHealthCheckModal: false,
147
147
  showProviderCacheModal: false,
148
148
  showProviderCacheAnnouncementModal: false,
149
+ hasReadSideAnnouncement: false,
149
150
  showCodexBridgePoolModal: false,
150
151
  showClaudeBridgePoolModal: false,
151
152
  showWebhookModal: false,
@@ -462,6 +463,10 @@ document.addEventListener('DOMContentLoaded', () => {
462
463
  installStatusTargets: null,
463
464
  appLatestVersion: '',
464
465
  showAppUpdateModal: false,
466
+ appUpdateAction: 'command',
467
+ appUpdateAsset: null,
468
+ appUpdateDownloadPending: false,
469
+ appUpdateDownloadStatus: '',
465
470
  appVersionStatusLoading: false,
466
471
  appVersionStatusError: '',
467
472
  appVersionStatusChecked: false,
@@ -72,7 +72,7 @@ export function createInstallMethods(options = {}) {
72
72
  },
73
73
 
74
74
  appUpdateNoticeMeta() {
75
- if (this.appVersionStatusLoading) return this.t('side.update.checkingMeta');
75
+ if (this.appVersionStatusLoading) return this.t(this.appUpdateAction === 'download' ? 'side.update.checking' : 'side.update.checkingMeta');
76
76
  if (this.appVersionStatusError) return this.appVersionStatusError;
77
77
  const current = this.normalizePackageVersion(this.appVersion);
78
78
  const latest = this.normalizePackageVersion(this.appLatestVersion);
@@ -106,10 +106,39 @@ export function createInstallMethods(options = {}) {
106
106
  return APP_UPDATE_COMMAND;
107
107
  },
108
108
 
109
+ hasNativeAppUpdateDownload() {
110
+ return typeof window !== 'undefined' && typeof window.desktopBridge?.downloadUpdate === 'function';
111
+ },
112
+
113
+ async downloadAppUpdate() {
114
+ const asset = this.appUpdateAsset;
115
+ if (this.appUpdateAction !== 'download' || !asset || this.appUpdateDownloadPending || !this.hasNativeAppUpdateDownload()) return;
116
+ this.appUpdateDownloadStatus = '';
117
+ this.appUpdateDownloadPending = true;
118
+ try {
119
+ const result = await window.desktopBridge.downloadUpdate(asset.url);
120
+ if (this.appUpdateAsset === asset) {
121
+ this.appUpdateDownloadStatus = ['completed', 'cancelled', 'unavailable'].includes(result?.status)
122
+ ? result.status : 'failed';
123
+ }
124
+ } catch (_) {
125
+ if (this.appUpdateAsset === asset) this.appUpdateDownloadStatus = 'failed';
126
+ } finally {
127
+ this.appUpdateDownloadPending = false;
128
+ if (this.showAppUpdateModal) this.$nextTick(() => (document.getElementById('app-update-primary') || document.getElementById('app-update-close'))?.focus());
129
+ }
130
+ },
131
+
132
+ async retryAppUpdateDownloadCheck() {
133
+ await this.loadAppVersionStatus({ silent: true, force: true });
134
+ if (this.showAppUpdateModal) this.$nextTick(() => (document.getElementById('app-update-primary') || document.getElementById('app-update-close'))?.focus());
135
+ },
136
+
109
137
  openAppUpdateModal(trigger) {
110
138
  this._appUpdateTrigger = trigger || document.activeElement;
111
139
  this.showAppUpdateModal = true;
112
- this.$nextTick(() => document.getElementById('app-update-command')?.focus());
140
+ const focusId = this.appUpdateAction === 'download' ? 'app-update-primary' : 'app-update-command';
141
+ this.$nextTick(() => document.getElementById(focusId)?.focus());
113
142
  },
114
143
 
115
144
  closeAppUpdateModal() {
@@ -126,6 +155,8 @@ export function createInstallMethods(options = {}) {
126
155
  this.appVersionStatusError = '';
127
156
  this.appVersionStatusChecked = false;
128
157
  this.appLatestVersion = '';
158
+ this.appUpdateAsset = null;
159
+ this.appUpdateDownloadStatus = '';
129
160
  this.appVersionStatusSource = '';
130
161
  this.appVersionStatusCheckedAt = '';
131
162
  try {
@@ -133,12 +164,17 @@ export function createInstallMethods(options = {}) {
133
164
  if (!this.appVersion) {
134
165
  this.appVersion = this.normalizePackageVersion(res?.currentVersion);
135
166
  }
167
+ if (res?.updateAction === 'download') this.appUpdateAction = 'download';
136
168
  if (res?.error) throw new Error(res.error);
137
169
  const latestVersion = this.normalizePackageVersion(res?.latestVersion);
138
170
  if (!latestVersion || !this.normalizePackageVersion(this.appVersion)) {
139
171
  throw new Error(this.t('side.update.checkFailed'));
140
172
  }
141
173
  this.appLatestVersion = latestVersion;
174
+ this.appUpdateAction = res.updateAction === 'download' ? 'download' : 'command';
175
+ if (this.appUpdateAction === 'download' && this.isAppUpdateAvailable() && res.asset?.url && res.asset?.name) {
176
+ this.appUpdateAsset = res.asset;
177
+ }
142
178
  this.appVersionStatusSource = typeof res.source === 'string' ? res.source : '';
143
179
  this.appVersionStatusCheckedAt = typeof res.checkedAt === 'string' ? res.checkedAt : '';
144
180
  this.appVersionStatusChecked = true;
@@ -17,6 +17,8 @@ export function createProviderCacheMethods(options = {}) {
17
17
 
18
18
  async openProviderCacheAnnouncementModal() {
19
19
  this.showProviderCacheAnnouncementModal = true;
20
+ this.hasReadSideAnnouncement = true;
21
+ this.$nextTick?.(() => this.$refs.sideAnnouncementClose?.focus());
20
22
  if (!this.providerCacheLoadedOnce) {
21
23
  await this.loadProviderCacheRecords();
22
24
  }
@@ -24,6 +26,7 @@ export function createProviderCacheMethods(options = {}) {
24
26
 
25
27
  closeProviderCacheAnnouncementModal() {
26
28
  this.showProviderCacheAnnouncementModal = false;
29
+ this.$nextTick?.(() => this.$refs.sideAnnouncementTrigger?.focus());
27
30
  },
28
31
 
29
32
  async openProviderCacheDetailsFromAnnouncement() {
@@ -472,6 +472,13 @@ const en = Object.freeze({
472
472
  'side.update.meta': 'Open update command',
473
473
  'side.update.metaVersions': 'Current v{current} → latest v{latest}',
474
474
  'side.update.commandHint': 'Run this in a terminal on the host running Codex Mate. Restart the service after a successful update.',
475
+ 'side.update.downloadPackage': 'Download installer',
476
+ 'side.update.downloading': 'Downloading…',
477
+ 'side.update.assetUnavailable': 'The matching installer is not available yet. Check again.',
478
+ 'side.update.download.completed': 'Download complete.',
479
+ 'side.update.download.cancelled': 'Download cancelled.',
480
+ 'side.update.download.failed': 'Download failed. Try again.',
481
+ 'side.update.download.unavailable': 'The installer has changed. Check for updates again.',
475
482
  'side.update.checkFailed': 'Failed to check latest version',
476
483
  'side.update.check': 'Check for updates',
477
484
  'side.update.checking': 'Checking for updates…',
@@ -469,10 +469,17 @@ const ja = Object.freeze({
469
469
  'side.docs.cliInstall': 'CLI インストール',
470
470
  'side.docs.cliInstall.meta': 'インストール / 更新 / 削除',
471
471
  'side.update.available': '新しいバージョンがあります',
472
- 'side.update.availableWithVersion': '新しいバージョン v{version}',
472
+ 'side.update.availableWithVersion': 'v{version} 更新あり',
473
473
  'side.update.meta': '更新コマンドを開く',
474
474
  'side.update.metaVersions': '現在 v{current} → 最新 v{latest}',
475
475
  'side.update.commandHint': 'Codex Mate を実行しているホストのターミナルで実行してください。更新成功後、サービスを再起動してください。',
476
+ 'side.update.downloadPackage': 'インストーラーをダウンロード',
477
+ 'side.update.downloading': 'ダウンロード中…',
478
+ 'side.update.assetUnavailable': 'このバージョンの対応インストーラーはまだ利用できません。更新を再確認してください。',
479
+ 'side.update.download.completed': 'ダウンロードが完了しました。',
480
+ 'side.update.download.cancelled': 'ダウンロードをキャンセルしました。',
481
+ 'side.update.download.failed': 'ダウンロードに失敗しました。再試行してください。',
482
+ 'side.update.download.unavailable': 'インストーラーが変更されました。更新を再確認してください。',
476
483
  'side.update.checkFailed': '最新バージョンの確認に失敗しました',
477
484
  'side.update.check': '更新を確認',
478
485
  'side.update.checking': '更新を確認中…',
@@ -461,6 +461,13 @@ const vi = Object.freeze({
461
461
  'side.update.meta': 'Mở lệnh cập nhật',
462
462
  'side.update.metaVersions': 'Hiện tại v{current} → mới nhất v{latest}',
463
463
  'side.update.commandHint': 'Chạy lệnh trong terminal trên máy đang chạy Codex Mate. Khởi động lại dịch vụ sau khi cập nhật thành công.',
464
+ 'side.update.downloadPackage': 'Tải bộ cài',
465
+ 'side.update.downloading': 'Đang tải…',
466
+ 'side.update.assetUnavailable': 'Chưa có bộ cài phù hợp cho phiên bản này. Hãy kiểm tra lại.',
467
+ 'side.update.download.completed': 'Đã tải xong.',
468
+ 'side.update.download.cancelled': 'Đã hủy tải xuống.',
469
+ 'side.update.download.failed': 'Không tải được. Hãy thử lại.',
470
+ 'side.update.download.unavailable': 'Bộ cài đã thay đổi. Hãy kiểm tra bản cập nhật lại.',
464
471
  'side.update.checkFailed': 'Không thể kiểm tra phiên bản mới nhất',
465
472
  'side.update.check': 'Kiểm tra cập nhật',
466
473
  'side.update.checking': 'Đang kiểm tra cập nhật…',
@@ -472,6 +472,13 @@ const zhTw = Object.freeze({
472
472
  'side.update.meta': '點擊查看更新命令',
473
473
  'side.update.metaVersions': '目前 v{current} → 最新 v{latest}',
474
474
  'side.update.commandHint': '在執行 Codex Mate 的主機終端執行。更新成功後重新啟動服務。',
475
+ 'side.update.downloadPackage': '下載安裝包',
476
+ 'side.update.downloading': '正在下載…',
477
+ 'side.update.assetUnavailable': '此版本的對應安裝包尚未就緒,請重試檢查。',
478
+ 'side.update.download.completed': '下載完成。',
479
+ 'side.update.download.cancelled': '已取消下載。',
480
+ 'side.update.download.failed': '下載失敗,請重試。',
481
+ 'side.update.download.unavailable': '安裝包已變更,請重新檢查更新。',
475
482
  'side.update.checkFailed': '檢查最新版本失敗',
476
483
  'side.update.check': '檢查更新',
477
484
  'side.update.checking': '正在檢查更新…',
@@ -472,6 +472,13 @@ const zh = Object.freeze({
472
472
  'side.update.meta': '点击查看更新命令',
473
473
  'side.update.metaVersions': '当前 v{current} → 最新 v{latest}',
474
474
  'side.update.commandHint': '在运行 Codex Mate 的主机终端执行。更新成功后重启服务。',
475
+ 'side.update.downloadPackage': '下载安装包',
476
+ 'side.update.downloading': '正在下载…',
477
+ 'side.update.assetUnavailable': '此版本的对应安装包尚未就绪,请重试检查。',
478
+ 'side.update.download.completed': '下载完成。',
479
+ 'side.update.download.cancelled': '已取消下载。',
480
+ 'side.update.download.failed': '下载失败,请重试。',
481
+ 'side.update.download.unavailable': '安装包已变更,请重新检查更新。',
475
482
  'side.update.checkFailed': '检查最新版本失败',
476
483
  'side.update.check': '检查更新',
477
484
  'side.update.checking': '正在检查更新…',
@@ -70,12 +70,13 @@ export function createI18nMethods() {
70
70
  toggleLanguageMenu() {
71
71
  this.languageMenuOpen = !this.languageMenuOpen;
72
72
  },
73
- closeLanguageMenu() {
73
+ closeLanguageMenu(restoreFocus = false) {
74
74
  this.languageMenuOpen = false;
75
+ if (restoreFocus) this.$refs?.sideLanguageTrigger?.focus();
75
76
  },
76
77
  selectLanguage(nextLang) {
77
78
  this.setLang(nextLang);
78
- this.languageMenuOpen = false;
79
+ this.closeLanguageMenu(true);
79
80
  },
80
81
  handleLanguageMenuFocusOut(event) {
81
82
  const currentTarget = event && event.currentTarget;