@adminide-stack/yantra-mobile 12.0.191-alpha.1 → 12.0.191
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 +15 -2
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/audio-input/NativeDictationBar.js +7 -3
- package/lib/features/audio-input/NativeDictationBar.js.map +1 -1
- package/lib/features/audio-input/speechParts.js +27 -0
- package/lib/features/audio-input/speechParts.js.map +1 -0
- package/lib/features/computer/ComputerAgentChatPane.js.map +1 -1
- package/lib/features/credits/FreeCreditsCard.js +1 -1
- package/lib/features/credits/FreeCreditsYesCard.js +93 -0
- package/lib/features/credits/FreeCreditsYesCard.js.map +1 -0
- package/lib/features/credits/freeCredits.js +1 -15
- package/lib/features/credits/freeCredits.js.map +1 -1
- package/lib/features/credits/lockedReply.js +44 -0
- package/lib/features/credits/lockedReply.js.map +1 -0
- package/lib/features/credits/useFreeCredits.js +8 -5
- package/lib/features/credits/useFreeCredits.js.map +1 -1
- package/lib/features/credits/useFreeCreditsYes.js +48 -0
- package/lib/features/credits/useFreeCreditsYes.js.map +1 -0
- package/lib/features/dictate/useVoiceQuestion.js +5 -3
- package/lib/features/dictate/useVoiceQuestion.js.map +1 -1
- package/lib/features/travel/airportCodes.js +76 -0
- package/lib/features/travel/airportCodes.js.map +1 -0
- package/lib/features/travel/airportIndex.js +1 -1
- package/lib/features/travel/airportIndex.js.map +1 -1
- package/lib/features/travel/parseTravelIntent.js +95 -124
- package/lib/features/travel/parseTravelIntent.js.map +1 -1
- package/lib/hooks/useHostFreeCreditsClaim.js +23 -0
- package/lib/hooks/useHostFreeCreditsClaim.js.map +1 -0
- package/lib/screens/Chat/index.js +11 -4
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/ComputerNative/useComputerHostChat.js +5 -3
- package/lib/screens/ComputerNative/useComputerHostChat.js.map +1 -1
- package/lib/screens/ExpensesNative/useExpensesHostChat.js +5 -3
- package/lib/screens/ExpensesNative/useExpensesHostChat.js.map +1 -1
- package/lib/screens/InboxNative/useInboxHostChat.js +5 -3
- package/lib/screens/InboxNative/useInboxHostChat.js.map +1 -1
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js +5 -3
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js.map +1 -1
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +5 -3
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -1
- package/lib/screens/MoviesNative/useMoviesHostChat.js +5 -3
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -1
- package/lib/screens/ResumeNative/useResumeHostChat.js +5 -3
- package/lib/screens/ResumeNative/useResumeHostChat.js.map +1 -1
- package/lib/screens/ShoppingNative/useShoppingHostChat.js +5 -3
- package/lib/screens/ShoppingNative/useShoppingHostChat.js.map +1 -1
- package/lib/screens/StudyNative/useStudyHostChat.js +5 -3
- package/lib/screens/StudyNative/useStudyHostChat.js.map +1 -1
- package/lib/screens/TravelNative/useTravelHostChat.js +5 -3
- package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripInboxContext}from'../../features/inbox/inboxContext.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';import {stripInboxContext}from'../../features/inbox/inboxContext.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -55,6 +55,7 @@ function useInboxHostChat(routeOrg) {
|
|
|
55
55
|
displayStreaming,
|
|
56
56
|
renderConnectorCard
|
|
57
57
|
} = useHostConnectorCard(chat, channelId);
|
|
58
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
58
59
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
59
60
|
id: `${m.role}-${index}`,
|
|
60
61
|
role: m.role,
|
|
@@ -77,6 +78,7 @@ function useInboxHostChat(routeOrg) {
|
|
|
77
78
|
connected: cdecli.channelConnected,
|
|
78
79
|
send,
|
|
79
80
|
clear,
|
|
80
|
-
renderConnectorCard
|
|
81
|
-
|
|
81
|
+
renderConnectorCard,
|
|
82
|
+
claimFreeCredits
|
|
83
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
82
84
|
}export{useInboxHostChat};//# sourceMappingURL=useInboxHostChat.js.map
|
|
@@ -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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAiBO,SAAS,iBAAiB,QAAkC,EAAA;AAjBnE,EAAA,IAAA,EAAA;AAkBE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAC5C,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,SA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useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -59,6 +59,7 @@ function useJobSearchHostChat() {
|
|
|
59
59
|
displayStreaming,
|
|
60
60
|
renderConnectorCard
|
|
61
61
|
} = useHostConnectorCard(chat, channelId);
|
|
62
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
62
63
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
63
64
|
id: `${m.role}-${index}`,
|
|
64
65
|
role: m.role,
|
|
@@ -80,6 +81,7 @@ function useJobSearchHostChat() {
|
|
|
80
81
|
connected: cdecli.channelConnected,
|
|
81
82
|
send,
|
|
82
83
|
clear,
|
|
83
|
-
renderConnectorCard
|
|
84
|
-
|
|
84
|
+
renderConnectorCard,
|
|
85
|
+
claimFreeCredits
|
|
86
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
85
87
|
}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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,oBAA0C,GAAA;AAlB1D,EAAA,IAAA,EAAA;AAmBE,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,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,SAAW,EAAA,eAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAM,MAAA,eAAA,GAAA,CAAkB,EAA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AAC,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,mBAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,KAAK,WAAa,EAAA,IAAA,CAAK,OAAO,MAAO,CAAA,gBAAA,EAAkB,MAAM,KAAO,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.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;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';import {stripLocalServicesContext}from'../../features/local-services/localServicesContext.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -57,6 +57,7 @@ function useLocalServicesHostChat(routeOrg, handedOffChannelId) {
|
|
|
57
57
|
displayStreaming,
|
|
58
58
|
renderConnectorCard
|
|
59
59
|
} = useHostConnectorCard(chat, channelId);
|
|
60
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
60
61
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
61
62
|
id: `${m.role}-${index}`,
|
|
62
63
|
role: m.role,
|
|
@@ -80,6 +81,7 @@ function useLocalServicesHostChat(routeOrg, handedOffChannelId) {
|
|
|
80
81
|
connected: cdecli.channelConnected,
|
|
81
82
|
send,
|
|
82
83
|
clear,
|
|
83
|
-
renderConnectorCard
|
|
84
|
-
|
|
84
|
+
renderConnectorCard,
|
|
85
|
+
claimFreeCredits
|
|
86
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
85
87
|
}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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n 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AAaA,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,mBAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,KAAK,WAAa,EAAA,IAAA,CAAK,OAAO,MAAO,CAAA,gBAAA,EAAkB,MAAM,KAAO,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.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;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';import {stripMoviesContext}from'../../features/movies/moviesContext.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -56,6 +56,7 @@ function useMoviesHostChat(routeOrg, handedOffChannelId) {
|
|
|
56
56
|
displayStreaming,
|
|
57
57
|
renderConnectorCard
|
|
58
58
|
} = useHostConnectorCard(chat, channelId);
|
|
59
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
59
60
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
60
61
|
id: `${m.role}-${index}`,
|
|
61
62
|
role: m.role,
|
|
@@ -78,6 +79,7 @@ function useMoviesHostChat(routeOrg, handedOffChannelId) {
|
|
|
78
79
|
connected: cdecli.channelConnected,
|
|
79
80
|
send,
|
|
80
81
|
clear,
|
|
81
|
-
renderConnectorCard
|
|
82
|
-
|
|
82
|
+
renderConnectorCard,
|
|
83
|
+
claimFreeCredits
|
|
84
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
83
85
|
}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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAiBgB,SAAA,iBAAA,CAAkB,UAAmB,kBAA6C,EAAA;AAjBlG,EAAA,IAAA,EAAA;AAkBE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAI5C,EAAM,MAAA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AAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,KAAK,WAAa,EAAA,IAAA,CAAK,OAAO,MAAO,CAAA,gBAAA,EAAkB,MAAM,KAAO,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -59,6 +59,7 @@ function useResumeHostChat() {
|
|
|
59
59
|
displayStreaming,
|
|
60
60
|
renderConnectorCard
|
|
61
61
|
} = useHostConnectorCard(chat, channelId);
|
|
62
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
62
63
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
63
64
|
id: `${m.role}-${index}`,
|
|
64
65
|
role: m.role,
|
|
@@ -80,6 +81,7 @@ function useResumeHostChat() {
|
|
|
80
81
|
connected: cdecli.channelConnected,
|
|
81
82
|
send,
|
|
82
83
|
clear,
|
|
83
|
-
renderConnectorCard
|
|
84
|
-
|
|
84
|
+
renderConnectorCard,
|
|
85
|
+
claimFreeCredits
|
|
86
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
85
87
|
}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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,iBAAoC,GAAA;AAhBpD,EAAA,IAAA,EAAA;AAiBE,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,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,SAAW,EAAA,eAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAM,MAAA,eAAA,GAAA,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7E,EAAA,CAAC,IAAM,EAAA,SAAA,EAAW,aAAa,CAAC,CAAA;AACnC,EAAM,MAAA,KAAA,GAAQ,YAAY,MAAM;AAC9B,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,mBAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,KAAK,WAAa,EAAA,IAAA,CAAK,OAAO,MAAO,CAAA,gBAAA,EAAkB,MAAM,KAAO,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -61,6 +61,7 @@ function useShoppingHostChat() {
|
|
|
61
61
|
displayStreaming,
|
|
62
62
|
renderConnectorCard
|
|
63
63
|
} = useHostConnectorCard(chat, channelId);
|
|
64
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
64
65
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
65
66
|
id: `${m.role}-${index}`,
|
|
66
67
|
role: m.role,
|
|
@@ -78,6 +79,7 @@ function useShoppingHostChat() {
|
|
|
78
79
|
connected: cdecli.channelConnected,
|
|
79
80
|
send,
|
|
80
81
|
clear: chat.clearMessages,
|
|
81
|
-
renderConnectorCard
|
|
82
|
-
|
|
82
|
+
renderConnectorCard,
|
|
83
|
+
claimFreeCredits
|
|
84
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, chat.clearMessages, renderConnectorCard, claimFreeCredits]);
|
|
83
85
|
}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 { 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":";;;;;;;;;;;;;;;;
|
|
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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,mBAAwC,GAAA;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C,CAAA;AACnC,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,OAAO,IAAK,CAAA,aAAA;AAAA,IACZ,mBAAA;AAAA,IACA;AAAA,GACG,EAAA,QAAA,CAAA,EACD,CAAC,QAAU,EAAA,QAAA,EAAU,KAAK,QAAU,EAAA,gBAAA,EAAkB,KAAK,SAAW,EAAA,IAAA,CAAK,aAAa,IAAK,CAAA,KAAA,EAAO,OAAO,gBAAkB,EAAA,IAAA,EAAM,KAAK,aAAe,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACnM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {stripStudyContext}from'../../features/study/studyContext.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';import {stripStudyContext}from'../../features/study/studyContext.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -55,6 +55,7 @@ function useStudyHostChat(routeOrg) {
|
|
|
55
55
|
displayStreaming,
|
|
56
56
|
renderConnectorCard
|
|
57
57
|
} = useHostConnectorCard(chat, channelId);
|
|
58
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
58
59
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
59
60
|
id: `${m.role}-${index}`,
|
|
60
61
|
role: m.role,
|
|
@@ -77,6 +78,7 @@ function useStudyHostChat(routeOrg) {
|
|
|
77
78
|
connected: cdecli.channelConnected,
|
|
78
79
|
send,
|
|
79
80
|
clear,
|
|
80
|
-
renderConnectorCard
|
|
81
|
-
|
|
81
|
+
renderConnectorCard,
|
|
82
|
+
claimFreeCredits
|
|
83
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, clear, renderConnectorCard, claimFreeCredits]);
|
|
82
84
|
}export{useStudyHostChat};//# sourceMappingURL=useStudyHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStudyHostChat.js","sources":["../../../src/screens/StudyNative/useStudyHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Study agent - same role as web `services.hostChat`.\n * Lives on the Study 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 { StudyHostChat } from '../../features/study/hostChat';\nimport { stripStudyContext } from '../../features/study/studyContext';\n\nexport function useStudyHostChat(routeOrg?: string): StudyHostChat {\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: 'StudyNative',\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, stripStudyContext);\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 study context line is for the agent; the user sees their own words.\n content: m.role === 'user' ? stripStudyContext(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":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useStudyHostChat.js","sources":["../../../src/screens/StudyNative/useStudyHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for the native Study agent - same role as web `services.hostChat`.\n * Lives on the Study 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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { StudyHostChat } from '../../features/study/hostChat';\nimport { stripStudyContext } from '../../features/study/studyContext';\n\nexport function useStudyHostChat(routeOrg?: string): StudyHostChat {\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: 'StudyNative',\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, stripStudyContext);\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 study context line is for the agent; the user sees their own words.\n content: m.role === 'user' ? stripStudyContext(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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAiBO,SAAS,iBAAiB,QAAkC,EAAA;AAjBnE,EAAA,IAAA,EAAA;AAkBE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAM,MAAA,YAAA,GAAe,YAAY,OAAW,IAAA,EAAA;AAC5C,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,CAAC,SAAW,EAAA,kBAAkB,CAAC,CAAA;AAClC,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,kBAAmB,CAAA;AAAA,IACrB,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;AAAA,IACf,CAAC,CAAA,EAAG,CAAC,eAAA,EAAiB,eAAe,CAAC,CAAA;AACxC,EAAA,MAAM,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,mBAAA;AAAA,IACA;AAAA,GAAA,EACG,WACD,CAAC,QAAA,EAAU,UAAU,IAAK,CAAA,QAAA,EAAU,kBAAkB,IAAK,CAAA,SAAA,EAAW,KAAK,WAAa,EAAA,IAAA,CAAK,OAAO,MAAO,CAAA,gBAAA,EAAkB,MAAM,KAAO,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useEffect,useMemo,useCallback}from'react';import {useRoute}from'@react-navigation/native';import {v4}from'uuid';import'react/jsx-runtime';import'react-native';import'common/graphql';import'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {useHostConnectorCard}from'../../hooks/useHostConnectorCard.js';import {useHostFreeCreditsClaim}from'../../hooks/useHostFreeCreditsClaim.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -59,6 +59,7 @@ function useTravelHostChat() {
|
|
|
59
59
|
displayStreaming,
|
|
60
60
|
renderConnectorCard
|
|
61
61
|
} = useHostConnectorCard(chat, channelId);
|
|
62
|
+
const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);
|
|
62
63
|
const messages = useMemo(() => displayMessages(visibleMessages.map((m, index) => ({
|
|
63
64
|
id: `${m.role}-${index}`,
|
|
64
65
|
role: m.role,
|
|
@@ -76,6 +77,7 @@ function useTravelHostChat() {
|
|
|
76
77
|
connected: cdecli.channelConnected,
|
|
77
78
|
send,
|
|
78
79
|
clear: chat.clearMessages,
|
|
79
|
-
renderConnectorCard
|
|
80
|
-
|
|
80
|
+
renderConnectorCard,
|
|
81
|
+
claimFreeCredits
|
|
82
|
+
}, steering), [steering, messages, chat.response, displayStreaming, chat.isLoading, chat.isStreaming, chat.error, cdecli.channelConnected, send, chat.clearMessages, renderConnectorCard, claimFreeCredits]);
|
|
81
83
|
}export{useTravelHostChat};//# sourceMappingURL=useTravelHostChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTravelHostChat.js","sources":["../../../src/screens/TravelNative/useTravelHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Travel Agent — same role as web `services.hostChat`.\n * Lives on the Travel screen (MF host), not in the travel remote.\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 { TravelHostChat } from '../../features/travel/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useTravelHostChat(): TravelHostChat {\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] = 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: 'TravelNative',\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":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTravelHostChat.js","sources":["../../../src/screens/TravelNative/useTravelHostChat.ts"],"sourcesContent":["/**\n * Host chat lane for native Travel Agent — same role as web `services.hostChat`.\n * Lives on the Travel screen (MF host), not in the travel remote.\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 { useHostFreeCreditsClaim } from '../../hooks/useHostFreeCreditsClaim';\nimport type { AgentChatMessage } from '../../features/agent-chat';\nimport type { TravelHostChat } from '../../features/travel/hostChat';\n\nconst TESTING_PROJECT_UUID = '9a8ac704-1040-4836-9b72-48b771ca91b1';\n\nexport function useTravelHostChat(): TravelHostChat {\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] = 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: 'TravelNative',\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 // A refusal for free credits never claimed: the pane's Yes claims them (NativeAgentChat).\n const claimFreeCredits = useHostFreeCreditsClaim(effectiveOrg);\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 claimFreeCredits,\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 claimFreeCredits,\n ],\n );\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,oBAAuB,GAAA,sCAAA;AACtB,SAAS,iBAAoC,GAAA;AAjBpD,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,C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AAA,gBAAA,EAAkB,KAAK,SAAW,EAAA,IAAA,CAAK,aAAa,IAAK,CAAA,KAAA,EAAO,OAAO,gBAAkB,EAAA,IAAA,EAAM,KAAK,aAAe,EAAA,mBAAA,EAAqB,gBAAgB,CAAC,CAAA;AACnM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/yantra-mobile",
|
|
3
|
-
"version": "12.0.191
|
|
3
|
+
"version": "12.0.191",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"uuid": "^9.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"common": "12.0.
|
|
30
|
+
"common": "^12.0.191",
|
|
31
31
|
"libphonenumber-js": "^1.13.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@react-native-async-storage/async-storage": "*",
|
|
47
47
|
"@react-navigation/native": "*",
|
|
48
48
|
"@shopify/react-native-skia": "*",
|
|
49
|
-
"common": "12.0.
|
|
49
|
+
"common": "12.0.188",
|
|
50
50
|
"expo-background-task": "*",
|
|
51
51
|
"expo-camera": "*",
|
|
52
52
|
"expo-constants": "*",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"typescript": {
|
|
72
72
|
"definition": "lib/index.d.ts"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "5613cbb8b9acb4842eda2a85be1ee8d42bf8b1b8"
|
|
75
75
|
}
|