@@ -17,6 +17,12 @@ import {
1717} from '@/lib/mothership/chat/attachment-preview'
1818import { organizationRoutes } from '@/lib/navigation/paths'
1919import { organizationDraftKey , SEARCH_ASSISTANT_DRAFT_SLOT } from '@/lib/organizations/draft-key'
20+ import { useOrganization } from '@/lib/organizations/provider'
21+ import {
22+ type OrganizationSummaryRequest ,
23+ organizationSearchParsers ,
24+ organizationSearchUrlKeys ,
25+ } from '@/lib/organizations/search-params'
2026import { isWorkspaceResourceKind , workspaceResourcePath } from '@/lib/resources'
2127import { assertMultiFileUploadAdmission } from '@/lib/uploads/client/admission'
2228import {
@@ -26,11 +32,6 @@ import {
2632 isAssistantImageType ,
2733} from '@/lib/uploads/shared/assistant-images'
2834import type { ConversationComposerProps } from '@/app/o/[organizationId]/home/components/composer'
29- import { useOrganizationContext } from '@/app/o/[organizationId]/providers/organization-provider'
30- import {
31- organizationSearchParsers ,
32- organizationSearchUrlKeys ,
33- } from '@/app/o/[organizationId]/search/search-params'
3435import { useSearchHistoryActions } from '@/app/workspace/[workspaceId]/home/components/message-content/components/source-history-context'
3536import {
3637 getMothershipUseChatOptions ,
@@ -62,12 +63,6 @@ import { useHydrated } from '@/hooks/use-hydrated'
6263import { readDraft , useMothershipDraftsStore } from '@/stores/mothership-drafts/store'
6364import type { ChatContext } from '@/stores/panel'
6465
65- export interface OrganizationSummaryRequest {
66- id : string
67- message : string
68- assistantSearch : WorkspaceSearchFilters
69- }
70-
7166/** Search's Assistant always runs its retrieval at this level. */
7267const ASSISTANT_SEARCH_LEVEL = 'fast' as const
7368
@@ -130,7 +125,7 @@ interface UseConversationGateOptions {
130125
131126/** Whether the surface may mount, and for which identity. Its key remounts on any change to one. */
132127export function useConversationGate ( { chatId, requestMode } : UseConversationGateOptions ) {
133- const { organization, searchAccess, canBuild, mothershipAvailable } = useOrganizationContext ( )
128+ const { organization, searchAccess, canBuild, mothershipAvailable } = useOrganization ( )
134129 const { data : session } = useSession ( )
135130 const isClient = useHydrated ( )
136131 const isRestoredChatEntry = useRestoredChatEntry ( { chatId } )
@@ -170,7 +165,7 @@ export function useOrganizationConversation({
170165 summaryRequest,
171166 onSummaryConsumed,
172167} : UseOrganizationConversationOptions ) {
173- const { organization, canBuild } = useOrganizationContext ( )
168+ const { organization, canBuild } = useOrganization ( )
174169 const panelSurface = surface . kind === 'panel' ? surface : null
175170 const { data : session } = useSession ( )
176171 const userId = session ?. user ?. id
0 commit comments