Repository navigation
Spaces: one Harbor client for the desktop and the phone - #1175
Merged
Merged
Conversation
The phone carried a copy of core's Harbor client (lib/spaces/client.ts, live.ts) that had drifted both ways: core gained agents, invocations, approvals and transport-failure reporting; the phone alone had profile images and push. Both now use @x/spaces-client, a new workspace package holding the one REST client and live socket, moved from core with their tests. It runs anywhere fetch, WebSocket and WebCrypto do, the first step of the Spaces web-app plan: the blob hash is WebCrypto by default (React Native passes expo-crypto's), and the default fetch is called unbound so a browser does not throw "Illegal invocation". Blob and image uploads share one bytes-PUT path, and every response goes through one contract check. For the phone this brings core's behavior: a failed fetch is a SpacesRequestError with code 'unreachable' (the offline banner checks that code), image responses are schema-checked, and space_removed frames reach member handlers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
replicas-connector Bot
added a commit
that referenced
this pull request
Oct 9, 2026
Main moved the Harbor client into @x/spaces-client (#1175); the alert-hook calls move with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: arkml <6592213+arkml@users.noreply.github.com> Co-Authored-By: replicas-connector[bot] <replicas-connector[bot]@users.noreply.github.com>
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.
First step of the Spaces web-app plan: the Harbor client moves into one package every app can use.
What changes
@x/spaces-client(apps/x/packages/spaces-client): the REST client and the live socket, moved frompackages/core/src/spaces/with their tests. Git tracks them as renames.spaces/index.tsno longer re-exports the client.lib/spaces/live.tsis deleted.lib/spaces/client.tsdrops from 587 lines to a subclass that passes expo-crypto's SHA-256, so the 14 places that construct a client didn't change.routes.fetch,WebSocket, and WebCrypto exist.node:crypto.fetchis called unbound. A browser throws "Illegal invocation" whenfetchis called as a method of another object.deps/test/typecheckscripts, the Forge build hook, and the phone'seas-build-post-installall build the package. The lockfile adds only the new importer.What the phone notices
SpacesRequestErrorwith codeunreachable, as on desktop. The offline banner (isNetworkError) checks that code.space_removedframes now reach member handlers. The phone registers none today.Desktop behavior is unchanged.
Verified locally
npm run typecheck(apps/x) passes.tsc --noEmitpasses for main.npm test(apps/x) passes: shared 321, spaces-client 34, core 1024, server 29, renderer 1152.apps/mainnpm run build: the main process androwboat-serverbundle with esbuild.expo export --platform iosbundles with Metro.tscon the phone reports two errors from missing CSS typings, in files this PR doesn't touch. The cause is Expo's generatedexpo-env.d.ts, which is absent in a fresh checkout.🤖 Generated with Claude Code