visionA/local-tool
jim800121chen 8c27da7cca test(local-tool): M9-5 — three-platform validation plan + e2e scripts + MJ3 fix
A 階段最後 milestone、出測試計畫 + 自動化腳本 + 三平台人工 checklist、使用者下週手動跑實機驗證。

Testing artifacts (8 檔、2630 行):
- .autoflow/06-testing/m9-5-validation-plan.md: 656 行(4 情境 × 3 平台 × 2 chip = 24 combo)
- 4 e2e specs (vitest + RTL + mock WS / mock fetch):
  - firmware-upgrade-happy-path.spec.ts (357 / 4 cases)
  - firmware-upgrade-error-recovery.spec.ts (356 / 4 cases + 8 reason it.each)
  - firmware-r-fw-11-modal-not-closable.spec.ts (303 / 6 cases)
  - wails-onbeforeclose-firmware-active.spec.ts (217 / 9 cases、含 5 todo 占位 M9-12)
- 3 manual checklists: macOS 264 / Windows 234 / Linux 243 行

設計取捨:
- 不引入 Playwright/Cypress (visionA-local frontend 沒裝、屬 architect 決策)、走 vitest + mock
- E2E 腳本放 06-testing/scripts/ 作 spec doc + 可選實作參考
- 實機驗證走人工 checklist (dongle 插拔 / kill process / SIGTERM 等需要實體互動)

MJ3 修復 (M9-4 reviewer round 1 留的 follow-up):
- server/internal/api/ws/firmware_ws_test.go: +16/-8
- "type": "firmware:progress" → "firmware_progress" (對齊 firmwareProgressMessage.Type)
- "phase" → "stage" (對齊 TDD §4.2 + FirmwareProgress.Stage)
- 不動 production code、只 test schema 對齊

執行建議 (給你下週):
- Day 1 P0: macOS+Win+Linux × KL520+KL720 happy path (~3h)
- Day 2 P1: R-FW-11 + disconnect_during_op + upgrade_mid_failed + 失敗注入 (4h)
- Day 3 P2: SIGTERM 延遲關閉 + Wails OnBeforeClose force-quit modal (2-3h)

測試:
- go test ./... -race 全綠 (server / wails / frontend 60 tests)
- MJ3 修復不破壞既有測試

A 階段開發 6/7 完成 (M9 文件 + M9-1 ~ M9-4.5)、剩 M9-5 實機驗證 (你下週跑)、跑完依結果決定 A 階段交付或派 sub-agent 修。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 15:34:17 +08:00
..

visionA-local

裝起來像一般 app離線也能跑接上 Kneron 就推論。edge-ai-platform 的 Kneron AI 邊緣推論能力,打包成單機桌面應用。

macOS x86_64 Windows x86_64 Linux x86_64 License


這是什麼

visionA-local 是 edge-ai-platform(原本要部署到 EC2 + Docker 的 Kneron 邊緣推論平台)的單機桌面衍生版本。為「帶著筆電做 Kneron demo 的人」而生 —— 主要服務 Innovedus 內部 FAE 與外部 Kneron 開發者。

三個核心承諾:

  • 🎒 零依賴Python runtime、KneronPLUS SDK、ffmpeg、預置 .nef 模型全部內嵌
  • ✈️ 零網路:下載一次後完全離線可用(適合客戶現場 IT 鎖得死緊的場景)
  • 🖱️ 零學習成本:雙擊安裝 → 開啟 → 插上 Kneron 裝置 30 秒內跑出第一幀推論

對標產品Docker Desktop、Ollama。


安裝(使用者)

macOSx86_64beta

  1. 從內部 Gitea Releases 下載 visiona-local.dmg
  2. 雙擊開啟 dmg → 把 visionA-local.app 拖到 Applications/
  3. 第一次啟動因為未做程式碼簽章Gatekeeper 會警告「來自未識別開發者」
    • 在 Finder 中右鍵點 visionA-local.app → 選「開啟」(不是雙擊)
    • 對話框出現「仍要開啟」時點確認
    • 往後直接雙擊即可
  4. 首次啟動會花 3060 秒解壓內嵌的 Python runtime 並離線安裝 wheels 這是預期行為,不是卡住。之後啟動只要幾秒

📁 資料目錄:~/Library/Application Support/visiona-local/ 包含 log、lock、ipc-port、自上傳模型

Windows / Linux

Coming soon — build script 已經寫好,等 CI runner 齊備後就會釋出。

  • WindowsInno Setup .exe installer
  • Linux.AppImage + udev rules需 root 裝 99-kneron.rules

系統需求

平台 最低版本 架構
macOS 14 Sonoma x86_64 ¹
Windows 10 1809 x86_64
Ubuntu 22.04 x86_64

¹ Apple Silicon 理論上可透過 Rosetta 2 執行,但未經測試

離線可用:安裝後所有核心功能(包含 Python sidecar、推論、模型管理、攝影機、影片解碼完全不需要網路。


功能總覽

有的功能

  • 裝置管理USB 自動偵測 Kneron KL520 / KL72010 秒內連線
  • 攝影機推論MJPEG 串流 + 即時 overlay首次延遲 ≤ 250ms穩定後 ≤ 150ms
  • 模型管理8 個預置 .nef 模型(分類 / 偵測 / 臉辨)+ 自上傳切換
  • 核心推論引擎image classification、object detection、face recognition
  • 媒體推論支援圖片與影片檔本機上傳R5 決策後不支援 URL 推論)
  • 中英雙語,跟隨系統 Dark Mode

不做的事(明確排除)

為了聚焦「個人工具」,以下功能從 edge-ai-platform 全數砍掉:

  • Cluster多裝置叢集
  • Relay / Tunnel遠端連線、反向代理
  • 韌體燒錄firmware flash
  • 系統列 Tray 常駐
  • Auto-update
  • Telemetry / 崩潰回報
  • License 啟用、憑證簽章
  • Mac App Store / Microsoft Store / Snap Store 上架

開發者區

專案結構

local-tool/
├── .autoflow/        PRD / 設計 / 架構 / 進度文件
├── server/           Go 1.26 後端Gin + go:embed
├── frontend/         Next.js 16 + React 19 + shadcn
├── visiona-local/    Wails 應用殼installer
├── payload/          打包暫存區
├── vendor/           第三方依賴make vendor-sync 下載,不進 git
├── dist/             最終安裝檔(.dmg / .exe / .AppImage
├── installer/        Inno Setup / AppImage script
├── scripts/          build 與維運腳本
└── Makefile

開發流程

# 1. 下載全部第三方依賴到 vendor/
make vendor-sync

# 2. 本機 build 並產出 dmgmacOS
make dmg

# 查看所有可用 targets
make help

主要 make targets

Target 作用
vendor-sync 下載 python-build-standalone、wheels、ffmpeg
build-server 編譯 Go server binary先 build frontend + embed
build-frontend pnpm build Next.js 靜態產物
payload-macos 準備 macOS payloadbinary + python + wheels + ffmpeg + 模型)
wails-macos Wails build + ad-hoc codesign
dmg 產出 dist/visiona-local.dmg
exe Windows installer需在 Windows runner 執行)
appimage Linux AppImage需在 Linux runner 執行)

三方平台 build

平台 指令 執行環境
macOS make dmg 本機Intel Mac
Windows make exe Windows runner + Inno Setup 6
Linux make appimage Ubuntu 22.04+ runner + appimagetool

vendor-*-windows / vendor-*-linux 可在 macOS 上跑通(只有 wails-* 和最後一步 installer 需要對應平台)。

文件位置

所有設計與架構文件在 .autoflow/

類型 路徑
產品需求PRD .autoflow/02-prd/PRD.md
設計規格 .autoflow/03-design/
架構設計 .autoflow/04-architecture/design-doc.md
TDD .autoflow/04-architecture/TDD.md
進度 .autoflow/progress.md

已知限制與 TODO

  • 🟡 Kneron 預置模型 re-distribution 授權:開發階段假設可用,正式發佈前需與 Kneron 官方確認
  • 🟡 Windows / Linux 安裝檔build script 就緒,等 CI runner 齊備
  • 🟡 Apple Silicon 未經測試(理論上 Rosetta 2 可跑)
  • 🟡 Linux Kneron USB vendor IDinstaller/linux/99-kneron.rules 需最終確認
  • 🟡 程式碼簽章Developer ID / EV cert不做,使用者需手動繞過 Gatekeeper / SmartScreen
  • 🟡 無 auto-update:新版需手動從 Gitea 下載

授權

License: TBD(內部工具 / MIT / proprietary 待定,發佈前確認)

第三方元件授權

元件 授權 備註
ffmpeg LGPL v3(方案 B 混合macOS 自 build decoder-only / Windows & Linux 用 BtbN n7.1 LGPL v2 TDD §2.2
KneronPLUS SDK Kneron 商用條款 再次確認 re-distribution 權利
python-build-standalone MPL 2.0 / PSFL
Python 標準函式庫 PSFL
shadcn/ui MIT
Next.js / React MIT
Wails MIT
Gin MIT

完整第三方授權清單於 .autoflow/02-prd/PRD.md §4.8。


致謝 / 起源

visionA-local 衍生自 Innovedus 內部專案 edge-ai-platform(原為部署於 EC2 + Docker 的多人共享平台)。本專案將其改造為單機桌面版本,聚焦「一個人帶一台筆電」的使用場景。

感謝 Kneron、python-build-standaloneastral-sh、shadcn 等開源社群。