visionA/local-agent
jim800121chen 72672972c8 chore(local-agent): 從 git 移除誤 commit 的 wails build binary(10MB Mach-O)
3f0175f commit local-agent/ 時連帶把 wails build 出的執行檔
local-agent/visiona-agent/visiona-agent(10MB Mach-O 64-bit x86_64)
一起進 git,違反「build artifact 不進 git」原則:

- 可重新產生:source 已在 git,clone 後 wails build 即可
- 平台特定:x86_64 macOS 執行檔對其他平台無用
- repo 變胖:git history 永遠保留這 10MB

修法:
- git rm --cached(保留磁碟上檔案,下次 wails build 還會用)
- local-agent/.gitignore 補 /visiona-agent/visiona-agent 防再犯

注意:3f0175f 的 history 仍含此 binary,徹底清除需 git filter-repo
(local-only repo、未 push、暫不處理)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 18:29:22 +08:00
..

visionA Agent

Phase 0 雛形 — 正在建置中

此專案於 2026-04-22 從 local-tool/ forkbaseline commitb71ff4cd3c72e879435f773ae15b23bf8b70841e

fork 後獨立演進,不主動與 local-tool 同步。 需要時手動 cherry-pick bug fix。

產品定位

visionA Agent 是 visionA 雲端版的 local 端代理程式:

它是什麼

  • 一個完整的 local server沿用 local-tool 的 KneronPLUS / camera / inference / device / model / Python runtime / ffmpeg 邏輯)
  • 加上 tunnel client,把自己 reverse-tunnel 到雲端 visionA-backend,讓雲端 web UI 可以透過 tunnel 操作使用者桌機上的 Kneron 裝置
  • 加上 3 頁極簡配置 UI(狀態 / 配對 / 設定給使用者看「Agent 是否在線」和「配對雲端帳號」用

它不是什麼

  • 不是 local-tool 的修改版local-tool 不動visionA Agent fork 後獨立演進)
  • 不保留 local-tool 原本的裝置 / 模型 / 推論 UI這些由雲端 web UI 負責;本機 UI 只管配對/設定)

目前進度Phase 0 雛形)

任務 狀態 說明
AB1 fork + 改名visiona-local → visiona-agent / bundle ID / Makefile 變數 78 處替換)
AB2+AB3 裁剪 Wails 業務 UI binding、刪除舊資料目錄遷移新增 pairing / connection / settings 的 stub binding回 ErrNotImplemented為 AB4-AB10 預留擴點
AB4 複製 tunnel client從 POCinternal/tunnel/
AB5 Agent config (YAML) 讀寫
AB6 Internal HTTP serverwrapper 綁 127.0.0.1:0
AB7 Pairing Exchanger呼叫雲端 /api/pairing/exchange
AB8 connstate broadcaster + Wails event 推送
AB9 autostart 三平台實作
AB10 logexport壓縮最近 7 天 log
AB11-12 Wails 整合 + 整合測試

架構圖(簡版)

[ Browser ] ── HTTPS ──► [ visionA-backend ]
                                │ (內部 HTTP forward
                                ▼
                         [ remote-proxy ]
                                │ WSS + yamux 出站長連線)
                                ▼
┌───────────────────────────────────────────────────────┐
│  visionA Agent使用者桌機Wails app                │
│                                                       │
│   [Tunnel client]            [3 頁配置 UI]             │
│         │                         │ Wails bindings    │
│         ▼                         ▼                   │
│   [Internal HTTP server 127.0.0.1:<random port>]      │
│   (沿用 local-tool 的 Gin handler裝置/模型/推論/... │
│                         │                             │
│                         ▼                             │
│   [Python runtime + KneronPLUS SDK + ffmpeg]          │
└───────────────────────────────────────────────────────┘
                                │
                                ▼
                       Kneron USB 裝置

文件

fork baseline

本專案於 2026-04-22 從 local-tool/commit b71ff4cd3c72e879435f773ae15b23bf8b70841e)一次性 fork 後獨立演進,不主動 syncADR-007

local-tool 原始 README 已封存於 docs/legacy-local-tool-readme.md,僅作 cherry-pick bug fix 時的歷史對照,不再代表 visionA Agent 的產品定位。

開發指令

# 下載第三方依賴到 vendor/
make vendor-sync

# 本機 build + 產出 macOS DMG
make dmg

# 列出所有 targets
make help

主要 targets沿用 local-tool 結構,但所有產物名稱已替換為 visiona-agent

Target 作用
vendor-sync 下載 python-build-standalone / wheels / ffmpeg
build-frontend pnpm build Next.js 靜態產物 → frontend/out/
wails-sync-frontend 同步 frontend/out/visiona-agent/frontend/Wails embed
wails-macos / wails-windows / wails-linux Wails build + ad-hoc codesignmacOS
dmg 產出 dist/visiona-agent.dmg(缺 create-dmg 時 fallback hdiutil
exe Inno Setup → dist/visiona-agent-*-windows-x64.exe(需 Windows runner
appimage dist/visiona-agent-*-x86_64.AppImage(需 Linux runner
dev-agent Wails dev mode
test-tunnel tunnel client 整合測試

三平台 build 細節與 local-tool 共存對照表:docs/BUILD-VERIFICATION.md