@gemies/sdk 9.2.0 → 10.0.0

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +9 -6
  3. package/package.json +4 -11
  4. package/src/accounts.ts +7 -1
  5. package/src/ask-eager.ts +0 -2
  6. package/src/ask-text.ts +0 -1
  7. package/src/ask.ts +0 -1
  8. package/src/components/AmbientField.tsx +13 -2
  9. package/src/components/ComposerDropZone.tsx +20 -4
  10. package/src/components/ComposerSuggestions.tsx +9 -2
  11. package/src/components/GemieActivityLine.tsx +11 -5
  12. package/src/components/GemieBetweenGemies.tsx +23 -10
  13. package/src/components/GemieChatContent.tsx +46 -23
  14. package/src/components/GemieChatScreen.tsx +7 -4
  15. package/src/components/GemieChatSheet.tsx +6 -2
  16. package/src/components/GemieComposer.tsx +17 -7
  17. package/src/components/GemieGroupWelcome.tsx +16 -2
  18. package/src/components/GemieRecentConversations.tsx +13 -10
  19. package/src/components/GemieSharedConversation.tsx +38 -6
  20. package/src/components/GemieWelcomeMessage.tsx +23 -7
  21. package/src/components/IdentityMark.tsx +6 -12
  22. package/src/components/PlanPreviewCard.tsx +18 -7
  23. package/src/components/QuestionCard.tsx +6 -2
  24. package/src/components/ReplyMarkdown.tsx +32 -6
  25. package/src/components/RichBlocks.tsx +20 -15
  26. package/src/components/accounts/GemieAccountGrants.tsx +27 -10
  27. package/src/components/accounts/GemieConnectedAccounts.tsx +87 -51
  28. package/src/components/canvas/CanvasComponent.tsx +6 -2
  29. package/src/components/canvas/DashboardRenderer.tsx +25 -8
  30. package/src/components/canvas/DeckRenderer.tsx +23 -6
  31. package/src/components/canvas/FormRenderer.tsx +8 -3
  32. package/src/components/connectors/ConnectorLogo.tsx +15 -9
  33. package/src/components/connectors/GemieConnectedConnectors.tsx +51 -25
  34. package/src/components/connectors/GemieConnectorsStore.tsx +99 -41
  35. package/src/components/connectors/GrantSwitchRow.tsx +18 -5
  36. package/src/components/thought/ThoughtPanel.tsx +26 -12
  37. package/src/components/thought/ToolStep.tsx +14 -6
  38. package/src/components/thread/AgentResultCard.tsx +10 -4
  39. package/src/components/thread/AgentTaskCard.tsx +8 -3
  40. package/src/components/thread/ApprovalCard.tsx +6 -2
  41. package/src/components/thread/ChatBubble.tsx +66 -25
  42. package/src/components/thread/GemieThread.tsx +25 -8
  43. package/src/components/thread/ThreadRow.tsx +20 -15
  44. package/src/components/thread/ThreadSearch.tsx +27 -10
  45. package/src/components/thread/ThreadSkeleton.tsx +12 -6
  46. package/src/components/thread/ToolResultCard.tsx +10 -4
  47. package/src/components/thread/TurnAttachments.tsx +17 -8
  48. package/src/components/voice/VoiceControls.tsx +9 -6
  49. package/src/connectors.ts +15 -2
  50. package/src/hooks/useChatVoice.ts +2 -10
  51. package/src/hooks/useMessageReactions.ts +5 -5
  52. package/src/hooks/useThoughtScope.ts +9 -8
  53. package/src/index.ts +2 -3
  54. package/src/lib/tool-call-status.ts +1 -1
  55. package/src/lib/utils.ts +1 -8
  56. package/src/realtime/react.tsx +9 -9
  57. package/src/realtime/reread.ts +28 -0
  58. package/src/realtime/store.ts +123 -0
  59. package/src/runtime/agents.ts +46 -27
  60. package/src/runtime/collections.ts +35 -136
  61. package/src/runtime/connected-accounts.ts +175 -88
  62. package/src/runtime/connectors.ts +244 -127
  63. package/src/runtime/conversations.ts +181 -607
  64. package/src/runtime/data/answer.ts +76 -0
  65. package/src/runtime/data/collections.ts +168 -0
  66. package/src/runtime/data/conversations.ts +626 -0
  67. package/src/runtime/data/reactions.ts +29 -0
  68. package/src/runtime/data/read.ts +37 -0
  69. package/src/runtime/data/threads.ts +149 -0
  70. package/src/runtime/index.ts +72 -8
  71. package/src/runtime/model.ts +0 -2
  72. package/src/runtime/routes.ts +2 -2
  73. package/src/runtime/sharing.ts +69 -56
  74. package/src/runtime/types.ts +8 -16
  75. package/src/runtime/use-bound-action.ts +27 -0
  76. package/src/runtime/use-conversation-stream.ts +8 -31
  77. package/src/runtime/use-conversation-thread.ts +40 -51
  78. package/src/runtime/use-gemie-thread.ts +32 -43
  79. package/src/runtime/use-start-conversation.ts +14 -15
  80. package/src/runtime/use-thread-history.ts +26 -36
  81. package/src/runtime/use-thread-search.ts +29 -76
  82. package/src/text.ts +0 -1
  83. package/src/voice.ts +0 -1
  84. package/src/components/Image.tsx +0 -12
  85. package/src/realtime/cache.ts +0 -257
  86. package/src/runtime/conversation-dates.ts +0 -31
  87. package/src/runtime/query-keys.ts +0 -66
  88. package/src/runtime/reaction-cache.ts +0 -45
@@ -10,7 +10,7 @@ import { Loading } from '@oxy.so/bloom/loading';
10
10
  import { useTheme } from '@oxy.so/bloom/theme';
11
11
  import { Muted } from '@oxy.so/bloom/typography';
12
12
  import type { ReactNode } from 'react';
13
- import { ScrollView, View } from 'react-native';
13
+ import { ScrollView, View, StyleSheet } from 'react-native';
14
14
 
15
15
  /**
16
16
  * One execution row: a tool call, its state, and — expanded — what went in
@@ -79,7 +79,7 @@ export function ToolStep({
79
79
  subtitle={description}
80
80
  destructive={status === 'error'}
81
81
  trailing={
82
- <View className="flex-row items-center gap-1.5">
82
+ <View style={styles.trailing}>
83
83
  {statusWord === null ? null : <Muted>{statusWord}</Muted>}
84
84
  <Chevron size="sm" fill={colors.textSecondary} />
85
85
  </View>
@@ -90,11 +90,11 @@ export function ToolStep({
90
90
  />
91
91
 
92
92
  {expanded ? (
93
- <View className="gap-2 pb-2">
93
+ <View style={styles.details}>
94
94
  {input.length > 0 || output.length > 0 ? (
95
95
  <ScrollView
96
- className="max-h-[200px]"
97
- contentContainerClassName="gap-2"
96
+ style={styles.detailsScroll}
97
+ contentContainerStyle={styles.detailsContent}
98
98
  nestedScrollEnabled
99
99
  >
100
100
  {input.length > 0 ? (
@@ -118,7 +118,7 @@ export function ToolStep({
118
118
  </ScrollView>
119
119
  ) : null}
120
120
  {chips.length > 0 ? (
121
- <View className="flex-row flex-wrap gap-1.5">
121
+ <View style={styles.chips}>
122
122
  {chips.map((source) => (
123
123
  <Chip key={source.url} size="sm" leadingIcon={RiGlobalLine}>
124
124
  {source.domain}
@@ -132,3 +132,11 @@ export function ToolStep({
132
132
  </View>
133
133
  );
134
134
  }
135
+
136
+ const styles = StyleSheet.create({
137
+ trailing: { flexDirection: 'row', alignItems: 'center', gap: 6 },
138
+ details: { gap: 8, paddingBottom: 8 },
139
+ detailsScroll: { maxHeight: 200 },
140
+ detailsContent: { gap: 8 },
141
+ chips: { flexDirection: 'row', flexWrap: 'wrap', gap: 6 },
142
+ });
@@ -15,7 +15,7 @@ import { RiCloseCircleLine } from '@oxy.so/bloom/icons/RiCloseCircleLine';
15
15
  import { Item } from '@oxy.so/bloom/item';
16
16
  import { Muted, Text } from '@oxy.so/bloom/typography';
17
17
  import React, { useState } from 'react';
18
- import { View } from 'react-native';
18
+ import { View, StyleSheet } from 'react-native';
19
19
 
20
20
  /**
21
21
  * AgentResultCard — the summary an agent run leaves in the chat when it ends.
@@ -76,7 +76,7 @@ export const AgentResultCard = React.memo(function AgentResultCard({
76
76
  return (
77
77
  <Card>
78
78
  <CardHeader>
79
- <View className="flex-row items-center gap-2">
79
+ <View style={styles.header}>
80
80
  <Badge
81
81
  variant="subtle"
82
82
  color={isSuccess ? 'success' : hasError ? 'error' : 'default'}
@@ -88,7 +88,7 @@ export const AgentResultCard = React.memo(function AgentResultCard({
88
88
  : 'chat.agentRun.unknown',
89
89
  )}
90
90
  />
91
- <View className="min-w-0 flex-1">
91
+ <View style={styles.title}>
92
92
  <Text variant="headline-semibold">
93
93
  {t(isSuccess ? 'chat.agentRun.taskComplete' : 'chat.agentRun.taskFailed')}
94
94
  </Text>
@@ -97,7 +97,7 @@ export const AgentResultCard = React.memo(function AgentResultCard({
97
97
  </View>
98
98
  </CardHeader>
99
99
  <CardBody>
100
- <View className="gap-3">
100
+ <View style={styles.body}>
101
101
  <Muted>{stats.join(' · ')}</Muted>
102
102
 
103
103
  {hasError && lastError ? <Admonition type="error">{lastError}</Admonition> : null}
@@ -123,3 +123,9 @@ export const AgentResultCard = React.memo(function AgentResultCard({
123
123
  </Card>
124
124
  );
125
125
  });
126
+
127
+ const styles = StyleSheet.create({
128
+ header: { flexDirection: 'row', alignItems: 'center', gap: 8 },
129
+ title: { minWidth: 0, flexGrow: 1, flexShrink: 1, flexBasis: '0%' },
130
+ body: { gap: 12 },
131
+ });
@@ -8,7 +8,7 @@ import { Badge } from '@oxy.so/bloom/badge';
8
8
  import { Card, CardBody, CardHeader } from '@oxy.so/bloom/card';
9
9
  import { Muted } from '@oxy.so/bloom/typography';
10
10
  import React, { useEffect, useState } from 'react';
11
- import { View } from 'react-native';
11
+ import { View, StyleSheet } from 'react-native';
12
12
 
13
13
  /**
14
14
  * AgentTaskCard — an agent run in progress, inline in the chat.
@@ -80,7 +80,7 @@ export const AgentTaskCard = React.memo(function AgentTaskCard({ activity }: Age
80
80
  return (
81
81
  <Card>
82
82
  <CardHeader>
83
- <View className="flex-row items-center justify-between gap-2">
83
+ <View style={styles.header}>
84
84
  <Badge variant="subtle" color={status.color} content={status.label} />
85
85
  <Muted>
86
86
  {[elapsed, plan && plan.total > 0 ? `${plan.completed}/${plan.total}` : '']
@@ -90,7 +90,7 @@ export const AgentTaskCard = React.memo(function AgentTaskCard({ activity }: Age
90
90
  </View>
91
91
  </CardHeader>
92
92
  <CardBody>
93
- <View className="gap-3">
93
+ <View style={styles.body}>
94
94
  {plan && plan.items.length > 0 ? (
95
95
  <AgentProgress
96
96
  steps={uniqueStepLabels(plan.items.map((item) => item.text))}
@@ -125,3 +125,8 @@ export const AgentTaskCard = React.memo(function AgentTaskCard({ activity }: Age
125
125
  </Card>
126
126
  );
127
127
  });
128
+
129
+ const styles = StyleSheet.create({
130
+ header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 8 },
131
+ body: { gap: 12 },
132
+ });
@@ -1,7 +1,7 @@
1
1
  import { Notification } from '@oxy.so/bloom/notification';
2
2
  import { Muted } from '@oxy.so/bloom/typography';
3
3
  import React, { useCallback, useState } from 'react';
4
- import { View } from 'react-native';
4
+ import { StyleSheet, View } from 'react-native';
5
5
  import { useLabels } from '../../lib/labels';
6
6
  import {
7
7
  ApprovalExpiredError,
@@ -85,7 +85,7 @@ function ApprovalCard({
85
85
 
86
86
  if (entry.outcome !== 'pending') {
87
87
  return (
88
- <View className="px-4 py-1" accessibilityRole="text">
88
+ <View style={styles.resolved} accessibilityRole="text">
89
89
  <Muted>{t(`chat.approval.resolved.${entry.outcome}`, { tool: entry.tool })}</Muted>
90
90
  </View>
91
91
  );
@@ -112,3 +112,7 @@ function ApprovalCard({
112
112
  />
113
113
  );
114
114
  }
115
+
116
+ const styles = StyleSheet.create({
117
+ resolved: { paddingHorizontal: 16, paddingVertical: 4 },
118
+ });
@@ -7,7 +7,7 @@ import {
7
7
  DropdownMenuTrigger,
8
8
  } from '@oxy.so/bloom/dropdown-menu';
9
9
  import { useInteractionState } from '@oxy.so/bloom/hooks';
10
- import { useTheme, withAlpha } from '@oxy.so/bloom/theme';
10
+ import { createTokenStyles, useTheme, withAlpha } from '@oxy.so/bloom/theme';
11
11
  import { type ComponentProps, type ReactNode, useState } from 'react';
12
12
  import { Platform, Pressable, Text, View } from 'react-native';
13
13
  import { useLabels } from '../../lib/labels';
@@ -48,6 +48,7 @@ export function ChatBubble({
48
48
  /** The words. A function is handed the colour text takes on the person's bubble (the theme's). */
49
49
  children: ReactNode | ((foreground: string | undefined) => ReactNode);
50
50
  }) {
51
+ const styles = useStyles();
51
52
  const { t } = useLabels();
52
53
  const theme = useTheme();
53
54
  const { state: hovered, onIn, onOut } = useInteractionState();
@@ -62,8 +63,7 @@ export function ChatBubble({
62
63
  const hasIcons = onReact !== undefined || onReply !== undefined || menu.length > 0;
63
64
  const icons = !hasIcons ? null : (
64
65
  <View
65
- className="shrink-0 flex-row items-center gap-0.5"
66
- style={{ opacity: shown ? 1 : 0 }}
66
+ style={[styles.icons, { opacity: shown ? 1 : 0 }]}
67
67
  pointerEvents={shown ? 'auto' : 'none'}
68
68
  >
69
69
  {onReact === undefined ? null : (
@@ -89,18 +89,17 @@ export function ChatBubble({
89
89
  );
90
90
  return (
91
91
  <View
92
- className="w-full py-2"
92
+ style={styles.turn}
93
93
  {...(Platform.OS === 'web' ? { onPointerEnter: onIn, onPointerLeave: onOut } : {})}
94
94
  >
95
- <View
96
- className={`w-full flex-row items-center gap-2 ${mine ? 'justify-end' : 'justify-start'}`}
97
- >
95
+ <View style={[styles.bubbleRow, mine && styles.mineBubbleRow]}>
98
96
  {mine ? icons : null}
99
97
  <View
100
- className={`min-w-0 max-w-[80%] rounded-3xl px-4 ${
101
- mine ? 'py-3' : 'bg-background-tertiary-default py-2'
102
- }`}
103
- style={mineColors ? { backgroundColor: mineColors.background } : undefined}
98
+ style={[
99
+ styles.bubble,
100
+ mine ? styles.mineBubble : styles.theirBubble,
101
+ mineColors ? { backgroundColor: mineColors.background } : undefined,
102
+ ]}
104
103
  >
105
104
  {typeof children === 'function' ? children(mineColors?.foreground) : children}
106
105
  </View>
@@ -108,11 +107,7 @@ export function ChatBubble({
108
107
  </View>
109
108
  {reactions.length === 0 ? null : (
110
109
  // The reactions sit on the bubble's lower edge, as the chat this is modelled on draws them.
111
- <View
112
- className={`-mt-2.5 flex-row flex-wrap items-center gap-1 ${
113
- mine ? 'justify-end me-2.5' : 'justify-start ms-2.5'
114
- }`}
115
- >
110
+ <View style={[styles.reactions, mine ? styles.mineReactions : styles.theirReactions]}>
116
111
  {reactions.map((emoji) => (
117
112
  <ReactionPill
118
113
  key={emoji}
@@ -128,6 +123,7 @@ export function ChatBubble({
128
123
 
129
124
  /** One reaction under a bubble: the emoji on a wash of the theme's primary, ringed in the surface. */
130
125
  function ReactionPill({ emoji, onPress }: { emoji: string; onPress?: () => void }) {
126
+ const styles = useStyles();
131
127
  const theme = useTheme();
132
128
  const { t } = useLabels();
133
129
  const { state: hovered, onIn, onOut } = useInteractionState();
@@ -140,14 +136,16 @@ function ReactionPill({ emoji, onPress }: { emoji: string; onPress?: () => void
140
136
  accessibilityState={{ selected: true }}
141
137
  disabled={onPress === undefined}
142
138
  onPress={onPress}
143
- className="h-[22px] flex-row items-center rounded-full px-2"
144
- style={{
145
- backgroundColor: withAlpha(theme.colors.primary, hovered ? 0.16 : 0.12),
146
- borderWidth: 2,
147
- borderColor: theme.colors.background,
148
- }}
139
+ style={[
140
+ styles.reaction,
141
+ {
142
+ backgroundColor: withAlpha(theme.colors.primary, hovered ? 0.16 : 0.12),
143
+ borderWidth: 2,
144
+ borderColor: theme.colors.background,
145
+ },
146
+ ]}
149
147
  >
150
- <Text className="text-sm leading-none">{emoji}</Text>
148
+ <Text style={styles.reactionEmoji}>{emoji}</Text>
151
149
  </Pressable>
152
150
  );
153
151
  }
@@ -233,6 +231,7 @@ function IconButton({
233
231
  onPress,
234
232
  ...rest
235
233
  }: { label: string; icon: Glyph } & Omit<ComponentProps<typeof Pressable>, 'children'>) {
234
+ const styles = useStyles();
236
235
  const theme = useTheme();
237
236
  const { state: hovered, onIn, onOut } = useInteractionState();
238
237
  return (
@@ -243,8 +242,10 @@ function IconButton({
243
242
  onPress={onPress}
244
243
  onHoverIn={onIn}
245
244
  onHoverOut={onOut}
246
- className="size-6 items-center justify-center rounded-full"
247
- style={{ backgroundColor: hovered ? theme.colors.backgroundSecondary : undefined }}
245
+ style={[
246
+ styles.iconButton,
247
+ { backgroundColor: hovered ? theme.colors.backgroundSecondary : undefined },
248
+ ]}
248
249
  >
249
250
  <Icon
250
251
  width={16}
@@ -254,3 +255,43 @@ function IconButton({
254
255
  </Pressable>
255
256
  );
256
257
  }
258
+
259
+ const useStyles = createTokenStyles((t) => ({
260
+ icons: { flexShrink: 0, flexDirection: 'row', alignItems: 'center', gap: 2 },
261
+ turn: { width: '100%', paddingVertical: 8 },
262
+ reaction: {
263
+ height: 22,
264
+ flexDirection: 'row',
265
+ alignItems: 'center',
266
+ borderRadius: 9999,
267
+ paddingHorizontal: 8,
268
+ },
269
+ reactionEmoji: { fontSize: 14, lineHeight: 14 },
270
+ iconButton: {
271
+ width: 24,
272
+ height: 24,
273
+ alignItems: 'center',
274
+ justifyContent: 'center',
275
+ borderRadius: 9999,
276
+ },
277
+ bubbleRow: {
278
+ width: '100%',
279
+ flexDirection: 'row',
280
+ alignItems: 'center',
281
+ justifyContent: 'flex-start',
282
+ gap: 8,
283
+ },
284
+ mineBubbleRow: { justifyContent: 'flex-end' },
285
+ bubble: { minWidth: 0, maxWidth: '80%', borderRadius: 24, paddingHorizontal: 16 },
286
+ mineBubble: { paddingVertical: 12 },
287
+ theirBubble: { backgroundColor: t.popover, paddingVertical: 8 },
288
+ reactions: {
289
+ marginTop: -10,
290
+ flexDirection: 'row',
291
+ flexWrap: 'wrap',
292
+ alignItems: 'center',
293
+ gap: 4,
294
+ },
295
+ mineReactions: { justifyContent: 'flex-end', marginInlineEnd: 10 },
296
+ theirReactions: { justifyContent: 'flex-start', marginInlineStart: 10 },
297
+ }));
@@ -10,6 +10,7 @@ import {
10
10
  type NativeScrollEvent,
11
11
  type NativeSyntheticEvent,
12
12
  View,
13
+ StyleSheet,
13
14
  } from 'react-native';
14
15
  import { AT_BOTTOM_THRESHOLD } from '../../hooks/useAtBottom';
15
16
  import { useMessageVote } from '../../hooks/useMessageVote';
@@ -104,7 +105,7 @@ export interface GemieThreadProps {
104
105
  onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
105
106
  /** Quote a turn's words into the composer (a bubble's reply button). Omitted, the button is not drawn. */
106
107
  onReply?: (text: string) => void;
107
- /** A saved reaction updates the live message as well as the query cache. */
108
+ /** A saved reaction updates the live message as well as the account's store. */
108
109
  onReactionChange?: (update: MessageReactionSnapshot) => void;
109
110
  /** A conversation read by somebody it was shared with: no votes, no read-aloud, no regenerate. */
110
111
  readOnly?: boolean;
@@ -280,8 +281,8 @@ export const GemieThread = memo(function GemieThread({
280
281
  if (nothingToShow) {
281
282
  return (
282
283
  // Screen reserves the composer; the empty state only owns its alignment.
283
- <View className="flex-1 justify-center px-4">
284
- <View className="w-full max-w-[768px] self-center">{empty}</View>
284
+ <View style={styles.empty}>
285
+ <View style={styles.emptyContent}>{empty}</View>
285
286
  </View>
286
287
  );
287
288
  }
@@ -338,7 +339,7 @@ export const GemieThread = memo(function GemieThread({
338
339
  * controller at all.
339
340
  */
340
341
  return (
341
- <View className="flex-1">
342
+ <View style={styles.thread}>
342
343
  <AiChatThread
343
344
  ref={threadRef}
344
345
  followAnimated={false}
@@ -350,18 +351,18 @@ export const GemieThread = memo(function GemieThread({
350
351
  >
351
352
  {/* The transcript column, centred: a little wider than the composer (896 against its
352
353
  768), so the answer has room to breathe. */}
353
- <View className="w-full max-w-4xl self-center">
354
+ <View style={styles.column}>
354
355
  {rows.length === 0 && conversationLoading ? <ThreadSkeleton /> : null}
355
356
 
356
- <View className="relative" onLayout={timeline.onListLayout}>
357
+ <View style={styles.list} onLayout={timeline.onListLayout}>
357
358
  {/* The slot the history loader shows in, held open for as long as there is history to
358
359
  load. The thread anchors ONE growth per request — the first after
359
360
  `onStartReached` — so a loader that appeared on request would spend that anchor on
360
361
  itself and leave the page that follows it to push the reader down. */}
361
362
  {loadMore === undefined && !loadingHistory ? null : (
362
- <View className="h-14 items-center justify-center">
363
+ <View style={styles.historySlot}>
363
364
  {loadingHistory ? (
364
- <Skeleton.Region className="w-full gap-2.5">
365
+ <Skeleton.Region style={styles.historyLoading}>
365
366
  <Skeleton.Box width="70%" height={14} borderRadius={8} />
366
367
  <Skeleton.Box width="45%" height={14} borderRadius={8} />
367
368
  </Skeleton.Region>
@@ -414,3 +415,19 @@ export const GemieThread = memo(function GemieThread({
414
415
  </View>
415
416
  );
416
417
  });
418
+
419
+ const styles = StyleSheet.create({
420
+ empty: {
421
+ flexGrow: 1,
422
+ flexShrink: 1,
423
+ flexBasis: '0%',
424
+ justifyContent: 'center',
425
+ paddingHorizontal: 16,
426
+ },
427
+ emptyContent: { width: '100%', maxWidth: 768, alignSelf: 'center' },
428
+ thread: { flexGrow: 1, flexShrink: 1, flexBasis: '0%' },
429
+ column: { width: '100%', maxWidth: 896, alignSelf: 'center' },
430
+ list: { position: 'relative' },
431
+ historySlot: { height: 56, alignItems: 'center', justifyContent: 'center' },
432
+ historyLoading: { width: '100%', gap: 10 },
433
+ });
@@ -45,6 +45,7 @@ import { ToolResultCard } from './ToolResultCard';
45
45
  import { ChatBubble } from './ChatBubble';
46
46
  import { TurnMenu } from './TurnMenu';
47
47
  import { TurnStatusLine } from './TurnStatusLine';
48
+ import { createTokenStyles } from '@oxy.so/bloom/theme';
48
49
 
49
50
  /**
50
51
  * What a row can do, built once by the thread so every memoised row sees the same object: the
@@ -128,6 +129,7 @@ export const ThreadRow = memo(function ThreadRow({
128
129
  workStartedAt,
129
130
  workEndedAt,
130
131
  }: ThreadRowProps) {
132
+ const styles = useStyles();
131
133
  const { t } = useLabels();
132
134
  const text = messageText(message);
133
135
  const isReply = message.role === 'assistant';
@@ -166,7 +168,7 @@ export const ThreadRow = memo(function ThreadRow({
166
168
  <Animated.View onLayout={onLayout}>
167
169
  {text.length === 0 && !attached ? null : (
168
170
  // Bloom's user turn, with the breathing room above it the thread has always had.
169
- <View className="mt-2 w-full flex-col items-end">
171
+ <View style={styles.question}>
170
172
  <TurnMenu actions={questionActions} label={t('chat.turnActions')}>
171
173
  {bubbles ? (
172
174
  // An agent's thread: the person's turn is a bubble in the theme's primary, never Bloom's
@@ -253,6 +255,7 @@ function ReplyTurn({
253
255
  workStartedAt,
254
256
  workEndedAt,
255
257
  }: ReplyTurnProps) {
258
+ const styles = useStyles();
256
259
  const { t } = useLabels();
257
260
  const { faviconUrl } = useGemieRuntime().host;
258
261
  const renderers = useToolRenderers();
@@ -425,11 +428,7 @@ function ReplyTurn({
425
428
 
426
429
  const replyBody =
427
430
  message.source === 'voice' ? (
428
- <Text
429
- className={
430
- bubbled ? 'text-sm leading-5 text-foreground' : 'text-base leading-7 text-foreground'
431
- }
432
- >
431
+ <Text style={bubbled ? styles.bubbledVoiceReply : styles.voiceReply}>
433
432
  {text}
434
433
  {message.isStreaming ? '▌' : ''}
435
434
  </Text>
@@ -466,9 +465,9 @@ function ReplyTurn({
466
465
  words, while a text turn's placeholder — stamped `isStreaming` too — is the thinking
467
466
  indicator's until its first token arrives. */}
468
467
  {showsContent && (
469
- <View className="w-full flex-col">
468
+ <View style={styles.reply}>
470
469
  {agent && agentAnchor ? (
471
- <View className="mb-0.5">
470
+ <View style={styles.replyIdentity}>
472
471
  <AgentReplyIdentity
473
472
  character={agentCharacterOf(agent)}
474
473
  name={agent.name}
@@ -547,7 +546,7 @@ function ReplyTurn({
547
546
  ))}
548
547
  {inlineCanvases.map(({ key, canvas }) => (
549
548
  <MessageBlockBoundary key={key}>
550
- <View className="rounded-2xl border border-border p-4" testID="shared-canvas">
549
+ <View style={styles.canvas} testID="shared-canvas">
551
550
  <CanvasComponent component={{ id: key, ...canvas }} />
552
551
  </View>
553
552
  </MessageBlockBoundary>
@@ -573,15 +572,11 @@ function ReplyTurn({
573
572
  </MessageBlockBoundary>
574
573
  )}
575
574
  {agent && message.turnOutcome === 'failed' && text.length === 0 ? (
576
- <Text className="text-sm text-muted-foreground">
577
- {t('chat.agentFailed', { name: agent.name })}
578
- </Text>
575
+ <Text style={styles.muted}>{t('chat.agentFailed', { name: agent.name })}</Text>
579
576
  ) : null}
580
577
  {/* A requested run that ended with no answer: the app's words, never the run's. */}
581
578
  {agent && messageFailureOf(message.content) === 'task_unfinished' ? (
582
- <Text className="text-sm text-muted-foreground">
583
- {t('chat.taskUnfinished', { name: agent.name })}
584
- </Text>
579
+ <Text style={styles.muted}>{t('chat.taskUnfinished', { name: agent.name })}</Text>
585
580
  ) : null}
586
581
  {bubbled ? (
587
582
  // Only the words are the bubble: the work log and the cards stay above it, whole.
@@ -605,3 +600,13 @@ function ReplyTurn({
605
600
  </>
606
601
  );
607
602
  }
603
+
604
+ const useStyles = createTokenStyles((t) => ({
605
+ question: { marginTop: 8, width: '100%', flexDirection: 'column', alignItems: 'flex-end' },
606
+ reply: { width: '100%', flexDirection: 'column' },
607
+ replyIdentity: { marginBottom: 2 },
608
+ canvas: { borderRadius: 16, borderWidth: 1, borderColor: t.border, padding: 16 },
609
+ muted: { fontSize: 14, color: t.mutedForeground, lineHeight: 20 },
610
+ voiceReply: { fontSize: 16, lineHeight: 28, color: t.foreground },
611
+ bubbledVoiceReply: { fontSize: 14, lineHeight: 20, color: t.foreground },
612
+ }));
@@ -9,7 +9,7 @@ import { ListItem } from '@oxy.so/bloom/list';
9
9
  import { Search } from '@oxy.so/bloom/search';
10
10
  import { Muted } from '@oxy.so/bloom/typography';
11
11
  import { useState } from 'react';
12
- import { ScrollView, View } from 'react-native';
12
+ import { ScrollView, View, StyleSheet } from 'react-native';
13
13
 
14
14
  /**
15
15
  * Searching what was said in this thread, across every conversation in it.
@@ -49,7 +49,8 @@ function hitDay(createdAt: string, locale: string): string {
49
49
  export const ThreadSearch = ({ thread, onJump, onClose }: ThreadSearchProps) => {
50
50
  const { t, locale } = useLabels();
51
51
  const [query, setQuery] = useState('');
52
- const { data: hits, isFetching, isError } = useThreadSearch(thread, query);
52
+ const { value: hits, isFetching, status } = useThreadSearch(thread, query);
53
+ const isError = status === 'error';
53
54
 
54
55
  /**
55
56
  * Told apart deliberately: nothing typed is not a search that found nothing.
@@ -60,12 +61,12 @@ export const ThreadSearch = ({ thread, onJump, onClose }: ThreadSearchProps) =>
60
61
  const found = hits ?? [];
61
62
 
62
63
  return (
63
- <View className="absolute inset-x-0 top-0 z-20 px-4 pt-4" pointerEvents="box-none">
64
- <View className="w-full max-w-[768px] self-center">
64
+ <View style={styles.overlay} pointerEvents="box-none">
65
+ <View style={styles.column}>
65
66
  <Card elevation="m">
66
67
  <CardBody>
67
- <View className="flex-row items-center gap-2">
68
- <View className="flex-1">
68
+ <View style={styles.searchRow}>
69
+ <View style={styles.search}>
69
70
  <Search
70
71
  label={t('chat.searchThreadPlaceholder')}
71
72
  value={query}
@@ -87,15 +88,15 @@ export const ThreadSearch = ({ thread, onJump, onClose }: ThreadSearchProps) =>
87
88
  </View>
88
89
 
89
90
  {!asked ? (
90
- <View className="px-1 py-4">
91
+ <View style={styles.hint}>
91
92
  <Muted>{t('chat.searchThreadHint')}</Muted>
92
93
  </View>
93
94
  ) : isError ? (
94
- <View className="px-1 py-4">
95
+ <View style={styles.hint}>
95
96
  <Muted>{t('chat.searchThreadFailed')}</Muted>
96
97
  </View>
97
98
  ) : found.length === 0 ? (
98
- <View className="px-1 py-4">
99
+ <View style={styles.hint}>
99
100
  <Muted>
100
101
  {isFetching ? t('chat.searchThreadSearching') : t('chat.searchThreadEmpty')}
101
102
  </Muted>
@@ -105,7 +106,7 @@ export const ThreadSearch = ({ thread, onJump, onClose }: ThreadSearchProps) =>
105
106
  // A height in px, not a percentage of a parent that has none:
106
107
  // measured in Chromium, the list otherwise sized itself to its
107
108
  // content and spilled the results over the thread behind it.
108
- className="mt-2 max-h-96"
109
+ style={styles.results}
109
110
  keyboardShouldPersistTaps="handled"
110
111
  >
111
112
  {found.map((hit) => (
@@ -128,3 +129,19 @@ export const ThreadSearch = ({ thread, onJump, onClose }: ThreadSearchProps) =>
128
129
  </View>
129
130
  );
130
131
  };
132
+
133
+ const styles = StyleSheet.create({
134
+ overlay: {
135
+ position: 'absolute',
136
+ insetInline: 0,
137
+ top: 0,
138
+ zIndex: 20,
139
+ paddingHorizontal: 16,
140
+ paddingTop: 16,
141
+ },
142
+ column: { width: '100%', maxWidth: 768, alignSelf: 'center' },
143
+ searchRow: { flexDirection: 'row', alignItems: 'center', gap: 8 },
144
+ search: { flexGrow: 1, flexShrink: 1, flexBasis: '0%' },
145
+ hint: { paddingHorizontal: 4, paddingVertical: 16 },
146
+ results: { marginTop: 8, maxHeight: 384 },
147
+ });
@@ -1,5 +1,5 @@
1
1
  import * as Skeleton from '@oxy.so/bloom/skeleton';
2
- import { View } from 'react-native';
2
+ import { View, StyleSheet } from 'react-native';
3
3
 
4
4
  /**
5
5
  * A conversation's turns that are on their way: the person's bubbles at the end, the replies as
@@ -9,22 +9,28 @@ import { View } from 'react-native';
9
9
  */
10
10
  export function ThreadSkeleton() {
11
11
  return (
12
- <Skeleton.Region className="gap-5 py-4">
13
- <View className="items-end">
12
+ <Skeleton.Region style={styles.skeleton}>
13
+ <View style={styles.question}>
14
14
  <Skeleton.Box width="65%" height={48} borderRadius={24} />
15
15
  </View>
16
- <View className="items-start gap-2.5">
16
+ <View style={styles.reply}>
17
17
  <Skeleton.Box width="80%" height={14} borderRadius={8} />
18
18
  <Skeleton.Box width="70%" height={14} borderRadius={8} />
19
19
  <Skeleton.Box width="45%" height={14} borderRadius={8} />
20
20
  </View>
21
- <View className="items-end">
21
+ <View style={styles.question}>
22
22
  <Skeleton.Box width="50%" height={40} borderRadius={24} />
23
23
  </View>
24
- <View className="items-start gap-2.5">
24
+ <View style={styles.reply}>
25
25
  <Skeleton.Box width="85%" height={14} borderRadius={8} />
26
26
  <Skeleton.Box width="60%" height={14} borderRadius={8} />
27
27
  </View>
28
28
  </Skeleton.Region>
29
29
  );
30
30
  }
31
+
32
+ const styles = StyleSheet.create({
33
+ skeleton: { gap: 20, paddingVertical: 16 },
34
+ question: { alignItems: 'flex-end' },
35
+ reply: { alignItems: 'flex-start', gap: 10 },
36
+ });
@@ -35,7 +35,7 @@ import {
35
35
  } from '@oxy.so/bloom/segmented-control';
36
36
  import { Muted, Text } from '@oxy.so/bloom/typography';
37
37
  import { useState } from 'react';
38
- import { View } from 'react-native';
38
+ import { View, StyleSheet } from 'react-native';
39
39
 
40
40
  /**
41
41
  * A tool result drawn inside the assistant turn, each card one block line of
@@ -170,9 +170,9 @@ function WeatherResult({ data }: { data: WeatherCardData }) {
170
170
  <AiChatMessageLine block>
171
171
  <Card>
172
172
  <CardHeader>
173
- <View className="flex-row items-center gap-3">
173
+ <View style={styles.weatherHeader}>
174
174
  <IconCircle icon={conditionIcon(data.current.condition)} size="lg" />
175
- <View className="min-w-0 flex-1">
175
+ <View style={styles.weatherText}>
176
176
  <Muted>{data.place}</Muted>
177
177
  <Text variant="title-1-medium">{degrees(data.current.temperature, unit)}</Text>
178
178
  <Muted>{t(`weather.condition.${data.current.condition}`)}</Muted>
@@ -230,7 +230,7 @@ function ScheduledTaskResult({ data }: { data: ScheduledTaskCardData }) {
230
230
  title={data.objective}
231
231
  subtitle={triggerLabel(data.trigger, t)}
232
232
  trailing={
233
- <View className="flex-row items-center gap-2">
233
+ <View style={styles.trailing}>
234
234
  <Badge
235
235
  variant="subtle"
236
236
  color={data.enabled ? 'success' : 'default'}
@@ -252,3 +252,9 @@ function ScheduledTaskResult({ data }: { data: ScheduledTaskCardData }) {
252
252
  </AiChatMessageLine>
253
253
  );
254
254
  }
255
+
256
+ const styles = StyleSheet.create({
257
+ weatherHeader: { flexDirection: 'row', alignItems: 'center', gap: 12 },
258
+ weatherText: { minWidth: 0, flexGrow: 1, flexShrink: 1, flexBasis: '0%' },
259
+ trailing: { flexDirection: 'row', alignItems: 'center', gap: 8 },
260
+ });