@adminide-stack/yantra-mobile 12.0.140 → 12.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/features/agent-chat/NativeAgentChat.js +21 -4
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ApprovalCard.js +353 -0
- package/lib/features/chat/ApprovalCard.js.map +1 -0
- package/lib/features/chat/AskUserCard.js +9 -2
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/askUser.js +25 -3
- package/lib/features/chat/askUser.js.map +1 -1
- package/lib/features/chat/queuedFollowUpRows.js +13 -0
- package/lib/features/chat/queuedFollowUpRows.js.map +1 -0
- package/lib/features/discover/DiscoverArticle.js +105 -92
- package/lib/features/discover/DiscoverArticle.js.map +1 -1
- package/lib/features/discover/DiscoverFeed.js +97 -48
- package/lib/features/discover/DiscoverFeed.js.map +1 -1
- package/lib/features/discover/DiscoverFollowUp.js +135 -0
- package/lib/features/discover/DiscoverFollowUp.js.map +1 -0
- package/lib/features/discover/DiscoverSidebar.js +555 -0
- package/lib/features/discover/DiscoverSidebar.js.map +1 -0
- package/lib/features/discover/DiscoverSkeletons.js +123 -0
- package/lib/features/discover/DiscoverSkeletons.js.map +1 -0
- package/lib/features/discover/DiscoverStoryCards.js +193 -87
- package/lib/features/discover/DiscoverStoryCards.js.map +1 -1
- package/lib/features/discover/followUpQuery.js +42 -0
- package/lib/features/discover/followUpQuery.js.map +1 -0
- package/lib/features/discover/markets.js +37 -0
- package/lib/features/discover/markets.js.map +1 -0
- package/lib/features/discover/useDiscoverSidebar.js +148 -0
- package/lib/features/discover/useDiscoverSidebar.js.map +1 -0
- package/lib/features/discover/weather.js +42 -0
- package/lib/features/discover/weather.js.map +1 -0
- package/lib/features/expenses/ExpensesAgentChatPane.js +1 -1
- package/lib/features/expenses/ExpensesAgentChatPane.js.map +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js.map +1 -1
- package/lib/features/job-search/JobSearchAgentChatPane.js +1 -0
- package/lib/features/job-search/JobSearchAgentChatPane.js.map +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js.map +1 -1
- package/lib/features/notion/NotionBlockSheets.js +206 -0
- package/lib/features/notion/NotionBlockSheets.js.map +1 -0
- package/lib/features/notion/NotionBlockView.js +36 -0
- package/lib/features/notion/NotionBlockView.js.map +1 -0
- package/lib/features/notion/NotionCommentsSheet.js +461 -0
- package/lib/features/notion/NotionCommentsSheet.js.map +1 -0
- package/lib/features/notion/NotionConnectionsSheet.js +244 -0
- package/lib/features/notion/NotionConnectionsSheet.js.map +1 -0
- package/lib/features/notion/NotionHistorySheet.js +439 -0
- package/lib/features/notion/NotionHistorySheet.js.map +1 -0
- package/lib/features/notion/NotionMediaBlocks.js +803 -0
- package/lib/features/notion/NotionMediaBlocks.js.map +1 -0
- package/lib/features/notion/NotionMentionSheet.js +279 -0
- package/lib/features/notion/NotionMentionSheet.js.map +1 -0
- package/lib/features/notion/NotionPageMenu.js +585 -0
- package/lib/features/notion/NotionPageMenu.js.map +1 -0
- package/lib/features/notion/NotionPageTree.js +220 -0
- package/lib/features/notion/NotionPageTree.js.map +1 -0
- package/lib/features/notion/NotionPageView.js +1253 -152
- package/lib/features/notion/NotionPageView.js.map +1 -1
- package/lib/features/notion/NotionShareSheet.js +606 -0
- package/lib/features/notion/NotionShareSheet.js.map +1 -0
- package/lib/features/notion/NotionSheets.js +87 -15
- package/lib/features/notion/NotionSheets.js.map +1 -1
- package/lib/features/notion/NotionSidebarSections.js +492 -0
- package/lib/features/notion/NotionSidebarSections.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js +659 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceView.js +257 -45
- package/lib/features/notion/NotionWorkspaceView.js.map +1 -1
- package/lib/features/notion/database/DatabaseCells.js +554 -0
- package/lib/features/notion/database/DatabaseCells.js.map +1 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js +792 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseLayouts.js +461 -0
- package/lib/features/notion/database/DatabaseLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseSheets.js +791 -0
- package/lib/features/notion/database/DatabaseSheets.js.map +1 -0
- package/lib/features/notion/database/NotionDatabaseView.js +817 -0
- package/lib/features/notion/database/NotionDatabaseView.js.map +1 -0
- package/lib/features/notion/database/RowPropertiesPanel.js +162 -0
- package/lib/features/notion/database/RowPropertiesPanel.js.map +1 -0
- package/lib/features/notion/database/chartData.js +89 -0
- package/lib/features/notion/database/chartData.js.map +1 -0
- package/lib/features/notion/database/chartView.js +112 -0
- package/lib/features/notion/database/chartView.js.map +1 -0
- package/lib/features/notion/database/connectorButton.js +33 -0
- package/lib/features/notion/database/connectorButton.js.map +1 -0
- package/lib/features/notion/database/databaseCalc.js +208 -0
- package/lib/features/notion/database/databaseCalc.js.map +1 -0
- package/lib/features/notion/database/databaseCalendar.js +157 -0
- package/lib/features/notion/database/databaseCalendar.js.map +1 -0
- package/lib/features/notion/database/databaseCsv.js +98 -0
- package/lib/features/notion/database/databaseCsv.js.map +1 -0
- package/lib/features/notion/database/databaseCsvActions.js +58 -0
- package/lib/features/notion/database/databaseCsvActions.js.map +1 -0
- package/lib/features/notion/database/databaseFilter.js +473 -0
- package/lib/features/notion/database/databaseFilter.js.map +1 -0
- package/lib/features/notion/database/databaseFormula.js +1072 -0
- package/lib/features/notion/database/databaseFormula.js.map +1 -0
- package/lib/features/notion/database/databaseGroup.js +151 -0
- package/lib/features/notion/database/databaseGroup.js.map +1 -0
- package/lib/features/notion/database/databaseRollup.js +58 -0
- package/lib/features/notion/database/databaseRollup.js.map +1 -0
- package/lib/features/notion/database/databaseTimeline.js +156 -0
- package/lib/features/notion/database/databaseTimeline.js.map +1 -0
- package/lib/features/notion/database/databaseView.js +1188 -0
- package/lib/features/notion/database/databaseView.js.map +1 -0
- package/lib/features/notion/database/databaseViews.js +310 -0
- package/lib/features/notion/database/databaseViews.js.map +1 -0
- package/lib/features/notion/database/relationSource.js +92 -0
- package/lib/features/notion/database/relationSource.js.map +1 -0
- package/lib/features/notion/database/uniqueId.js +17 -0
- package/lib/features/notion/database/uniqueId.js.map +1 -0
- package/lib/features/notion/database/useNotionDatabase.js +617 -0
- package/lib/features/notion/database/useNotionDatabase.js.map +1 -0
- package/lib/features/notion/notionAgentRunStatus.js +39 -0
- package/lib/features/notion/notionAgentRunStatus.js.map +1 -0
- package/lib/features/notion/notionCodeLanguages.js +112 -0
- package/lib/features/notion/notionCodeLanguages.js.map +1 -0
- package/lib/features/notion/notionComments.js +86 -0
- package/lib/features/notion/notionComments.js.map +1 -0
- package/lib/features/notion/notionConnections.js +74 -0
- package/lib/features/notion/notionConnections.js.map +1 -0
- package/lib/features/notion/notionDocuments.js +453 -1
- package/lib/features/notion/notionDocuments.js.map +1 -1
- package/lib/features/notion/notionEditorModel.js +142 -7
- package/lib/features/notion/notionEditorModel.js.map +1 -1
- package/lib/features/notion/notionMarkdownShortcuts.js +51 -0
- package/lib/features/notion/notionMarkdownShortcuts.js.map +1 -0
- package/lib/features/notion/notionMedia.js +119 -0
- package/lib/features/notion/notionMedia.js.map +1 -0
- package/lib/features/notion/notionMentionDate.js +32 -0
- package/lib/features/notion/notionMentionDate.js.map +1 -0
- package/lib/features/notion/notionMentionOptions.js +162 -0
- package/lib/features/notion/notionMentionOptions.js.map +1 -0
- package/lib/features/notion/notionNotesAgent.js +445 -0
- package/lib/features/notion/notionNotesAgent.js.map +1 -0
- package/lib/features/notion/notionPageAccess.js +168 -0
- package/lib/features/notion/notionPageAccess.js.map +1 -0
- package/lib/features/notion/notionPageActions.js +138 -0
- package/lib/features/notion/notionPageActions.js.map +1 -0
- package/lib/features/notion/notionPageHistory.js +154 -0
- package/lib/features/notion/notionPageHistory.js.map +1 -0
- package/lib/features/notion/notionPageKinds.js +200 -0
- package/lib/features/notion/notionPageKinds.js.map +1 -0
- package/lib/features/notion/notionRecents.js +48 -0
- package/lib/features/notion/notionRecents.js.map +1 -0
- package/lib/features/notion/notionRichText.js +177 -0
- package/lib/features/notion/notionRichText.js.map +1 -0
- package/lib/features/notion/notionRichTitle.js +336 -0
- package/lib/features/notion/notionRichTitle.js.map +1 -0
- package/lib/features/notion/useNotionWorkspace.js +272 -13
- package/lib/features/notion/useNotionWorkspace.js.map +1 -1
- package/lib/features/notion/usePageActions.js +155 -0
- package/lib/features/notion/usePageActions.js.map +1 -0
- package/lib/features/resume/ResumeAgentChatPane.js +1 -1
- package/lib/features/resume/ResumeAgentChatPane.js.map +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
- package/lib/features/study/StudyAgentChatPane.js +1 -1
- package/lib/features/study/StudyAgentChatPane.js.map +1 -1
- package/lib/features/travel/TravelAgentChatPane.js +1 -1
- package/lib/features/travel/TravelAgentChatPane.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +40 -8
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +1 -1
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/codeFiles.js +302 -0
- package/lib/features/webbuilder/codeFiles.js.map +1 -0
- package/lib/features/webbuilder/codeHighlight.js +209 -0
- package/lib/features/webbuilder/codeHighlight.js.map +1 -0
- package/lib/features/webbuilder/components/CodeView.js +682 -52
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +59 -38
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +3 -3
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/stepLabels.js +68 -0
- package/lib/features/webbuilder/stepLabels.js.map +1 -0
- package/lib/hooks/useHostChatSteering.js +45 -0
- package/lib/hooks/useHostChatSteering.js.map +1 -0
- package/lib/screens/Chat/index.js +2 -12
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/ExpensesNative/useExpensesHostChat.js +25 -5
- package/lib/screens/ExpensesNative/useExpensesHostChat.js.map +1 -1
- package/lib/screens/InboxNative/useInboxHostChat.js +25 -5
- package/lib/screens/InboxNative/useInboxHostChat.js.map +1 -1
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js +25 -5
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js.map +1 -1
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +25 -5
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -1
- package/lib/screens/MoviesNative/useMoviesHostChat.js +25 -5
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -1
- package/lib/screens/NotionPage/index.js +2 -2
- package/lib/screens/NotionPage/index.js.map +1 -1
- package/lib/screens/ResumeNative/useResumeHostChat.js +25 -5
- package/lib/screens/ResumeNative/useResumeHostChat.js.map +1 -1
- package/lib/screens/ShoppingNative/useShoppingHostChat.js +25 -5
- package/lib/screens/ShoppingNative/useShoppingHostChat.js.map +1 -1
- package/lib/screens/StudyNative/useStudyHostChat.js +25 -5
- package/lib/screens/StudyNative/useStudyHostChat.js.map +1 -1
- package/lib/screens/TravelNative/useTravelHostChat.js +25 -5
- package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -1
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +222 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -0
- package/lib/screens/WebBuilderNative/index.js +1 -1
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js +126 -4
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +120 -11
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInboxHostChat.js","sources":["../../../src/screens/InboxNative/useInboxHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Inbox agent - same role as web `services.hostChat`.\n * Lives on the Inbox screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { InboxHostChat } from '../../features/inbox/hostChat';\nimport { stripInboxContext } from '../../features/inbox/inboxContext';\n\nexport function useInboxHostChat(routeOrg?: string): InboxHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n label: 'InboxNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useInboxHostChat.js","sources":["../../../src/screens/InboxNative/useInboxHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Inbox agent - same role as web `services.hostChat`.\n * Lives on the Inbox screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { InboxHostChat } from '../../features/inbox/hostChat';\nimport { stripInboxContext } from '../../features/inbox/inboxContext';\n\nexport function useInboxHostChat(routeOrg?: string): InboxHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n label: 'InboxNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat, stripInboxContext);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n // The inbox context line is for the agent; the user sees their own words.\n content: m.role === 'user' ? stripInboxContext(m.content) : m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n const clear = useCallback(() => {\n // Stop mid-turn, wipe the local transcript, then open a fresh channel so\n // gateway history cannot rehydrate the cleared thread.\n chat.clearMessages();\n setChannelId(uuidv4());\n }, [chat]);\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBO,SAAS,iBAAiB,QAAkC,EAAA;AAhBnE,EAAA,IAAA,EAAA;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A,KAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,IAAK,CAAA,WAAA,EAAa,KAAK,KAAO,EAAA,MAAA,CAAO,kBAAkB,IAAM,EAAA,KAAA,EAAO,mBAAmB,CAAC,CAAA;AACpK"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const TESTING_PROJECT_UUID = "9a8ac704-1040-4836-9b72-48b771ca91b1";
|
|
2
18
|
function useJobSearchHostChat() {
|
|
3
19
|
var _a;
|
|
4
20
|
const params = useRoute().params;
|
|
@@ -34,17 +50,21 @@ function useJobSearchHostChat() {
|
|
|
34
50
|
recoverAgentAuth: cdecli.recoverAgentAuth
|
|
35
51
|
}), [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode]);
|
|
36
52
|
const chat = useChatStream(channelId, chatRouting);
|
|
53
|
+
const {
|
|
54
|
+
visibleMessages,
|
|
55
|
+
steering
|
|
56
|
+
} = useHostChatSteering(chat);
|
|
37
57
|
const {
|
|
38
58
|
displayMessages,
|
|
39
59
|
displayStreaming,
|
|
40
60
|
renderConnectorCard
|
|
41
61
|
} = useHostConnectorCard(chat, channelId);
|
|
42
|
-
const messages = useMemo(() => displayMessages(
|
|
62
|
+
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
43
63
|
id: `${m.role}-${index}`,
|
|
44
64
|
role: m.role,
|
|
45
65
|
content: m.content,
|
|
46
66
|
attachments: m.attachments
|
|
47
|
-
}))), [
|
|
67
|
+
}))), [visibleMessages, displayMessages]);
|
|
48
68
|
const send = useCallback((text, attachments) => {
|
|
49
69
|
void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));
|
|
50
70
|
}, [chat, channelId, ensureChannel]);
|
|
@@ -52,7 +72,7 @@ function useJobSearchHostChat() {
|
|
|
52
72
|
chat.clearMessages();
|
|
53
73
|
setChannelId(v4());
|
|
54
74
|
}, [chat]);
|
|
55
|
-
return useMemo(() => ({
|
|
75
|
+
return useMemo(() => __spreadValues({
|
|
56
76
|
messages,
|
|
57
77
|
streaming: displayStreaming(chat.response),
|
|
58
78
|
busy: chat.isLoading || chat.isStreaming,
|
|
@@ -61,5 +81,5 @@ function useJobSearchHostChat() {
|
|
|
61
81
|
send,
|
|
62
82
|
clear,
|
|
63
83
|
renderConnectorCard
|
|
64
|
-
}), [messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
84
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
65
85
|
}export{useJobSearchHostChat};//# sourceMappingURL=useJobSearchHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useJobSearchHostChat.js","sources":["../../../src/screens/JobSearchNative/useJobSearchHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Job Agent — same role as web `services.hostChat`.\n * Lives on the Job Search screen (MF host), not in the remote, so Apollo /\n * cdecli stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { JobSearchHostChat } from '../../features/job-search/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useJobSearchHostChat(): JobSearchHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n label: 'JobSearchNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useJobSearchHostChat.js","sources":["../../../src/screens/JobSearchNative/useJobSearchHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Job Agent — same role as web `services.hostChat`.\n * Lives on the Job Search screen (MF host), not in the remote, so Apollo /\n * cdecli stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { JobSearchHostChat } from '../../features/job-search/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useJobSearchHostChat(): JobSearchHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n label: 'JobSearchNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n content: m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n const clear = useCallback(() => {\n // Stop pondering mid-turn, wipe local transcript, then open a fresh\n // channel so gateway history cannot rehydrate the cleared thread.\n chat.clearMessages();\n setChannelId(uuidv4());\n }, [chat]);\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,oBAA0C,GAAA;AAjB1D,EAAA,IAAA,EAAA;AAkBE,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,MAAA;AAI1B,EAAM,MAAA,QAAA,GAAW,QAAO,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAY,WAAW,MAAO,CAAA,OAAA,CAAQ,MAAS,GAAA,EAAA;AAC/E,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAC5C,EAAA,MAAM,kBAAkB,SAAa,IAAA,oBAAA;AACrC,EAAA,MAAM,CAAC,SAAW,EAAA,YAAY,IAAI,QAAS,CAAA,MAAMA,IAAQ,CAAA;AACzD,EAAA,MAAM,SAAS,mBAAoB,EAAA;AACnC,EAAM,MAAA;AAAA,IACJ;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,kBAAA,CAAmB,SAAS,CAAA;AAC5B,IAAO,OAAA,MAAA;AAAA,GACN,EAAA,CAA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AAM,IAAO,GAAA,WAAA,CAAY,CAAC,IAAA,EAAc,WAAsC,KAAA;AAE5E,IAAK,KAAA,aAAA,GAAgB,IAAK,CAAA,MAAM,KAAK,WAAY,CAAA,IAAA,EAAM,WAAa,EAAA,SAAS,CAAC,CAAA;AAAA,GAC7E,EAAA,CAAC,IAAM,EAAA,SAAA,EAAW,aAAa,CAAC,CAAA;AACnC,EAAM,MAAA,KAAA,GAAQ,YAAY,MAAM;AAG9B,IAAA,IAAA,CAAK,aAAc,EAAA;AACnB,IAAA,YAAA,CAAaA,IAAQ,CAAA;AAAA,GACvB,EAAG,CAAC,IAAI,CAAC,CAAA;AACT,EAAA,OAAO,QAAQ,MAAO,cAAA,CAAA;AAAA,IACpB,QAAA;AAAA,IACA,SAAA,EAAW,gBAAiB,CAAA,IAAA,CAAK,QAAQ,CAAA;AAAA,IACzC,IAAA,EAAM,IAAK,CAAA,SAAA,IAAa,IAAK,CAAA,WAAA;AAAA,IAC7B,OAAO,IAAK,CAAA,KAAA;AAAA,IACZ,WAAW,MAAO,CAAA,gBAAA;AAAA,IAClB,IAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,IAAK,CAAA,WAAA,EAAa,KAAK,KAAO,EAAA,MAAA,CAAO,kBAAkB,IAAM,EAAA,KAAA,EAAO,mBAAmB,CAAC,CAAA;AACpK"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripLocalServicesContext}from'../../features/local-services/localServicesContext.js';
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripLocalServicesContext}from'../../features/local-services/localServicesContext.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
function useLocalServicesHostChat(routeOrg, handedOffChannelId) {
|
|
2
18
|
var _a;
|
|
3
19
|
const {
|
|
4
20
|
orgName,
|
|
@@ -32,18 +48,22 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
32
48
|
recoverAgentAuth: cdecli.recoverAgentAuth
|
|
33
49
|
}), [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode]);
|
|
34
50
|
const chat = useChatStream(channelId, chatRouting);
|
|
51
|
+
const {
|
|
52
|
+
visibleMessages,
|
|
53
|
+
steering
|
|
54
|
+
} = useHostChatSteering(chat, stripLocalServicesContext);
|
|
35
55
|
const {
|
|
36
56
|
displayMessages,
|
|
37
57
|
displayStreaming,
|
|
38
58
|
renderConnectorCard
|
|
39
59
|
} = useHostConnectorCard(chat, channelId);
|
|
40
|
-
const messages = useMemo(() => displayMessages(
|
|
60
|
+
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
41
61
|
id: `${m.role}-${index}`,
|
|
42
62
|
role: m.role,
|
|
43
63
|
// The local services context line is for the agent; the user sees their own words.
|
|
44
64
|
content: m.role === "user" ? stripLocalServicesContext(m.content) : m.content,
|
|
45
65
|
attachments: m.attachments
|
|
46
|
-
}))), [
|
|
66
|
+
}))), [visibleMessages, displayMessages]);
|
|
47
67
|
const send = useCallback((text, attachments) => {
|
|
48
68
|
void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));
|
|
49
69
|
}, [chat, channelId, ensureChannel]);
|
|
@@ -52,7 +72,7 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
52
72
|
setHandedOff(false);
|
|
53
73
|
setChannelId(v4());
|
|
54
74
|
}, [chat]);
|
|
55
|
-
return useMemo(() => ({
|
|
75
|
+
return useMemo(() => __spreadValues({
|
|
56
76
|
messages,
|
|
57
77
|
streaming: displayStreaming(chat.response),
|
|
58
78
|
busy: chat.isLoading || chat.isStreaming,
|
|
@@ -61,5 +81,5 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
61
81
|
send,
|
|
62
82
|
clear,
|
|
63
83
|
renderConnectorCard
|
|
64
|
-
}), [messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
84
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
65
85
|
}export{useLocalServicesHostChat};//# sourceMappingURL=useLocalServicesHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalServicesHostChat.js","sources":["../../../src/screens/LocalServicesNative/useLocalServicesHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Local Services agent - same role as web `services.hostChat`.\n * Lives on the Local Services screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { LocalServicesHostChat } from '../../features/local-services/hostChat';\nimport { stripLocalServicesContext } from '../../features/local-services/localServicesContext';\n\nexport function useLocalServicesHostChat(routeOrg?: string, handedOffChannelId?: string): LocalServicesHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n // A hand-off from an empty Chat names the chat it was typed into: the agent\n // carries on in it (it already exists) instead of leaving an empty \"New chat\".\n const [channelId, setChannelId] = useState(() => handedOffChannelId || uuidv4());\n const [handedOff, setHandedOff] = useState(Boolean(handedOffChannelId));\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n exists: handedOff,\n label: 'LocalServicesNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useLocalServicesHostChat.js","sources":["../../../src/screens/LocalServicesNative/useLocalServicesHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Local Services agent - same role as web `services.hostChat`.\n * Lives on the Local Services screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { LocalServicesHostChat } from '../../features/local-services/hostChat';\nimport { stripLocalServicesContext } from '../../features/local-services/localServicesContext';\n\nexport function useLocalServicesHostChat(routeOrg?: string, handedOffChannelId?: string): LocalServicesHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n // A hand-off from an empty Chat names the chat it was typed into: the agent\n // carries on in it (it already exists) instead of leaving an empty \"New chat\".\n const [channelId, setChannelId] = useState(() => handedOffChannelId || uuidv4());\n const [handedOff, setHandedOff] = useState(Boolean(handedOffChannelId));\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n exists: handedOff,\n label: 'LocalServicesNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat, stripLocalServicesContext);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n // The local services context line is for the agent; the user sees their own words.\n content: m.role === 'user' ? stripLocalServicesContext(m.content) : m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n const clear = useCallback(() => {\n // Stop mid-turn, wipe the local transcript, then open a fresh channel so\n // gateway history cannot rehydrate the cleared thread.\n chat.clearMessages();\n setHandedOff(false);\n setChannelId(uuidv4());\n }, [chat]);\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBgB,SAAA,wBAAA,CAAyB,UAAmB,kBAAoD,EAAA;AAhBhH,EAAA,IAAA,EAAA;AAiBE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAI5C,EAAM,MAAA,CAAC,WAAW,YAAY,CAAA,GAAI,SAAS,MAAM,kBAAA,IAAsBA,IAAQ,CAAA;AAC/E,EAAA,MAAM,CAAC,SAAW,EAAA,YAAY,IAAI,QAAS,CAAA,OAAA,CAAQ,kBAAkB,CAAC,CAAA;AACtE,EAAA,MAAM,SAAS,mBAAoB,EAAA;AACnC,EAAM,MAAA;AAAA,IACJ;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,kBAAA,CAAmB,SAAS,CAAA;AAC5B,IAAO,OAAA,MAAA;AAAA,GACN,EAAA,CAAC,SAAW,EAAA,kBAAkB,CAAC,CAAA;AAClC,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,kBAAmB,CAAA;AAAA,IACrB,SAAA;AAAA,IACA,OAAS,EAAA,YAAA;AAAA,IACT,WAAW,SAAa,IAAA,IAAA,GAAA,SAAA,GAAA,EAAA;AAAA,IACxB,MAAQ,EAAA,SAAA;AAAA,IACR,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAM,MAAA,eAAA,GAAA,CAAkB,EAAO,GAAA,MAAA,CAAA,eAAA,KAAP,IAA0B,GAAA,EAAA,GAAA,SAAA;AAClD,EAAM,MAAA,WAAA,GAAoC,QAAQ,OAAO;AAAA,IACvD,kBAAkB,MAAO,CAAA,gBA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,IAAA,CAAK,aAAc,EAAA;AACnB,IAAA,YAAA,CAAa,KAAK,CAAA;AAClB,IAAA,YAAA,CAAaA,IAAQ,CAAA;AAAA,GACvB,EAAG,CAAC,IAAI,CAAC,CAAA;AACT,EAAA,OAAO,QAAQ,MAAO,cAAA,CAAA;AAAA,IACpB,QAAA;AAAA,IACA,SAAA,EAAW,gBAAiB,CAAA,IAAA,CAAK,QAAQ,CAAA;AAAA,IACzC,IAAA,EAAM,IAAK,CAAA,SAAA,IAAa,IAAK,CAAA,WAAA;AAAA,IAC7B,OAAO,IAAK,CAAA,KAAA;AAAA,IACZ,WAAW,MAAO,CAAA,gBAAA;AAAA,IAClB,IAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,IAAK,CAAA,WAAA,EAAa,KAAK,KAAO,EAAA,MAAA,CAAO,kBAAkB,IAAM,EAAA,KAAA,EAAO,mBAAmB,CAAC,CAAA;AACpK"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripMoviesContext}from'../../features/movies/moviesContext.js';
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripMoviesContext}from'../../features/movies/moviesContext.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
function useMoviesHostChat(routeOrg, handedOffChannelId) {
|
|
2
18
|
var _a;
|
|
3
19
|
const {
|
|
4
20
|
orgName,
|
|
@@ -31,18 +47,22 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
31
47
|
recoverAgentAuth: cdecli.recoverAgentAuth
|
|
32
48
|
}), [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode]);
|
|
33
49
|
const chat = useChatStream(channelId, chatRouting);
|
|
50
|
+
const {
|
|
51
|
+
visibleMessages,
|
|
52
|
+
steering
|
|
53
|
+
} = useHostChatSteering(chat, stripMoviesContext);
|
|
34
54
|
const {
|
|
35
55
|
displayMessages,
|
|
36
56
|
displayStreaming,
|
|
37
57
|
renderConnectorCard
|
|
38
58
|
} = useHostConnectorCard(chat, channelId);
|
|
39
|
-
const messages = useMemo(() => displayMessages(
|
|
59
|
+
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
40
60
|
id: `${m.role}-${index}`,
|
|
41
61
|
role: m.role,
|
|
42
62
|
// The movies context line is for the agent; the user sees their own words.
|
|
43
63
|
content: m.role === "user" ? stripMoviesContext(m.content) : m.content,
|
|
44
64
|
attachments: m.attachments
|
|
45
|
-
}))), [
|
|
65
|
+
}))), [visibleMessages, displayMessages]);
|
|
46
66
|
const send = useCallback((text, attachments) => {
|
|
47
67
|
void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));
|
|
48
68
|
}, [chat, channelId, ensureChannel]);
|
|
@@ -50,7 +70,7 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
50
70
|
chat.clearMessages();
|
|
51
71
|
setChannelId(v4());
|
|
52
72
|
}, [chat]);
|
|
53
|
-
return useMemo(() => ({
|
|
73
|
+
return useMemo(() => __spreadValues({
|
|
54
74
|
messages,
|
|
55
75
|
streaming: displayStreaming(chat.response),
|
|
56
76
|
busy: chat.isLoading || chat.isStreaming,
|
|
@@ -59,5 +79,5 @@ import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid'
|
|
|
59
79
|
send,
|
|
60
80
|
clear,
|
|
61
81
|
renderConnectorCard
|
|
62
|
-
}), [messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
82
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
63
83
|
}export{useMoviesHostChat};//# sourceMappingURL=useMoviesHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMoviesHostChat.js","sources":["../../../src/screens/MoviesNative/useMoviesHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Movies agent - same role as web `services.hostChat`.\n * Lives on the Movies screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { MoviesHostChat } from '../../features/movies/hostChat';\nimport { stripMoviesContext } from '../../features/movies/moviesContext';\n\nexport function useMoviesHostChat(routeOrg?: string, handedOffChannelId?: string): MoviesHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n // A hand-off from an empty Chat names the chat it was typed into: Movies carries\n // on in that chat (it already exists) instead of leaving an empty \"New chat\".\n const [channelId, setChannelId] = useState(() => handedOffChannelId || uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n exists: Boolean(handedOffChannelId) && channelId === handedOffChannelId,\n label: 'MoviesNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useMoviesHostChat.js","sources":["../../../src/screens/MoviesNative/useMoviesHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Movies agent - same role as web `services.hostChat`.\n * Lives on the Movies screen (MF host), not in the remote, so Apollo / cdecli\n * stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { MoviesHostChat } from '../../features/movies/hostChat';\nimport { stripMoviesContext } from '../../features/movies/moviesContext';\n\nexport function useMoviesHostChat(routeOrg?: string, handedOffChannelId?: string): MoviesHostChat {\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n\n // A hand-off from an empty Chat names the chat it was typed into: Movies carries\n // on in that chat (it already exists) instead of leaving an empty \"New chat\".\n const [channelId, setChannelId] = useState(() => handedOffChannelId || uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: projectId ?? '',\n exists: Boolean(handedOffChannelId) && channelId === handedOffChannelId,\n label: 'MoviesNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat, stripMoviesContext);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n // The movies context line is for the agent; the user sees their own words.\n content: m.role === 'user' ? stripMoviesContext(m.content) : m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n const clear = useCallback(() => {\n // Stop mid-turn, wipe the local transcript, then open a fresh channel so\n // gateway history cannot rehydrate the cleared thread.\n chat.clearMessages();\n setChannelId(uuidv4());\n }, [chat]);\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBgB,SAAA,iBAAA,CAAkB,UAAmB,kBAA6C,EAAA;AAhBlG,EAAA,IAAA,EAAA;AAiBE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YA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;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,IAAK,CAAA,WAAA,EAAa,KAAK,KAAO,EAAA,MAAA,CAAO,kBAAkB,IAAM,EAAA,KAAA,EAAO,mBAAmB,CAAC,CAAA;AACpK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {useMemo}from'react';import {StyleSheet}from'react-native';import {SafeAreaView}from'react-native-safe-area-context';import {useRoute}from'@react-navigation/native';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {useMemo}from'react';import {StyleSheet}from'react-native';import {SafeAreaView}from'react-native-safe-area-context';import {useRoute}from'@react-navigation/native';import {NotionBlockView}from'../../features/notion/NotionBlockView.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';function NotionPageScreen() {
|
|
2
2
|
const route = useRoute();
|
|
3
3
|
const params = route.params;
|
|
4
4
|
const {
|
|
@@ -10,7 +10,7 @@ import {jsx}from'react/jsx-runtime';import {useMemo}from'react';import {StyleShe
|
|
|
10
10
|
return typeof raw === "string" && raw.trim() ? raw.trim() : null;
|
|
11
11
|
}, [params == null ? void 0 : params.orgName]);
|
|
12
12
|
const blockId = typeof (params == null ? void 0 : params.blockId) === "string" && params.blockId ? params.blockId : null;
|
|
13
|
-
return /* @__PURE__ */ jsx(SafeAreaView, { edges: ["left", "right"], style: styles.container, children: /* @__PURE__ */ jsx(
|
|
13
|
+
return /* @__PURE__ */ jsx(SafeAreaView, { edges: ["left", "right"], style: styles.container, children: /* @__PURE__ */ jsx(NotionBlockView, { orgName, blockId, isDark }) });
|
|
14
14
|
}
|
|
15
15
|
const styles = StyleSheet.create({
|
|
16
16
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/screens/NotionPage/index.tsx"],"sourcesContent":["/**\n * Native Notion page (browser `/notion/page/:blockId`). Reached from the\n * Notion workspace or a sub-page link inside another page.\n */\nimport React, { useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport { useRoute } from '@react-navigation/native';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/screens/NotionPage/index.tsx"],"sourcesContent":["/**\n * Native Notion page (browser `/notion/page/:blockId`). Reached from the\n * Notion workspace or a sub-page link inside another page. Databases open in\n * the native database view.\n */\nimport React, { useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport { useRoute } from '@react-navigation/native';\nimport { NotionBlockView } from '../../features/notion/NotionBlockView';\nimport { useAppTheme } from '../../theme/AppThemeProvider';\n\nexport interface NotionPageRouteParams {\n orgName?: string | null;\n blockId?: string | null;\n}\n\nexport default function NotionPageScreen() {\n const route = useRoute();\n const params = route.params as NotionPageRouteParams | undefined;\n const { isDark } = useAppTheme();\n\n const orgName = useMemo(() => {\n const raw = params?.orgName ?? '';\n return typeof raw === 'string' && raw.trim() ? raw.trim() : null;\n }, [params?.orgName]);\n const blockId = typeof params?.blockId === 'string' && params.blockId ? params.blockId : null;\n\n return (\n <SafeAreaView edges={['left', 'right']} style={styles.container}>\n <NotionBlockView orgName={orgName} blockId={blockId} isDark={isDark} />\n </SafeAreaView>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"names":[],"mappings":"iVAeA,SAAwB,gBAAmB,GAAA;AACzC,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EAAA,MAAM,SAAS,KAAM,CAAA,MAAA;AACrB,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,WAAY,EAAA;AAChB,EAAM,MAAA,OAAA,GAAU,QAAQ,MAAM;AArBhC,IAAA,IAAA,EAAA;AAsBI,IAAM,MAAA,GAAA,GAAA,CAAM,EAAQ,GAAA,MAAA,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAA,KAAR,IAAmB,GAAA,EAAA,GAAA,EAAA;AAC/B,IAAO,OAAA,OAAO,QAAQ,QAAY,IAAA,GAAA,CAAI,MAAS,GAAA,GAAA,CAAI,MAAS,GAAA,IAAA;AAAA,GAC3D,EAAA,CAAC,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAO,CAAC,CAAA;AACpB,EAAM,MAAA,OAAA,GAAU,QAAO,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAY,YAAY,MAAO,CAAA,OAAA,GAAU,OAAO,OAAU,GAAA,IAAA;AACzF,EAAA,uBAAQ,GAAA,CAAA,YAAA,EAAA,EAAa,KAAO,EAAA,CAAC,QAAQ,OAAO,CAAA,EAAG,KAAO,EAAA,MAAA,CAAO,WACnD,QAAC,kBAAA,GAAA,CAAA,eAAA,EAAA,EAAgB,OAAkB,EAAA,OAAA,EAAkB,QAAgB,CACzE,EAAA,CAAA;AACR;AACA,MAAM,MAAA,GAAS,WAAW,MAAO,CAAA;AAAA,EAC/B,SAAW,EAAA;AAAA,IACT,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const TESTING_PROJECT_UUID = "9a8ac704-1040-4836-9b72-48b771ca91b1";
|
|
2
18
|
function useResumeHostChat() {
|
|
3
19
|
var _a;
|
|
4
20
|
const params = useRoute().params;
|
|
@@ -34,17 +50,21 @@ function useResumeHostChat() {
|
|
|
34
50
|
recoverAgentAuth: cdecli.recoverAgentAuth
|
|
35
51
|
}), [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode]);
|
|
36
52
|
const chat = useChatStream(channelId, chatRouting);
|
|
53
|
+
const {
|
|
54
|
+
visibleMessages,
|
|
55
|
+
steering
|
|
56
|
+
} = useHostChatSteering(chat);
|
|
37
57
|
const {
|
|
38
58
|
displayMessages,
|
|
39
59
|
displayStreaming,
|
|
40
60
|
renderConnectorCard
|
|
41
61
|
} = useHostConnectorCard(chat, channelId);
|
|
42
|
-
const messages = useMemo(() => displayMessages(
|
|
62
|
+
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
43
63
|
id: `${m.role}-${index}`,
|
|
44
64
|
role: m.role,
|
|
45
65
|
content: m.content,
|
|
46
66
|
attachments: m.attachments
|
|
47
|
-
}))), [
|
|
67
|
+
}))), [visibleMessages, displayMessages]);
|
|
48
68
|
const send = useCallback((text, attachments) => {
|
|
49
69
|
void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));
|
|
50
70
|
}, [chat, channelId, ensureChannel]);
|
|
@@ -52,7 +72,7 @@ function useResumeHostChat() {
|
|
|
52
72
|
chat.clearMessages();
|
|
53
73
|
setChannelId(v4());
|
|
54
74
|
}, [chat]);
|
|
55
|
-
return useMemo(() => ({
|
|
75
|
+
return useMemo(() => __spreadValues({
|
|
56
76
|
messages,
|
|
57
77
|
streaming: displayStreaming(chat.response),
|
|
58
78
|
busy: chat.isLoading || chat.isStreaming,
|
|
@@ -61,5 +81,5 @@ function useResumeHostChat() {
|
|
|
61
81
|
send,
|
|
62
82
|
clear,
|
|
63
83
|
renderConnectorCard
|
|
64
|
-
}), [messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
84
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard]);
|
|
65
85
|
}export{useResumeHostChat};//# sourceMappingURL=useResumeHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResumeHostChat.js","sources":["../../../src/screens/ResumeNative/useResumeHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Resume — same role as web `services.hostChat`.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { ResumeHostChat } from '../../features/resume/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useResumeHostChat(): ResumeHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n label: 'ResumeNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useResumeHostChat.js","sources":["../../../src/screens/ResumeNative/useResumeHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Resume — same role as web `services.hostChat`.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { ResumeHostChat } from '../../features/resume/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useResumeHostChat(): ResumeHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n const [channelId, setChannelId] = useState(() => uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n label: 'ResumeNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n content: m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n const clear = useCallback(() => {\n chat.clearMessages();\n setChannelId(uuidv4());\n }, [chat]);\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n clear,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,iBAAoC,GAAA;AAfpD,EAAA,IAAA,EAAA;AAgBE,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,MAAA;AAI1B,EAAM,MAAA,QAAA,GAAW,QAAO,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAY,WAAW,MAAO,CAAA,OAAA,CAAQ,MAAS,GAAA,EAAA;AAC/E,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAC5C,EAAA,MAAM,kBAAkB,SAAa,IAAA,oBAAA;AACrC,EAAA,MAAM,CAAC,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useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const TESTING_PROJECT_UUID = "9a8ac704-1040-4836-9b72-48b771ca91b1";
|
|
2
18
|
function useShoppingHostChat() {
|
|
3
19
|
var _a;
|
|
4
20
|
const params = useRoute().params;
|
|
@@ -36,21 +52,25 @@ function useShoppingHostChat() {
|
|
|
36
52
|
recoverAgentAuth: cdecli.recoverAgentAuth
|
|
37
53
|
}), [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode]);
|
|
38
54
|
const chat = useChatStream(channelId, chatRouting);
|
|
55
|
+
const {
|
|
56
|
+
visibleMessages,
|
|
57
|
+
steering
|
|
58
|
+
} = useHostChatSteering(chat);
|
|
39
59
|
const {
|
|
40
60
|
displayMessages,
|
|
41
61
|
displayStreaming,
|
|
42
62
|
renderConnectorCard
|
|
43
63
|
} = useHostConnectorCard(chat, channelId);
|
|
44
|
-
const messages = useMemo(() => displayMessages(
|
|
64
|
+
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
45
65
|
id: `${m.role}-${index}`,
|
|
46
66
|
role: m.role,
|
|
47
67
|
content: m.content,
|
|
48
68
|
attachments: m.attachments
|
|
49
|
-
}))), [
|
|
69
|
+
}))), [visibleMessages, displayMessages]);
|
|
50
70
|
const send = useCallback((text, attachments) => {
|
|
51
71
|
void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));
|
|
52
72
|
}, [chat, channelId, ensureChannel]);
|
|
53
|
-
return useMemo(() => ({
|
|
73
|
+
return useMemo(() => __spreadValues({
|
|
54
74
|
messages,
|
|
55
75
|
streaming: displayStreaming(chat.response),
|
|
56
76
|
busy: chat.isLoading || chat.isStreaming,
|
|
@@ -59,5 +79,5 @@ function useShoppingHostChat() {
|
|
|
59
79
|
send,
|
|
60
80
|
clear: chat.clearMessages,
|
|
61
81
|
renderConnectorCard
|
|
62
|
-
}), [messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, chat.clearMessages, renderConnectorCard]);
|
|
82
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, chat.clearMessages, renderConnectorCard]);
|
|
63
83
|
}export{useShoppingHostChat};//# sourceMappingURL=useShoppingHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShoppingHostChat.js","sources":["../../../src/screens/ShoppingNative/useShoppingHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Shop Agent — same role as web `services.hostChat`.\n * Lives on the Shop screen (MF host), not in the shopping remote, so Apollo /\n * cdecli stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { ShoppingHostChat } from '../../features/shopping/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useShoppingHostChat(): ShoppingHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n // A hand-off from an empty Chat names the chat it was typed into. Shop carries\n // on in that chat (it already exists) instead of leaving an empty \"New chat\".\n const handedOffChannelId =\n typeof params?.channelId === 'string' && params.channelId.trim() ? params.channelId.trim() : '';\n const [channelId] = useState(() => handedOffChannelId || uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n exists: Boolean(handedOffChannelId),\n label: 'ShoppingNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n
|
|
1
|
+
{"version":3,"file":"useShoppingHostChat.js","sources":["../../../src/screens/ShoppingNative/useShoppingHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Shop Agent — same role as web `services.hostChat`.\n * Lives on the Shop screen (MF host), not in the shopping remote, so Apollo /\n * cdecli stay out of the federated bundle.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useRoute } from '@react-navigation/native';\nimport { v4 as uuidv4 } from 'uuid';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useChatStream, type MessageAttachment, type UseChatStreamRouting } from '../../hooks/useChatStream';\nimport { usePrerequisiteIds } from '../../hooks/usePrerequisiteIds';\nimport { useHostChatChannel } from '../../hooks/useHostChatChannel';\nimport { useHostChatSteering } from '../../hooks/useHostChatSteering';\nimport { useHostConnectorCard } from '../../hooks/useHostConnectorCard';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { ShoppingHostChat } from '../../features/shopping/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useShoppingHostChat(): ShoppingHostChat {\n const params = useRoute().params as { orgName?: unknown; channelId?: unknown } | undefined;\n const routeOrg = typeof params?.orgName === 'string' ? params.orgName.trim() : '';\n const { orgName, projectId } = usePrerequisiteIds();\n const effectiveOrg = routeOrg || orgName || '';\n const submitProjectId = projectId || TESTING_PROJECT_UUID;\n\n // A hand-off from an empty Chat names the chat it was typed into. Shop carries\n // on in that chat (it already exists) instead of leaving an empty \"New chat\".\n const handedOffChannelId =\n typeof params?.channelId === 'string' && params.channelId.trim() ? params.channelId.trim() : '';\n const [channelId] = useState(() => handedOffChannelId || uuidv4());\n\n const cdecli = useCdecliConnection();\n const { setActiveChannelId } = cdecli;\n useEffect(() => {\n setActiveChannelId(channelId);\n return undefined;\n }, [channelId, setActiveChannelId]);\n\n const { ensureChannel } = useHostChatChannel({\n channelId,\n orgName: effectiveOrg,\n projectId: submitProjectId,\n exists: Boolean(handedOffChannelId),\n label: 'ShoppingNative',\n });\n\n const persistenceMode = cdecli.persistenceMode ?? 'backend';\n const chatRouting: UseChatStreamRouting = useMemo(\n () => ({\n channelConnected: cdecli.channelConnected,\n accountId: cdecli.accountId,\n persistenceMode,\n recoverAgentAuth: cdecli.recoverAgentAuth,\n }),\n [cdecli.channelConnected, cdecli.accountId, cdecli.recoverAgentAuth, persistenceMode],\n );\n\n const chat = useChatStream(channelId, chatRouting);\n\n // Mid-reply sends queue behind the running turn; the pane shows them above its composer.\n const { visibleMessages, steering } = useHostChatSteering(chat);\n\n // A `[CONNECTOR_CONNECT]` request is answered by a card the host renders; the\n // remote gets the thread without the markers and the card's replies.\n const { displayMessages, displayStreaming, renderConnectorCard } = useHostConnectorCard(chat, channelId);\n\n const messages: AgentChatMessage[] = useMemo(\n () =>\n displayMessages(\n visibleMessages.map((m, index) => ({\n id: `${m.role}-${index}`,\n role: m.role,\n content: m.content,\n attachments: m.attachments,\n })),\n ),\n [visibleMessages, displayMessages],\n );\n\n const send = useCallback(\n (text: string, attachments?: MessageAttachment[]) => {\n // The chat is created by the first message, not by opening the screen.\n void ensureChannel().then(() => chat.sendMessage(text, attachments, channelId));\n },\n [chat, channelId, ensureChannel],\n );\n\n return useMemo(\n () => ({\n messages,\n streaming: displayStreaming(chat.response),\n busy: chat.isLoading || chat.isStreaming,\n error: chat.error,\n connected: cdecli.channelConnected,\n send,\n clear: chat.clearMessages,\n renderConnectorCard,\n ...steering,\n }),\n [\n steering,\n messages,\n chat.response,\n displayStreaming,\n chat.isLoading,\n chat.isStreaming,\n chat.error,\n cdecli.channelConnected,\n send,\n chat.clearMessages,\n renderConnectorCard,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,mBAAwC,GAAA;AAjBxD,EAAA,IAAA,EAAA;AAkBE,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,MAAA;AAI1B,EAAM,MAAA,QAAA,GAAW,QAAO,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAY,WAAW,MAAO,CAAA,OAAA,CAAQ,MAAS,GAAA,EAAA;AAC/E,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAC5C,EAAA,MAAM,kBAAkB,SAAa,IAAA,oBAAA;AAIrC,EAAA,MAAM,kBAAqB,GAAA,QAAO,MAAQ,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAA,SAAA,CAAA,KAAc,QAAY,IAAA,MAAA,CAAO,SAAU,CAAA,IAAA,EAAS,GAAA,MAAA,CAAO,SAAU,CAAA,IAAA,EAAS,GAAA,EAAA;AACxH,EAAA,MAAM,CAAC,SAAS,CAAA,GAAI,SAAS,MAAM,kBAAA,IAAsBA,IAAQ,CAAA;AACjE,EAAA,MAAM,SAAS,mBAAoB,EAAA;AACnC,EAAM,MAAA;AAAA,IACJ;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,kBAAA,CAAmB,SAAS,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