feat(desktop): cloud-mode option in onboarding wizard#375
Draft
yagudaev wants to merge 1 commit into
Draft
Conversation
Adds the "VoiceClaw Cloud" radio at the top of the provider step. Picking it skips the BYO key flow entirely — the wizard verifies the user against cloud.getvoiceclaw.com and surfaces today's free-tier allowance instead of asking for a Gemini/OpenAI/Grok key. cloud-broker module - src/main/cloud-broker.ts: thin client over /api/auth/me and /api/gemini/session-token. Reads the device token from the encrypted sqlite devices row, caches the broker token in-memory, refreshes at 80% of newSessionExpireTime, coalesces concurrent fetches so one cache miss doesn't cause N upstream calls. - 15 vitest cases covering happy / not-signed-in / 401 / 429+retry / cache reuse / forceRefresh / call coalescing / fetchMe. IPC + preload - cloud:getStatus, cloud:fetchMe, cloud:fetchSessionToken - Renderer-side wrappers in onboarding-api.ts as cloudApi. Wizard - StepProvider grows an "access mode" picker (Cloud vs Bring-Your-Own). - Cloud mode auto-verifies on selection: hits /api/auth/me, surfaces tier + minutes-remaining-today, or shows a "go sign in first" panel when there's no device token, or an error+retry when the broker is unreachable. - Continue is gated on cloudVerified=true (cloud) or providerKeyValidated=true (byo-key). Payload now records accessMode + cloudVerified for downstream steps. Out of scope (PR #3.5) - Wiring relay-server to consume ephemeral tokens from cloud-broker at session start instead of GEMINI_API_KEY. The minted token is fetched and cached here; it's not yet handed to relay-server. That plumbing change touches the relay's lifecycle and warrants its own reviewable PR. Depends on PR #1.5 (URL flip to cloud.getvoiceclaw.com) being live before this lands, otherwise cloud:getStatus reaches the wrong host. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
NAN-660 PR #3 of 4. Adds the user-facing path to the broker: the wizard now offers VoiceClaw Cloud as a first-class option above BYO-key.
What's in this PR
cloud-brokermodule —desktop/src/main/cloud-broker.ts/api/auth/meand/api/gemini/session-tokendevicesrow (set in PR Add displayText function call for write-only display during voice (NAN-534) #1's auth flow)newSessionExpireTimeRetry-After/ cache reuse /forceRefresh/ call coalescing /fetchMeIPC + preload
cloud:getStatus,cloud:fetchMe,cloud:fetchSessionTokencloudApiwrapper inonboarding-api.tsWizard StepProvider
/api/auth/me, surfaces tier + minutes-remaining-todayaccessMode+cloudVerifiedfor downstream stepsOut of scope
GEMINI_API_KEYfrom env. Wiring relay to ask cloud-broker for a fresh token at session start is its own diff — it touches relay's lifecycle and queue management.Coordination
Depends on:
cloud.getvoiceclaw.comcloud:getStatusandcloud:fetchMereach the old hostcloud.getvoiceclaw.comTest plan
VOICECLAW_AUTH_BASE_URL=http://localhost:3000against a running voiceclaw-cloud — pick cloud mode, see the verified panelcloud.getvoiceclaw.comafter deploys land🤖 Generated with Claude Code