collapse the dual-world type layer and delete the widening shims

The types/bsky post/profile/starterPack unions drop their @atproto/api arms,
and dangerousIsType/validate go with the old-world guards they wrapped. The
moderation subjects.ts widening shim and rich-text-helpers' asSdkFacets both
existed only to bridge branded and unbranded views, so their 55 and 14 callers
now go straight to @bsky.app/sdk/moderation and the raw facets.

Boundary fallout: lexicon token defs are camelCase schema objects needing
.value, and the branded string slots that the widening used to absorb are now
cast or branded at their producers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-04 04:53:44 +03:00
parent e9a67f2dea
commit ae0750099f
114 changed files with 591 additions and 899 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import {useMemo} from 'react'
import {moderateFeedGenerator} from '#/lib/moderation/subjects'
import {moderateFeedGenerator} from '@bsky.app/sdk/moderation'
import {useModerationOpts} from '#/state/preferences/moderation-opts'
import {atoms as a, useTheme} from '#/alf'
import * as FeedCard from '#/components/FeedCard'
+1 -1
View File
@@ -1,6 +1,6 @@
import {useMemo} from 'react'
import {moderateUserList} from '#/lib/moderation/subjects'
import {moderateUserList} from '@bsky.app/sdk/moderation'
import {useModerationOpts} from '#/state/preferences/moderation-opts'
import {atoms as a, useTheme} from '#/alf'
import * as ListCard from '#/components/ListCard'
+2 -3
View File
@@ -1,15 +1,14 @@
import {useCallback, useMemo} from 'react'
import {View} from 'react-native'
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
import {moderatePost} from '@bsky.app/sdk/moderation'
import {Trans} from '@lingui/react/macro'
import {useQueryClient} from '@tanstack/react-query'
import {type $Typed} from '@atproto/lex'
import {AtUri} from '@atproto/syntax'
import {app} from '#/lexicons'
import {moderatePost} from '#/lib/moderation/subjects'
import {makeProfileLink} from '#/lib/routes/links'
import {asSdkFacets} from '#/lib/strings/rich-text-helpers'
import {getChatInviteCodeFromUrl} from '#/lib/strings/url-helpers'
import {useModerationOpts} from '#/state/preferences/moderation-opts'
import {unstableCacheProfileView} from '#/state/queries/profile'
@@ -287,7 +286,7 @@ export function QuoteEmbed({
if (!bsky.isType(app.bsky.feed.post, quote.record)) return undefined
const {text, facets} = quote.record
return text.trim()
? new RichTextAPI({text: text, facets: asSdkFacets(facets)})
? new RichTextAPI({text: text, facets: facets})
: undefined
}, [quote.record])