add lex client seam, types/bsky schema helpers, pilot trending migration

This commit is contained in:
Samuel Newman
2026-07-15 19:38:25 +03:00
parent 15e232749a
commit 105e68c12c
7 changed files with 490 additions and 8 deletions
+13
View File
@@ -9,6 +9,7 @@ import {
useSyncExternalStore,
} from 'react'
import {type AtpAgent, type AtpSessionEvent} from '@atproto/api'
import {type Client} from '@atproto/lex-client'
import * as persisted from '#/state/persisted'
import {useCloseAllActiveElements} from '#/state/util'
@@ -26,6 +27,7 @@ import {
} from './agent'
import {type Action, getInitialState, reducer, type State} from './reducer'
export {isSignupQueued} from './util'
import {agentToLexClient} from './clients'
import {addSessionDebugLog} from './logging'
export type {SessionAccount} from '#/state/session/types'
@@ -460,3 +462,14 @@ export function useAgent(): AtpAgent {
}
return agent
}
/**
* Authenticated lex {@link Client} wrapping the current session agent. Stable
* per-agent, so it only changes identity when the active account changes.
*
* @see agentToLexClient for how the AtpAgent is bridged to the lex Client.
*/
export function useLexClient(): Client {
const agent = useAgent()
return agentToLexClient(agent)
}