Fixes #55 — app-password credentials from env vars no longer assume bsky.social.
When ATP_IDENTIFIER + ATP_APP_PASSWORD are set without PDS_URL, Sequoia now resolves the identifier's DID document and uses the PDS listed there, so self-hosted PDS users work out of the box (matching what the docs already claimed).
- Added
src/lib/identity.ts: identity resolution moved out ofatproto.ts(which imports@atproto/api) socredentials.tscan use it without the heavy dependency. loadCredentialsenv branch:PDS_URL || await resolvePdsUrlOrDefault(identifier). An explicitPDS_URLstill wins with no network call.- Handle resolution now normalizes identifiers (strips leading
@, trims, lowercases) and falls back tohttps://<handle>/.well-known/atproto-didwhen the Bluesky appview can't resolve — relevant for self-hosted handles. - Falls back to
bsky.socialwith a warning namingPDS_URLwhen the identifier isn't resolvable (e.g. an email login) or the lookup fails, so existing setups don't break. auth.ts/login.tsimport the resolvers from../lib/identity.- Docs: note the auto-resolution and the email caveat in
workflows.mdx. - Tests: 13 new tests in
test/identity.test.tsandtest/credentials.test.ts(appview path, well-known fallback, did:plc/did:web docs, email + failure fallbacks,PDS_URLprecedence). Full suite 94 pass / 0 fail;tsc --noEmitclean.