Skip to content

feat: integrate official Zhizi Cloud API - #30

Merged
wimi321 merged 1 commit into
mainfrom
feat/zhizi-official-api
Aug 3, 2026
Merged

feat: integrate official Zhizi Cloud API#30
wimi321 merged 1 commit into
mainfrom
feat/zhizi-official-api

Conversation

@wimi321

@wimi321 wimi321 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Integrates GoAgent with Zhizi Cloud's official OpenAPI for the complete account, billing, payment, and remote KataGo workflow.

Local KataGo remains the default engine. Signing in, purchasing VIP, or topping up never enables remote analysis automatically; users must explicitly test and enable Zhizi Cloud.

What changed

Official account and billing

  • Added a centralized, Zod-validated Zhizi API client with Bearer authentication, timeouts, stable errors, and JSON/plain-text error handling.
  • Added phone or email password login, verification-code login/registration, password reset, account overview, balance, usage, and credit history.
  • Added live VIP product discovery instead of hardcoded prices.
  • Added WeChat QR payment sessions for VIP purchases and balance top-ups.
  • Payment creation is single-shot, polling stops on terminal state or dialog close, and renderer never receives raw payment responses or tokens.

Remote analysis

  • Added strict allowlists for GPU tier, KataGo backend, and network.
  • Uses only the official Socket.IO token and ready event.
  • Added fresh-token reconnect, full-board replay, session generations, stale-result rejection, numeric GTP command IDs, fragmented output handling, and bounded retries.
  • Preserved candidate, winrate, score lead, PV, and live speed output.
  • Preserved local spawn and generic iKataGo paths without using either as an implicit Zhizi fallback.

Product experience

  • Added a dedicated Zhizi Cloud settings page with Compute, Account & Billing, and Usage views.
  • Added seven-language UI coverage.
  • Expired saved sessions are treated as signed out.
  • Login success always leaves analysis in local mode until the user explicitly enables Zhizi Cloud.
  • Removed legacy client-path, free-form argument, token-display, and automatic-remote settings.

Verification

  • pnpm install --frozen-lockfile --offline
  • pnpm check: 234 tests passed
  • pnpm check:teacher-quality
  • pnpm smoke:zhizi-public-api
  • Real desktop login and account overview
  • Real VIP shared remote analysis
  • Explicit remote enable and return-to-local flow
  • Strict saved-account smoke: one connection, worker ready, KataGo candidate/winrate/score output returned
  • Credential scan passed; no account password, token, private key, or payment order is committed

Notes

  • No real payment order was created during validation.
  • The unrelated local website/design-concepts/ directory is not included in this PR.

@wimi321
wimi321 marked this pull request as ready for review August 3, 2026 08:21
@wimi321
wimi321 merged commit 2fc97e5 into main Aug 3, 2026
5 checks passed
@wimi321
wimi321 deleted the feat/zhizi-official-api branch August 3, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant