Commit Graph

7978 Commits

Author SHA1 Message Date
Samuel Newman 85f2ff39a7 classify migrated chat convo errors with matchXrpcError
The lex client throws XrpcResponseError, which is not an XRPCError
subclass, so the old per-method error classes generated by @atproto/api
no longer match. Those instanceof checks compile fine but silently stop
firing, degrading every typed chat failure to the generic fallback
message. Narrow against the method schema instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:52 +03:00
Samuel Newman 195c7a8d4a migrate the chat convo lifecycle mutations to the chat client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:52 +03:00
Samuel Newman 6b9b18cba4 migrate the chat convo read queries to the chat client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 1ba8c3feb9 skip getProfile if no did 2026-08-13 21:50:51 +03:00
Samuel Newman 3f8016139c cast branded params with the dedicated syntax types
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 384058d6a2 migrate the pinned post and verification cache profile reads to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman d8d4b3cf32 migrate the mute, block, starter pack and suggestion queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman a8db57e00d migrate the list and feed generator queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 8d738b891f migrate the follows and followers queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 6ef3628155 cast branded params with the dedicated syntax types
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 935935518a migrate service config and composer thread reads to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman b3aa00a4d7 migrate the post thread queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman c43e34c185 migrate starter pack and search queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 099921b9c5 migrate trending discovery queries to the appview client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:51 +03:00
Samuel Newman 1318347053 widen types/bsky views to accept generated lexicon types
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 9a649b97ad add the canonical client hooks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 40521e4008 add the pds, chat and throwing clients
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman dc9741d8ba add the chat proxy service constant
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 0d7dcfc5b0 add lexicon schema helpers to types/bsky
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman b02754f8b8 apply tweaked version of matthieu's suggestion 2026-08-13 21:50:50 +03:00
Samuel Newman 00af680341 document the public client labeler asymmetry
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 1f3784fc7b migrate the trends query to the lex client
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman f3a2674b9b match xrpc errors against the method schema
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 7fee516d4c add the lex client seam over the bridge agent
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:50:50 +03:00
Samuel Newman 90824d83c4 bump lex 2026-08-13 21:48:16 +03:00
Samuel Newman 8a119ecdb2 update latest lexicons 2026-08-13 21:41:06 +03:00
Samuel Newman 38367d2a5c update atproto deps 2026-08-13 21:41:06 +03:00
Samuel Newman 4bec37037e update, rm permission sets 2026-08-13 21:41:06 +03:00
Samuel Newman f8a5f8c2e2 resolve newly published lexicons from the network
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:06 +03:00
Samuel Newman 259a94cd24 Update pnpm-workspace.yaml 2026-08-13 21:41:06 +03:00
Samuel Newman 45c394f9a3 move lex install --ci out of postinstall into a lexicons:verify ci job
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:06 +03:00
Samuel Newman 3d91143c80 drop direct lex-client dep, import from @atproto/lex
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:06 +03:00
Samuel Newman a3243820c9 add lexicon codegen: vendored lexicons, lex cli and generation scripts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:06 +03:00
Samuel Newman a2129885c6 fix lockfile 2026-08-13 21:41:05 +03:00
Samuel Newman 7f6db6352d fix lockfile 2026-08-13 21:41:05 +03:00
Samuel Newman b1a7cc7998 fix lockfile 2026-08-13 21:41:05 +03:00
Samuel Newman 69101a9348 take named options in makeSessionHooks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 131d4815e6 keep the stored pds url when a refresh delivers no did doc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 517439abd6 expand session test coverage, fix abort-test contamination
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman fb494881de redact session debug logs, fix stale bundle read and render-phase ref write
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 6df3986c2b surface lex error messages in cleanError
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 5ffee15c4f reject no-op refreshes, mirror the inner session's pds routing
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 374e1ba3de dispose the bundle and fail loudly when prep destroys the session
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman b96d85387d rm subpar comment 2026-08-13 21:41:05 +03:00
Samuel Newman 1e6106e865 pin the matchXrpcError pattern for the lexicon codegen followup
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:05 +03:00
Samuel Newman 3e42c659c9 clean up migration-context comments
Comments should explain the code as it is, not narrate the change that produced
it. Drops "the old X" / "now" / "no longer" framing and a stale version pin in
favour of concrete names and the live constraints.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:04 +03:00
Samuel Newman 9f381485dc dispose superseded bundles on aborted login and signup
`createAccount` and `login` abandoned the factory's returned bundle when a
newer task had already aborted them. The factories return an ARMED bundle, so
that session kept auto-refreshing and rotating refresh tokens server-side for
an account the app was no longer tracking; for signup the void-fired
post-signup writes kept its agent live too. Dispose in both abort branches,
matching `resumeSession`.

Also document why disposal of a replaced bundle is deferred to the post-commit
effect rather than done inline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:04 +03:00
Samuel Newman 21d67da9a9 match lex errors with instanceof, drop getErrorName
`getErrorName` erased the typed error classes by flattening everything to a
string code. Anchor on the classes instead: `LexAuthFactorError` for the login
2FA branch, `XrpcResponseError` for the signup error codes.

`@atproto/lex-client` stays a direct dependency because `XrpcResponseError` is
used at runtime for `instanceof`. It is already in the runtime graph via
`@atproto/lex-password-session`, so the direct declaration adds no bundle
weight; it makes the import legal under pnpm's strict layout and pins the
version so both packages share one `LexError` identity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:04 +03:00
Samuel Newman 1d279dc894 adapt error classification and email state to the lex session core
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:04 +03:00
Samuel Newman abdf1abf4b rebuild the session lifecycle on passwordsession
Replace the AtpAgent-owned session lifecycle with PasswordSession-backed
bundles, dispatched through the bridge agent. The provider, reducer and
factories now hold a `{session, agent, service}` bundle whose identity gates
session events, so a stale session can no longer log out the current account
or restore its tokens after a switch.

Behavioural changes that come with the new auth core:
- token rotation is read from the hook payload (PasswordSession fires before
  committing its live getter), so refreshes persist the new tokens
- replaced bundles are disposed rather than mutated, since PasswordSession has
  no in-place patch; cross-tab syncs rebuild instead
- the expiry rescue path prefers a newer persisted generation over logging
  every tab out

Post-signup writes keep main's agent.* call style; createAccount synthesizes
the email/active fields the thinner lex output omits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:41:04 +03:00