@gemies/sdk 9.2.0 → 10.0.1
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/CHANGELOG.md +103 -0
- package/README.md +9 -6
- package/package.json +4 -11
- package/src/accounts.ts +7 -1
- package/src/ask-eager.ts +0 -2
- package/src/ask-text.ts +0 -1
- package/src/ask.ts +0 -1
- package/src/components/AmbientField.tsx +13 -2
- package/src/components/ComposerDropZone.tsx +20 -4
- package/src/components/ComposerSuggestions.tsx +9 -2
- package/src/components/GemieActivityLine.tsx +11 -5
- package/src/components/GemieBetweenGemies.tsx +23 -10
- package/src/components/GemieChatContent.tsx +46 -23
- package/src/components/GemieChatScreen.tsx +7 -4
- package/src/components/GemieChatSheet.tsx +6 -2
- package/src/components/GemieComposer.tsx +17 -7
- package/src/components/GemieGroupWelcome.tsx +16 -2
- package/src/components/GemieRecentConversations.tsx +13 -10
- package/src/components/GemieSharedConversation.tsx +38 -6
- package/src/components/GemieWelcomeMessage.tsx +23 -7
- package/src/components/IdentityMark.tsx +6 -12
- package/src/components/PlanPreviewCard.tsx +18 -7
- package/src/components/QuestionCard.tsx +6 -2
- package/src/components/ReplyMarkdown.tsx +32 -6
- package/src/components/RichBlocks.tsx +20 -15
- package/src/components/accounts/GemieAccountGrants.tsx +27 -10
- package/src/components/accounts/GemieConnectedAccounts.tsx +87 -51
- package/src/components/canvas/CanvasComponent.tsx +6 -2
- package/src/components/canvas/DashboardRenderer.tsx +25 -8
- package/src/components/canvas/DeckRenderer.tsx +23 -6
- package/src/components/canvas/FormRenderer.tsx +8 -3
- package/src/components/connectors/ConnectorLogo.tsx +15 -9
- package/src/components/connectors/GemieConnectedConnectors.tsx +51 -25
- package/src/components/connectors/GemieConnectorsStore.tsx +99 -41
- package/src/components/connectors/GrantSwitchRow.tsx +18 -5
- package/src/components/thought/ThoughtPanel.tsx +26 -12
- package/src/components/thought/ToolStep.tsx +14 -6
- package/src/components/thread/AgentResultCard.tsx +10 -4
- package/src/components/thread/AgentTaskCard.tsx +8 -3
- package/src/components/thread/ApprovalCard.tsx +6 -2
- package/src/components/thread/ChatBubble.tsx +66 -25
- package/src/components/thread/GemieThread.tsx +32 -10
- package/src/components/thread/ThreadRow.tsx +20 -15
- package/src/components/thread/ThreadSearch.tsx +27 -10
- package/src/components/thread/ThreadSkeleton.tsx +12 -6
- package/src/components/thread/ToolResultCard.tsx +10 -4
- package/src/components/thread/TurnAttachments.tsx +17 -8
- package/src/components/voice/VoiceControls.tsx +9 -6
- package/src/connectors.ts +15 -2
- package/src/hooks/useAgentRunFailureToast.ts +34 -0
- package/src/hooks/useChatVoice.ts +2 -10
- package/src/hooks/useMessageReactions.ts +5 -5
- package/src/hooks/useThoughtScope.ts +9 -8
- package/src/index.ts +2 -3
- package/src/lib/tool-call-status.ts +1 -1
- package/src/lib/utils.ts +1 -8
- package/src/realtime/react.tsx +9 -9
- package/src/realtime/reread.ts +28 -0
- package/src/realtime/store.ts +123 -0
- package/src/runtime/agents.ts +46 -27
- package/src/runtime/collections.ts +35 -136
- package/src/runtime/connected-accounts.ts +175 -88
- package/src/runtime/connectors.ts +244 -127
- package/src/runtime/conversations.ts +181 -607
- package/src/runtime/data/answer.ts +76 -0
- package/src/runtime/data/collections.ts +168 -0
- package/src/runtime/data/conversations.ts +626 -0
- package/src/runtime/data/reactions.ts +29 -0
- package/src/runtime/data/read.ts +37 -0
- package/src/runtime/data/threads.ts +149 -0
- package/src/runtime/index.ts +72 -8
- package/src/runtime/model.ts +0 -2
- package/src/runtime/routes.ts +2 -2
- package/src/runtime/sharing.ts +69 -56
- package/src/runtime/types.ts +8 -16
- package/src/runtime/use-bound-action.ts +27 -0
- package/src/runtime/use-conversation-stream.ts +8 -31
- package/src/runtime/use-conversation-thread.ts +40 -51
- package/src/runtime/use-gemie-thread.ts +32 -43
- package/src/runtime/use-start-conversation.ts +14 -15
- package/src/runtime/use-thread-history.ts +26 -36
- package/src/runtime/use-thread-search.ts +29 -76
- package/src/text.ts +0 -1
- package/src/voice.ts +0 -1
- package/src/components/Image.tsx +0 -12
- package/src/realtime/cache.ts +0 -257
- package/src/runtime/conversation-dates.ts +0 -31
- package/src/runtime/query-keys.ts +0 -66
- package/src/runtime/reaction-cache.ts +0 -45
|
@@ -2,7 +2,8 @@ import { Text } from '@oxy.so/bloom/typography';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { useConnectorLogoUrl } from '../../runtime/connectors';
|
|
5
|
-
import { Image } from '
|
|
5
|
+
import { Image } from 'expo-image';
|
|
6
|
+
import { createTokenStyles } from '@oxy.so/bloom/theme';
|
|
6
7
|
|
|
7
8
|
export interface ConnectorLogoProps {
|
|
8
9
|
/** The connector's name, for the monogram and for screen readers. */
|
|
@@ -20,6 +21,7 @@ export interface ConnectorLogoProps {
|
|
|
20
21
|
* brand mark. Without one, or when it does not load, a monogram — never a broken image.
|
|
21
22
|
*/
|
|
22
23
|
export function ConnectorLogo({ name, logoUrl, size = 40 }: ConnectorLogoProps) {
|
|
24
|
+
const styles = useStyles();
|
|
23
25
|
const src = useConnectorLogoUrl(logoUrl);
|
|
24
26
|
const [failed, setFailed] = useState(false);
|
|
25
27
|
const radius = Math.round(size * 0.22);
|
|
@@ -30,13 +32,14 @@ export function ConnectorLogo({ name, logoUrl, size = 40 }: ConnectorLogoProps)
|
|
|
30
32
|
<View
|
|
31
33
|
accessibilityRole="image"
|
|
32
34
|
accessibilityLabel={name}
|
|
33
|
-
|
|
34
|
-
style={{ width: size, height: size, borderRadius: radius }}
|
|
35
|
+
style={[styles.monogram, { width: size, height: size, borderRadius: radius }]}
|
|
35
36
|
>
|
|
36
37
|
<Text
|
|
37
38
|
variant="body-medium"
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
style={[
|
|
40
|
+
styles.initial,
|
|
41
|
+
{ fontSize: Math.round(size * 0.45), lineHeight: Math.round(size * 0.6) },
|
|
42
|
+
]}
|
|
40
43
|
>
|
|
41
44
|
{letter}
|
|
42
45
|
</Text>
|
|
@@ -45,10 +48,7 @@ export function ConnectorLogo({ name, logoUrl, size = 40 }: ConnectorLogoProps)
|
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
return (
|
|
48
|
-
<View
|
|
49
|
-
className="overflow-hidden border border-border bg-white"
|
|
50
|
-
style={{ width: size, height: size, borderRadius: radius }}
|
|
51
|
-
>
|
|
51
|
+
<View style={[styles.logo, { width: size, height: size, borderRadius: radius }]}>
|
|
52
52
|
<Image
|
|
53
53
|
source={{ uri: src }}
|
|
54
54
|
accessibilityLabel={name}
|
|
@@ -59,3 +59,9 @@ export function ConnectorLogo({ name, logoUrl, size = 40 }: ConnectorLogoProps)
|
|
|
59
59
|
</View>
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
const useStyles = createTokenStyles((t) => ({
|
|
64
|
+
monogram: { alignItems: 'center', justifyContent: 'center', backgroundColor: t.popover },
|
|
65
|
+
initial: { color: t.mutedForeground },
|
|
66
|
+
logo: { overflow: 'hidden', borderWidth: 1, borderColor: t.border, backgroundColor: '#fff' },
|
|
67
|
+
}));
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
useConnectorActions,
|
|
19
19
|
} from '../../runtime/connectors';
|
|
20
20
|
import { ConnectorLogo } from './ConnectorLogo';
|
|
21
|
+
import { createTokenStyles } from '@oxy.so/bloom/theme';
|
|
21
22
|
|
|
22
23
|
/** This component's own strings. */
|
|
23
24
|
const K = 'gemie.connectors';
|
|
@@ -46,6 +47,7 @@ export function GemieConnectedConnectors({
|
|
|
46
47
|
onBrowse,
|
|
47
48
|
t = englishCopy,
|
|
48
49
|
}: GemieConnectedConnectorsProps) {
|
|
50
|
+
const styles = useStyles();
|
|
49
51
|
const connections = useConnections();
|
|
50
52
|
const actions = useConnectorActions({ returnTo: connectorReturnTo(nativeScheme) });
|
|
51
53
|
const [pending, setPending] = useState<string | null>(null);
|
|
@@ -54,7 +56,7 @@ export function GemieConnectedConnectors({
|
|
|
54
56
|
const reconnect = async (connection: Connection) => {
|
|
55
57
|
setPending(connection._id);
|
|
56
58
|
try {
|
|
57
|
-
const done = await actions.reconnect.
|
|
59
|
+
const done = await actions.reconnect.run(connection._id);
|
|
58
60
|
if (done?.status === 'running') {
|
|
59
61
|
toast.success(t(`${K}.reconnected`, { name: connection.displayName }));
|
|
60
62
|
}
|
|
@@ -77,7 +79,7 @@ export function GemieConnectedConnectors({
|
|
|
77
79
|
if (!ok) return;
|
|
78
80
|
setPending(connection._id);
|
|
79
81
|
try {
|
|
80
|
-
await actions.disconnect.
|
|
82
|
+
await actions.disconnect.run(connection._id);
|
|
81
83
|
toast.success(t(`${K}.disconnected`, { name }));
|
|
82
84
|
} catch {
|
|
83
85
|
toast.error(t(`${K}.disconnectFailed`));
|
|
@@ -86,22 +88,27 @@ export function GemieConnectedConnectors({
|
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
|
|
89
|
-
if (connections.
|
|
91
|
+
if (connections.isLoading) return <ConnectedSkeleton />;
|
|
90
92
|
|
|
91
|
-
if (connections.
|
|
93
|
+
if (connections.status === 'error') {
|
|
92
94
|
return (
|
|
93
|
-
<View
|
|
94
|
-
<Text variant="body-2-regular"
|
|
95
|
+
<View style={styles.failure}>
|
|
96
|
+
<Text variant="body-2-regular" style={styles.muted}>
|
|
95
97
|
{t(`${K}.connected.loadFailed`)}
|
|
96
98
|
</Text>
|
|
97
|
-
<Button
|
|
99
|
+
<Button
|
|
100
|
+
size="sm"
|
|
101
|
+
appearance="outline"
|
|
102
|
+
tone="neutral"
|
|
103
|
+
onPress={() => void connections.refresh()}
|
|
104
|
+
>
|
|
98
105
|
{t(`${K}.store.retry`)}
|
|
99
106
|
</Button>
|
|
100
107
|
</View>
|
|
101
108
|
);
|
|
102
109
|
}
|
|
103
110
|
|
|
104
|
-
const rows = connections.
|
|
111
|
+
const rows = connections.value ?? [];
|
|
105
112
|
if (rows.length === 0) {
|
|
106
113
|
return (
|
|
107
114
|
<EmptyState
|
|
@@ -114,9 +121,9 @@ export function GemieConnectedConnectors({
|
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
return (
|
|
117
|
-
<View
|
|
118
|
-
<View
|
|
119
|
-
<Text variant="body-2-regular"
|
|
124
|
+
<View style={styles.connections}>
|
|
125
|
+
<View style={styles.intro}>
|
|
126
|
+
<Text variant="body-2-regular" style={styles.description}>
|
|
120
127
|
{t(`${K}.connected.description`)}
|
|
121
128
|
</Text>
|
|
122
129
|
<Button size="sm" appearance="outline" tone="neutral" onPress={onBrowse}>
|
|
@@ -124,17 +131,14 @@ export function GemieConnectedConnectors({
|
|
|
124
131
|
</Button>
|
|
125
132
|
</View>
|
|
126
133
|
{rows.map((connection, index) => (
|
|
127
|
-
<View
|
|
128
|
-
|
|
129
|
-
className={`gap-2 py-3 ${index === 0 ? '' : 'border-t border-border'}`}
|
|
130
|
-
>
|
|
131
|
-
<View className="flex-row items-center gap-3">
|
|
134
|
+
<View key={connection._id} style={[styles.connectionRow, index > 0 && styles.divider]}>
|
|
135
|
+
<View style={styles.connection}>
|
|
132
136
|
<ConnectorLogo name={connection.displayName} logoUrl={connection.logoUrl} size={36} />
|
|
133
|
-
<View
|
|
137
|
+
<View style={styles.connectionText}>
|
|
134
138
|
<Text variant="body-2-semibold" numberOfLines={1}>
|
|
135
139
|
{connection.displayName}
|
|
136
140
|
</Text>
|
|
137
|
-
<Text variant="body-2-regular"
|
|
141
|
+
<Text variant="body-2-regular" style={styles.muted} numberOfLines={1}>
|
|
138
142
|
{[
|
|
139
143
|
connection.accountLabel ??
|
|
140
144
|
(connection.source === 'custom' ? connection.config.url : null),
|
|
@@ -152,16 +156,16 @@ export function GemieConnectedConnectors({
|
|
|
152
156
|
/>
|
|
153
157
|
</View>
|
|
154
158
|
{connection.status !== 'running' && connection.statusMessage ? (
|
|
155
|
-
<Text variant="body-2-regular"
|
|
159
|
+
<Text variant="body-2-regular" style={styles.muted}>
|
|
156
160
|
{connection.statusMessage}
|
|
157
161
|
</Text>
|
|
158
162
|
) : null}
|
|
159
163
|
{connection.usedBy.length > 0 ? (
|
|
160
|
-
<Text variant="body-2-regular"
|
|
164
|
+
<Text variant="body-2-regular" style={styles.muted}>
|
|
161
165
|
{t(`${K}.usedBy`, { names: connection.usedBy.map((gemie) => gemie.name).join(', ') })}
|
|
162
166
|
</Text>
|
|
163
167
|
) : null}
|
|
164
|
-
<View
|
|
168
|
+
<View style={styles.actions}>
|
|
165
169
|
{connection.status !== 'running' ? (
|
|
166
170
|
<Button
|
|
167
171
|
size="sm"
|
|
@@ -210,7 +214,7 @@ export function GemieConnectedConnectors({
|
|
|
210
214
|
onClose={() => setRenaming(null)}
|
|
211
215
|
onSave={async (accountLabel) => {
|
|
212
216
|
if (!renaming) return;
|
|
213
|
-
await actions.rename.
|
|
217
|
+
await actions.rename.run(renaming._id, accountLabel);
|
|
214
218
|
}}
|
|
215
219
|
t={t}
|
|
216
220
|
/>
|
|
@@ -291,13 +295,14 @@ function RenameDialog({
|
|
|
291
295
|
|
|
292
296
|
/** The list's shape while it is read: rows, never a spinner. */
|
|
293
297
|
function ConnectedSkeleton() {
|
|
298
|
+
const styles = useStyles();
|
|
294
299
|
return (
|
|
295
300
|
<Skeleton.Region>
|
|
296
|
-
<View
|
|
301
|
+
<View style={styles.loading}>
|
|
297
302
|
{[0, 1].map((index) => (
|
|
298
|
-
<View key={index}
|
|
303
|
+
<View key={index} style={styles.connection}>
|
|
299
304
|
<Skeleton.Box width={36} height={36} borderRadius={8} />
|
|
300
|
-
<View
|
|
305
|
+
<View style={styles.loadingText}>
|
|
301
306
|
<Skeleton.Box width={140} height={14} />
|
|
302
307
|
<Skeleton.Box width={200} height={12} />
|
|
303
308
|
</View>
|
|
@@ -307,3 +312,24 @@ function ConnectedSkeleton() {
|
|
|
307
312
|
</Skeleton.Region>
|
|
308
313
|
);
|
|
309
314
|
}
|
|
315
|
+
|
|
316
|
+
const useStyles = createTokenStyles((t) => ({
|
|
317
|
+
failure: { alignItems: 'flex-start', gap: 8, paddingVertical: 10 },
|
|
318
|
+
muted: { color: t.mutedForeground },
|
|
319
|
+
connections: { gap: 4 },
|
|
320
|
+
intro: {
|
|
321
|
+
flexDirection: 'row',
|
|
322
|
+
alignItems: 'center',
|
|
323
|
+
justifyContent: 'space-between',
|
|
324
|
+
gap: 12,
|
|
325
|
+
paddingBottom: 4,
|
|
326
|
+
},
|
|
327
|
+
description: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', color: t.mutedForeground },
|
|
328
|
+
connection: { flexDirection: 'row', alignItems: 'center', gap: 12 },
|
|
329
|
+
connectionText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 2 },
|
|
330
|
+
actions: { flexDirection: 'row', flexWrap: 'wrap', gap: 8 },
|
|
331
|
+
loading: { gap: 16, paddingVertical: 10 },
|
|
332
|
+
loadingText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 6 },
|
|
333
|
+
connectionRow: { gap: 8, paddingVertical: 12 },
|
|
334
|
+
divider: { borderTopWidth: 1, borderColor: t.border },
|
|
335
|
+
}));
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
useWebSignInReturn,
|
|
46
46
|
} from '../../runtime/connectors';
|
|
47
47
|
import { ConnectorLogo } from './ConnectorLogo';
|
|
48
|
+
import { createTokenStyles } from '@oxy.so/bloom/theme';
|
|
48
49
|
|
|
49
50
|
/** This component's own strings. */
|
|
50
51
|
const K = 'gemie.connectors';
|
|
@@ -98,6 +99,7 @@ export function GemieConnectorsStore({
|
|
|
98
99
|
t = englishCopy,
|
|
99
100
|
onConnected,
|
|
100
101
|
}: GemieConnectorsStoreProps) {
|
|
102
|
+
const styles = useStyles();
|
|
101
103
|
const [query, setQuery] = useState('');
|
|
102
104
|
const [category, setCategory] = useState<ConnectorCategory | null>(null);
|
|
103
105
|
const [filters, setFilters] = useState<ReadonlySet<StoreFilter>>(new Set());
|
|
@@ -126,18 +128,15 @@ export function GemieConnectorsStore({
|
|
|
126
128
|
|
|
127
129
|
const accountsOf = useMemo(() => {
|
|
128
130
|
const counts = new Map<string, number>();
|
|
129
|
-
for (const connection of connections.
|
|
131
|
+
for (const connection of connections.value ?? []) {
|
|
130
132
|
if (connection.registryId) {
|
|
131
133
|
counts.set(connection.registryId, (counts.get(connection.registryId) ?? 0) + 1);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
return counts;
|
|
135
|
-
}, [connections.
|
|
137
|
+
}, [connections.value]);
|
|
136
138
|
|
|
137
|
-
const
|
|
138
|
-
const entries = pages.flatMap((page) => page.servers);
|
|
139
|
-
const total = pages[0]?.total ?? 0;
|
|
140
|
-
const categories = pages[0]?.categories ?? [];
|
|
139
|
+
const { entries, total, categories } = store;
|
|
141
140
|
const browsing = !q && category === null && filters.size === 0 && sort === 'featured';
|
|
142
141
|
const featured = browsing ? entries.filter((entry) => entry.featured) : [];
|
|
143
142
|
const rest = browsing ? entries.filter((entry) => !entry.featured) : entries;
|
|
@@ -153,7 +152,7 @@ export function GemieConnectorsStore({
|
|
|
153
152
|
const connect = async (entry: ConnectorEntry) => {
|
|
154
153
|
setPending(entry.id);
|
|
155
154
|
try {
|
|
156
|
-
const connection = await actions.connect.
|
|
155
|
+
const connection = await actions.connect.run(entry.id);
|
|
157
156
|
if (connection) {
|
|
158
157
|
toast.success(t(`${K}.signIn.connected`, { name: entry.name }));
|
|
159
158
|
onConnected?.();
|
|
@@ -177,7 +176,7 @@ export function GemieConnectorsStore({
|
|
|
177
176
|
);
|
|
178
177
|
|
|
179
178
|
return (
|
|
180
|
-
<View
|
|
179
|
+
<View style={styles.store}>
|
|
181
180
|
<Search
|
|
182
181
|
label={t(`${K}.store.search`)}
|
|
183
182
|
value={query}
|
|
@@ -207,7 +206,7 @@ export function GemieConnectorsStore({
|
|
|
207
206
|
))}
|
|
208
207
|
</ChipRow>
|
|
209
208
|
) : null}
|
|
210
|
-
<View
|
|
209
|
+
<View style={styles.filters}>
|
|
211
210
|
<ChipRow role="group" accessibilityLabel={t(`${K}.store.filters`)}>
|
|
212
211
|
{FILTERS.map((filter) => (
|
|
213
212
|
<Chip
|
|
@@ -224,14 +223,19 @@ export function GemieConnectorsStore({
|
|
|
224
223
|
<SortSelect value={sort} onChange={setSort} t={t} />
|
|
225
224
|
</View>
|
|
226
225
|
|
|
227
|
-
{store.
|
|
226
|
+
{store.isLoading ? (
|
|
228
227
|
<StoreSkeleton />
|
|
229
228
|
) : store.isError && entries.length === 0 ? (
|
|
230
|
-
<View
|
|
231
|
-
<Text variant="body-2-regular"
|
|
229
|
+
<View style={styles.failure}>
|
|
230
|
+
<Text variant="body-2-regular" style={styles.muted}>
|
|
232
231
|
{t(`${K}.store.loadFailed`)}
|
|
233
232
|
</Text>
|
|
234
|
-
<Button
|
|
233
|
+
<Button
|
|
234
|
+
size="sm"
|
|
235
|
+
appearance="outline"
|
|
236
|
+
tone="neutral"
|
|
237
|
+
onPress={() => void store.refresh()}
|
|
238
|
+
>
|
|
235
239
|
{t(`${K}.store.retry`)}
|
|
236
240
|
</Button>
|
|
237
241
|
</View>
|
|
@@ -252,18 +256,18 @@ export function GemieConnectorsStore({
|
|
|
252
256
|
</StoreGroup>
|
|
253
257
|
) : null}
|
|
254
258
|
{entries.length === 0 ? (
|
|
255
|
-
<Text variant="body-2-regular"
|
|
259
|
+
<Text variant="body-2-regular" style={styles.emptyText}>
|
|
256
260
|
{q ? t(`${K}.store.noResults`, { query: q }) : t(`${K}.store.empty`)}
|
|
257
261
|
</Text>
|
|
258
262
|
) : null}
|
|
259
|
-
{store.
|
|
260
|
-
<View
|
|
263
|
+
{store.hasMore ? (
|
|
264
|
+
<View style={styles.more}>
|
|
261
265
|
<Button
|
|
262
266
|
size="sm"
|
|
263
267
|
appearance="outline"
|
|
264
268
|
tone="neutral"
|
|
265
|
-
loading={store.
|
|
266
|
-
onPress={() => void store.
|
|
269
|
+
loading={store.isLoadingMore}
|
|
270
|
+
onPress={() => void store.more()}
|
|
267
271
|
>
|
|
268
272
|
{t(`${K}.store.more`, { count: total - entries.length })}
|
|
269
273
|
</Button>
|
|
@@ -275,14 +279,14 @@ export function GemieConnectorsStore({
|
|
|
275
279
|
<Pressable
|
|
276
280
|
accessibilityRole="button"
|
|
277
281
|
onPress={() => setCustomOpen(true)}
|
|
278
|
-
|
|
282
|
+
style={styles.customTile}
|
|
279
283
|
>
|
|
280
|
-
<View
|
|
284
|
+
<View style={styles.customIcon}>
|
|
281
285
|
<RiAddLine width={20} height={20} />
|
|
282
286
|
</View>
|
|
283
|
-
<View
|
|
287
|
+
<View style={styles.customText}>
|
|
284
288
|
<Text variant="body-2-semibold">{t(`${K}.custom.title`)}</Text>
|
|
285
|
-
<Text variant="body-2-regular"
|
|
289
|
+
<Text variant="body-2-regular" style={styles.muted}>
|
|
286
290
|
{t(`${K}.custom.description`)}
|
|
287
291
|
</Text>
|
|
288
292
|
</View>
|
|
@@ -292,7 +296,7 @@ export function GemieConnectorsStore({
|
|
|
292
296
|
open={customOpen}
|
|
293
297
|
onClose={() => setCustomOpen(false)}
|
|
294
298
|
onAdd={async (input) => {
|
|
295
|
-
await actions.addCustom.
|
|
299
|
+
await actions.addCustom.run(input);
|
|
296
300
|
toast.success(t(`${K}.signIn.connected`, { name: input.name }));
|
|
297
301
|
onConnected?.();
|
|
298
302
|
}}
|
|
@@ -338,10 +342,11 @@ function SortSelect({
|
|
|
338
342
|
}
|
|
339
343
|
|
|
340
344
|
function StoreGroup({ title, children }: { title?: string; children: React.ReactNode }) {
|
|
345
|
+
const styles = useStyles();
|
|
341
346
|
return (
|
|
342
|
-
<View
|
|
347
|
+
<View style={styles.section}>
|
|
343
348
|
{title ? <Text variant="headline-semibold">{title}</Text> : null}
|
|
344
|
-
<View
|
|
349
|
+
<View style={styles.grid}>{children}</View>
|
|
345
350
|
</View>
|
|
346
351
|
);
|
|
347
352
|
}
|
|
@@ -359,15 +364,16 @@ function StoreCard({
|
|
|
359
364
|
onConnect: (entry: ConnectorEntry) => void;
|
|
360
365
|
t: Translate;
|
|
361
366
|
}) {
|
|
367
|
+
const styles = useStyles();
|
|
362
368
|
return (
|
|
363
|
-
<View
|
|
364
|
-
<View
|
|
369
|
+
<View style={styles.entry}>
|
|
370
|
+
<View style={styles.entryHeader}>
|
|
365
371
|
<ConnectorLogo name={entry.name} logoUrl={entry.logoUrl} size={40} />
|
|
366
|
-
<View
|
|
372
|
+
<View style={styles.entryText}>
|
|
367
373
|
<Text variant="body-2-semibold" numberOfLines={1}>
|
|
368
374
|
{entry.name}
|
|
369
375
|
</Text>
|
|
370
|
-
<View
|
|
376
|
+
<View style={styles.badges}>
|
|
371
377
|
<Badge
|
|
372
378
|
size="label-small"
|
|
373
379
|
variant="subtle"
|
|
@@ -384,7 +390,7 @@ function StoreCard({
|
|
|
384
390
|
content={t(`${K}.store.filter.noSignIn`)}
|
|
385
391
|
/>
|
|
386
392
|
) : null}
|
|
387
|
-
<Text variant="body-2-regular"
|
|
393
|
+
<Text variant="body-2-regular" style={styles.muted} numberOfLines={1}>
|
|
388
394
|
{accounts > 0
|
|
389
395
|
? t(`${K}.store.connectedCount`, { count: accounts })
|
|
390
396
|
: t(`${K}.category.${entry.category}`)}
|
|
@@ -392,10 +398,10 @@ function StoreCard({
|
|
|
392
398
|
</View>
|
|
393
399
|
</View>
|
|
394
400
|
</View>
|
|
395
|
-
<Text variant="body-2-regular"
|
|
401
|
+
<Text variant="body-2-regular" style={styles.muted} numberOfLines={2}>
|
|
396
402
|
{entry.description}
|
|
397
403
|
</Text>
|
|
398
|
-
<View
|
|
404
|
+
<View style={styles.entryActions}>
|
|
399
405
|
<Button
|
|
400
406
|
size="sm"
|
|
401
407
|
appearance={accounts > 0 ? 'outline' : 'solid'}
|
|
@@ -431,6 +437,7 @@ function CustomServerDialog({
|
|
|
431
437
|
onAdd: (input: { name: string; url: string; headers?: Record<string, string> }) => Promise<void>;
|
|
432
438
|
t: Translate;
|
|
433
439
|
}) {
|
|
440
|
+
const styles = useStyles();
|
|
434
441
|
const [name, setName] = useState('');
|
|
435
442
|
const [url, setUrl] = useState('');
|
|
436
443
|
const [headerName, setHeaderName] = useState('');
|
|
@@ -483,7 +490,7 @@ function CustomServerDialog({
|
|
|
483
490
|
},
|
|
484
491
|
]}
|
|
485
492
|
>
|
|
486
|
-
<View
|
|
493
|
+
<View style={styles.form}>
|
|
487
494
|
<View>
|
|
488
495
|
<TextFieldLabel>{t(`${K}.custom.name`)}</TextFieldLabel>
|
|
489
496
|
<TextFieldInput
|
|
@@ -514,7 +521,7 @@ function CustomServerDialog({
|
|
|
514
521
|
<AccordionItem value="advanced">
|
|
515
522
|
<AccordionTrigger>{t(`${K}.custom.advanced`)}</AccordionTrigger>
|
|
516
523
|
<AccordionContent>
|
|
517
|
-
<View
|
|
524
|
+
<View style={styles.form}>
|
|
518
525
|
<View>
|
|
519
526
|
<TextFieldLabel>{t(`${K}.custom.headerName`)}</TextFieldLabel>
|
|
520
527
|
<TextFieldInput
|
|
@@ -549,17 +556,15 @@ function CustomServerDialog({
|
|
|
549
556
|
|
|
550
557
|
/** The store's shape while the catalogue is read: cards, never a spinner. */
|
|
551
558
|
function StoreSkeleton() {
|
|
559
|
+
const styles = useStyles();
|
|
552
560
|
return (
|
|
553
561
|
<Skeleton.Region>
|
|
554
|
-
<View
|
|
562
|
+
<View style={styles.grid}>
|
|
555
563
|
{[0, 1, 2, 3].map((index) => (
|
|
556
|
-
<View
|
|
557
|
-
|
|
558
|
-
className="min-w-[260px] flex-1 basis-[260px] gap-3 rounded-2xl border border-border p-4"
|
|
559
|
-
>
|
|
560
|
-
<View className="flex-row items-center gap-3">
|
|
564
|
+
<View key={index} style={styles.entry}>
|
|
565
|
+
<View style={styles.entryHeader}>
|
|
561
566
|
<Skeleton.Box width={40} height={40} borderRadius={9} />
|
|
562
|
-
<View
|
|
567
|
+
<View style={styles.loadingText}>
|
|
563
568
|
<Skeleton.Box width={120} height={14} />
|
|
564
569
|
<Skeleton.Box width={80} height={12} />
|
|
565
570
|
</View>
|
|
@@ -572,3 +577,56 @@ function StoreSkeleton() {
|
|
|
572
577
|
</Skeleton.Region>
|
|
573
578
|
);
|
|
574
579
|
}
|
|
580
|
+
|
|
581
|
+
const useStyles = createTokenStyles((t) => ({
|
|
582
|
+
store: { gap: 16 },
|
|
583
|
+
filters: {
|
|
584
|
+
flexDirection: 'row',
|
|
585
|
+
flexWrap: 'wrap',
|
|
586
|
+
alignItems: 'center',
|
|
587
|
+
justifyContent: 'space-between',
|
|
588
|
+
gap: 12,
|
|
589
|
+
},
|
|
590
|
+
failure: { alignItems: 'flex-start', gap: 8, paddingVertical: 16 },
|
|
591
|
+
muted: { color: t.mutedForeground },
|
|
592
|
+
emptyText: { paddingVertical: 16, color: t.mutedForeground },
|
|
593
|
+
more: { alignItems: 'center' },
|
|
594
|
+
customTile: {
|
|
595
|
+
flexDirection: 'row',
|
|
596
|
+
alignItems: 'center',
|
|
597
|
+
gap: 12,
|
|
598
|
+
borderRadius: 16,
|
|
599
|
+
borderStyle: 'dashed',
|
|
600
|
+
borderWidth: 1,
|
|
601
|
+
borderColor: t.border,
|
|
602
|
+
padding: 16,
|
|
603
|
+
},
|
|
604
|
+
customIcon: {
|
|
605
|
+
height: 40,
|
|
606
|
+
width: 40,
|
|
607
|
+
alignItems: 'center',
|
|
608
|
+
justifyContent: 'center',
|
|
609
|
+
borderRadius: 12,
|
|
610
|
+
backgroundColor: t.popover,
|
|
611
|
+
},
|
|
612
|
+
customText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 2 },
|
|
613
|
+
section: { gap: 8 },
|
|
614
|
+
grid: { flexDirection: 'row', flexWrap: 'wrap', gap: 12 },
|
|
615
|
+
entry: {
|
|
616
|
+
minWidth: 260,
|
|
617
|
+
flexGrow: 1,
|
|
618
|
+
flexShrink: 1,
|
|
619
|
+
flexBasis: 260,
|
|
620
|
+
gap: 12,
|
|
621
|
+
borderRadius: 16,
|
|
622
|
+
borderWidth: 1,
|
|
623
|
+
borderColor: t.border,
|
|
624
|
+
padding: 16,
|
|
625
|
+
},
|
|
626
|
+
entryHeader: { flexDirection: 'row', alignItems: 'center', gap: 12 },
|
|
627
|
+
entryText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 4 },
|
|
628
|
+
badges: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', gap: 6 },
|
|
629
|
+
entryActions: { flexDirection: 'row', alignItems: 'center', gap: 8 },
|
|
630
|
+
form: { gap: 12 },
|
|
631
|
+
loadingText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 6 },
|
|
632
|
+
}));
|
|
@@ -2,6 +2,7 @@ import { Switch } from '@oxy.so/bloom/switch';
|
|
|
2
2
|
import { Text } from '@oxy.so/bloom/typography';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
+
import { createTokenStyles } from '@oxy.so/bloom/theme';
|
|
5
6
|
|
|
6
7
|
export interface GrantSwitchRowProps {
|
|
7
8
|
/** What the row grants, drawn before its name: a connector's logo, a platform's mark. */
|
|
@@ -31,17 +32,16 @@ export function GrantSwitchRow({
|
|
|
31
32
|
onCheckedChange,
|
|
32
33
|
first,
|
|
33
34
|
}: GrantSwitchRowProps) {
|
|
35
|
+
const styles = useStyles();
|
|
34
36
|
return (
|
|
35
|
-
<View
|
|
36
|
-
className={`flex-row items-center gap-2.5 py-2.5 pe-2.5 ${first ? '' : 'border-t border-border'}`}
|
|
37
|
-
>
|
|
37
|
+
<View style={[styles.row, !first && styles.divider]}>
|
|
38
38
|
{leading}
|
|
39
|
-
<View
|
|
39
|
+
<View style={styles.text}>
|
|
40
40
|
<Text variant="body-2-regular" numberOfLines={1}>
|
|
41
41
|
{label}
|
|
42
42
|
</Text>
|
|
43
43
|
{detail ? (
|
|
44
|
-
<Text variant="body-2-regular"
|
|
44
|
+
<Text variant="body-2-regular" style={styles.detail} numberOfLines={1}>
|
|
45
45
|
{detail}
|
|
46
46
|
</Text>
|
|
47
47
|
) : null}
|
|
@@ -55,3 +55,16 @@ export function GrantSwitchRow({
|
|
|
55
55
|
</View>
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
const useStyles = createTokenStyles((t) => ({
|
|
60
|
+
text: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 2 },
|
|
61
|
+
detail: { color: t.mutedForeground },
|
|
62
|
+
row: {
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
gap: 10,
|
|
66
|
+
paddingVertical: 10,
|
|
67
|
+
paddingInlineEnd: 10,
|
|
68
|
+
},
|
|
69
|
+
divider: { borderTopWidth: 1, borderColor: t.border },
|
|
70
|
+
}));
|
|
@@ -44,7 +44,7 @@ import { useTheme } from '@oxy.so/bloom/theme';
|
|
|
44
44
|
import { Muted, Text } from '@oxy.so/bloom/typography';
|
|
45
45
|
import * as WebBrowser from 'expo-web-browser';
|
|
46
46
|
import { useCallback, useMemo, useState } from 'react';
|
|
47
|
-
import { Platform, ScrollView, View } from 'react-native';
|
|
47
|
+
import { Platform, ScrollView, View, StyleSheet } from 'react-native';
|
|
48
48
|
|
|
49
49
|
/** One array for "nothing selected", so the memos below hold across renders. */
|
|
50
50
|
const NO_MESSAGES: Message[] = [];
|
|
@@ -100,7 +100,7 @@ function PhaseRow({ step, isActive }: { step: PhaseStep; isActive: boolean }) {
|
|
|
100
100
|
const label = t(STEP_LABEL_KEYS[step.type]);
|
|
101
101
|
const ending = step.type === 'done' || step.type === 'failed';
|
|
102
102
|
return (
|
|
103
|
-
<View
|
|
103
|
+
<View style={styles.step} accessible accessibilityLabel={label}>
|
|
104
104
|
<PhaseIcon type={step.type} />
|
|
105
105
|
<Text variant={ending ? 'body-medium' : 'body-regular'}>
|
|
106
106
|
{isActive ? <AgentLogShimmerText>{label}</AgentLogShimmerText> : label}
|
|
@@ -209,8 +209,8 @@ function ActivityTab({ entries }: { entries: AuditEntry[] }) {
|
|
|
209
209
|
last={index === entries.length - 1}
|
|
210
210
|
reduce={reduce}
|
|
211
211
|
>
|
|
212
|
-
<View
|
|
213
|
-
<View
|
|
212
|
+
<View style={styles.entry}>
|
|
213
|
+
<View style={styles.entryHeader}>
|
|
214
214
|
{entry.status === 'interrupted' ? (
|
|
215
215
|
<RiForbidLine size="xs" fill={colors.textSecondary} />
|
|
216
216
|
) : null}
|
|
@@ -242,11 +242,11 @@ function SelectionState({ status }: { status: 'loading' | 'failed' | 'gone' }) {
|
|
|
242
242
|
if (status === 'loading') {
|
|
243
243
|
// The steps are on their way: rows shaped like them, not a word about waiting.
|
|
244
244
|
return (
|
|
245
|
-
<Skeleton.Region
|
|
245
|
+
<Skeleton.Region style={styles.loading} testID="thought-loading">
|
|
246
246
|
{[0, 1, 2].map((row) => (
|
|
247
|
-
<View key={row}
|
|
247
|
+
<View key={row} style={styles.loadingRow}>
|
|
248
248
|
<Skeleton.Circle size={20} />
|
|
249
|
-
<View
|
|
249
|
+
<View style={styles.loadingText}>
|
|
250
250
|
<Skeleton.Box width={row === 1 ? '55%' : '75%'} height={13} borderRadius={6} />
|
|
251
251
|
<Skeleton.Box width="40%" height={11} borderRadius={6} />
|
|
252
252
|
</View>
|
|
@@ -397,9 +397,9 @@ export function ThoughtPanel({ onClose, outputActions }: ThoughtPanelProps) {
|
|
|
397
397
|
);
|
|
398
398
|
|
|
399
399
|
return (
|
|
400
|
-
<View
|
|
401
|
-
<View
|
|
402
|
-
<View
|
|
400
|
+
<View style={styles.panel}>
|
|
401
|
+
<View style={styles.tabs}>
|
|
402
|
+
<View style={styles.tabToggle}>
|
|
403
403
|
<TabToggle value={activeTab} onChange={setActiveTab} />
|
|
404
404
|
</View>
|
|
405
405
|
{!shell?.compact && (
|
|
@@ -415,8 +415,8 @@ export function ThoughtPanel({ onClose, outputActions }: ThoughtPanelProps) {
|
|
|
415
415
|
</View>
|
|
416
416
|
|
|
417
417
|
<ScrollView
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
style={styles.scroll}
|
|
419
|
+
contentContainerStyle={styles.scrollContent}
|
|
420
420
|
showsVerticalScrollIndicator={false}
|
|
421
421
|
>
|
|
422
422
|
{content}
|
|
@@ -437,3 +437,17 @@ function ToolGlyph({ toolName, fill }: { toolName: string | undefined; fill: str
|
|
|
437
437
|
const ToolIcon = getToolIcon(toolName || '');
|
|
438
438
|
return <ToolIcon width={14} height={14} fill={fill} />;
|
|
439
439
|
}
|
|
440
|
+
|
|
441
|
+
const styles = StyleSheet.create({
|
|
442
|
+
step: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingVertical: 4 },
|
|
443
|
+
entry: { paddingVertical: 4 },
|
|
444
|
+
entryHeader: { flexDirection: 'row', alignItems: 'center', gap: 6 },
|
|
445
|
+
loading: { gap: 16, padding: 12 },
|
|
446
|
+
loadingRow: { flexDirection: 'row', alignItems: 'center', gap: 12 },
|
|
447
|
+
loadingText: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 6 },
|
|
448
|
+
panel: { minHeight: 0, flexGrow: 1, flexShrink: 1, flexBasis: '0%', gap: 10, paddingTop: 8 },
|
|
449
|
+
tabs: { height: 30, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' },
|
|
450
|
+
tabToggle: { minWidth: 0, flexShrink: 1 },
|
|
451
|
+
scroll: { flexGrow: 1, flexShrink: 1, flexBasis: '0%', paddingHorizontal: 16 },
|
|
452
|
+
scrollContent: { paddingBottom: 16 },
|
|
453
|
+
});
|