You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement ConfigurableAgent for proper multi-server routing
6
+
7
+
This release introduces the `ConfigurableAgent` class that enables proper routing of AT Protocol requests to different servers (PDS, SDS, or custom instances) while maintaining OAuth authentication from a single session.
8
+
9
+
**Breaking Changes:**
10
+
- Repository now uses `ConfigurableAgent` internally instead of standard `Agent`
11
+
- This fixes the issue where invalid `agent.service` and `agent.api.xrpc.uri` property assignments were causing TypeScript errors
12
+
13
+
**New Features:**
14
+
-`ConfigurableAgent` class exported from `@hypercerts-org/sdk-core`
15
+
- Support for simultaneous connections to multiple SDS instances with one OAuth session
16
+
- Proper request routing based on configured service URL rather than session defaults
- Replace all `any` types in test files with proper type annotations
21
+
- Eliminate build warnings from missing type declarations
22
+
23
+
**Architecture:**
24
+
The new routing system wraps the OAuth session's fetch handler to prepend the target server URL, ensuring requests go to the intended destination while maintaining full authentication (DPoP, access tokens, etc.). This enables use cases like:
fix(sdk-core): ensure repository operations route to correct server (PDS/SDS)
6
+
7
+
**Problem:**
8
+
When using OAuth authentication to access organization repositories on SDS via `repo.repo(organizationDid)`, all operations like `hypercerts.list()` and `hypercerts.listCollections()` were incorrectly routing to the user's PDS instead of the SDS server, causing "Could not find repo" errors.
9
+
10
+
**Root Cause:**
11
+
The AT Protocol Agent was created from the OAuth session but only had its `api.xrpc.uri` property configured. Without setting the Agent's `service` property, it continued using the session's default PDS URL for all requests, even when switched to organization repositories.
12
+
13
+
**Solution:**
14
+
Set both `agent.service` and `agent.api.xrpc.uri` to the specified server URL in the Repository constructor. This ensures that:
15
+
- Initial repository creation routes to the correct server (PDS or SDS)
16
+
- Repository switching via `.repo(did)` maintains the same server routing
17
+
- All operation implementations (HypercertOperationsImpl, RecordOperationsImpl, ProfileOperationsImpl, BlobOperationsImpl) now route correctly
18
+
19
+
**Documentation:**
20
+
Added comprehensive PDS/SDS orchestration explanation to README covering:
21
+
- Server type comparison and use cases
22
+
- How repository routing works internally
23
+
- Common patterns for personal vs organization hypercerts
24
+
- Key implementation details about Agent configuration
0 commit comments