@vinaverse/react-native 0.1.0-alpha.11 → 0.1.0-alpha.13
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/README.md +16 -3
- package/dist/ask.cjs +10 -5
- package/dist/ask.d.cts +35 -5
- package/dist/ask.d.ts +35 -5
- package/dist/ask.js +3 -2
- package/dist/chat.cjs +69 -69
- package/dist/chat.d.cts +44 -8
- package/dist/chat.d.ts +44 -8
- package/dist/chat.js +3 -3
- package/dist/{chunk-XAG2P447.cjs → chunk-272ACDLI.cjs} +248 -104
- package/dist/chunk-272ACDLI.cjs.map +1 -0
- package/dist/{chunk-EFEXTVIT.js → chunk-35A77CNF.js} +11 -3
- package/dist/chunk-35A77CNF.js.map +1 -0
- package/dist/{chunk-NMKJ7LIJ.cjs → chunk-35T5QPMT.cjs} +31 -7
- package/dist/chunk-35T5QPMT.cjs.map +1 -0
- package/dist/{chunk-7KPCO443.js → chunk-GFD4T3IA.js} +28 -4
- package/dist/chunk-GFD4T3IA.js.map +1 -0
- package/dist/{chunk-2J2LIJLW.js → chunk-MCVW6TZD.js} +113 -33
- package/dist/chunk-MCVW6TZD.js.map +1 -0
- package/dist/{chunk-KSHDF3MG.js → chunk-QSMMC4RZ.js} +216 -74
- package/dist/chunk-QSMMC4RZ.js.map +1 -0
- package/dist/{chunk-POJP52GE.js → chunk-TY4TISCR.js} +4 -4
- package/dist/chunk-TY4TISCR.js.map +1 -0
- package/dist/{chunk-6QYDPGRS.cjs → chunk-UMCOOQT6.cjs} +11 -3
- package/dist/chunk-UMCOOQT6.cjs.map +1 -0
- package/dist/{chunk-MG32E4JI.cjs → chunk-VWAAUCE3.cjs} +11 -11
- package/dist/chunk-VWAAUCE3.cjs.map +1 -0
- package/dist/{chunk-4PXQ7DEY.cjs → chunk-YVCMKSJG.cjs} +140 -60
- package/dist/chunk-YVCMKSJG.cjs.map +1 -0
- package/dist/{context-gHCLFsJh.d.ts → context-B4ctXjm5.d.cts} +22 -1
- package/dist/{context-gHCLFsJh.d.cts → context-B4ctXjm5.d.ts} +22 -1
- package/dist/history.cjs +52 -48
- package/dist/history.cjs.map +1 -1
- package/dist/history.d.cts +12 -3
- package/dist/history.d.ts +12 -3
- package/dist/history.js +13 -9
- package/dist/history.js.map +1 -1
- package/dist/index.cjs +83 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/launcher.cjs +10 -10
- package/dist/launcher.js +2 -2
- package/package.json +7 -7
- package/dist/chunk-2J2LIJLW.js.map +0 -1
- package/dist/chunk-4PXQ7DEY.cjs.map +0 -1
- package/dist/chunk-6QYDPGRS.cjs.map +0 -1
- package/dist/chunk-7KPCO443.js.map +0 -1
- package/dist/chunk-EFEXTVIT.js.map +0 -1
- package/dist/chunk-KSHDF3MG.js.map +0 -1
- package/dist/chunk-MG32E4JI.cjs.map +0 -1
- package/dist/chunk-NMKJ7LIJ.cjs.map +0 -1
- package/dist/chunk-POJP52GE.js.map +0 -1
- package/dist/chunk-XAG2P447.cjs.map +0 -1
package/dist/history.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AgentHistoryList.tsx","../src/components/readOnlyStore.ts","../src/components/AgentTranscript.tsx"],"names":["useMemo","CopyProvider","ThemeProvider","jsx","Alert","useCopy","useTheme","useAgentRuntime","useAgentSweep","useAgentProfile","history","useAgentHistory","useState","useCallback","Row","formatDateTime","View","ActivityIndicator","Button","FlashList","jsxs","Pressable","Text","useAgentTranscript","useRef","ChatContextProvider","DefaultHeader","DisclosureBar","Centered","useReducedMotion","carousels","itemType"],"mappings":";;;;;;;;;;;;AA8IO,SAAS,iBAAiB,KAAA,EAAyC;AACxE,EAAA,MAAM,IAAA,GAAOA,aAAA;AAAA,IACX,MACE,KAAA,CAAM,SAAA,GACF,EAAE,GAAG,KAAA,CAAM,IAAA,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7C,QAAA,EAAA;AAAA,wBAAAb,cAAAA;AAAA,UAACmB,gBAAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO;AAAA,cACL,OAAO,MAAA,CAAO,IAAA;AAAA,cACd,QAAA,EAAU,KAAK,IAAA,CAAK,EAAA;AAAA,cACpB,SAAA,EAAW;AAAA,aACb;AAAA,YAEC,QAAA,EAAA,CAAA,CAAE,KAAA,CAAM,IAAA,GAAO,gBAAA,GAAmB,kBAAkB;AAAA;AAAA,SACvD;AAAA,QACC,KAAA,CAAM,IAAA,GAAO,IAAA,mBACZnB,cAAAA;AAAA,UAACe,wBAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO,EAAE,UAAU,CAAA;AAAA,YACnB,OAAA,EAAQ,SAAA;AAAA,YACR,SAAS,KAAA,CAAM;AAAA;AAAA;AACjB;AAAA;AAAA,GAEJ;AAEJ","file":"history.cjs","sourcesContent":["// A person's past conversations with the agent (history): newest activity first, a page at a time as the person\n// scrolls, each row a conversation to open (the app shows `AgentTranscript`), to continue (pinned for its key, the\n// app shows the chat) or to delete (confirmed first, a policy the app can replace). Every part is a slot given the\n// kit's own as `Default`; the words come from `copy`. Built only on the public hooks.\n\nimport { FlashList } from '@shopify/flash-list';\nimport type {\n AgentConversation,\n AgentFailureReason,\n} from '@vinaverse/client/agent';\nimport type { ConversationSummary } from '@vinaverse/client/history';\nimport {\n type CopyOverrides,\n CopyProvider,\n formatDateTime,\n useCopy,\n} from '@vinaverse/react';\nimport { useAgentProfile, useAgentRuntime } from '@vinaverse/react/agent';\nimport { useAgentHistory } from '@vinaverse/react/history';\nimport {\n type ComponentType,\n type ReactElement,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n ActivityIndicator,\n Alert,\n Pressable,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { useAgentSweep } from '../platform.js';\nimport {\n type ColorSchemeSetting,\n type ThemeOverrides,\n ThemeProvider,\n useTheme,\n} from '../theme.js';\nimport { Button } from './Button.js';\n\ntype Slot<P> = ComponentType<P & { readonly Default: ComponentType<P> }>;\n\n/** One past conversation as the list draws it. */\nexport interface HistoryRowProps {\n readonly conversation: ConversationSummary;\n /** Its last activity, in the locale and zone (\"Oct 15, 2026, 9:30 AM\"). */\n readonly when: string;\n /** \"6 messages\" (`copy.historyMessages`). */\n readonly messages: string;\n /** It can only be read (`state: ended`); an open one can be continued. */\n readonly ended: boolean;\n /** The row's tap: the app opens the transcript. Absent when the app gave no `onOpen`. */\n readonly onOpen: (() => void) | undefined;\n /** Absent when the conversation ended, or the app gave no `onContinue`. */\n readonly onContinue: (() => void) | undefined;\n readonly onDelete: () => void;\n readonly deleting: boolean;\n /** The last delete of this row failed (`copy.historyDeleteFailed`). */\n readonly deleteFailed: boolean;\n}\nexport interface HistoryEmptyProps {\n readonly agentName: string;\n}\n/** The list could not be read: `off` when history is switched off for this tenant, mode or person. */\nexport interface HistoryFailureProps {\n readonly reason: AgentFailureReason;\n readonly onRetry: () => void;\n}\n/** The props the list gives its list component: FlashList's. */\nexport interface HistoryListProps {\n readonly data: readonly ConversationSummary[];\n readonly renderItem: (info: {\n item: ConversationSummary;\n index: number;\n }) => ReactElement | null;\n readonly keyExtractor: (item: ConversationSummary) => string;\n readonly onEndReached: () => void;\n readonly onRefresh: () => void;\n readonly refreshing: boolean;\n readonly ListFooterComponent: ReactElement | null;\n readonly ListEmptyComponent: ReactElement | null;\n readonly contentContainerStyle: object;\n}\n/** What a history warning is about: a delete the backend refused. */\nexport interface HistoryWarning {\n readonly code: 'delete_failed';\n}\n\nexport interface AgentHistoryListSlots {\n readonly Row?: Slot<HistoryRowProps>;\n readonly Empty?: Slot<HistoryEmptyProps>;\n readonly Failure?: Slot<HistoryFailureProps>;\n /** A list with FlashList's props. Default: FlashList. */\n readonly ListComponent?: ComponentType<HistoryListProps>;\n}\n\nexport interface AgentHistoryListProps {\n /** The person signed in (null for a guest): the key a conversation continues or is deleted under. */\n readonly subject: string | null;\n /** The app's side: `customer` or `business`. */\n readonly mode: string;\n /** The business acted for, with `business`. */\n readonly scope?: string | null;\n /** The agent, for a backend that serves more than one. */\n readonly agent?: string | null;\n /** The thread a continued conversation runs in; default `chat`. */\n readonly thread?: string;\n /** Conversations per page (1–50). Default 20. */\n readonly pageSize?: number;\n /** A row was tapped: show its transcript (`AgentTranscript`). */\n readonly onOpen?: (conversation: ConversationSummary) => void;\n /**\n * \"Continue\" on an open conversation: it is pinned for its key (`useAgentHistory().keyOf`), and the app shows the\n * live conversation (`AgentChat` with that key, or `show()` on it).\n */\n readonly onContinue?: (\n conversation: ConversationSummary,\n live: AgentConversation,\n ) => void;\n /** Asks before deleting; default the platform's alert with the copy's words. False keeps the conversation. */\n readonly confirmDelete?: (\n conversation: ConversationSummary,\n ) => boolean | Promise<boolean>;\n /** A delete the backend refused, for the app's logger; the row says it too. */\n readonly onWarning?: (message: string, warning: HistoryWarning) => void;\n readonly components?: AgentHistoryListSlots;\n readonly locale?: string;\n readonly timeZone?: string;\n readonly copy?: CopyOverrides;\n readonly theme?: ThemeOverrides;\n readonly colorScheme?: ColorSchemeSetting;\n /** The agent's name until the status gives one. */\n readonly agentName?: string;\n readonly style?: StyleProp<ViewStyle>;\n readonly testID?: string;\n}\n\nexport function AgentHistoryList(props: AgentHistoryListProps): ReactNode {\n const copy = useMemo(\n () =>\n props.agentName\n ? { ...props.copy, agentFallbackName: props.agentName }\n : props.copy,\n [props.agentName, props.copy],\n );\n return (\n <CopyProvider locale={props.locale} copy={copy}>\n <ThemeProvider theme={props.theme} colorScheme={props.colorScheme}>\n <HistoryList {...props} />\n </ThemeProvider>\n </CopyProvider>\n );\n}\n\n/** The platform's alert: cancel keeps the conversation, so does dismissing it. */\nfunction alertConfirm(\n t: ReturnType<typeof useCopy>['t'],\n): () => Promise<boolean> {\n return () =>\n new Promise<boolean>((resolve) => {\n Alert.alert(\n t('historyDeleteTitle'),\n t('historyDeleteBody'),\n [\n { text: t('cancel'), style: 'cancel', onPress: () => resolve(false) },\n {\n text: t('historyDelete'),\n style: 'destructive',\n onPress: () => resolve(true),\n },\n ],\n { cancelable: true, onDismiss: () => resolve(false) },\n );\n });\n}\n\nfunction HistoryList(props: AgentHistoryListProps): ReactNode {\n const { t, locale, direction } = useCopy();\n const { colors, space } = useTheme();\n const runtime = useAgentRuntime();\n useAgentSweep(runtime);\n const { name } = useAgentProfile(t('agentFallbackName'));\n const history = useAgentHistory({\n subject: props.subject,\n mode: props.mode,\n scope: props.scope ?? null,\n agent: props.agent ?? null,\n ...(props.thread === undefined ? {} : { thread: props.thread }),\n ...(props.pageSize === undefined ? {} : { pageSize: props.pageSize }),\n });\n const { state } = history;\n const [deleting, setDeleting] = useState<ReadonlySet<string>>(new Set());\n const [failed, setFailed] = useState<ReadonlySet<string>>(new Set());\n const { onOpen, onContinue, onWarning, confirmDelete, timeZone } = props;\n // One function while the words are the same, so the rows keep theirs.\n const confirm = useMemo(\n () => confirmDelete ?? alertConfirm(t),\n [confirmDelete, t],\n );\n const remove = useCallback(\n async (conversation: ConversationSummary) => {\n if (!(await confirm(conversation))) return;\n mark(setDeleting, conversation.id, true);\n mark(setFailed, conversation.id, false);\n try {\n await history.remove(conversation);\n } catch (error) {\n mark(setFailed, conversation.id, true);\n onWarning?.(`Vinaverse history: delete failed: ${String(error)}`, {\n code: 'delete_failed',\n });\n } finally {\n mark(setDeleting, conversation.id, false);\n }\n },\n [confirm, history, onWarning],\n );\n const slots = props.components ?? {};\n const { Row, Empty, Failure, ListComponent } = slots;\n const renderItem = useCallback(\n ({ item }: { item: ConversationSummary }) => {\n const own: HistoryRowProps = {\n conversation: item,\n when: formatDateTime(item.last_activity_at, locale, timeZone),\n messages: t('historyMessages', { count: item.message_count }),\n ended: item.state === 'ended',\n onOpen: onOpen ? () => onOpen(item) : undefined,\n onContinue:\n onContinue && item.state === 'open'\n ? () => onContinue(item, history.continue(item))\n : undefined,\n onDelete: () => void remove(item),\n deleting: deleting.has(item.id),\n deleteFailed: failed.has(item.id),\n };\n return Row ? (\n <Row {...own} Default={DefaultHistoryRow} />\n ) : (\n <DefaultHistoryRow {...own} />\n );\n },\n [\n Row,\n locale,\n timeZone,\n t,\n onOpen,\n onContinue,\n history,\n remove,\n deleting,\n failed,\n ],\n );\n const empty =\n state.failure && state.conversations.length === 0 ? (\n <Centered>\n {Failure ? (\n <Failure\n reason={state.failure}\n onRetry={history.refresh}\n Default={DefaultHistoryFailure}\n />\n ) : (\n <DefaultHistoryFailure\n reason={state.failure}\n onRetry={history.refresh}\n />\n )}\n </Centered>\n ) : state.started && !state.loading ? (\n <Centered>\n {Empty ? (\n <Empty agentName={name} Default={DefaultHistoryEmpty} />\n ) : (\n <DefaultHistoryEmpty agentName={name} />\n )}\n </Centered>\n ) : null;\n const footer =\n state.loading && state.conversations.length > 0 ? (\n <View style={{ padding: space.md, alignItems: 'center' }}>\n <ActivityIndicator\n color={colors.textMuted}\n accessibilityLabel={t('loading')}\n />\n </View>\n ) : state.failure && state.conversations.length > 0 ? (\n <View style={{ padding: space.sm, alignItems: 'center' }}>\n <Button label={t('tryAgain')} variant=\"text\" onPress={history.retry} />\n </View>\n ) : null;\n const list: HistoryListProps = useMemo(\n () => ({\n data: state.conversations,\n renderItem,\n keyExtractor: (item) => item.id,\n onEndReached: history.loadMore,\n onRefresh: history.refresh,\n refreshing: state.loading && state.conversations.length === 0,\n ListFooterComponent: footer,\n ListEmptyComponent: empty,\n contentContainerStyle: { paddingVertical: space.sm },\n }),\n [state, renderItem, history, footer, empty, space.sm],\n );\n const List = ListComponent;\n return (\n <View\n testID={props.testID ?? 'vinaverse-history'}\n style={[\n { flex: 1, backgroundColor: colors.background, direction },\n props.style,\n ]}\n >\n {List ? <List {...list} /> : <FlashList {...list} />}\n </View>\n );\n}\n\n/** A set of ids with `id` in it or not, as a state update. */\nconst mark = (\n set: (f: (s: ReadonlySet<string>) => ReadonlySet<string>) => void,\n id: string,\n on: boolean,\n) =>\n set((s) => {\n const next = new Set(s);\n if (on) next.add(id);\n else next.delete(id);\n return next;\n });\n\nfunction Centered(props: { readonly children: ReactNode }) {\n const { space } = useTheme();\n return (\n <View\n style={{\n alignItems: 'center',\n justifyContent: 'center',\n padding: space.xl,\n }}\n >\n {props.children}\n </View>\n );\n}\n\n/** A conversation: its title, when it was last active, how many messages; continue when it can be, delete. */\nexport function DefaultHistoryRow(props: HistoryRowProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font, radius } = useTheme();\n const { conversation } = props;\n const detail = [\n props.when,\n props.messages,\n props.ended ? t('historyEnded') : null,\n ]\n .filter(Boolean)\n .join(' · ');\n return (\n <View\n style={{\n marginHorizontal: space.lg,\n marginVertical: space.xs,\n borderRadius: radius.lg,\n backgroundColor: colors.surface,\n opacity: props.deleting ? 0.6 : 1,\n }}\n testID={`vinaverse-history-${conversation.id}`}\n >\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={`${conversation.title}. ${detail}`}\n accessibilityState={{ disabled: !props.onOpen || props.deleting }}\n disabled={!props.onOpen || props.deleting}\n onPress={props.onOpen}\n style={{ paddingHorizontal: space.md, paddingTop: space.md }}\n >\n <Text\n numberOfLines={2}\n style={{\n color: colors.text,\n fontSize: font.size.md,\n fontWeight: '600',\n ...(font.family ? { fontFamily: font.family } : {}),\n }}\n >\n {conversation.title}\n </Text>\n <Text\n style={{\n color: colors.textMuted,\n fontSize: font.size.sm,\n marginTop: space.xxs,\n }}\n >\n {detail}\n </Text>\n </Pressable>\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: space.xs,\n paddingHorizontal: space.xs,\n }}\n >\n {props.onContinue ? (\n <Button\n label={t('historyContinue')}\n variant=\"text\"\n disabled={props.deleting}\n onPress={props.onContinue}\n />\n ) : null}\n <Button\n label={t('historyDelete')}\n variant=\"text\"\n busy={props.deleting}\n onPress={props.onDelete}\n />\n {props.deleteFailed ? (\n <Text style={{ color: colors.danger, fontSize: font.size.xs }}>\n {t('historyDeleteFailed')}\n </Text>\n ) : null}\n </View>\n </View>\n );\n}\n\nexport function DefaultHistoryEmpty(props: HistoryEmptyProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n return (\n <View style={{ alignItems: 'center', gap: space.sm }}>\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.lg,\n fontWeight: '600',\n textAlign: 'center',\n }}\n >\n {t('historyEmpty')}\n </Text>\n <Text\n style={{\n color: colors.textMuted,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t('historyEmptyBody', { agent: props.agentName })}\n </Text>\n </View>\n );\n}\n\n/** The list could not be read: history is off, or try again. */\nexport function DefaultHistoryFailure(props: HistoryFailureProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n const off = props.reason === 'off';\n return (\n <View\n accessibilityRole=\"alert\"\n style={{ alignItems: 'center', gap: space.md }}\n >\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t(off ? 'historyOff' : 'historyFailed')}\n </Text>\n {off ? null : (\n <Button\n label={t('tryAgain')}\n variant=\"primary\"\n onPress={props.onRetry}\n />\n )}\n </View>\n );\n}\n","// A past conversation as the chat's parts read one: a `ChatStore` over history's items that never changes and takes\n// no action (every action a no-op, nothing streams), so the bubbles and cards draw a transcript exactly as they draw\n// a live conversation restored from the device, inert.\nimport type {\n ConversationView,\n TimelineItem,\n} from '@vinaverse/client/conversation';\nimport type { ChatStore } from '../context.js';\n\nconst none = () => () => undefined;\n\nexport function readOnlyStore(view: {\n readonly items: readonly TimelineItem[];\n readonly conversationId: string;\n readonly agentName: string | null;\n readonly agentAvatar: string | null;\n}): ChatStore {\n const snapshot: ConversationView = {\n status: 'ready',\n conversationId: view.conversationId,\n banner: null,\n next: null,\n agent: { name: view.agentName, avatarUrl: view.agentAvatar },\n welcome: null,\n disclosure: null,\n takeover: null,\n items: view.items,\n activity: [],\n responding: false,\n openQuestion: null,\n answersNeedWebSocket: false,\n turnsLeft: null,\n history: 'restored',\n };\n return {\n getSnapshot: () => snapshot,\n subscribe: none,\n getStreaming: () => null,\n subscribeStreaming: none,\n send: () => '',\n retry: () => null,\n retryTurn: () => null,\n cancel: () => undefined,\n answer: () => '',\n cardAction: () => '',\n decideProposal: () => Promise.resolve(null),\n checkLink: () => false,\n continueHere: () => Promise.resolve(),\n setForeground: () => undefined,\n start: () => undefined,\n };\n}\n","// A past conversation read back (history): its messages and the cards their turns drew, newest page first, earlier\n// pages above as the person scrolls up or asks. Drawn by the chat's own parts over a read-only store, so a bubble and\n// a card look as they looked live, and restored cards take nothing: no proposal is confirmed from history, no link\n// opens, no answer is given. A refusal and a proposal's outcome are shown as they were. \"Continue\" pins the\n// conversation for the app's key and hands the app the live conversation to show. Built only on the public hooks.\n\nimport { FlashList } from '@shopify/flash-list';\nimport type {\n AgentConversation,\n AgentFailureReason,\n AgentKey,\n} from '@vinaverse/client/agent';\nimport type { CardItem, TimelineItem } from '@vinaverse/client/conversation';\nimport { type CopyOverrides, CopyProvider, useCopy } from '@vinaverse/react';\nimport { useAgentProfile, useAgentRuntime } from '@vinaverse/react/agent';\nimport { useAgentTranscript } from '@vinaverse/react/history';\nimport {\n type ComponentType,\n type ReactElement,\n type ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport {\n ActivityIndicator,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport {\n ChatContextProvider,\n type ChatHandlers,\n type ChatSlots,\n type ImagePolicy,\n} from '../context.js';\nimport { useReducedMotion } from '../platform.js';\nimport {\n type ColorSchemeSetting,\n type ThemeOverrides,\n ThemeProvider,\n useTheme,\n} from '../theme.js';\nimport { Button } from './Button.js';\nimport { DefaultHeader } from './ChatHeader.js';\nimport { DisclosureBar } from './DisclosureBar.js';\nimport { carousels, itemType, Row } from './MessageList.js';\nimport { readOnlyStore } from './readOnlyStore.js';\nimport type { HeaderProps } from './types.js';\n\ntype Slot<P> = ComponentType<P & { readonly Default: ComponentType<P> }>;\n\n/** The transcript could not be read: `gone` for one deleted, expired or never theirs (no retry helps). */\nexport interface TranscriptFailureProps {\n readonly reason: AgentFailureReason;\n readonly gone: boolean;\n readonly onRetry: () => void;\n}\n\n/** The props the transcript gives its list: FlashList's, anchored at the bottom, earlier pages asked for at the top. */\nexport interface TranscriptListProps {\n readonly data: readonly TimelineItem[];\n readonly renderItem: (info: {\n item: TimelineItem;\n index: number;\n }) => ReactElement | null;\n readonly keyExtractor: (item: TimelineItem) => string;\n readonly getItemType: (item: TimelineItem) => string;\n readonly maintainVisibleContentPosition: {\n readonly startRenderingFromBottom: boolean;\n readonly animateAutoScrollToBottom: boolean;\n };\n readonly onStartReached: () => void;\n readonly ListHeaderComponent: ReactElement | null;\n readonly contentContainerStyle: object;\n}\n\nexport interface AgentTranscriptSlots\n extends Pick<ChatSlots, 'MessageBubble' | 'Image' | 'CardGroup' | 'cards'> {\n readonly Header?: ComponentType<HeaderProps>;\n readonly Failure?: Slot<TranscriptFailureProps>;\n /** A list with FlashList's props. Default: FlashList. */\n readonly ListComponent?: ComponentType<TranscriptListProps>;\n}\n\nexport interface AgentTranscriptProps {\n readonly conversationId: string;\n /** Items per page. Default 30. */\n readonly pageSize?: number;\n /**\n * \"Continue\" under the transcript, with both: the key the conversation goes on under (`useAgentHistory().keyOf`)\n * and what the app does with the live conversation (show it: `AgentChat` with that key).\n */\n readonly agentKey?: AgentKey;\n readonly onContinue?: (conversation: AgentConversation) => void;\n /** The conversation ended (its summary's `state`): no \"Continue\", as the list offers it only for an open one. */\n readonly ended?: boolean;\n readonly components?: AgentTranscriptSlots;\n /** Which card photos are drawn, as on the chat. Keep stable. */\n readonly imagePolicy?: ImagePolicy;\n readonly prefetchImage?: ChatHandlers['prefetchImage'];\n readonly locale?: string;\n readonly timeZone?: string;\n readonly copy?: CopyOverrides;\n readonly theme?: ThemeOverrides;\n readonly colorScheme?: ColorSchemeSetting;\n /** The agent's name and picture until the status gives them. */\n readonly agentName?: string;\n readonly agentAvatar?: string;\n /** Hide the header (a screen that draws its own); the disclosure stays. */\n readonly hideHeader?: boolean;\n readonly style?: StyleProp<ViewStyle>;\n readonly testID?: string;\n}\n\nexport function AgentTranscript(props: AgentTranscriptProps): ReactNode {\n const copy = useMemo(\n () =>\n props.agentName\n ? { ...props.copy, agentFallbackName: props.agentName }\n : props.copy,\n [props.agentName, props.copy],\n );\n return (\n <CopyProvider locale={props.locale} copy={copy}>\n <ThemeProvider theme={props.theme} colorScheme={props.colorScheme}>\n <Transcript {...props} />\n </ThemeProvider>\n </CopyProvider>\n );\n}\n\nconst EMPTY_SLOTS: AgentTranscriptSlots = {};\n\nfunction Transcript(props: AgentTranscriptProps): ReactNode {\n const { t, direction } = useCopy();\n const { colors, space } = useTheme();\n const runtime = useAgentRuntime();\n const profile = useAgentProfile(t('agentFallbackName'));\n const name = profile.name;\n const avatar = props.agentAvatar ?? profile.avatarUrl;\n const transcript = useAgentTranscript(props.conversationId, {\n ...(props.pageSize === undefined ? {} : { pageSize: props.pageSize }),\n });\n const { state } = transcript;\n const slots = props.components ?? EMPTY_SLOTS;\n const { Header, Failure, ListComponent } = slots;\n // The chat's slots among them (bubble, image, carousel, cards), one object while the app's is the same.\n const chatSlots = useMemo<ChatSlots>(() => {\n const { Header: _h, Failure: _f, ListComponent: _l, ...rest } = slots;\n return rest;\n }, [slots]);\n // The parts read the conversation through the chat context: a read-only store over the page read so far.\n const store = useMemo(\n () =>\n readOnlyStore({\n items: state.items,\n conversationId: props.conversationId,\n agentName: name,\n agentAvatar: avatar,\n }),\n [state.items, props.conversationId, name, avatar],\n );\n const handlers = useRef<ChatHandlers>({});\n handlers.current = {\n ...(props.prefetchImage ? { prefetchImage: props.prefetchImage } : {}),\n };\n const value = useMemo(\n () => ({\n store,\n handlers,\n slots: chatSlots,\n agentAvatar: props.agentAvatar,\n timeZone: props.timeZone,\n failureAction: null,\n starters: undefined,\n imagePolicy: props.imagePolicy,\n }),\n [store, chatSlots, props.agentAvatar, props.timeZone, props.imagePolicy],\n );\n const header = { name, avatarUrl: avatar, takeoverBy: null };\n const gone =\n state.failure === 'not_found' ||\n state.failure === 'expired' ||\n state.failure === 'ended';\n const onContinue = props.onContinue;\n const agentKey = props.agentKey;\n return (\n <ChatContextProvider value={value}>\n <View\n testID={props.testID ?? 'vinaverse-transcript'}\n style={[\n { flex: 1, backgroundColor: colors.background, direction },\n props.style,\n ]}\n >\n {props.hideHeader ? null : Header ? (\n <Header {...header} Default={DefaultHeader} />\n ) : (\n <DefaultHeader {...header} />\n )}\n <DisclosureBar />\n <View style={{ flex: 1 }}>\n {state.failure && state.items.length === 0 ? (\n <Centered>\n {Failure ? (\n <Failure\n reason={state.failure}\n gone={gone}\n onRetry={transcript.load}\n Default={DefaultTranscriptFailure}\n />\n ) : (\n <DefaultTranscriptFailure\n reason={state.failure}\n gone={gone}\n onRetry={transcript.load}\n />\n )}\n </Centered>\n ) : (\n <TranscriptList\n items={state.items}\n loading={state.loading}\n more={!state.done && state.started && !state.loading}\n failed={state.failure !== null}\n onEarlier={transcript.loadEarlier}\n onRetry={transcript.retry}\n ListComponent={ListComponent}\n grouped={chatSlots.CardGroup !== undefined}\n />\n )}\n </View>\n {onContinue && agentKey && !gone && props.ended !== true ? (\n <View style={{ padding: space.lg }}>\n <Button\n label={t('historyContinue')}\n variant=\"primary\"\n onPress={() =>\n onContinue(runtime.continue(agentKey, props.conversationId))\n }\n />\n </View>\n ) : null}\n </View>\n </ChatContextProvider>\n );\n}\n\nfunction authorOf(item: TimelineItem | undefined): string | null {\n return item?.type === 'message' ? item.role : null;\n}\n\nfunction TranscriptList(props: {\n readonly items: readonly TimelineItem[];\n readonly loading: boolean;\n /** Earlier pages remain, and none is being read. */\n readonly more: boolean;\n /** The last page asked for (an earlier one, or the newest again) could not be read. */\n readonly failed: boolean;\n readonly onEarlier: () => void;\n readonly onRetry: () => void;\n readonly ListComponent: ComponentType<TranscriptListProps> | undefined;\n readonly grouped: boolean;\n}) {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n const reducedMotion = useReducedMotion();\n const { items, grouped } = props;\n const runsRef = useRef<ReadonlyMap<string, readonly CardItem[]>>(new Map());\n const grouping = useMemo(\n () => (grouped ? carousels(items, runsRef.current) : null),\n [items, grouped],\n );\n runsRef.current = grouping?.runs ?? new Map();\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const groupingRef = useRef(grouping);\n groupingRef.current = grouping;\n const renderItem = useCallback(\n ({ item, index }: { item: TimelineItem; index: number }) => (\n <Row\n item={item}\n showAuthor={authorOf(item) !== authorOf(itemsRef.current[index - 1])}\n run={groupingRef.current?.runs.get(item.key)}\n inside={groupingRef.current?.inside.has(item.key) === true}\n />\n ),\n [],\n );\n const header = props.loading ? (\n <View style={{ padding: space.md, alignItems: 'center' }}>\n <ActivityIndicator\n color={colors.textMuted}\n accessibilityLabel={t('loading')}\n />\n </View>\n ) : props.failed ? (\n // Said where the earlier messages would be, with a way to ask again (the same cursor, or the newest page).\n <View\n accessibilityRole=\"alert\"\n style={{\n padding: space.sm,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: space.sm,\n }}\n >\n <Text style={{ color: colors.textMuted, fontSize: font.size.sm }}>\n {t('transcriptEarlier')}\n </Text>\n <Button\n label={t('tryAgain')}\n hint={t('transcriptEarlier')}\n variant=\"text\"\n onPress={props.onRetry}\n />\n </View>\n ) : props.more ? (\n <View style={{ padding: space.sm, alignItems: 'center' }}>\n <Button\n label={t('transcriptEarlier')}\n variant=\"text\"\n onPress={props.onEarlier}\n />\n </View>\n ) : null;\n const list: TranscriptListProps = useMemo(\n () => ({\n data: items,\n renderItem,\n keyExtractor: (item) => item.key,\n getItemType: itemType,\n maintainVisibleContentPosition: {\n startRenderingFromBottom: true,\n animateAutoScrollToBottom: !reducedMotion,\n },\n onStartReached: props.onEarlier,\n ListHeaderComponent: header,\n contentContainerStyle: { paddingVertical: space.sm },\n }),\n [items, renderItem, reducedMotion, props.onEarlier, header, space.sm],\n );\n const List = props.ListComponent;\n return List ? <List {...list} /> : <FlashList {...list} />;\n}\n\nfunction Centered(props: { readonly children: ReactNode }) {\n const { space } = useTheme();\n return (\n <View\n style={{\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: space.xl,\n }}\n >\n {props.children}\n </View>\n );\n}\n\n/** The transcript could not be read: gone for good, or try again. */\nexport function DefaultTranscriptFailure(\n props: TranscriptFailureProps,\n): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n return (\n <View\n accessibilityRole=\"alert\"\n style={{ alignItems: 'center', gap: space.md }}\n >\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t(props.gone ? 'transcriptGone' : 'transcriptFailed')}\n </Text>\n {props.gone ? null : (\n <Button\n label={t('tryAgain')}\n variant=\"primary\"\n onPress={props.onRetry}\n />\n )}\n </View>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/AgentHistoryList.tsx","../src/components/readOnlyStore.ts","../src/components/AgentTranscript.tsx"],"names":["useMemo","CopyProvider","ThemeProvider","jsx","Alert","useCopy","useTheme","useAgentRuntime","useAgentSweep","useAgentProfile","history","useAgentHistory","useState","useCallback","Row","summaryTitle","formatDateTime","View","ActivityIndicator","Button","FlashList","jsxs","Pressable","Text","useAgentTranscript","useRef","ChatContextProvider","DefaultHeader","DisclosureBar","Centered","useReducedMotion","carousels","itemType"],"mappings":";;;;;;;;;;;;;AA2JO,SAAS,iBAAiB,KAAA,EAAyC;AACxE,EAAA,MAAM,IAAA,GAAOA,aAAA;AAAA,IACX,MACE,KAAA,CAAM,SAAA,GACF,EAAE,GAAG,KAAA,CAAM,IAAA,EAAM,iBAAA,EAAmB,KAAA,CAAM,SAAA,EAAU,GACpD,KAAA,CAAM,IAAA;AAAA,IACZ,CAAC,KAAA,CAAM,SAAA,EAAW,KAAA,CAAM,IAAI;AAAA,GAC9B;AACA,EAAA,sCACGC,oBAAA,EAAA,EAAa,MAAA,EAAQ,MAAM,MAAA,EAA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AAA,EAAA;AAAA,wBAAAd,cAAAA;AAAA,UAACoB,gBAAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO;AAAA,cACL,OAAO,MAAA,CAAO,IAAA;AAAA,cACd,QAAA,EAAU,KAAK,IAAA,CAAK,EAAA;AAAA,cACpB,SAAA,EAAW;AAAA,aACb;AAAA,YAEC,QAAA,EAAA,CAAA,CAAE,KAAA,CAAM,IAAA,GAAO,gBAAA,GAAmB,kBAAkB;AAAA;AAAA,SACvD;AAAA,QACC,KAAA,CAAM,IAAA,GAAO,IAAA,mBACZpB,cAAAA;AAAA,UAACgB,wBAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO,EAAE,UAAU,CAAA;AAAA,YACnB,OAAA,EAAQ,SAAA;AAAA,YACR,SAAS,KAAA,CAAM;AAAA;AAAA;AACjB;AAAA;AAAA,GAEJ;AAEJ","file":"history.cjs","sourcesContent":["// A person's past conversations with the agent (history): newest activity first, a page at a time as the person\n// scrolls, each row a conversation to open (the app shows `AgentTranscript`), to continue (pinned for its key, the\n// app shows the chat) or to delete (confirmed first, a policy the app can replace). Every part is a slot given the\n// kit's own as `Default`; the words come from `copy`. Built only on the public hooks.\n\nimport { FlashList } from '@shopify/flash-list';\nimport type {\n AgentConversation,\n AgentFailureReason,\n AgentKey,\n} from '@vinaverse/client/agent';\nimport {\n type ConversationSummary,\n summaryTitle,\n} from '@vinaverse/client/history';\nimport {\n type CopyOverrides,\n CopyProvider,\n formatDateTime,\n useCopy,\n} from '@vinaverse/react';\nimport { useAgentProfile, useAgentRuntime } from '@vinaverse/react/agent';\nimport { useAgentHistory } from '@vinaverse/react/history';\nimport {\n type ComponentType,\n type ReactElement,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n ActivityIndicator,\n Alert,\n Pressable,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { useAgentSweep } from '../platform.js';\nimport {\n type ColorSchemeSetting,\n type ThemeOverrides,\n ThemeProvider,\n useTheme,\n} from '../theme.js';\nimport { Button } from './Button.js';\n\ntype Slot<P> = ComponentType<P & { readonly Default: ComponentType<P> }>;\n\n/** One past conversation as the list draws it. */\nexport interface HistoryRowProps {\n readonly conversation: ConversationSummary;\n /** Its title: the object's when it is about one, else the app's (`titleOf`), else the server's. */\n readonly title: string;\n /** Its last activity, in the locale and zone (\"Oct 15, 2026, 9:30 AM\"). */\n readonly when: string;\n /** \"6 messages\" (`copy.historyMessages`). */\n readonly messages: string;\n /** It can only be read (`state: ended`); an open one can be continued. */\n readonly ended: boolean;\n /** The row's tap: the app opens the transcript. Absent when the app gave no `onOpen`. */\n readonly onOpen: (() => void) | undefined;\n /** Absent when the conversation ended, or the app gave no `onContinue`. */\n readonly onContinue: (() => void) | undefined;\n readonly onDelete: () => void;\n readonly deleting: boolean;\n /** The last delete of this row failed (`copy.historyDeleteFailed`). */\n readonly deleteFailed: boolean;\n}\nexport interface HistoryEmptyProps {\n readonly agentName: string;\n}\n/** The list could not be read: `off` when history is switched off for this tenant, mode or person. */\nexport interface HistoryFailureProps {\n readonly reason: AgentFailureReason;\n readonly onRetry: () => void;\n}\n/** The props the list gives its list component: FlashList's. */\nexport interface HistoryListProps {\n readonly data: readonly ConversationSummary[];\n readonly renderItem: (info: {\n item: ConversationSummary;\n index: number;\n }) => ReactElement | null;\n readonly keyExtractor: (item: ConversationSummary) => string;\n readonly onEndReached: () => void;\n readonly onRefresh: () => void;\n readonly refreshing: boolean;\n readonly ListFooterComponent: ReactElement | null;\n readonly ListEmptyComponent: ReactElement | null;\n readonly contentContainerStyle: object;\n}\n/** What a history warning is about: a delete the backend refused. */\nexport interface HistoryWarning {\n readonly code: 'delete_failed';\n}\n\nexport interface AgentHistoryListSlots {\n readonly Row?: Slot<HistoryRowProps>;\n readonly Empty?: Slot<HistoryEmptyProps>;\n readonly Failure?: Slot<HistoryFailureProps>;\n /** A list with FlashList's props. Default: FlashList. */\n readonly ListComponent?: ComponentType<HistoryListProps>;\n}\n\nexport interface AgentHistoryListProps {\n /** The person signed in (null for a guest): the key a conversation continues or is deleted under. */\n readonly subject: string | null;\n /** The app's side: `customer` or `business`. */\n readonly mode: string;\n /** The business acted for, with `business`. */\n readonly scope?: string | null;\n /** The agent, for a backend that serves more than one. */\n readonly agent?: string | null;\n /** The thread a continued conversation runs in; default `chat`. */\n readonly thread?: string;\n /** Conversations per page (1–50). Default 20. */\n readonly pageSize?: number;\n /**\n * The app's key for a past conversation (its modes in its own words): continue and delete go under it, and\n * `onContinue`'s live conversation is that key's. Keep it stable. Default: the server's mode and business.\n */\n readonly keyOf?: (conversation: ConversationSummary) => AgentKey;\n /** The app's title for a row; the object's title, when the conversation is about one, comes first. Keep it stable. */\n readonly titleOf?: (conversation: ConversationSummary) => string | null;\n /** A row was tapped: show its transcript (`AgentTranscript`). */\n readonly onOpen?: (conversation: ConversationSummary) => void;\n /**\n * \"Continue\" on an open conversation: it is pinned for its key (`useAgentHistory().keyOf`), and the app shows the\n * live conversation (`AgentChat` with that key, or `show()` on it).\n */\n readonly onContinue?: (\n conversation: ConversationSummary,\n live: AgentConversation,\n ) => void;\n /** Asks before deleting; default the platform's alert with the copy's words. False keeps the conversation. */\n readonly confirmDelete?: (\n conversation: ConversationSummary,\n ) => boolean | Promise<boolean>;\n /** A delete the backend refused, for the app's logger; the row says it too. */\n readonly onWarning?: (message: string, warning: HistoryWarning) => void;\n readonly components?: AgentHistoryListSlots;\n readonly locale?: string;\n readonly timeZone?: string;\n readonly copy?: CopyOverrides;\n readonly theme?: ThemeOverrides;\n readonly colorScheme?: ColorSchemeSetting;\n /** The agent's name until the status gives one. */\n readonly agentName?: string;\n readonly style?: StyleProp<ViewStyle>;\n readonly testID?: string;\n}\n\nexport function AgentHistoryList(props: AgentHistoryListProps): ReactNode {\n const copy = useMemo(\n () =>\n props.agentName\n ? { ...props.copy, agentFallbackName: props.agentName }\n : props.copy,\n [props.agentName, props.copy],\n );\n return (\n <CopyProvider locale={props.locale} copy={copy}>\n <ThemeProvider theme={props.theme} colorScheme={props.colorScheme}>\n <HistoryList {...props} />\n </ThemeProvider>\n </CopyProvider>\n );\n}\n\n/** The platform's alert: cancel keeps the conversation, so does dismissing it. */\nfunction alertConfirm(\n t: ReturnType<typeof useCopy>['t'],\n): () => Promise<boolean> {\n return () =>\n new Promise<boolean>((resolve) => {\n Alert.alert(\n t('historyDeleteTitle'),\n t('historyDeleteBody'),\n [\n { text: t('cancel'), style: 'cancel', onPress: () => resolve(false) },\n {\n text: t('historyDelete'),\n style: 'destructive',\n onPress: () => resolve(true),\n },\n ],\n { cancelable: true, onDismiss: () => resolve(false) },\n );\n });\n}\n\nfunction HistoryList(props: AgentHistoryListProps): ReactNode {\n const { t, locale, direction } = useCopy();\n const { colors, space } = useTheme();\n const runtime = useAgentRuntime();\n useAgentSweep(runtime);\n const { name } = useAgentProfile(t('agentFallbackName'), props.mode);\n const history = useAgentHistory({\n subject: props.subject,\n mode: props.mode,\n scope: props.scope ?? null,\n agent: props.agent ?? null,\n ...(props.thread === undefined ? {} : { thread: props.thread }),\n ...(props.pageSize === undefined ? {} : { pageSize: props.pageSize }),\n ...(props.keyOf ? { keyOf: props.keyOf } : {}),\n });\n const { state } = history;\n const [deleting, setDeleting] = useState<ReadonlySet<string>>(new Set());\n const [failed, setFailed] = useState<ReadonlySet<string>>(new Set());\n const { onOpen, onContinue, onWarning, confirmDelete, timeZone, titleOf } =\n props;\n // One function while the words are the same, so the rows keep theirs.\n const confirm = useMemo(\n () => confirmDelete ?? alertConfirm(t),\n [confirmDelete, t],\n );\n const remove = useCallback(\n async (conversation: ConversationSummary) => {\n if (!(await confirm(conversation))) return;\n mark(setDeleting, conversation.id, true);\n mark(setFailed, conversation.id, false);\n try {\n await history.remove(conversation);\n } catch (error) {\n mark(setFailed, conversation.id, true);\n onWarning?.(`Vinaverse history: delete failed: ${String(error)}`, {\n code: 'delete_failed',\n });\n } finally {\n mark(setDeleting, conversation.id, false);\n }\n },\n [confirm, history, onWarning],\n );\n const slots = props.components ?? {};\n const { Row, Empty, Failure, ListComponent } = slots;\n const renderItem = useCallback(\n ({ item }: { item: ConversationSummary }) => {\n const own: HistoryRowProps = {\n conversation: item,\n title: summaryTitle(item, titleOf?.(item)),\n when: formatDateTime(item.last_activity_at, locale, timeZone),\n messages: t('historyMessages', { count: item.message_count }),\n ended: item.state === 'ended',\n onOpen: onOpen ? () => onOpen(item) : undefined,\n onContinue:\n onContinue && item.state === 'open'\n ? () => onContinue(item, history.continue(item))\n : undefined,\n onDelete: () => void remove(item),\n deleting: deleting.has(item.id),\n deleteFailed: failed.has(item.id),\n };\n return Row ? (\n <Row {...own} Default={DefaultHistoryRow} />\n ) : (\n <DefaultHistoryRow {...own} />\n );\n },\n [\n Row,\n titleOf,\n locale,\n timeZone,\n t,\n onOpen,\n onContinue,\n history,\n remove,\n deleting,\n failed,\n ],\n );\n const empty =\n state.failure && state.conversations.length === 0 ? (\n <Centered>\n {Failure ? (\n <Failure\n reason={state.failure}\n onRetry={history.refresh}\n Default={DefaultHistoryFailure}\n />\n ) : (\n <DefaultHistoryFailure\n reason={state.failure}\n onRetry={history.refresh}\n />\n )}\n </Centered>\n ) : state.started && !state.loading ? (\n <Centered>\n {Empty ? (\n <Empty agentName={name} Default={DefaultHistoryEmpty} />\n ) : (\n <DefaultHistoryEmpty agentName={name} />\n )}\n </Centered>\n ) : null;\n const footer =\n state.loading && state.conversations.length > 0 ? (\n <View style={{ padding: space.md, alignItems: 'center' }}>\n <ActivityIndicator\n color={colors.textMuted}\n accessibilityLabel={t('loading')}\n />\n </View>\n ) : state.failure && state.conversations.length > 0 ? (\n <View style={{ padding: space.sm, alignItems: 'center' }}>\n <Button label={t('tryAgain')} variant=\"text\" onPress={history.retry} />\n </View>\n ) : null;\n const list: HistoryListProps = useMemo(\n () => ({\n data: state.conversations,\n renderItem,\n keyExtractor: (item) => item.id,\n onEndReached: history.loadMore,\n onRefresh: history.refresh,\n refreshing: state.loading && state.conversations.length === 0,\n ListFooterComponent: footer,\n ListEmptyComponent: empty,\n contentContainerStyle: { paddingVertical: space.sm },\n }),\n [state, renderItem, history, footer, empty, space.sm],\n );\n const List = ListComponent;\n return (\n <View\n testID={props.testID ?? 'vinaverse-history'}\n style={[\n { flex: 1, backgroundColor: colors.background, direction },\n props.style,\n ]}\n >\n {List ? <List {...list} /> : <FlashList {...list} />}\n </View>\n );\n}\n\n/** A set of ids with `id` in it or not, as a state update. */\nconst mark = (\n set: (f: (s: ReadonlySet<string>) => ReadonlySet<string>) => void,\n id: string,\n on: boolean,\n) =>\n set((s) => {\n const next = new Set(s);\n if (on) next.add(id);\n else next.delete(id);\n return next;\n });\n\nfunction Centered(props: { readonly children: ReactNode }) {\n const { space } = useTheme();\n return (\n <View\n style={{\n alignItems: 'center',\n justifyContent: 'center',\n padding: space.xl,\n }}\n >\n {props.children}\n </View>\n );\n}\n\n/** A conversation: its title, when it was last active, how many messages; continue when it can be, delete. */\nexport function DefaultHistoryRow(props: HistoryRowProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font, radius } = useTheme();\n const { conversation } = props;\n const detail = [\n props.when,\n props.messages,\n props.ended ? t('historyEnded') : null,\n ]\n .filter(Boolean)\n .join(' · ');\n return (\n <View\n style={{\n marginHorizontal: space.lg,\n marginVertical: space.xs,\n borderRadius: radius.lg,\n backgroundColor: colors.surface,\n opacity: props.deleting ? 0.6 : 1,\n }}\n testID={`vinaverse-history-${conversation.id}`}\n >\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={`${props.title}. ${detail}`}\n accessibilityState={{ disabled: !props.onOpen || props.deleting }}\n disabled={!props.onOpen || props.deleting}\n onPress={props.onOpen}\n style={{ paddingHorizontal: space.md, paddingTop: space.md }}\n >\n <Text\n numberOfLines={2}\n style={{\n color: colors.text,\n fontSize: font.size.md,\n fontWeight: '600',\n ...(font.family ? { fontFamily: font.family } : {}),\n }}\n >\n {props.title}\n </Text>\n <Text\n style={{\n color: colors.textMuted,\n fontSize: font.size.sm,\n marginTop: space.xxs,\n }}\n >\n {detail}\n </Text>\n </Pressable>\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: space.xs,\n paddingHorizontal: space.xs,\n }}\n >\n {props.onContinue ? (\n <Button\n label={t('historyContinue')}\n variant=\"text\"\n disabled={props.deleting}\n onPress={props.onContinue}\n />\n ) : null}\n <Button\n label={t('historyDelete')}\n variant=\"text\"\n busy={props.deleting}\n onPress={props.onDelete}\n />\n {props.deleteFailed ? (\n <Text style={{ color: colors.danger, fontSize: font.size.xs }}>\n {t('historyDeleteFailed')}\n </Text>\n ) : null}\n </View>\n </View>\n );\n}\n\nexport function DefaultHistoryEmpty(props: HistoryEmptyProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n return (\n <View style={{ alignItems: 'center', gap: space.sm }}>\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.lg,\n fontWeight: '600',\n textAlign: 'center',\n }}\n >\n {t('historyEmpty')}\n </Text>\n <Text\n style={{\n color: colors.textMuted,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t('historyEmptyBody', { agent: props.agentName })}\n </Text>\n </View>\n );\n}\n\n/** The list could not be read: history is off, or try again. */\nexport function DefaultHistoryFailure(props: HistoryFailureProps): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n const off = props.reason === 'off';\n return (\n <View\n accessibilityRole=\"alert\"\n style={{ alignItems: 'center', gap: space.md }}\n >\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t(off ? 'historyOff' : 'historyFailed')}\n </Text>\n {off ? null : (\n <Button\n label={t('tryAgain')}\n variant=\"primary\"\n onPress={props.onRetry}\n />\n )}\n </View>\n );\n}\n","// A past conversation as the chat's parts read one: a `ChatStore` over history's items that never changes and takes\n// no action (every action a no-op, nothing streams), so the bubbles and cards draw a transcript exactly as they draw\n// a live conversation restored from the device, inert.\nimport type {\n ConversationView,\n TimelineItem,\n} from '@vinaverse/client/conversation';\nimport type { ChatStore } from '../context.js';\n\nconst none = () => () => undefined;\n\nexport function readOnlyStore(view: {\n readonly items: readonly TimelineItem[];\n readonly conversationId: string;\n readonly agentName: string | null;\n readonly agentAvatar: string | null;\n}): ChatStore {\n const snapshot: ConversationView = {\n status: 'ready',\n conversationId: view.conversationId,\n banner: null,\n next: null,\n agent: { name: view.agentName, avatarUrl: view.agentAvatar },\n welcome: null,\n disclosure: null,\n takeover: null,\n items: view.items,\n activity: [],\n responding: false,\n openQuestion: null,\n answersNeedWebSocket: false,\n turnsLeft: null,\n history: 'restored',\n };\n return {\n getSnapshot: () => snapshot,\n subscribe: none,\n getStreaming: () => null,\n subscribeStreaming: none,\n send: () => '',\n retry: () => null,\n retryTurn: () => null,\n cancel: () => undefined,\n answer: () => '',\n cardAction: () => '',\n decideProposal: () => Promise.resolve(null),\n checkLink: () => false,\n continueHere: () => Promise.resolve(),\n setForeground: () => undefined,\n start: () => undefined,\n };\n}\n","// A past conversation read back (history): its messages and the cards their turns drew, newest page first, earlier\n// pages above as the person scrolls up or asks. Drawn by the chat's own parts over a read-only store, so a bubble and\n// a card look as they looked live, and restored cards take nothing: no proposal is confirmed from history, no link\n// opens, no answer is given. A refusal and a proposal's outcome are shown as they were. \"Continue\" pins the\n// conversation for the app's key and hands the app the live conversation to show. Built only on the public hooks.\n\nimport { FlashList } from '@shopify/flash-list';\nimport type {\n AgentConversation,\n AgentFailureReason,\n AgentKey,\n} from '@vinaverse/client/agent';\nimport type { CardItem, TimelineItem } from '@vinaverse/client/conversation';\nimport { type CopyOverrides, CopyProvider, useCopy } from '@vinaverse/react';\nimport { useAgentProfile, useAgentRuntime } from '@vinaverse/react/agent';\nimport { useAgentTranscript } from '@vinaverse/react/history';\nimport {\n type ComponentType,\n type ReactElement,\n type ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport {\n ActivityIndicator,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport {\n ChatContextProvider,\n type ChatHandlers,\n type ChatSlots,\n type ImagePolicy,\n} from '../context.js';\nimport { useReducedMotion } from '../platform.js';\nimport {\n type ColorSchemeSetting,\n type ThemeOverrides,\n ThemeProvider,\n useTheme,\n} from '../theme.js';\nimport { Button } from './Button.js';\nimport { DefaultHeader } from './ChatHeader.js';\nimport { DisclosureBar } from './DisclosureBar.js';\nimport { carousels, itemType, Row } from './MessageList.js';\nimport { readOnlyStore } from './readOnlyStore.js';\nimport type { HeaderProps } from './types.js';\n\ntype Slot<P> = ComponentType<P & { readonly Default: ComponentType<P> }>;\n\n/** The transcript could not be read: `gone` for one deleted, expired or never theirs (no retry helps). */\nexport interface TranscriptFailureProps {\n readonly reason: AgentFailureReason;\n readonly gone: boolean;\n readonly onRetry: () => void;\n}\n\n/** The props the transcript gives its list: FlashList's, anchored at the bottom, earlier pages asked for at the top. */\nexport interface TranscriptListProps {\n readonly data: readonly TimelineItem[];\n readonly renderItem: (info: {\n item: TimelineItem;\n index: number;\n }) => ReactElement | null;\n readonly keyExtractor: (item: TimelineItem) => string;\n readonly getItemType: (item: TimelineItem) => string;\n readonly maintainVisibleContentPosition: {\n readonly startRenderingFromBottom: boolean;\n readonly animateAutoScrollToBottom: boolean;\n };\n readonly onStartReached: () => void;\n readonly ListHeaderComponent: ReactElement | null;\n readonly contentContainerStyle: object;\n}\n\nexport interface AgentTranscriptSlots\n extends Pick<ChatSlots, 'MessageBubble' | 'Image' | 'CardGroup' | 'cards'> {\n readonly Header?: ComponentType<HeaderProps>;\n readonly Failure?: Slot<TranscriptFailureProps>;\n /** A list with FlashList's props. Default: FlashList. */\n readonly ListComponent?: ComponentType<TranscriptListProps>;\n}\n\nexport interface AgentTranscriptProps {\n readonly conversationId: string;\n /** Items per page. Default 30. */\n readonly pageSize?: number;\n /**\n * \"Continue\" under the transcript, with both: the key the conversation goes on under (`useAgentHistory().keyOf`)\n * and what the app does with the live conversation (show it: `AgentChat` with that key).\n */\n readonly agentKey?: AgentKey;\n readonly onContinue?: (conversation: AgentConversation) => void;\n /** The conversation ended (its summary's `state`): no \"Continue\", as the list offers it only for an open one. */\n readonly ended?: boolean;\n readonly components?: AgentTranscriptSlots;\n /** Which card photos are drawn, as on the chat. Keep stable. */\n readonly imagePolicy?: ImagePolicy;\n readonly prefetchImage?: ChatHandlers['prefetchImage'];\n readonly locale?: string;\n readonly timeZone?: string;\n readonly copy?: CopyOverrides;\n readonly theme?: ThemeOverrides;\n readonly colorScheme?: ColorSchemeSetting;\n /** The agent's name and picture until the status gives them. */\n readonly agentName?: string;\n readonly agentAvatar?: string;\n /** Hide the header (a screen that draws its own); the disclosure stays. */\n readonly hideHeader?: boolean;\n readonly style?: StyleProp<ViewStyle>;\n readonly testID?: string;\n}\n\nexport function AgentTranscript(props: AgentTranscriptProps): ReactNode {\n const copy = useMemo(\n () =>\n props.agentName\n ? { ...props.copy, agentFallbackName: props.agentName }\n : props.copy,\n [props.agentName, props.copy],\n );\n return (\n <CopyProvider locale={props.locale} copy={copy}>\n <ThemeProvider theme={props.theme} colorScheme={props.colorScheme}>\n <Transcript {...props} />\n </ThemeProvider>\n </CopyProvider>\n );\n}\n\nconst EMPTY_SLOTS: AgentTranscriptSlots = {};\n\nfunction Transcript(props: AgentTranscriptProps): ReactNode {\n const { t, direction } = useCopy();\n const { colors, space } = useTheme();\n const runtime = useAgentRuntime();\n const profile = useAgentProfile(t('agentFallbackName'));\n const name = profile.name;\n const avatar = props.agentAvatar ?? profile.avatarUrl;\n const transcript = useAgentTranscript(props.conversationId, {\n ...(props.pageSize === undefined ? {} : { pageSize: props.pageSize }),\n });\n const { state } = transcript;\n const slots = props.components ?? EMPTY_SLOTS;\n const { Header, Failure, ListComponent } = slots;\n // The chat's slots among them (bubble, image, carousel, cards), one object while the app's is the same.\n const chatSlots = useMemo<ChatSlots>(() => {\n const { Header: _h, Failure: _f, ListComponent: _l, ...rest } = slots;\n return rest;\n }, [slots]);\n // The parts read the conversation through the chat context: a read-only store over the page read so far.\n const store = useMemo(\n () =>\n readOnlyStore({\n items: state.items,\n conversationId: props.conversationId,\n agentName: name,\n agentAvatar: avatar,\n }),\n [state.items, props.conversationId, name, avatar],\n );\n const handlers = useRef<ChatHandlers>({});\n handlers.current = {\n ...(props.prefetchImage ? { prefetchImage: props.prefetchImage } : {}),\n };\n const value = useMemo(\n () => ({\n store,\n handlers,\n slots: chatSlots,\n agentAvatar: props.agentAvatar,\n timeZone: props.timeZone,\n failureAction: null,\n starters: undefined,\n imagePolicy: props.imagePolicy,\n }),\n [store, chatSlots, props.agentAvatar, props.timeZone, props.imagePolicy],\n );\n const header = { name, avatarUrl: avatar, takeoverBy: null };\n const gone =\n state.failure === 'not_found' ||\n state.failure === 'expired' ||\n state.failure === 'ended';\n const onContinue = props.onContinue;\n const agentKey = props.agentKey;\n return (\n <ChatContextProvider value={value}>\n <View\n testID={props.testID ?? 'vinaverse-transcript'}\n style={[\n { flex: 1, backgroundColor: colors.background, direction },\n props.style,\n ]}\n >\n {props.hideHeader ? null : Header ? (\n <Header {...header} Default={DefaultHeader} />\n ) : (\n <DefaultHeader {...header} />\n )}\n <DisclosureBar />\n <View style={{ flex: 1 }}>\n {state.failure && state.items.length === 0 ? (\n <Centered>\n {Failure ? (\n <Failure\n reason={state.failure}\n gone={gone}\n onRetry={transcript.load}\n Default={DefaultTranscriptFailure}\n />\n ) : (\n <DefaultTranscriptFailure\n reason={state.failure}\n gone={gone}\n onRetry={transcript.load}\n />\n )}\n </Centered>\n ) : (\n <TranscriptList\n items={state.items}\n loading={state.loading}\n more={!state.done && state.started && !state.loading}\n failed={state.failure !== null}\n onEarlier={transcript.loadEarlier}\n onRetry={transcript.retry}\n ListComponent={ListComponent}\n grouped={chatSlots.CardGroup !== undefined}\n />\n )}\n </View>\n {onContinue && agentKey && !gone && props.ended !== true ? (\n <View style={{ padding: space.lg }}>\n <Button\n label={t('historyContinue')}\n variant=\"primary\"\n onPress={() =>\n onContinue(runtime.continue(agentKey, props.conversationId))\n }\n />\n </View>\n ) : null}\n </View>\n </ChatContextProvider>\n );\n}\n\nfunction authorOf(item: TimelineItem | undefined): string | null {\n return item?.type === 'message' ? item.role : null;\n}\n\nfunction TranscriptList(props: {\n readonly items: readonly TimelineItem[];\n readonly loading: boolean;\n /** Earlier pages remain, and none is being read. */\n readonly more: boolean;\n /** The last page asked for (an earlier one, or the newest again) could not be read. */\n readonly failed: boolean;\n readonly onEarlier: () => void;\n readonly onRetry: () => void;\n readonly ListComponent: ComponentType<TranscriptListProps> | undefined;\n readonly grouped: boolean;\n}) {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n const reducedMotion = useReducedMotion();\n const { items, grouped } = props;\n const runsRef = useRef<ReadonlyMap<string, readonly CardItem[]>>(new Map());\n const grouping = useMemo(\n () => (grouped ? carousels(items, runsRef.current) : null),\n [items, grouped],\n );\n runsRef.current = grouping?.runs ?? new Map();\n const itemsRef = useRef(items);\n itemsRef.current = items;\n const groupingRef = useRef(grouping);\n groupingRef.current = grouping;\n const renderItem = useCallback(\n ({ item, index }: { item: TimelineItem; index: number }) => (\n <Row\n item={item}\n showAuthor={authorOf(item) !== authorOf(itemsRef.current[index - 1])}\n run={groupingRef.current?.runs.get(item.key)}\n inside={groupingRef.current?.inside.has(item.key) === true}\n />\n ),\n [],\n );\n const header = props.loading ? (\n <View style={{ padding: space.md, alignItems: 'center' }}>\n <ActivityIndicator\n color={colors.textMuted}\n accessibilityLabel={t('loading')}\n />\n </View>\n ) : props.failed ? (\n // Said where the earlier messages would be, with a way to ask again (the same cursor, or the newest page).\n <View\n accessibilityRole=\"alert\"\n style={{\n padding: space.sm,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: space.sm,\n }}\n >\n <Text style={{ color: colors.textMuted, fontSize: font.size.sm }}>\n {t('transcriptEarlier')}\n </Text>\n <Button\n label={t('tryAgain')}\n hint={t('transcriptEarlier')}\n variant=\"text\"\n onPress={props.onRetry}\n />\n </View>\n ) : props.more ? (\n <View style={{ padding: space.sm, alignItems: 'center' }}>\n <Button\n label={t('transcriptEarlier')}\n variant=\"text\"\n onPress={props.onEarlier}\n />\n </View>\n ) : null;\n const list: TranscriptListProps = useMemo(\n () => ({\n data: items,\n renderItem,\n keyExtractor: (item) => item.key,\n getItemType: itemType,\n maintainVisibleContentPosition: {\n startRenderingFromBottom: true,\n animateAutoScrollToBottom: !reducedMotion,\n },\n onStartReached: props.onEarlier,\n ListHeaderComponent: header,\n contentContainerStyle: { paddingVertical: space.sm },\n }),\n [items, renderItem, reducedMotion, props.onEarlier, header, space.sm],\n );\n const List = props.ListComponent;\n return List ? <List {...list} /> : <FlashList {...list} />;\n}\n\nfunction Centered(props: { readonly children: ReactNode }) {\n const { space } = useTheme();\n return (\n <View\n style={{\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: space.xl,\n }}\n >\n {props.children}\n </View>\n );\n}\n\n/** The transcript could not be read: gone for good, or try again. */\nexport function DefaultTranscriptFailure(\n props: TranscriptFailureProps,\n): ReactNode {\n const { t } = useCopy();\n const { colors, space, font } = useTheme();\n return (\n <View\n accessibilityRole=\"alert\"\n style={{ alignItems: 'center', gap: space.md }}\n >\n <Text\n style={{\n color: colors.text,\n fontSize: font.size.md,\n textAlign: 'center',\n }}\n >\n {t(props.gone ? 'transcriptGone' : 'transcriptFailed')}\n </Text>\n {props.gone ? null : (\n <Button\n label={t('tryAgain')}\n variant=\"primary\"\n onPress={props.onRetry}\n />\n )}\n </View>\n );\n}\n"]}
|
package/dist/history.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AgentRuntimeProvider, UseAgentConversation, useAgentConversation, useAgentFeatures, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState } from '@vinaverse/react/agent';
|
|
2
2
|
export { UseAgentHistory, UseAgentHistoryOptions, UseAgentTranscript, useAgentHistory, useAgentTranscript } from '@vinaverse/react/history';
|
|
3
|
-
import { d as ChatSlots, H as HeaderProps, I as ImagePolicy, c as ChatHandlers } from './context-
|
|
4
|
-
export { C as CardCarousel } from './context-
|
|
5
|
-
import { AgentConversation, AgentFailureReason
|
|
3
|
+
import { d as ChatSlots, H as HeaderProps, I as ImagePolicy, c as ChatHandlers } from './context-B4ctXjm5.cjs';
|
|
4
|
+
export { C as CardCarousel } from './context-B4ctXjm5.cjs';
|
|
5
|
+
import { AgentKey, AgentConversation, AgentFailureReason } from '@vinaverse/client/agent';
|
|
6
6
|
import { ConversationSummary } from '@vinaverse/client/history';
|
|
7
7
|
import { CopyOverrides } from '@vinaverse/react';
|
|
8
8
|
import { ComponentType, ReactElement, ReactNode } from 'react';
|
|
@@ -18,6 +18,8 @@ type Slot$1<P> = ComponentType<P & {
|
|
|
18
18
|
/** One past conversation as the list draws it. */
|
|
19
19
|
interface HistoryRowProps {
|
|
20
20
|
readonly conversation: ConversationSummary;
|
|
21
|
+
/** Its title: the object's when it is about one, else the app's (`titleOf`), else the server's. */
|
|
22
|
+
readonly title: string;
|
|
21
23
|
/** Its last activity, in the locale and zone ("Oct 15, 2026, 9:30 AM"). */
|
|
22
24
|
readonly when: string;
|
|
23
25
|
/** "6 messages" (`copy.historyMessages`). */
|
|
@@ -80,6 +82,13 @@ interface AgentHistoryListProps {
|
|
|
80
82
|
readonly thread?: string;
|
|
81
83
|
/** Conversations per page (1–50). Default 20. */
|
|
82
84
|
readonly pageSize?: number;
|
|
85
|
+
/**
|
|
86
|
+
* The app's key for a past conversation (its modes in its own words): continue and delete go under it, and
|
|
87
|
+
* `onContinue`'s live conversation is that key's. Keep it stable. Default: the server's mode and business.
|
|
88
|
+
*/
|
|
89
|
+
readonly keyOf?: (conversation: ConversationSummary) => AgentKey;
|
|
90
|
+
/** The app's title for a row; the object's title, when the conversation is about one, comes first. Keep it stable. */
|
|
91
|
+
readonly titleOf?: (conversation: ConversationSummary) => string | null;
|
|
83
92
|
/** A row was tapped: show its transcript (`AgentTranscript`). */
|
|
84
93
|
readonly onOpen?: (conversation: ConversationSummary) => void;
|
|
85
94
|
/**
|
package/dist/history.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AgentRuntimeProvider, UseAgentConversation, useAgentConversation, useAgentFeatures, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState } from '@vinaverse/react/agent';
|
|
2
2
|
export { UseAgentHistory, UseAgentHistoryOptions, UseAgentTranscript, useAgentHistory, useAgentTranscript } from '@vinaverse/react/history';
|
|
3
|
-
import { d as ChatSlots, H as HeaderProps, I as ImagePolicy, c as ChatHandlers } from './context-
|
|
4
|
-
export { C as CardCarousel } from './context-
|
|
5
|
-
import { AgentConversation, AgentFailureReason
|
|
3
|
+
import { d as ChatSlots, H as HeaderProps, I as ImagePolicy, c as ChatHandlers } from './context-B4ctXjm5.js';
|
|
4
|
+
export { C as CardCarousel } from './context-B4ctXjm5.js';
|
|
5
|
+
import { AgentKey, AgentConversation, AgentFailureReason } from '@vinaverse/client/agent';
|
|
6
6
|
import { ConversationSummary } from '@vinaverse/client/history';
|
|
7
7
|
import { CopyOverrides } from '@vinaverse/react';
|
|
8
8
|
import { ComponentType, ReactElement, ReactNode } from 'react';
|
|
@@ -18,6 +18,8 @@ type Slot$1<P> = ComponentType<P & {
|
|
|
18
18
|
/** One past conversation as the list draws it. */
|
|
19
19
|
interface HistoryRowProps {
|
|
20
20
|
readonly conversation: ConversationSummary;
|
|
21
|
+
/** Its title: the object's when it is about one, else the app's (`titleOf`), else the server's. */
|
|
22
|
+
readonly title: string;
|
|
21
23
|
/** Its last activity, in the locale and zone ("Oct 15, 2026, 9:30 AM"). */
|
|
22
24
|
readonly when: string;
|
|
23
25
|
/** "6 messages" (`copy.historyMessages`). */
|
|
@@ -80,6 +82,13 @@ interface AgentHistoryListProps {
|
|
|
80
82
|
readonly thread?: string;
|
|
81
83
|
/** Conversations per page (1–50). Default 20. */
|
|
82
84
|
readonly pageSize?: number;
|
|
85
|
+
/**
|
|
86
|
+
* The app's key for a past conversation (its modes in its own words): continue and delete go under it, and
|
|
87
|
+
* `onContinue`'s live conversation is that key's. Keep it stable. Default: the server's mode and business.
|
|
88
|
+
*/
|
|
89
|
+
readonly keyOf?: (conversation: ConversationSummary) => AgentKey;
|
|
90
|
+
/** The app's title for a row; the object's title, when the conversation is about one, comes first. Keep it stable. */
|
|
91
|
+
readonly titleOf?: (conversation: ConversationSummary) => string | null;
|
|
83
92
|
/** A row was tapped: show its transcript (`AgentTranscript`). */
|
|
84
93
|
readonly onOpen?: (conversation: ConversationSummary) => void;
|
|
85
94
|
/**
|
package/dist/history.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Button, ChatContextProvider, DefaultHeader, DisclosureBar, carousels, Row, itemType } from './chunk-
|
|
2
|
-
export { CardCarousel } from './chunk-
|
|
3
|
-
import { ThemeProvider, useTheme, useAgentSweep, useReducedMotion } from './chunk-
|
|
4
|
-
export { ThemeProvider, useTheme } from './chunk-
|
|
1
|
+
import { Button, ChatContextProvider, DefaultHeader, DisclosureBar, carousels, Row, itemType } from './chunk-QSMMC4RZ.js';
|
|
2
|
+
export { CardCarousel } from './chunk-QSMMC4RZ.js';
|
|
3
|
+
import { ThemeProvider, useTheme, useAgentSweep, useReducedMotion } from './chunk-35A77CNF.js';
|
|
4
|
+
export { ThemeProvider, useTheme } from './chunk-35A77CNF.js';
|
|
5
5
|
import { useAgentRuntime, useAgentProfile } from '@vinaverse/react/agent';
|
|
6
6
|
export { AgentRuntimeProvider, useAgentConversation, useAgentFeatures, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState } from '@vinaverse/react/agent';
|
|
7
7
|
import { useAgentHistory, useAgentTranscript } from '@vinaverse/react/history';
|
|
8
8
|
export { useAgentHistory, useAgentTranscript } from '@vinaverse/react/history';
|
|
9
9
|
import { FlashList } from '@shopify/flash-list';
|
|
10
|
+
import { summaryTitle } from '@vinaverse/client/history';
|
|
10
11
|
import { CopyProvider, useCopy, formatDateTime } from '@vinaverse/react';
|
|
11
12
|
import { useMemo, useState, useCallback, useRef } from 'react';
|
|
12
13
|
import { View, ActivityIndicator, Pressable, Text, Alert } from 'react-native';
|
|
@@ -41,19 +42,20 @@ function HistoryList(props) {
|
|
|
41
42
|
const { colors, space } = useTheme();
|
|
42
43
|
const runtime = useAgentRuntime();
|
|
43
44
|
useAgentSweep(runtime);
|
|
44
|
-
const { name } = useAgentProfile(t("agentFallbackName"));
|
|
45
|
+
const { name } = useAgentProfile(t("agentFallbackName"), props.mode);
|
|
45
46
|
const history = useAgentHistory({
|
|
46
47
|
subject: props.subject,
|
|
47
48
|
mode: props.mode,
|
|
48
49
|
scope: props.scope ?? null,
|
|
49
50
|
agent: props.agent ?? null,
|
|
50
51
|
...props.thread === void 0 ? {} : { thread: props.thread },
|
|
51
|
-
...props.pageSize === void 0 ? {} : { pageSize: props.pageSize }
|
|
52
|
+
...props.pageSize === void 0 ? {} : { pageSize: props.pageSize },
|
|
53
|
+
...props.keyOf ? { keyOf: props.keyOf } : {}
|
|
52
54
|
});
|
|
53
55
|
const { state } = history;
|
|
54
56
|
const [deleting, setDeleting] = useState(/* @__PURE__ */ new Set());
|
|
55
57
|
const [failed, setFailed] = useState(/* @__PURE__ */ new Set());
|
|
56
|
-
const { onOpen, onContinue, onWarning, confirmDelete, timeZone } = props;
|
|
58
|
+
const { onOpen, onContinue, onWarning, confirmDelete, timeZone, titleOf } = props;
|
|
57
59
|
const confirm = useMemo(
|
|
58
60
|
() => confirmDelete ?? alertConfirm(t),
|
|
59
61
|
[confirmDelete, t]
|
|
@@ -82,6 +84,7 @@ function HistoryList(props) {
|
|
|
82
84
|
({ item }) => {
|
|
83
85
|
const own = {
|
|
84
86
|
conversation: item,
|
|
87
|
+
title: summaryTitle(item, titleOf?.(item)),
|
|
85
88
|
when: formatDateTime(item.last_activity_at, locale, timeZone),
|
|
86
89
|
messages: t("historyMessages", { count: item.message_count }),
|
|
87
90
|
ended: item.state === "ended",
|
|
@@ -95,6 +98,7 @@ function HistoryList(props) {
|
|
|
95
98
|
},
|
|
96
99
|
[
|
|
97
100
|
Row2,
|
|
101
|
+
titleOf,
|
|
98
102
|
locale,
|
|
99
103
|
timeZone,
|
|
100
104
|
t,
|
|
@@ -199,7 +203,7 @@ function DefaultHistoryRow(props) {
|
|
|
199
203
|
Pressable,
|
|
200
204
|
{
|
|
201
205
|
accessibilityRole: "button",
|
|
202
|
-
accessibilityLabel: `${
|
|
206
|
+
accessibilityLabel: `${props.title}. ${detail}`,
|
|
203
207
|
accessibilityState: { disabled: !props.onOpen || props.deleting },
|
|
204
208
|
disabled: !props.onOpen || props.deleting,
|
|
205
209
|
onPress: props.onOpen,
|
|
@@ -215,7 +219,7 @@ function DefaultHistoryRow(props) {
|
|
|
215
219
|
fontWeight: "600",
|
|
216
220
|
...font.family ? { fontFamily: font.family } : {}
|
|
217
221
|
},
|
|
218
|
-
children:
|
|
222
|
+
children: props.title
|
|
219
223
|
}
|
|
220
224
|
),
|
|
221
225
|
/* @__PURE__ */ jsx(
|