Skip to content

Commit 2fc00d3

Browse files
haochaoc
authored andcommitted
fix: resolve bundled KataGo runtime paths
1 parent 811d51d commit 2fc00d3

24 files changed

Lines changed: 1208 additions & 151 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ dist
44
website/.astro
55
release
66
.release
7+
.dev-release
8+
.dev-cache
79
.DS_Store
810
*.log
911
.goagent

docs/RELEASE_NOTES_v0.4.14.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# GoAgent v0.4.14
2+
3+
GoAgent v0.4.14 is a Windows KataGo startup hotfix. It fixes a packaged-resource path bug where Windows portable builds could try to launch KataGo from `resources/app.asar/data/katago/...`, which cannot contain a runnable executable. GoAgent now resolves bundled KataGo from `resources/data/katago` or `resources/app.asar.unpacked/data/katago`, and never tries to spawn a binary from inside `app.asar`.
4+
5+
QQ 群:1030632742,欢迎一起交流、提建议、完善 GoAgent。
6+
7+
## v0.4 系列延续能力
8+
9+
This release keeps the broader v0.4 foundation: grounded shape recognition engine, local pattern matcher, knowledge source-policy gates, optimized move-range review, quality checks and eval gates, Real Eval / engine silver fixture gate, KataGo engine pool telemetry, Release artifact smoke, student level, student age, teacher persona style settings with evidence boundary, teacher sessions, selective PR #6 integration, Tool-first Agent runtime, Kokoro selected-provider TTS with offline synthesis, Windows OpenCL runtime bundle, KataGo OpenCL adjacent runtime files, GPU vendor OpenCL drivers, and the community contribution path from layiku and wimi321.
10+
11+
## 中文
12+
13+
### 下载前先选版本
14+
15+
| 平台 / 场景 | 推荐下载 |
16+
| --- | --- |
17+
| macOS Apple Silicon(M 系列) | GoAgent-0.4.14-mac-arm64.dmg |
18+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
19+
| Windows x64 安装版,普通用户推荐 | GoAgent-0.4.14-win-x64.exe |
20+
| Windows x64 免安装版 | GoAgent-0.4.14-win-x64-portable.zip |
21+
| Windows x64 NVIDIA 专版安装版 | GoAgent-0.4.14-win-x64-nvidia.exe |
22+
| Windows x64 NVIDIA 专版免安装包 | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
23+
| 校验文件 | SHA256SUMS.txt |
24+
25+
### 本版重点
26+
27+
- 修复 Windows 免安装包 / 安装包中 KataGo 路径误指向 `app.asar` 的问题。
28+
- GoAgent 会优先从 `resources/data/katago``resources/app.asar.unpacked/data/katago` 查找内置 KataGo。
29+
- 明确禁止从 `app.asar` 内部启动 KataGo,避免 `spawn ... ENOENT`
30+
- 默认仍使用本机 KataGo 分析;智子云远程算力只有用户在设置里显式启用才会使用。
31+
- 设置页文案继续面向普通用户,减少开发者式说明。
32+
33+
## 繁體中文
34+
35+
### 下載前先選版本
36+
37+
| 平台 / 使用情境 | 建議下載 |
38+
| --- | --- |
39+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
40+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
41+
| Windows x64 安裝版 | GoAgent-0.4.14-win-x64.exe |
42+
| Windows x64 免安裝版 | GoAgent-0.4.14-win-x64-portable.zip |
43+
| Windows x64 NVIDIA 專版 | GoAgent-0.4.14-win-x64-nvidia.exe |
44+
| Windows x64 NVIDIA 免安裝包 | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
45+
| 校驗檔 | SHA256SUMS.txt |
46+
47+
### 本版重點
48+
49+
- 修復 Windows 套件中 KataGo 路徑誤指向 `app.asar` 的問題。
50+
- 內建 KataGo 會從 `resources/data/katago``resources/app.asar.unpacked/data/katago` 啟動。
51+
- GoAgent 不會從 `app.asar` 內部執行 KataGo。
52+
- 預設仍使用本機 KataGo;智子雲只有手動啟用時才會使用。
53+
54+
## English
55+
56+
### Pick the right package before downloading
57+
58+
| Platform / use case | Recommended download |
59+
| --- | --- |
60+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
61+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
62+
| Windows x64 installer | GoAgent-0.4.14-win-x64.exe |
63+
| Windows x64 portable ZIP | GoAgent-0.4.14-win-x64-portable.zip |
64+
| Windows x64 NVIDIA installer | GoAgent-0.4.14-win-x64-nvidia.exe |
65+
| Windows x64 NVIDIA portable package | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
66+
| Checksums | SHA256SUMS.txt |
67+
68+
### Highlights
69+
70+
- Fixes Windows packaged KataGo resolution when the app is installed or extracted as a portable ZIP.
71+
- GoAgent now resolves bundled KataGo from `resources/data/katago` or `resources/app.asar.unpacked/data/katago`.
72+
- GoAgent never tries to spawn KataGo from inside `app.asar`, preventing `spawn ... ENOENT`.
73+
- Local KataGo remains the default analysis engine; Zhizi Cloud is used only when the user explicitly enables it.
74+
- Settings copy remains user-facing and avoids developer-oriented configuration wording.
75+
76+
## 日本語
77+
78+
### ダウンロード前に選ぶもの
79+
80+
| 環境 | 推奨ファイル |
81+
| --- | --- |
82+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
83+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
84+
| Windows x64 インストーラー | GoAgent-0.4.14-win-x64.exe |
85+
| Windows x64 ポータブル ZIP | GoAgent-0.4.14-win-x64-portable.zip |
86+
| Windows x64 NVIDIA 版 | GoAgent-0.4.14-win-x64-nvidia.exe |
87+
| Windows x64 NVIDIA ポータブル | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
88+
| チェックサム | SHA256SUMS.txt |
89+
90+
### 主な変更
91+
92+
- Windows パッケージで KataGo のパスが `app.asar` 内を指す問題を修正しました。
93+
- KataGo は `resources/data/katago` または `resources/app.asar.unpacked/data/katago` から起動します。
94+
- 既定ではローカル KataGo を使います。Zhizi Cloud はユーザーが明示的に有効化した場合のみ使われます。
95+
96+
## 한국어
97+
98+
### 다운로드 전 선택
99+
100+
| 환경 | 권장 다운로드 |
101+
| --- | --- |
102+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
103+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
104+
| Windows x64 설치 프로그램 | GoAgent-0.4.14-win-x64.exe |
105+
| Windows x64 포터블 ZIP | GoAgent-0.4.14-win-x64-portable.zip |
106+
| Windows x64 NVIDIA 설치 프로그램 | GoAgent-0.4.14-win-x64-nvidia.exe |
107+
| Windows x64 NVIDIA 포터블 | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
108+
| 체크섬 | SHA256SUMS.txt |
109+
110+
### 이번 버전
111+
112+
- Windows 패키지에서 KataGo 경로가 `app.asar` 내부를 가리키는 문제를 수정했습니다.
113+
- KataGo는 `resources/data/katago` 또는 `resources/app.asar.unpacked/data/katago`에서 실행됩니다.
114+
- 기본값은 로컬 KataGo이며, Zhizi Cloud는 사용자가 직접 켠 경우에만 사용됩니다.
115+
116+
## ภาษาไทย
117+
118+
### เลือกไฟล์ก่อนดาวน์โหลด
119+
120+
| แพลตฟอร์ม | ไฟล์ที่แนะนำ |
121+
| --- | --- |
122+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
123+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
124+
| Windows x64 installer | GoAgent-0.4.14-win-x64.exe |
125+
| Windows x64 portable ZIP | GoAgent-0.4.14-win-x64-portable.zip |
126+
| Windows x64 NVIDIA installer | GoAgent-0.4.14-win-x64-nvidia.exe |
127+
| Windows x64 NVIDIA portable | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
128+
| Checksums | SHA256SUMS.txt |
129+
130+
### จุดสำคัญของรุ่นนี้
131+
132+
- แก้ปัญหา Windows package ชี้ path ของ KataGo เข้าไปใน `app.asar`
133+
- GoAgent จะเรียก KataGo จาก `resources/data/katago` หรือ `resources/app.asar.unpacked/data/katago`
134+
- ค่าเริ่มต้นยังใช้ KataGo ในเครื่อง; Zhizi Cloud จะใช้เมื่อผู้ใช้เปิดเองเท่านั้น
135+
136+
## Tiếng Việt
137+
138+
### Chọn gói tải xuống
139+
140+
| Nền tảng | Gói khuyến nghị |
141+
| --- | --- |
142+
| macOS Apple Silicon | GoAgent-0.4.14-mac-arm64.dmg |
143+
| macOS Intel | GoAgent-0.4.14-mac-x64.dmg |
144+
| Windows x64 installer | GoAgent-0.4.14-win-x64.exe |
145+
| Windows x64 portable ZIP | GoAgent-0.4.14-win-x64-portable.zip |
146+
| Windows x64 NVIDIA installer | GoAgent-0.4.14-win-x64-nvidia.exe |
147+
| Windows x64 NVIDIA portable | GoAgent-0.4.14-win-x64-nvidia-portable.7z.001 and all following split parts |
148+
| Checksums | SHA256SUMS.txt |
149+
150+
### Điểm mới
151+
152+
- Sửa lỗi gói Windows trỏ đường dẫn KataGo vào bên trong `app.asar`.
153+
- GoAgent chạy KataGo từ `resources/data/katago` hoặc `resources/app.asar.unpacked/data/katago`.
154+
- Mặc định vẫn dùng KataGo cục bộ; Zhizi Cloud chỉ chạy khi người dùng bật rõ ràng.

docs/ZHIZI_CLOUD_ENGINE.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@ GoAgent -> 智子云登录 -> Socket.IO 远程 KataGo -> GTP kata-analyze
1919
在 GoAgent 设置页打开“分析引擎”:
2020

2121
1. 引擎模式选择 `智子云远程算力:直连`
22-
2. 填写智子云账号和密码,点击“登录并连接智子云”。
22+
2. 算力类型默认选择 `VIP 共享引擎`,GoAgent 会提交 `--gpu-type vip-share`。这是智子管理员确认的 VIP 包月引擎,不会额外按时间扣独享费用。
23+
- `独享 1x / 3x / 6x` 对应 `--gpu-type 1x / 3x / 6x`,属于按算力和时间计费的独享 worker。
24+
- 如果你只是购买了 VIP,请不要选择独享档位。
25+
3. 填写智子云主账号手机号或邮箱和密码,点击“登录并连接智子云”。
2326
- GoAgent 会调用智子云登录接口获取 token。
2427
- 登录成功后,GoAgent 会把 token 保存到本地加密存储。
2528
- 登录成功后,引擎模式会自动切到 `智子云远程算力:直连`
2629
- 后续只需要启动 GoAgent,不需要先启动其它应用。
27-
3. 如果密码登录提示密码不正确,可以点击“发送验证码”,收到短信后用“验证码登录”。
30+
- `zz-` 开头的是智子连接账号,不是主账号登录 token。它需要先在智子官方账号体系里绑定,不能直接填在 GoAgent 的登录框里换取远程算力 token。
31+
4. 如果密码登录提示密码不正确,可以点击“发送验证码”,收到短信后用“验证码登录”。
2832
- 这和智子 Web 端的 `send-code` / `fast-login` 流程一致。
2933
- 验证码只用于本次登录;GoAgent 不会长期保存验证码。
30-
4. Token 通常不需要手动填写。只有你已经从其它方式拿到了 token,才使用“高级:Token”。
31-
5. `zz-ikatago 路径` 是兼容旧连接器的高级选项,普通用户可以不填。
32-
6. 附加参数一般留空;只有你明确知道智子云 Socket.IO 连接参数时再填写。
34+
5. Token 通常不需要手动填写。只有你已经从其它方式拿到了 token,才使用“高级:Token”。
35+
6. `zz-ikatago 路径` 是兼容旧连接器的高级选项,普通用户可以不填。
36+
7. 附加参数一般留空;只有你明确知道智子云 Socket.IO 连接参数时再填写。算力类型优先用设置页下拉框选择,避免把 VIP 共享误写成独享计费参数
3337

3438
`自动` 模式现在是本机优先的默认模式,不会因为本机分析失败就自动上传局面到智子云。需要远程算力时,请手动启用 `智子云远程算力:直连`
3539

@@ -65,9 +69,12 @@ GoAgent 不会把智子 token 写入普通设置文件,也不会在日志中
6569

6670
- `智子云未配置完整`:还没有在 GoAgent 中登录智子云,请输入账号密码或短信验证码登录。
6771
- `智子云未登录`:当前选择了 `智子云远程算力:直连`,但本地没有可用 token。请在设置页用账号密码或短信验证码登录;普通用户不需要填写 `zz-ikatago` 路径。
72+
- `这是智子云连接账号,不是可直接登录的主账号`:请改用智子云主账号手机号或邮箱登录。`zz-` 连接账号不能直接换取 GoAgent 远程算力 token。
6873
- `密码不正确`:智子官方密码接口拒绝了这组密码。可以改用“发送验证码”再“验证码登录”。
6974
- `验证码不正确或已过期`:重新发送验证码后再登录。
70-
- `智子云余额不足或当前没有可用算力`:先确认智子云套餐或余额已经生效;如果刚充值,点击 `退出智子云登录` 后重新登录,让 GoAgent 刷新 token 和远程会话。
75+
- `智子云远程 worker 返回额度不足或不可分配`:如果你是 VIP 用户,请先确认算力类型选择的是 `VIP 共享引擎(--gpu-type vip-share)`。如果选择 `1x / 3x / 6x`,智子云会按独享 worker 计费,并可能因为独享余额不足返回 `not_enough_credit`。如果刚充值或刚购买 VIP,点击 `退出智子云登录` 后重新登录,让 GoAgent 刷新 token 和远程会话。
76+
- 如果检测连接显示 `主账号 token 有效``会员有效``连接账号已绑定`,但远端仍返回 `not_enough_credit`,说明 GoAgent 已完成官方公开流程:`fetch-socketio-token` 成功、Socket.IO 收到 `ready`,但智子 worker 在执行 GTP 初始化时拒绝分配算力。此时请把这段状态反馈给智子官方,让官方检查连接账号的远程 worker/GPU 权益是否已经实际生效。
77+
- 官方 Postman 中的 `connectAccount/login` 只用于验证连接账号凭据,不返回 GoAgent 直连所需的 token,也不会替代主账号登录流程。
7178
- `智子云 KataGo 启动超时`:检查 token 是否有效,或在 GoAgent 中重新登录。
7279
- `智子云 GTP 命令失败`:可能是远端引擎尚未 ready、账号状态异常,或智子云当前连接不可用。
7380
- 如果本机 KataGo 可用,且不是强制智子云模式,GoAgent 会在智子云失败后回退本机 KataGo。

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "goagent",
3-
"version": "0.4.13",
3+
"version": "0.4.14",
44
"description": "Agentic AI teacher for Go / Weiqi / Baduk, powered by KataGo and multimodal LLMs.",
55
"main": "out/main/index.js",
66
"type": "module",
@@ -16,10 +16,11 @@
1616
},
1717
"packageManager": "pnpm@10.30.3",
1818
"scripts": {
19-
"dev": "electron-vite dev",
19+
"dev": "node scripts/start_dev_app.mjs",
20+
"dev:vite": "electron-vite dev",
2021
"build": "electron-vite build",
2122
"typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json",
22-
"preview": "electron-vite preview",
23+
"preview": "node scripts/start_dev_app.mjs --skip-build",
2324
"lint": "pnpm typecheck",
2425
"test": "node --test tests/*.test.mjs",
2526
"check": "pnpm test && pnpm typecheck && pnpm build",

scripts/start_dev_app.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env node
2+
import { spawnSync } from 'node:child_process'
3+
import { existsSync, readdirSync } from 'node:fs'
4+
import { join, resolve } from 'node:path'
5+
6+
const root = resolve(new URL('..', import.meta.url).pathname)
7+
const args = new Set(process.argv.slice(2))
8+
const skipBuild = args.has('--skip-build')
9+
const devOutputDir = join(root, '.dev-release')
10+
const builderCacheDir = join(root, '.dev-cache', 'electron-builder')
11+
12+
function run(command, commandArgs, options = {}) {
13+
const result = spawnSync(command, commandArgs, {
14+
cwd: root,
15+
stdio: 'inherit',
16+
env: process.env,
17+
...options
18+
})
19+
if (result.error) {
20+
throw result.error
21+
}
22+
if (typeof result.status === 'number' && result.status !== 0) {
23+
process.exit(result.status)
24+
}
25+
}
26+
27+
function findFirstApp(directory) {
28+
if (!existsSync(directory)) {
29+
return null
30+
}
31+
const entries = readdirSync(directory, { withFileTypes: true })
32+
for (const entry of entries) {
33+
const fullPath = join(directory, entry.name)
34+
if (entry.isDirectory() && entry.name.endsWith('.app')) {
35+
return fullPath
36+
}
37+
if (entry.isDirectory()) {
38+
const nested = findFirstApp(fullPath)
39+
if (nested) {
40+
return nested
41+
}
42+
}
43+
}
44+
return null
45+
}
46+
47+
if (process.platform === 'darwin') {
48+
if (!skipBuild) {
49+
run('pnpm', ['exec', 'electron-vite', 'build'])
50+
run(
51+
'pnpm',
52+
[
53+
'exec',
54+
'electron-builder',
55+
'--mac',
56+
'dir',
57+
'--publish',
58+
'never',
59+
'-c.directories.output=.dev-release',
60+
'-c.mac.target=dir',
61+
'-c.mac.notarize=false',
62+
'-c.mac.identity=null'
63+
],
64+
{
65+
env: {
66+
...process.env,
67+
ELECTRON_BUILDER_CACHE: builderCacheDir
68+
}
69+
}
70+
)
71+
}
72+
73+
const appPath = findFirstApp(devOutputDir)
74+
if (!appPath) {
75+
throw new Error('GoAgent dev app was not found. Run `pnpm dev` once before `pnpm preview`.')
76+
}
77+
run('open', ['-n', appPath])
78+
console.log(`GoAgent dev app launched from ${appPath}`)
79+
} else {
80+
run('pnpm', ['exec', 'electron-vite', skipBuild ? 'preview' : 'dev'])
81+
}

0 commit comments

Comments
 (0)